Example 4. Use the Gauss-Jordan elimination method to solve the linear system  [Graphics:Images/GaussianJordanMod_gr_116.gif].  

Solution 4.

[Graphics:../Images/GaussianJordanMod_gr_117.gif]




[Graphics:../Images/GaussianJordanMod_gr_118.gif]

[Graphics:../Images/GaussianJordanMod_gr_119.gif]

[Graphics:../Images/GaussianJordanMod_gr_120.gif]

[Graphics:../Images/GaussianJordanMod_gr_121.gif]

Form the augmented matrix  [Graphics:../Images/GaussianJordanMod_gr_122.gif]  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.

[Graphics:../Images/GaussianJordanMod_gr_123.gif]




[Graphics:../Images/GaussianJordanMod_gr_124.gif]

[Graphics:../Images/GaussianJordanMod_gr_125.gif]

[Graphics:../Images/GaussianJordanMod_gr_126.gif]

[Graphics:../Images/GaussianJordanMod_gr_127.gif]

Then perform Gauss-Jordan elimination. Note that we are storing the solution returned in the variable  G.

[Graphics:../Images/GaussianJordanMod_gr_128.gif]



[Graphics:../Images/GaussianJordanMod_gr_129.gif]

[Graphics:../Images/GaussianJordanMod_gr_130.gif]

[Graphics:../Images/GaussianJordanMod_gr_131.gif]

[Graphics:../Images/GaussianJordanMod_gr_132.gif]

[Graphics:../Images/GaussianJordanMod_gr_133.gif]

This time use Mathematica to get the solution vector  [Graphics:../Images/GaussianJordanMod_gr_134.gif]  out of this augmented matrix !

[Graphics:../Images/GaussianJordanMod_gr_135.gif]

[Graphics:../Images/GaussianJordanMod_gr_136.gif]

Verify the solution.

[Graphics:../Images/GaussianJordanMod_gr_137.gif]




[Graphics:../Images/GaussianJordanMod_gr_138.gif]

[Graphics:../Images/GaussianJordanMod_gr_139.gif]

[Graphics:../Images/GaussianJordanMod_gr_140.gif]

[Graphics:../Images/GaussianJordanMod_gr_141.gif]

[Graphics:../Images/GaussianJordanMod_gr_142.gif]

[Graphics:../Images/GaussianJordanMod_gr_143.gif]

We are done.

Aside.  We can compare our answer with the answer obtained by using Mathematica's built in  RowReduce  procedure.  

[Graphics:../Images/GaussianJordanMod_gr_144.gif]


[Graphics:../Images/GaussianJordanMod_gr_145.gif]

[Graphics:../Images/GaussianJordanMod_gr_146.gif]

[Graphics:../Images/GaussianJordanMod_gr_147.gif]

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.

[Graphics:../Images/GaussianJordanMod_gr_148.gif]



[Graphics:../Images/GaussianJordanMod_gr_149.gif]

[Graphics:../Images/GaussianJordanMod_gr_150.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004