You are on page 1of 4

Example of LU Decomposition

Solving the following linear systems of equations:


3x1 0.1x2 0.2x3 = 7.85
0.1x1 + 7x2 0.3x3 = 19.3
0.3x1 0.2x2 + 10x3 = 71.4

The above system can be rearranged to give [A]{x} {b} = 0

Suppose the above system could be expressed as an upper triangular system,


u12
u22
0

u11
0
0

u13 x1
d1
u23 x2 = d2
u33 x3
d3

Recognize that this is similar to the manipulation that occurs in the first step of Gaussian
elimination. That is, elimination is used to reduce the system to upper triangular form. The
above equation can also be expressed in matrix notation and rearranged to give
[U]{x} {d} = 0

Now assume that there is a lower diagonal matrix with 1s on the diagonal,
1
[L] = 21
31

0
1
32

0
0
1

That is, [L][U]{x} {d} = [A]{x} {b} = 0


If the equation holds, it follows [L][U] = [A] and [L]{d} = {b}

Before we use the LU decomposition, let us use Gaussian elimination to solve this system.
1. The Gaussian Elimination Method
Work with the augmented matrix as follows:
3 0.1 0.2
0.1
7
0.3
0.3 0.2 10

3
0.1
7.85
7.00333
19.3 R2-(0.1/3)R1 & R3-(0.3/3)R1 0
0 0.190000
71.4
3

0.1
7.00333
0
0

R3-(-0.190000/7.00333)R2 0

0.2
0.293333
10.0120

7.85
19.5617
70.0843

0.2
0.293333
10.02000

7.85
19.5617
70.6150

Solve by back substitution,

70.0843

x3 = 10.0120 = 7.00003
x2 =
x1 =

19.5617+0.293333
7.00333

= 2.50000

7.85+0.1(2.50000)+0.2(7.00003)
3

For comparison purpose, the exact solution is x1 = 3,


x2 = 2.5
and x3 = 7

= 3.00000

2. The LU Decomposition

3 0.1 0.2
Now, let us do LU decomposition of matrix A = 0.1
7
0.3
0.3 0.2 10
3
We have found U = 0
0

0.1
7.00333
0

0.2
0.293333 produced from the elimination process above!
10.0120

Then how about L ? It turns out that the three elements of L were already generated from the Gaussian
elimination process from above operations:
21 =
31 =
32 =

a21 0.1
=
= 0.0333333
a11
3
a31 0.3
=
= 0.100000
a11
3

a32
0.19
= 0.0271300
=
a22 7.00333

1
Thus, the lower triangle matrix is L = 0.0333333
0.100000

0
1
0.0271300

Now let us check to see if multiplying L by U yields A,


1
LU = 0.0333333
0.100000

0
1
0.0271300

0 3
0.1
0 0 7.00333
1 0
0

0
0
1

0.2
0.293333
10.0120

3
= 0.0999999
0.3

0.1
0.2
7
0.3 Yes!!!
0.2 9.99996

The minor discrepancies are due to roundoff.

Note: Up to this point in LU decomposition, we have not invoked the {} matrix yet!
3. The Substitution Steps
Recall the system to be solved is

3 0.1 0.2 x1
7.85
0.1
7
0.3 x2 = 19.3
0.3 0.2 10 x3
71.4

The forward-elimination phase is implemented by applying [L]{d} = {b}:


1
0.0333333
0.100000

0
1
0.0271300

0 d1
7.85
d
0 2 = 19.3
1 d3
71.4

Solving the above equations yields: d1 = 7.85, d2 = 19.5617, and d3 = 70.0843


7.85
Thus, {d} = 19.5617
70.0843

This result can now be substituted into [U]{x} = {d}:


3
0
0

0.1
7.00333
0

x1
0.2
7.85
0.293333 x2 = 19.5617
x3
10.0120
70.0843

3
which can be solved by back substitution for the final solution: {x} = 2.5
7.00003

Since L and U stay the same for any other B matrix, another B matrix will call for the generation
of a new {d}, which will subsequently yield a new solution for {x}.
Summary
The LU decomposition method can best be summarized in the following diagram.

You might also like