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: [mg9476] Re: [mg9417] Assigning solutions found by FindRoot
  • From: Allan Hayes <hay at haystack.demon.co.uk>
  • Date: Thu, 6 Nov 1997 02:40:18 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Christian Zemlin <chr at itb.biologie.hu-berlin.de> [mg9417] Assigning
solutions found by FindRoot

> 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 **

Chris:

Something like

In[1]:= FindAndAssignRoot[elms__]:= FindRoot[elms]/.Rule->Set

In[2]:= FindAndAssignRoot[eqns, {x, 0}, {y, 0}]

Out[2]= {1.,1.}

In[3]:=
{x,y}

Out[3]={1.,1.}


Allan Hayes
hay at haystack.demon.co.uk
http://www.haystack.demon.co.uk/training.html voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
Leicester,  UK



  • Prev by Date: Re: DSolve to solve simultaneous ODEs
  • Next by Date: Customizing output format
  • Previous by thread: Re: Assigning solutions found by FindRoot
  • Next by thread: Re: Assigning solutions found by FindRoot