augcoefmatrix and linsolve



Wolfgang,

I had the same situation, and I wrote this function:

mlinsolve(A,x,b) := block([m,eqs],
   matrixp(A) or error("A must be a matrix!"),
   (listp(x) and listp(b)) or error("x,b must be lists!"),
   m : length(A),
   eqs : [],
   for i : 1 thru m do eqs : cons(row(A,i) . x = b[i], eqs),
   linsolve(eqs,x)
)

				Kostas

Wolfgang Lindner wrote:
> dear group,
> 
> given a linear system m:[x+y=2,x-y=3] one gets the augmented system matrix via
> 
> augcoefmatrix(m)= [1  1 -2]
>                   [1 -1 -3].
> 
> Working with matrices and solving linear systems I need the 'inverse' procedure:
> given a   m x n-matrix e.g.
>  
> A: [1  1 -2]
>    [1 -1 -3]
> 
> I want to automatic construct the right 'input'list [x+y=2,x-y=3] to feed
> linsolve([x+y=2,x-y=3],[x,y]).
> 
> Is there a maxima function who can do this?
> 
> HTH Wolfgang
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima