Previous Up Next

15.7.4  Solving AX=b

The simult command can solve a linear system of equations or several linear systems of equations with the same matrix of coefficients (see also 15.7.3).

Examples

Solve the system:

  

      3x+y=−2,
      3x +2y=2.
simult([[3,1],[3,2]],[[-2],[2]])
     


−2
4


          

Hence x=−2 and y=4 is the solution.

Solve the systems:

  

      3x+y=−2,
3 x +2y=2

and

  

      3x+y=1,
      3x +2y=2.
simult([[3,1],[3,2]],[[-2,1],[2,2]])
     


−20
41


          

Therefore x=−2 and y=4 is the solution of the first system of equations and x=0 and y=1 is the solution of the second system.


Previous Up Next