Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: using a previous result

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67351] Re: using a previous result
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Mon, 19 Jun 2006 00:01:14 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 6/18/06 at 5:13 AM, ridley_david at yahoo.com wrote:

>Once I've solved a system of equations, I would like to use the
>previous results in future equations. If my output is
>{{p1->x,p2->y}} how do I assign those values as p1star and p2star so
>I can reuse them?

This will do what you want

{p1star,p2star}={p1,p2}/.First@{{p1->x,p2->y}}

But note often it isn't necessary to extract the values from rules. For example here is a root of a simple polynomial

In[17]:=
root=FindRoot[x^2-.5x-1,{x,0}]

Out[17]=
{x -> -0.7807764064044151}

Now this can be used to evaluate any expression of x say 2 x + 1 as follows:

In[18]:=
2 x+1/.root

Out[18]=
-0.561553

--
To reply via email subtract one hundred and four


  • Prev by Date: Re: matrix substitution-> theta1 minimal Pisot quotient group
  • Next by Date: Re: Re: Package writing
  • Previous by thread: Re: using a previous result
  • Next by thread: RE: using a previous result