LU decomposition: General Engineering



Chapter 04.07

LU Decomposition

After reading this chapter, you should be able to:

1. identify when LU decomposition is numerically more efficient than Gaussian elimination,

2. decompose a nonsingular matrix into LU, and

3. show how LU decomposition is used to find the inverse of a matrix.

I hear about LU decomposition used as a method to solve a set of simultaneous linear equations. What is it?

We already studied two numerical methods of finding the solution to simultaneous linear equations – Naïve Gauss elimination and Gaussian elimination with partial pivoting. Then, why do we need to learn another method? To appreciate why LU decomposition could be a better choice than the Gauss elimination techniques in some cases, let us discuss first what LU decomposition is about.

For a nonsingular matrix [pic] on which one can successfully conduct the Naïve Gauss elimination forward elimination steps, one can always write it as

[pic]

where

[pic]= Lower triangular matrix

[pic] = Upper triangular matrix

Then if one is solving a set of equations

[pic],

then

[pic] as [pic]

Multiplying both sides by [pic],

[pic]

[pic]=[pic] as [pic]

[pic] as [pic]

Let

[pic]

then

[pic] (1)

and

[pic] (2)

So we can solve Equation (1) first for [pic] by using forward substitution and then use Equation (2) to calculate the solution vector [pic] by back substitution.

This is all exciting but LU decomposition looks more complicated than Gaussian elimination. Do we use LU decomposition because it is computationally more efficient than Gaussian elimination to solve a set of n equations given by [A][X]=[C]?

For a square matrix [pic] of [pic] size, the computational time[1] [pic] to decompose the [pic] matrix to [pic] form is given by

[pic] = [pic],

where

[pic]= clock cycle time[2].

The computational time [pic] to solve by forward substitution [pic] is given by

[pic] = [pic]

The computational time [pic] to solve by back substitution [pic] is given by

[pic] = [pic]

So, the total computational time to solve a set of equations by LU decomposition is

[pic]= [pic]+[pic]+[pic]

= [pic]+[pic]+[pic]

= [pic]

Now let us look at the computational time taken by Gaussian elimination. The computational time [pic] for the forward elimination part,

[pic]= [pic],

and the computational time [pic] for the back substitution part is

[pic] = [pic]

So, the total computational time [pic] to solve a set of equations by Gaussian Elimination is

[pic]= [pic]+[pic]

= [pic]+[pic]

= [pic]

The computational time for Gaussian elimination and LU decomposition is identical.

This has confused me further! Why learn LU decomposition method when it takes the same computational time as Gaussian elimination, and that too when the two methods are closely related. Please convince me that LU decomposition has its place in solving linear equations!

We have the knowledge now to convince you that LU decomposition method has its place in the solution of simultaneous linear equations. Let us look at an example where the LU decomposition method is computationally more efficient than Gaussian elimination. Remember in trying to find the inverse of the matrix [pic] in Chapter 04.05, the problem reduces to solving [pic] sets of equations with the [pic] columns of the identity matrix as the RHS vector. For calculations of each column of the inverse of the [pic] matrix, the coefficient matrix [pic] matrix in the set of equation [pic] does not change. So if we use the LU decomposition method, the [pic] decomposition needs to be done only once, the forward substitution (Equation 1) [pic] times, and the back substitution (Equation 2) [pic] times.

Therefore, the total computational time [pic] required to find the inverse of a matrix using LU decomposition is

[pic]= [pic]+[pic]+[pic]

= [pic]+[pic][pic]+[pic][pic]

= [pic]

In comparison, if Gaussian elimination method were used to find the inverse of a matrix, the forward elimination as well as the back substitution will have to be done n times. The total computational time [pic] required to find the inverse of a matrix by using Gaussian elimination then is

[pic]= [pic]+[pic]

= [pic][pic]+[pic][pic]

= [pic]

Clearly for large [pic], [pic]>>[pic] as [pic] has the dominating terms of [pic] and [pic]has the dominating terms of [pic]. For large values of [pic], Gaussian elimination method would take more computational time (approximately [pic] times – prove it) than the LU decomposition method. Typical values of the ratio of the computational time for different values of [pic] are given in Table 1.

Table 1 Comparing computational times of finding inverse of a matrix using LU decomposition and Gaussian elimination.

|[pic] |10 |100 |1000 |10000 |

