Professional Documents
Culture Documents
A A A A A A L L L L L L: III. LU Decomposition Method
A A A A A A L L L L L L: III. LU Decomposition Method
a11
a
21
a31
a12
a22
a32
a13 l11
a23 = l 21
a33 l31
a12
a22
a32
a13 l11
a23 = l21
a33 l31
0
l 22
l32
0
0
l33
1
0
u12
1
0
u13
u 23
1
Hence
a11
a
21
a31
l11u12
l11u13
We can find, therefore, the elements of the matrices [L] and [U] by equating the two above
matrices:
a12 a12
l11 a11
l u l u a , hence u a 23 l21u13
23
23
21 13 22 23
l 22
52
Oooooooooouffffffffff !!!.
For a general nn matrix, you have to apply the following expressions to find the LU
decomposition of a matrix [A]:
j 1
; ij; i=1,2,,n
i 1
aij lik u kj
k 1
u ij
lii
; i<j; j=2,3,,n
and u ii 1 ; i=1,2,,n
IMPORTANT NOTE
As for the 33 matrix (see above), it is better to follow a certain order when computing the
terms of the [L] and [U] matrices. This order is: l i1,u1j; li2,u2j; ; li,n-1,un-1,,j; lnn.
Example
Find the LU decomposition of the following matrix using Crouts method:
a11
[A]= a 21
a31
a12
a22
a32
a13 2
a23 = 4
a33 3
1
3
2
1
1
2
A x b
Under the following form
A x LU x b
To find the solution x , we define first a vector z :
z U x
Our initial system becomes, then:
L z b
53
As [L] is a lower triangular matrix the z can be computed starting by z 1 until zn. Then the values
of x can be found using the equation:
z U x
as [U] is an upper triangular matrix, it is possible to compute x using a back substitution
process starting xn until x1. [You will better understand with an example ]
The general form to solve a system of linear equations using LU decomposition is:
z1
b1
l11
i 1
zi
bi lik z k
k 1
lii
; i 2,3,..., n
And
xn z n
xi z i
k i 1
ik
xk ; i n 1, n 2,...,2,1
Example
Solve the following equations using the LU decomposition:
2 x1 x2 x3 4
4 x1 3x2 x3 6
3x 2 x 2 x 15
1 2 3
Note on storage of [A]; [L]; [U]
1- In practice, the matrices [L] and [U] do not need to be stored separately. By omitting
the zeroes in [L] and [U] and the ones in the diagonal of [U] it is possible to store the
elements of [L] and [U] in the same matrix.
2- Note also that in the general formula for LU decomposition once an element of the
matrix [A] is used, it is not needed in the subsequent computations. Hence, the
elements of the matrix generated in point (1) above can be stored in [A]
54
In many engineering applications the matrices involved will be symmetric and defined positive. It
is, then, better to use the Choleskis method.
In the Choleskis method, our matrix [A] is decomposed into:
[A]=[U]T [U]
where [U] is an upper triangular matrix.
The elements of [U] are given by:
u11 a11 1 / 2
u a1 j ; j 2,3,..., n
1j u
11
i 1
uii aii u
k 1
uij
2
ki
1/ 2
; i 2,3,..., n
i 1
1
u 0; i j
ij
1
A x b 0 ; second column:
0
0
A x b 1 ; and third column;
0
0
A x b 0
1
The best way to implement such a calculation is to use LU decomposition.
In engineering, the inverse matrix is of particular interest, since its elements represent the
response of a single part of the system to a unit stimulus of any other part of the system.
III.5. Matrix condition number
55
For a vector x :
x1
x2
x
.
.
x n
The Euclidean norm of this vector is defined as:
x x12 x 22 ... x n2
1
2
LP
x
i 1
1
P
P
i
Note
If the value of (p) is increased to infinity in the above expression, the value of the L norm will
For a matrix; the first and infinity norms are defined as:
n
A 1 max
aij
1 j n
i 1
n
A max
aij
1 i n
j 1
56
Cond A A A1
Cond A
A
A
Therefore, the error on the solution can be as large as the relative error of the norm of [A]
multiplied by the condition number.
If the precision on [A] is t-digits (10 -t) and Cond[A]=10C, the solution on [x] may be valid to only t-c
digits (10c-t).
III.6. Jacobi iteration Method
The Jacobi method is an iterative method to solve systems of linear algebraic equations.
Consider the following system:
.
an1 x1 an 2 x2 an 3 x3 ... ann xnn bn
This system can be written under the following form:
1
b1 a12 x2 a13 x3 ... a1n xn
x
a11
x1
1
bn an1x1 an 2 x2 ... an,n 1xn,n 1
ann
xi
1
aii
bi
j 1, j i
ij
x j ; i=1,2,,n
Here we start, by an initial guess for x 1; x2; ; xn, and we compute the new values for the next
iteration. If no good initial guess is available, we can assume each component to be zero.
We generate the solution at the next iteration using the following expression:
xik 1
1
bi
aii
j 1, j i
ij
57
xik 1 xik
;
xik
It is possible to show that a sufficient condition for the convergence of the Jacobi method is:
a ii
j 1, j i
ij
k 1
well as xi 2 , xi 3 ,..., x n , are used in finding the value x i 1 . This implies that always the
most recent approximations are used during the computation. The general expression is:
xik 1
1
aii
i 1
bi aij x kj 1
j 1
NEW
OLD
j i 1
ij
Note
- The Gauss-Seidel method will converge to the correct solution irrespective of the initial
estimate, if the system of equations is diagonally dominant. But, in many cases, the solution
will converges, even if the system is weakly diagonally dominant.
Example
Find the solution of the following equations using the Gauss-Seidel iteration method:
5 x1 x2 2 x3 1
2 x1 6 x2 3x3 2
2 x x 7 x 32
1 2 3
58
59