Module for PA = LU Factorization with Pivoting

Check out the new Numerical Analysis Projects page.

 

LU Factorization with NO pivoting  To construct the  [Graphics:Images/LUfactorMod_gr_1.gif]  factorization of the non-singular matrix  [Graphics:Images/LUfactorMod_gr_2.gif].  

Remark 1.  This is not a linear system.

Remark 2.  The easy way uses row vectors and is a modification the code for limited Gauss Jordan elimination.
 

Mathematica Subroutine (Limited Gauss-Jordan Elimination).

Mathematica Subroutine (LandU).

[Graphics:Images/LUfactorMod_gr_4.gif]

Example 1. Given  [Graphics:Images/LUfactorMod_gr_5.gif].  Find matrices L and U so that LU = A.  
Solution 1.

 

Example 2. Given  [Graphics:Images/LUfactorMod_gr_15.gif].  Find matrices L and U so that LU = A.  
Solution 2.

 

A = LU;  Factorization with NO pivoting (a.k.a. LU Decomposition)  To construct the solution to the linear system  [Graphics:Images/LUfactorMod_gr_28.gif],
assuming that  [Graphics:Images/LUfactorMod_gr_29.gif].  The solution  [Graphics:Images/LUfactorMod_gr_30.gif]  is found in three steps:  

    
1.  Construct the matrices  [Graphics:Images/LUfactorMod_gr_31.gif], if possible.  
    
2.  Solve  [Graphics:Images/LUfactorMod_gr_32.gif]  for  [Graphics:Images/LUfactorMod_gr_33.gif]  using forward substitution.
    
3.  Solve  [Graphics:Images/LUfactorMod_gr_34.gif]  for  [Graphics:Images/LUfactorMod_gr_35.gif]  using back substitution.

 

PA = LU;  Factorization with Pivoting  To construct the solution to the linear system  [Graphics:Images/LUfactorMod_gr_36.gif], where  [Graphics:Images/LUfactorMod_gr_37.gif]  is a nonsingular matrix.  
The solution  [Graphics:Images/LUfactorMod_gr_38.gif]  is found in four steps:  

    
1.  Construct the matrices  [Graphics:Images/LUfactorMod_gr_39.gif].  
    
2.  Compute the column vector   [Graphics:Images/LUfactorMod_gr_40.gif].
    
3.  Solve  [Graphics:Images/LUfactorMod_gr_41.gif]  for  [Graphics:Images/LUfactorMod_gr_42.gif]  using forward substitution.
    
4.  Solve  [Graphics:Images/LUfactorMod_gr_43.gif]  for  [Graphics:Images/LUfactorMod_gr_44.gif]  using back substitution.

Remark.  The matrix  A  is a global variable and elements are changed when the  LUfactor  subroutine is executed.  Hence, it is important to save a copy of  A  in the variable  A0.

Use one of the following two versions of the  LUfactor  subroutine and the  SolveLU  subroutine.  The first version of  LUfactor  uses parallel programming and "row operations" instead of loops.

Mathematica Subroutine (LUfactor).

[Graphics:Images/LUfactorMod_gr_45.gif]

This is the second version of  LUfactor  and it uses more loops and traditional programming.

Mathematica Subroutine (LUfactor).

[Graphics:Images/LUfactorMod_gr_46.gif]

Use the subroutine SolveLU which is similar to the forward substitution and back substitution subroutines.

Mathematica Subroutine (SolveLU).

[Graphics:Images/LUfactorMod_gr_47.gif]

Remark.  Everything has been carefully set up so that  L,  U, and  P  can all be studied.

 

Example 3.  Use  PA = LU  factorization with pivoting to solve the linear system  AX = B,  where

    [Graphics:Images/LUfactorMod_gr_48.gif]  and  [Graphics:Images/LUfactorMod_gr_49.gif].  
Solution 3.

 

Example 4.  Use  PA = LU  factorization with pivoting to solve the linear system  AX = B,  where

    [Graphics:Images/LUfactorMod_gr_92.gif]  and  [Graphics:Images/LUfactorMod_gr_93.gif].  
Solution 4.

 

 

Old Lab Project (LU Factorization  LU Factorization).  
Internet hyperlinks to an old lab project.  

 

Research Experience for Undergraduates

LU Factorization  LU Factorization  
Internet hyperlinks to web sites and a bibliography of articles.  

 

Downloads (LU Factorization LU Factorization).  
Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003