next up previous contents index
suivant: Gauss-Jordan reduction: rref gaussjord monter: Linear systems précédent: Matrix of a system   Table des matières   Index


Gauss reduction of a matrix : ref

ref is used to solve a linear system of equations written in matrix form:
A*X=B
The argument of ref is the augmented matrix of the system (the matrix obtained by augmenting the matrix A to the right with the column vector B).
The result is a matrix [A1,B1] where A1 has zeros under its principal diagonal, and the solutions of:
A1*X=B1
are the same as the solutions of:
A*X=B

For example, solve the system :

$\displaystyle \left\{\vphantom{
\begin{array}{lcr} 3x + y & = &-2 \\  3x +2y & =& 2 \end{array}}\right.$$\displaystyle \begin{array}{lcr} 3x + y & = &-2 \\  3x +2y & =& 2 \end{array}$

Input :
ref([[3,1,-2],[3,2,2]])
Output :
[[1,1/3,-2/3],[0,1,4]]
Hence the solution is y = 4 (last row) and x = - 2 (substitute y in the first row).



giac documentation written by Renée De Graeve and Bernard Parisse