|[pic]/[pic] |3.28 |25.83 |250.8 |2501 |

Are you convinced now that LU decomposition has its place in solving systems of equations? We are now ready to answer other curious questions such as

1) How do I find LU matrices for a nonsingular matrix [pic]?

2) How do I conduct forward and back substitution steps of Equations (1) and (2), respectively?

How do I decompose a non-singular matrix [pic], that is, how do I find [pic]?

If forward elimination steps of the Naïve Gauss elimination methods can be applied on a nonsingular matrix, then [pic] can be decomposed into LU as

[pic]

[pic]

The elements of the [pic] matrix are exactly the same as the coefficient matrix one obtains at the end of the forward elimination steps in Naïve Gauss elimination.

The lower triangular matrix [pic] has 1 in its diagonal entries. The non-zero elements on the non-diagonal elements in [pic] are multipliers that made the corresponding entries zero in the upper triangular matrix [pic] during forward elimination.

Let us look at this using the same example as used in Naïve Gaussian elimination.

Example 1

Find the LU decomposition of the matrix

[pic]

Solution

[pic]

[pic]

The [pic] matrix is the same as found at the end of the forward elimination of Naïve Gauss elimination method, that is

[pic]

To find [pic] and [pic], find the multiplier that was used to make the [pic] and [pic] elements zero in the first step of forward elimination of the Naïve Gauss elimination method. It was

[pic]

[pic]

[pic]

[pic]

To find [pic], what multiplier was used to make [pic] element zero? Remember [pic] element was made zero in the second step of forward elimination. The [pic] matrix at the beginning of the second step of forward elimination was

[pic]

So

[pic]

[pic]

Hence

[pic]

Confirm [pic].

[pic]

[pic]

Example 2

Use the LU decomposition method to solve the following simultaneous linear equations.

[pic]

Solution

Recall that

[pic][pic]

and if

[pic]

then first solving

[pic]

and then

[pic]

gives the solution vector [pic].

Now in the previous example, we showed

[pic]

[pic]

First solve

[pic]

[pic]

to give

[pic]

[pic]

[pic]

Forward substitution starting from the first equation gives

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

Hence

[pic]

[pic]

This matrix is same as the right hand side obtained at the end of the forward elimination steps of Naïve Gauss elimination method. Is this a coincidence?

Now solve

[pic]

[pic]

[pic]

[pic]

[pic]

From the third equation

[pic]

[pic]

[pic]

Substituting the value of [pic] in the second equation,

[pic]

[pic]

[pic]

[pic]

Substituting the value of [pic] and [pic] in the first equation,

[pic]

[pic]

[pic]

[pic]

Hence the solution vector is

[pic]

How do I find the inverse of a square matrix using LU decomposition?

A matrix [pic] is the inverse of [pic] if

[pic].

How can we use LU decomposition to find the inverse of the matrix? Assume the first column of [pic] (the inverse of [pic]) is

[pic]

Then from the above definition of an inverse and the definition of matrix multiplication

[pic]

Similarly the second column of [pic] is given by

[pic]

Similarly, all columns of [pic] can be found by solving [pic] different sets of equations with the column of the right hand side being the [pic] columns of the identity matrix.

Example 3

Use LU decomposition to find the inverse of

[pic]

Solution

Knowing that

[pic]

[pic]

We can solve for the first column of [pic]by solving for

[pic]

First solve

[pic],

that is

[pic]

to give

[pic]

[pic]

[pic]

Forward substitution starting from the first equation gives

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

Hence

[pic]

[pic]

Now solve

[pic]

that is

[pic]

[pic]

[pic]

[pic]

Backward substitution starting from the third equation gives

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

Hence the first column of the inverse of [pic] is

[pic]

Similarly by solving

[pic] gives [pic]

and solving

[pic] gives [pic]

Hence

[pic]

Can you confirm the following for the above example?

[pic]

Key Terms:

LU decomposition

Inverse

-----------------------

[1] The time is calculated by first separately calculating the number of additions, subtractions, multiplications, and divisions in a procedure such as back substitution, etc. We then assume 4 clock cycles each for an add, subtract, or multiply operation, and 16 clock cycles for a divide operation as is the case for a typical AMD®-K7 chip.



[2] As an example, a 1.2 GHz CPU has a clock cycle of [pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download