solving equations involving matrices



Sorry, I guess I made the assumption that solve was very smart and could 
solve anything that all of Maxima itself could solve. I realize now that 
solve isn't that clever and works best with algebraic equations.

And one small correction, s:m1.m2-m3; returns a matrix so 
listofeqs:[s[1],s[2]]; returns a list of rows, not a list of equations 
or expressions, so solve still wouldn't give any solutions. 
listofeqs:[s[1][1],s[2][1]]; works fine on the other hand. I'm sure you 
already knew this, however.


Thanks for your help.


Richard Fateman wrote:
> You  are correct, you did something "wrong".
> You did not supply the right form for the argument expected by solve.
> If you wish to set things up as a matrix, instead of a list of equations,
> you could always convert by doing something like this:
> 
> s:  m1.m2-m3;   /* your example */
> listofeqs:  [s[1],s[2]];
> listofvars: [x,y];
> 
> solve(listofeqs, listofvars);
> 
> if you don't know in advance the size of the matrices, you can
> find them out and use listofeqs: makelist(s[i],i,1,length(s));
> 
> If you want to add this feature to solve,
> you are welcome to look at the code and figure out how.
> 
> 
> RJF
> 
> 
> ----- Original Message ----- From: "Via Purifico" <union at bluebottle.com>
> To: <maxima at math.utexas.edu>
> Sent: Wednesday, May 24, 2006 6:06 PM
> Subject: solving equations involving matrices
> 
> 
>> Hello, I am somewhat new to Maxima. I am trying to solve this simple 
>> system of linear equations:
>>
>> 3x + 8y = 5
>> 4x + 11y = 7
>>
>> I put them into a matrix and tried to solve:
>>
>> (%i19) matrix([3,8],[4,11]) . matrix([x],[y]) = matrix([5],[7]);
>>
>>                             [ 8 y + 3 x  ]   [ 5 ]
>> (%o19)                      [            ] = [   ]
>>                             [ 11 y + 4 x ]   [ 7 ]
>> (%i20) solve(%,[x,y]);
>>
>> (%o20)                                []
>>
>> This somewhat disappointed me, because when I did:
>>
>> (%i18) solve([3*x + 8*y = 5, 4*x + 11*y = 7],[x,y]);
>>
>> (%o18)                        [[x = - 1, y = 1]]
>>
>> it seemed to work fine. Am I doing something wrong? Why doesn't Maxima 
>> have an answer for the equation involving matrices?
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
> 
>