assign numerical value from a previous line



Hello,

 

I am a new user and having difficulty finding a method to assign a value
from a previous line. 

 

Here we have an equation that gives two solutions, [x = - 10.0, x = 10.0].

And we have two functions, %phi[1] : -x/(2*d)  and %phi[2] : -x/(2*d) 

that their x values are given by the previous equation.

 

Is there an operational function that will assign the x's to their
respective %phi[n] functions?

 

            x = - 10.0 assign %phi[1] : -x/(2*d)  and  

 

Example:

/* Solve for x when y=0 */

x^2+d*y*4+d^2*(-4);

y:0;

d:5;

solve(%i1,x);

''%, numer;                               [x = - 10.0, x = 10.0]

 

Now read the value on the above line and assign the left and right values as

 

x = - 10.0 assign %phi[1] : -x/(2*d)        result should be %phi[1] : -10.0

x = 10.0 assign %phi[3] : -x/(2*d)          result should be %phi[2] : 10.0

 

Does anyone have a solution?

 

Bill

 

William Porter

wporter at omegapar.com