PA LU Examples

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Examples

Example 1
Find the PA = LU factorization of the matrix
A=[

First, rows 1 and 2 need to be exchage, according to partial pivoting:


[

] exchange rows 1 and row 3 [

] P = [

][

].

].

We will use the permutation matrix P to keep track of the cumulative permutation of rows
that have been done along the way. Now we perform two rows operations, namely,
subtract 1/2 x row 1 from row 2 [

] subtract 1/4 x row 1 from row 3

], to eliminate the first column. We have done something new instead of

putting only a zero in the eliminated position, we have made the zero a storage location. Inside
the zero at the (i, j) position, we store multiplier m ij that se used to eiminate that position. We do
this for a reason. This is the mechanism by which the multipliers will stay with their row, in case
future row exchanges are made.
[

] exchange rows 2 and row 3 [

]P=[

][

subtract -1/2 x row 2 from row 3 [

].

This is the finished elimination. Now we can read off the PA = LU factorization:
[

][

]=[

][

Using the PA = LU factorization to solve a system of equations Ax = b is just a slight


variant of the A = LU version. Multiply the equation Ax = b by P on the left, and then proceed as
before:
PAx = Pb
LUx = Pb.
Solve
Lc = Pb for c
Ux = c for x.
Example 2
Find the PA = LU factorization to solve the system Ax = b, where
A=[

], b = [ ].

The PA = LU factorization is known from Example 1. It remains to complete the two back
substitutions.
Lc = Pb:
[

] [ ]= [

][ ] = [ ]

Starting at the top, we have c1 = 0, c2 = 6, c3 = 8.


Ux = c:
2

] [ ] = [ ].

Starting at the bottom, we have x3 = 1, x2 = 2, x1 = -1.

You might also like