Solving a matrix equation



-----maxima-bounces at math.utexas.edu wrote: -----

>I have a matrix A (for example 3*3), and a vector X=matrix([x],[y],[z]).
>What are the instructions for solving the linear system A.X=0 ?

For a invertible coefficient matrix, you can use the (undocumented)
function linsolve_by_lu; for other cases, I think you'll have to
convert to equations and use linsolve (or solve or algsys).

Examples:

Solve using rational numbers --- don't compute the matrix condition number:

(%i18) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1]));
(%o18) [matrix([1/33],[4/33]),false]

Solve using IEEE doubles --- return an upper bound for the matrix condition
number as the second list entry:

(%i19) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1]), 'floatfield);
(%o19) [matrix([0.03030303030303],[0.12121212121212]),6.835016835016835]

Multiple right-hand-sides are okay -- find the inverse:

(%i20) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1,0],[0,1]));
(%o20) [matrix([-2/11,7/33],[3/11,-5/33]),false]

Solve using bigfloats:

(%i21) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1]),
'bigfloatfield), fpprec : 20;
(%o21) [matrix([3.030303030303030303b-2],[1.2121212121212121212
b-1]),6.835016835016835]

Barton