Discussion:
Simultaneous Matrix Equations
Tim Milstead
2006-03-07 20:02:14 UTC
Permalink
I wish to solve multiple simultaneous equations. Each equation is a
matrix equation.
As an introduction I have tried solving a single matrix equation like this:

solve(matrix([x],[y])=matrix([1],[2]));

without much luck. I just get [] for the answer.
Can Maxima do this?
Can people reply to my email address in addition to the mailing list?


Thanks in advance,

Tim Milstead.
Richard Fateman
2006-03-08 00:25:22 UTC
Permalink
You could try

linsolve([ x=1, y=2], [x,y]);

using solve instead of linsolve will find solutions that are
not linear, e.g.

solve([ x^2=1, y=2], [x,y]);

It is possible to extract the matrix elements and construct
the equations by writing a little program; maybe there is
a command to do this.

RJF
Post by Tim Milstead
I wish to solve multiple simultaneous equations. Each equation is a
matrix equation.
solve(matrix([x],[y])=matrix([1],[2]));
without much luck. I just get [] for the answer.
Can Maxima do this?
Can people reply to my email address in addition to the mailing list?
Thanks in advance,
Tim Milstead.
_______________________________________________
Maxima mailing list
http://www.math.utexas.edu/mailman/listinfo/maxima
laurent couraud
2006-03-09 19:56:39 UTC
Permalink
-----Message d'origine-----
Envoyé : mercredi 8 mars 2006 01:25
À : Tim Milstead
Objet : Re: [Maxima] Simultaneous Matrix Equations
You could try
linsolve([ x=1, y=2], [x,y]);
using solve instead of linsolve will find solutions that are
not linear, e.g.
solve([ x^2=1, y=2], [x,y]);
It is possible to extract the matrix elements and construct
the equations by writing a little program; maybe there is
a command to do this.
COEFMATRIX ([eq1, ...], [var1, ...])
Jaime E. Villate
2006-03-10 11:14:32 UTC
Permalink
Post by laurent couraud
Post by Richard Fateman
It is possible to extract the matrix elements and construct
the equations by writing a little program; maybe there is
a command to do this.
COEFMATRIX ([eq1, ...], [var1, ...])
coefmatrix does the opposite of what was needed.

"Extract the matrix elements and construct the equations"
in this case meant going from:
eqn: matrix([x],[y]) = matrix([1],[2]);
to:
[x=1, y=2]

which can be done with:
makelist(lhs(eq)[i][1] = rhs(eq)[i][1], i, 1, length(lhs(eq)));

By the way, I just noticed the documentation of coefmatrix is wrong:

-- Function: coefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ..., <x_n>])
Returns the coefficient matrix for the variables <eqn_1>, ...,
<eqn_m> of the system of linear equations <x_1>, ..., <x_n>.

Does any developer have any objection if I change it to:

-- Function: coefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ..., <x_n>])
Returns the coefficient matrix for the variables <x_1>, ...,
<x_n> of the system of linear equations <eqn_1>, ..., <eqn_m>.
?

I guess for simple changes like this I just commit a a new version of
doc/info/Matrices.texi; is that enough, or should I do something else?

Jaime
Robert Dodier
2006-03-10 16:32:25 UTC
Permalink
Hello Jaime,
Post by Jaime E. Villate
I guess for simple changes like this I just commit a a new version of
doc/info/Matrices.texi; is that enough, or should I do something else?
Just verify that makeinfo succeeds after you make this change
or anything like it. You can also make the appropriate changes
in the doc/info/es and doc/info/pt directories if you want.
Since this is a minor bug fix, you can commit this change to
the 5.9.3 branch as well as HEAD.

Thanks for your help,

Robert Dodier

Loading...