On Mon, 2011-02-07 at 09:42 +0000, Lut Mentz wrote:
> I want to extract from the output of Solve() an executable string to
> make an assignment. For instance
>
> (%i1) solve([gz], [accz]);
> (%o1) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F]
> (%i2) %[1];
> (%o2) accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F
>
> I'd like to turn the last output to "accz:
> -(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F" and execute it.
Try the following, instead of (%i2):
(%i2) accz: rhs(%[1]);
Regards,
Jaime