1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ MaplePrimes is a better place for such questions. $\endgroup$ – user64494 Jul 9 '13 at 5:58
1
$\begingroup$

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] .$$

$\endgroup$
  • $\begingroup$ This SysSolve procedure provides no more functionality than the procedure LinearAlgebra:-LinearSolve already offers. In fact it offers less functionality since it does not pass along any additional optional arguments. And it's poorly written because its source relies on loading the LinearAlgebra package outside its definition. $\endgroup$ – acer Jul 10 '13 at 1:32
  • 1
    $\begingroup$ Thanks Mhenni Benghorbal, this is good, but also can you tell how to make this in general? I mean if A is not invertable the need to know what y should be (y should be in the range of A)? so how to make this procedure effective for any matrix A and any y?? thanks. $\endgroup$ – LoveMath Jul 10 '13 at 4:04
  • $\begingroup$ @acer: This is a basic procedure so the OP see how he can write a procedure. To make it more sophisticated it is up to the OP. $\endgroup$ – Mhenni Benghorbal Jul 10 '13 at 4:16
  • $\begingroup$ @LoveMath: The command "LinearSolve" handles the three possible cases for a linear system. Namely, a unique solution, infinite number of solutions( the example in the answer ) and no solution. $\endgroup$ – Mhenni Benghorbal Jul 10 '13 at 4:19
  • $\begingroup$ @Babak S. Thanks for the edit. I really appreciate it. $\endgroup$ – Mhenni Benghorbal Jul 12 '13 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.