Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How do I assign the solution obtained by FindRoot to a variable?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128486] Re: How do I assign the solution obtained by FindRoot to a variable?
  • From: "Dr. Wolfgang Hintze" <weh at snafu.de>
  • Date: Wed, 24 Oct 2012 03:33:07 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <k658dg$h6c$1@smc.vnet.net>

On 23 Okt., 07:04, NS Lin <nansheng.... at gmail.com> wrote:
> I would like to store the root/solution obtained by the FindRoot[] function to a variable.  How can I do that?
>
> Thanks!
>
> NS

In[472]:= eq = x == Exp[-x]

Out[472]= x == E^(-x)

In[475]:= z = x /. FindRoot[eq, {x, 1}]

Out[475]= 0.5671432904097838

In[477]:= Exp[-z]

Out[477]= 0.5671432904097838

Regards,
Wolfgang



  • Prev by Date: Re: How do I assign the solution obtained by FindRoot to
  • Next by Date: Re: How do I assign the solution obtained by FindRoot to a variable?
  • Previous by thread: Re: How do I assign the solution obtained by FindRoot to a variable?
  • Next by thread: Re: How do I assign the solution obtained by FindRoot to a variable?