Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12161

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

From "Dr. Wolfgang Hintze" <weh@snafu.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How do I assign the solution obtained by FindRoot to a variable?
Date 2012-10-24 07:32 +0000
Message-ID <k685j6$m8q$1@smc.vnet.net> (permalink)
References <k658dg$h6c$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On 23 Okt., 07:04, NS Lin <nansheng....@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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I assign the solution obtained by FindRoot to a variable? NS Lin <nansheng.lin@gmail.com> - 2012-10-23 05:02 +0000
  Re: How do I assign the solution obtained by FindRoot to a variable? "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-10-24 07:32 +0000
  Re: How do I assign the solution obtained by FindRoot to a variable? "Nasser M. Abbasi" <nma@12000.org> - 2012-10-24 07:43 +0000

csiph-web