Example 2.  Consider the linear system  [Graphics:Images/CholeskyMod_gr_95.gif].  
2 (b).  Solve the linear system  AX = B  by using the Crout method.  

Solution 2 (b).

(i).  Enter the matrix and vector.  

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



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

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

(ii).  Construct the Crout factorization of matrix A.

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



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

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

(iii). Solve the linear system using our  ForeSub[n]  and  [BackSub[n]  subroutines.

First, solve the lower-triangular system    LY = B  for  Y.

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



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

Verify that  LY = B.

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



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

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

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

Second, solve the upper-triangular system    UX = Y  for  X.

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



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

Verify that  UX = Y.  

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



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

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

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

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

Therefore X is the solution to  LUX = B. and hence AX = B
And we can verify that it is the solution.

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



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

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

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

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

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

We can compare this solution with the solution obtained in part (a).

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



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

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004