Example 4. Use the
Gauss-Jordan elimination method to solve the linear
system
.
Solution 4.
Form the augmented matrix
using
Mathematica's procedure AppendRows, which adds more elements
to each of the rows, hence is a command to "append"
column(s). First, load the "MatrixManipulation" procedure
into memory. Be sure to execute the following command
before any reference to "AppendRows" is made, otherwise a "multiple
contexts" error will be committed.
Then perform Gauss-Jordan elimination. Note that we are storing the solution returned in the variable G.
This time use Mathematica to get the solution
vector
out
of this augmented matrix !
Verify the solution.
We are done.
Aside. We can compare
our answer with the answer obtained by using Mathematica's
built in RowReduce procedure.
This agrees with our answer that was obtained with our subroutine GaussJordan[M,4].
Aside. We can compute the solution X with Mathematica's "LinearSolve" procedure.

(c) John H. Mathews 2004