Gauss-Jordan Reduction of Linear Equations
(An interactive exploration, step by step.)
UNDER CONSTRUCTION:
The goal is to get the identity matrix on the LHS.
That means there is only one lone x value
per equation on the LHS.
*?
#
if its pivot number
is too small
Round-off errors get really bad when you subtract small numbers.
Interchanging rows moves them elsewhere.
The resulting Inverse matrix will be unchanged.
*? .
Use row #
below it
Subsequent subtractions will clear constants below the pivot.
If you move a row above, though, it will lose its pivot.
*? .
The system of equations
can be represented in matrix form: A * X = B
The X symbolizes the column vector
[x1 x2]T,
which is
multiplied
by each row-vector in A to give the column B vector
The "T" signifies a transposed matrix. The companion program
(above button) can generate them.
[B1 B2]T
or [1.7 2.8]T.
The equations can now be solved by matrix-multiplication.
Gauss-Jordan reduction, to the left, gives the inverse
A-1:
(Try it; multiply its rows by the columns of the A matrix above.
You will get
I,
the identity matrix.)
*?
Multiply B = [1.7 2.8]T
by this inverse to solve the equations:
(A-1) A X = X = A-1 B:
and specifically,
HINT: click on constants to load them into the clipboard;
Multiply both sides of equations by constants to adjust Aijs
to equal the diagonal constants.
Subtract equations from each other to give zeros
after adjusting A21, A31 etc.
*?
then click multiply/divide boxes to drop them.
A matrix to the right starts as an identity matrix,
and your row operations will be duplicated there.
The result will be an Inverse Matrix for the Aijs,
which will become an identity matrix on the LHS.
*?
Pivots are numbers on the diagonal with zeros to the left
and below.
Procedure: use the boxes and buttons below as a calculator
to leave only one (diagonal) X-value in each row.
*?
PIVOT: multiply rows below by
Click on one of the diagonal (pivot) constants.
It will load into the clipboard.
Then click on the box to the left to paste it there.
*?
Next, click on a constant above or below the pivot (blue box)
Click on the second box in the next line to paste
it there and another box will appear around that row..
*?
Then press the "Divide Row" button below.
The constant becomes equal the pivot and the entire row
will change.
*?
Note that the values in the "Under Construction" matrix
also change, progressing toward A-1.
*?
by
,
to duplicate the pivot.
The pivot will be duplicated in the same column as the pivot.
The row you clicked will also be indicated to the left.
*?
"Divide Row" also multiples by the pivot.
The row remains equal on both sides of the
(new) equation.
*?
The entire row will be changed to adjust the constant
to match the pivot.
That sets you up to get a zero by clicking the
"subtract" button below.
*?
the pivot row (
)
to create a zero.
Multiplying a row makes it remain a (different) equation.
Subtracting rows also gives valid equations.
*?
Triangulization: all columns below diagonal
element should be set to zero.
Then the elements above can be zeroed without
overwriting other zeros.
*?
The goal is an Identity Matrix on the LHS:
Off-diagonals should all be zeroed.
Finally, the diagonals should be set to unity
(to the right).
*? Matrix equation (before modifications)
(Make changes here, and equations etc. will change.)
The above procedure will generate the inverse in (A-1) A X = X = A-1 B.
and X is given by