How to make a procedure in Maple

324 Views Asked by At

Let the matrix $A$ be a linear map (let us take $A$ to be square matrix), and we want to solve $Ax=y$ for any $y$ in range of the linear map $A$. Can anyone help me with the code of procedure (proc) in Maple for doing this job?? Actually, I can use LinearAlgebra package and the command LinearAlgebra(A,y) for particular $y$ in range of $A$, but I need the procedure in Maple that do this thing for any matrix $A$ and for all the range of $A$. Can anyone help me in this issue?

thanks very much.

1

There are 1 best solutions below

6
On

Here is one

[> with(LinearAlgebra):
   SysSolve := proc( A::Matrix, y::Vector ) local solu, B, z;   
     B := A;
     z := y;
   solu := ( LinearSolve( B, z ) ); 
   end: 

[>A := Matrix( [[1,1],[2,2]] );
   y := Vector( 2, [ 1,2] );
   SysSolve(A,y);

$$ \left[ \begin {array}{c} 1-{\it \_t}_{{2}}\\{\it \_t}_{{2}}\end {array} \right] .$$