MathGroup Archive 1997

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

Search the Archive

Re: Assigning solutions found by FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9469] Re: [mg9417] Assigning solutions found by FindRoot
  • From: "W. Meeussen" <w.meeussen.vdmcc at vandemoortele.be>
  • Date: Thu, 6 Nov 1997 02:40:13 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

hi,

try:

Clear[x,y]; FindRoot[{x == y, x + y == 2}, {x, 0}, {y, 0}]
        {x -> 1., y -> 1.}

Look wat it is like from Mathematica 's point of view: %//FullForm
        List[Rule[x, 1.], Rule[y, 1.]]

wat you want is a rule-eating rule : FindRoot[{x == y, x + y == 2}, {x,
0}, {y, 0}]/.Rule->Set
        {1., 1.}

?x
        Global`x
        x = 1.

?y
        Global`y
        y = 1.

making a delayed assignment (:= or SetDelayed) works too. isn't it nice?

wouter.

At 01:56 5-11-97 -0500, Christian Zemlin wrote:
>Hello everybody,
>
>I use FindRoot to solve systems of around ten equations and I would like
>to use  the results for further computation.  Therefore, I need a
>function that assigns  the computed solution to the variables.  For
>example:
>
>In[1] := FindRoot[{x == y, x + y == 2}, {x, 0}, {y, 0}] Out[1] := {x ->
>1., y -> 1.}
>
>In[2] := **Command I am looking for ** Out[2] := ** Now, x is set to 1
>and y is set to 1 **
>
>
>Can anybody help me with this?
>
>Thanks,
>Chris
>
> 
>----------------------------------
>E-Mail: Christian Zemlin <chr at lotka.biologie.hu-berlin.de> Time:
>07:33:18
>
>This message was sent by XFMail
>----------------------------------
>
>
Dr. Wouter L. J. MEEUSSEN
w.meeussen.vdmcc at vandemoortele.be
eu000949 at pophost.eunet.be



  • Prev by Date: Re: DSolve to solve simultaneous ODEs
  • Next by Date: subsets (recursion homework)
  • Previous by thread: Re: Assigning solutions found by FindRoot
  • Next by thread: Re: Assigning solutions found by FindRoot