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


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

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

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-10-24 07:31 +0000
Last post2012-10-24 07:31 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-10-24 07:31 +0000
SubjectRe: How do I assign the solution obtained by FindRoot to a variable?
Message-ID<k685fn$m72$1@smc.vnet.net>
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
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web