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


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

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

From Bob Hanlon <hanlonr357@gmail.com>
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:31 +0000
Message-ID <k685fn$m72$1@smc.vnet.net> (permalink)
References <20121023045437.AE4F2685C@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


eqn = Sin[x] + Exp[x];

z = x /.
  FindRoot[eqn, {x, 0}]

-0.588533

eqn /. x -> z

0.

eqns = {Exp[x - 2] == y, y^2 == x};

{r, s} = {x, y} /.
  FindRoot[eqns,
   {{x, 1}, {y, 1}}]

{0.019026, 0.137935}

eqns /. {x -> r, y -> s}

{True, True}


Bob Hanlon


On Tue, Oct 23, 2012 at 12:54 AM, NS Lin <nansheng.lin@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
>

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


Thread

Re: How do I assign the solution obtained by FindRoot to a variable? Bob Hanlon <hanlonr357@gmail.com> - 2012-10-24 07:31 +0000

csiph-web