Question: How do I extract the value of variables in a solve()?

Hello all,

I have a nonlinear model y=f(x,y,z,p) that I'd like to solve for various value of p (parameter), where f is a system of equations. This model is constrained by a set of inequalities c(x,y,z,p) <= 0.

I coded the model up in Maple in the following format:

f1 := ...;
f2:=....;
f3:=...;
f4:=...;
c1:= x>=0;
c2:= ....;
etc.

To solve this, I type:

p:=2;
soln:=solve({f1,f2,f2,f3c1,c2},[x,y,z]);

I get a numerical answer in soln. I would like to vary p and create a table of values like this:

p   x   y   z
2   .3  .4  .3
3   .2  .6  .7
etc.

How do I extract the numbers from soln (for a given p) into a vector in order to built the above table? 

I know how to loop, and to concatenate vectors, but I don't know how to get that vector from the soln.

 

Thanks

Paul


Please Wait...