Basic algebraic equations query in Maxima



On Mon, 2010-04-19 at 09:47 +0200, Brian Wylie wrote:
> My code:
> 
> kill(all);
> EqX1: xMeas = a*x + x0;
> x: solve(EqX1, x);
> EqY1: yMeas = b*(y*cos(rho)+x*sin(rho)) + y0;
> y:solve(EqY1, y);
> EqZ1: zMeas = c*(z*cos(phi)*cos(%lambda) + x*sin(phi)*cos(%lambda) +
> y*sin(%lambda)) + z0;
> z: solve(EqZ1, z); 

Hi,
Two things to keep in mind about the command "x: solve(EqX1, x);" 
1. The result of solve is a list and not an expression. You want to save
an expression and not a list in x. You should use:
  x: ev(x, solve(EqX1, x));
2. Even after you define x correctly, it will not be substituted into
EqY1, unless you do that explicitly (EqY1, keeps the value that x had at
the time EqY1 was define.

I suggest that you do the following, after defining EqX1, EqY1 and EqZ1:
 solx: solve(EqX1, x);
 soly: solve(ev(EqY1,solx), y);
 solz: solve(ev(EqZ1,solx,soly), z);

Regards,
Jaime