lower upper decomposition

© All Rights Reserved

7 views

lower upper decomposition

© All Rights Reserved

- fdfd_waveEqn
- KLU UserGuide
- Inverse of 4x4 Matrix
- A Friendly Mathematics Competition - 35 Years of Teamwork in Indiana
- Finite Element Analysis by S.S. Bhavikatti, New Age Int. (2005)
- MATRIX_OPERATION (JAVA PROGRAM PDF)
- LU_Crout
- Linear Algebra Factsheet
- Math t short Note (for memory flash back only )
- _14_ELC4340_Spring13_Power_System_Matrices.doc
- lawn67
- Lecture 1210
- Matlab3
- 17matdip41
- EC 400 Quizzes for Class 2
- SOLUTION CHARACTERISTICS OF QUADRATIC POWER FLOW PROBLEMS
- lag4
- Linear
- CE_KNT_03
- 260 MT1

You are on page 1of 15

LECTURE THREE

LU Decomposition

After this lecture you should be able to:

2. Decompose a non-singular matrix into LU,

Show how LU Decomposition is used to find matrix inverse

1.2

We already studied two numerical methods of finding the solution to simultaneous linear

equations Naive Gauss Elimination and Gaussian Elimination with Partial Pivoting. To

appreciate why LU Decomposition could be a better choice than the Gaussian Elimination

techniques in some cases, let us discuss first what LU Decomposition is about.

For any non-singular matrix A on which one can conduct Naive Gaussian Elimination or

forward elimination steps, one can always write it as A LU

where

L = Lower triangular matrix (specifically, a unit lower triangular Matrix)

U = Upper triangular matrix

Then if one is solving a set of equations Ax b , it will imply that LUx b since A LU .

Multiplying both side by L1 , we have

L1LUx L1b

IUx L1 x since L1L I ,

Ux L1 x since IU U

Let L1b z then Lz b (1)

And Ux z (2)

So we can solve equation (1) first for z and then use equation (2) to calculate x .

n3

The computational time required to decompose the A matrix to LU form is proportional to ,

3

where n is the number of equations (size of A matrix). Then to solve the Lz b , the

n2

computational time is proportional to . Then to solve the Ux z , the computational time is

2

1

Numerical Analysis Math351/352

n2

proportional to . So the total computational time to solve a set of equations by LU

2

n3

decomposition is proportional to n 2 .

3

n3 n2

time proportional to , where the computational time for forward elimination is

3 2

n3 n2

proportional to and for the back substitution the time is proportional to .

3 2

Finding the inverse of the matrix A reduces to solving n sets of equations with the n columns of

the identity matrix as the RHS vector. For calculations of each column of the inverse of the A

matrix, the coefficient matrix A matrix in the set of equation Ax b does not change. So if we

use LU Decomposition method, the A LU decomposition needs to be done only once and the

use of equations (1) and (2) still needs to be done n times.

So the total computational time required to find the inverse of a matrix using LU decomposition

n3 4n 3

is proportional to n( n 2 ) .

3 3

In comparison, if Gaussian elimination method were applied to find the inverse of a matrix, the

n3 n 2 n 4 n3

time would be proportional to n .

3 2 3 2

n 4 n 3 4n 3

For large values of n,

3 2 3

L U Decomposition Algorithm:

In these methods the coefficient matrix A of the given system of equation Ax b is written as a

product of a Lower triangular matrix L and an Upper triangular matrix U, such that A LU

where the elements of L (lij 0; for i j ) and the elements of U (uij 0; for i j ) that is,

2

Numerical Analysis Math351/352

l l 0 u22

L 21 22 and U .

0 un 1,n

ln1 ln 2 lnn 0

0 unn

min( i , j )

Now using the rules of matrix multiplication aij k 1

lik ukj , i, j 1, ,n

This gives a system of n 2 equations for the n2 n unknowns (the non-zero elements in L and

U). To make the number of unknowns and the number of equations equal one can fix the

diagonal element either in L or in U such as '1's then solve the n 2 equations for the remaining n 2

unknowns in L and U. This leads to the following algorithm:

Algorithm

is a lower triangular and U uij nn

an upper

triangular, can be computed directly by the following algorithm (provided zero divisions are not

encountered):

Algorithm

k 1

For k 1 to n do specify lkk or ukk and compute the other such that lkk ukk akk lkmumk .

m 1

1 k 1

Compute the kth column of L using lik ik limumk

a k i n , and compute the kth

ukk m 1

1 k 1

row of U using ukj kj lkmumj

a k j n

lkk m 1

End

u jj 1 1 j n respectively.

If forward elimination steps of Naive Gauss elimination methods can be applied on a non-

singular matrix, then A can be decomposed into LU as

3

Numerical Analysis Math351/352

a a22 1

A

21 21 0 u22 LU

an 1,n 0 un 1,n

an1 an ,n 1 ann n1 n 1, n 1 1 0 0 unn

1. The elements of the U matrix are exactly the same as the coefficient matrix one obtains at

the end of the forward elimination steps in Naive Gauss Elimination.

2. The lower triangular matrix L has 1 in its diagonal entries. The non-zero elements

below the diagonal in L are multipliers that made the corresponding entries zero in the

upper triangular matrix U during forward elimination.

4

Numerical Analysis Math351/352

Solving systems of linear equations (AX=b) using LU factorization can be quite cumbersome,

although it seem to be one of the simplest ways of finding the solution for the system, Ax=b. In

pure matrix notation, the upper triangular matrix, U, can be calculated by constructing specific

permutation matrices and elementary matrices to solve the Elimination process with both partial

and complete pivoting.

matrices as follows:

1 0 0 1 0 0

m 1 a ( j 1)

Where M 1

21 , M 0 1 with m ij known as the

0 2

0 ij

a jj

mn1 0 1 0 mn 2 1

multiplier

In solving Gaussian elimination without partial pivoting to triangularize A, the process yields the

factorization, MA U .In this case, the system Ax = b is equivalent to the triangular system

Ux Mb b where M M k 1M k 2 M k 3 ...M1

The elementary matrices M1 and M2 are called first and second Gaussian transformation matrix

respectively with M k being the k th Gaussian transformation matrix.

Generally, to solve Ax b using Naive Gaussian elimination without partial pivoting by this

approach, a permutation matrix is introduced to perform the pivoting strategies:

First We find the factorization MA U by the triangularization algorithm using partial pivoting.

We then solve the triangular system by back substitution as follows Ux Mb b .

The vector b Mb M n1Pn1M n2 Pn2 M 2 P2 M1Pb

1

T

sk 1 M k Pk sk

5

Numerical Analysis Math351/352

Example

1 0 0 1 0 0 s1 2

2

If n 3, P1 0 0 1 , M1 m21 1 0 , then s2 M1Ps

1 1 s2

0 1 0 m

31 0 1 s3 2

b1

1 1 b2 then the entries of s

(2)

If Ps are given by:

b

3

2

s1 b1

s2 2 m21b1 b3

s3 2 m31b1 b2

In the same way, to solve Ax = b Using Gaussian Elimination with Complete Pivoting, we

modify the previous construction to include another permutation matrix, Q such that when post

multiplied by A, we can perform column interchange. This results in M ( PAQ) U

Example 1

Find the LU decomposition of the matrix

25 5 1

A 64 8 1

144 12 1

Solution

1 0 0 u11 u12 u13

A LU 21 1 0 0 u22 u23

31 32 1 0 0 u33

The U matrix is the same as found at the end of the forward elimination of Naive Gauss

elimination method, that is

Forward Elimination of Unknowns: Since there are three equations, there will be two steps of

forward elimination of unknowns.

25 5 1

64 8 1

144 12 1

6

Numerical Analysis Math351/352

First step: Divide Row 1 by 25 and then multiply it by 64 and subtract the results from Row 2

25 5 1

64

Row 2 ( Row 1) 0 4.8 1.56

25

144 12 1

64

Here the multiplier , m21

25

Divide Row 1 by 25 and then multiply it by 144 and subtract the results from Row 3

25 5 1

144

Row 3 ( Row 1) 0 4.8 1.56

25

0 16.8 4.76

144

Here the multiplier , m31 , hence the first Gaussian transformation matrix is given by:

25

1 0 0 1 0 0

M 1 m21 1 0 2.56 1 0 And the corresponding product is given by:

m31 0 1 5.76 0 1

1 0 0 25 5 1 25 5 1

A M 1 A 2.60 1 0 64 8 1 0 4.8 1.56 (by a single multiplication)

(1)

5.76 0 1 144 12 1 0 16.8 4.76

Second step: We now divide Row 2 by -4.8 and then multiply by -16.8 and subtract the results

from Row 3

25 5 1 25 5 1

16.8

Row 3 ( Row 2) 0 4.8 1.56 which produces U 0 4.8 1.56

4.8

0 0 0.7 0 0 0.7

16.8

Here the multiplier, m32 , hence the 2nd Gaussian transformation matrix is given by:

4.8

7

Numerical Analysis Math351/352

1 0 0 1 0 0

M 2 0 1

0 0 1 0 And the corresponding product is given by:

0 m32 1 0 3.5 1

1 0 0 25 5 1 25 5 1

A(2)

M 2 A(1) 0 1 0 0 4.8 1.56 0 4.8 1.56 U

(by a single multiplication)

To find 21 and 31 , what multiplier was used to make the a 21 and a 31 elements zero in the first

step of forward elimination of Naive Gauss Elimination Method It was

64

21 m21 2.56

25

144

31 m31 5.76

25

To find 32 , what multiplier was used to make a 32 element zero. Remember a 32 element was

made zero in the second step of forward elimination. The A matrix at the beginning of the

second step of forward elimination was

25 5 1

0 4.8 1.56

0 16.8 4.76

So

16.8

m32 3.5

4.8

32

Hence

1 0 0 1 0 0

L m21 1 0 2.56 1 0

m31 m32 1 5.76 3.5 1

Confirm LU A .

1 0 0 25 5 1 25 5 1

LU 2.56 1 0 0 4.8 1.56 64 8 1

5.76 3.5 1 0 0 0.7 144 12 1

8

Numerical Analysis Math351/352

Example 2

Use LU decomposition method to solve the following linear system of equations.

25 5 1 x1 106.8

64 8 1 x 177.2

2

144 12 1 x3 279.2

Solution

Recall that Ax b and if A LU then first solving Lz b and then Ux z gives the solution

vector x .

1 0 0 25 5 1

A LU 2.56 1 0 0 4.8 1.56

5.76 3.5 1 0 0 0.7

1 0 0 z1 106.8

2.56 1 0 z 177.2

2

5.76 3.5 1 z 3 279.2

to give

z1 106.8

2.56 z1 z2 177.2

5.76 z1 3.5 z2 z3 279.2

z1 106.8

z2 177.2 2.56 z1 177.2 2.56(106.8) 96.2

z3 279.2 5.76 z1 3.5 z2 279.2 5.76(106.8) 3.5(96.21) 0.735

Hence

z1 106.8

z z2 96.21

z3 0.735

9

Numerical Analysis Math351/352

This matrix is same as the right hand side obtained at the end of the forward elimination steps of

Naive Gauss elimination method. Is this a coincidence?

25 5 1 x1 106.8

0 4.8 1.56 x -96.21

2

0 0 0.7 x3 0.735

25 x1 5 x2 x3 106.8

4.8 x2 1.56 x3 96.21

0.7 x3 0.735

0.735

From the third equation 0.7 x3 0.735 x3 1.050

0.7

4.8 x2 1.56 x3 96.21 x2 19.70

4.8 -4.8

106.8 5 x2 x3

25 x1 5 x2 x3 106.8 x1

25

106.8 5 19.70 1.050

0.2900

25

x1 0.2900

x 19.70

2

x3 1.050

10

Numerical Analysis Math351/352

Example 3

Solve

0 1 1 2

Ax b with A 1 2 3 and b 6

1 1 1 3

(a) using partial pivoting and (b) using complete pivoting.

Solution:

(a) Partial pivoting:

We compute U as follows:

Step 1:

0 1 0 1 2 3 1 0 0

P1 1 0 0 ; P1 A 0 1 1 ; M 1 0 1 0 ;

0 0 1 1 1 1 1 0 1

1 2 3

A M 1 P1 A 0 1 1 ;

(1)

0 1 2

Step 2 :

1 0 0 1 2 3 1 0 0

P2 0 1 0 ; P2 A(1) 0 1 1 ; M 2 0 1 0 ;

0 0 1 0 1 2 0 1 1

1 2 3

U A(2) M 2 P2 A(1) M 2 P2 M 1 P1 A 0 1 1

0 0 1

1

Note : Defining P P2 P1 and L P( M 2 P2 M 1P1 ) , we have PA LU .

We compute b as follows:

Step1:

0 1 0 6 1 0 0 6

P1 1 0 0 ;

1 2 ;

Pb M 1 0 1 0 ;

1 2 ;

M 1Pb

0 0 1 3 1 0 1 3

Step 2 :

1 0 0 6 1 0 0 6

P2 0 1 0 ; P2 M1 Pb 2 ; M 2 0 1 0 ; b M 2 P2 M 1Pb 2 ;

0 0 1 3 0 1 1 1

1 1

11

Numerical Analysis Math351/352

1 2 3 x1 6

Ux b 0 1 1 x 2 and x x x 1

2 1 2 3

0 0 1 x3 1

(b) Complete pivoting: We compute U as follows:

Step 1:

0 1 0 0 0 1 3 2 1 1 0 0

P1 1 0 0 ; Q1 0 1 0 ; P1 AQ1 1 1 0 ; M 1 13 1 0 ;

0 0 1 1 0 0 1 1 1 1 0 1

3

1 2 3

A(1) M 1 P1 AQ1 0 13 13

0 1 2

3 3

Step 2 :

1 0 0 1 0 0 3 1 2 1 0 0

P2 0 0 1 ; Q2 0 0 1 ;

P2 A Q2 0 3 3 ;

(1) 2 1

M2 0 1 0;

0 1 0 0 1 0

1 1

0 3 3 0 2 1

1

3 1 2

U A M 2 P2 A Q2 M 2 P2 M 1P1 AQ1Q2 0 23 13

(2) (1)

0 0 1

2

We compute b as follows:

Step1:

0 1 0 6 1 0 0 6

1

P1 1 0 0 ; 1 2 ;

Pb M 1 3 1 0 ; M 1Pb

1 0

0 0 1 3 1 0 1 1

3

Step 2 :

1 0 0 6 1 0 0 6

P2 0 0 1 ; P2 M 1 Pb 1 ; M 2 0 1 0 ; M 1 Pb 0 ;

0 1 0 1

0 1 1

1

0 2 1

6

b M 2 P2 M 1 Pb

1 1

1

2

12

Numerical Analysis Math351/352

3 1 2 y1 6

Uy b 0 23 13 y2 1

0 0 1 y 1

2 3 2

is y1 y2 y3 1 . Because xk , k 1, 2,3 is simply the rearrangement of yk , we have

x1 x2 x3 1 .

A matrix B is the inverse of A if AB I BA . First assume that the first column of B (the

inverse of A is b11 b21 bn1 then from the above definition of inverse and definition of

T

matrix multiplication.

b11 1

b 0

A 21

bn1 0

b12 0

b 1

A 22

bn 2 0

Similarly, all columns of B can be found by solving n different sets of equations with the column

of the right hand sides being the n columns of the identity matrix.

Example 3

Use LU decomposition to find the inverse of

25 5 1

A 64 8 1

144 12 1

13

Numerical Analysis Math351/352

Solution

Knowing that

1 0 0 25 5 1

A LU 2.56 1 0 0 -4.8 -1.56

5.76 3.5 1 0 0 0.7

25 5 1 b11 1

64 8 1 b 0

21

144 12 1 b31 0

1 0 0 z1 1

2.56 1 0 z 0

2

5.76 3.5 1 z 3 0

to give

z1 1

2.56 z1 z2 0

5.76 z1 3.5 z2 z3 0

z1 1

z 2 0-2.56z1 0 2.56 1 256

z3 0 5.76 z1 3.5 z2 0 5.76 1 3.5 2.56 3.2

Hence

z1 1

z z2 2.56

z3 3.2

14

Numerical Analysis Math351/352

0 4.8 1.56 b - 2.56 4.8b21 1.56b31 2.56

21

0 0 0.7 b31 3.2 0.7b31 3.2

3.2

b31 4.571

0.7

b21 0.9524

4.8 4.8

b11 0.04762

25 25

b11 0.04762

b 0.9524

21

b31 4.571

Similarly by solving

64 8 1 b 1 b22 1.417

22

144 12 1 b32 0 b32 5.000

and solving

64 8 1 b 0 b 0.4643

23 23

144 12 1 b 33 1 b33 1.429

Hence

A 0.9524 1.417 0.4643

1

15

- fdfd_waveEqnUploaded byjs9999
- KLU UserGuideUploaded byDavis Montenegro
- Inverse of 4x4 MatrixUploaded byMartin Hanz Ernette Calunod
- A Friendly Mathematics Competition - 35 Years of Teamwork in IndianaUploaded bySoruth Kuntikul
- Finite Element Analysis by S.S. Bhavikatti, New Age Int. (2005)Uploaded byRavi Pratap Singh
- MATRIX_OPERATION (JAVA PROGRAM PDF)Uploaded byAMRENDRA SINGH
- LU_CroutUploaded byGregory West
- Linear Algebra FactsheetUploaded bycmtinv
- Math t short Note (for memory flash back only )Uploaded byVictor Hah Chang Wah
- _14_ELC4340_Spring13_Power_System_Matrices.docUploaded byAnonymous AFFiZn
- lawn67Uploaded byDeaglan Halligan
- Lecture 1210Uploaded byYalew Tamene
- Matlab3Uploaded byJayveeRevillaJeresano
- 17matdip41Uploaded bySushma greeshma
- EC 400 Quizzes for Class 2Uploaded byAvijit Puri
- SOLUTION CHARACTERISTICS OF QUADRATIC POWER FLOW PROBLEMSUploaded byjaach78
- lag4Uploaded byKhmer Cham
- LinearUploaded bySheikh Riasat
- CE_KNT_03Uploaded byEkaoru Septian
- 260 MT1Uploaded byaltansenel
- LangCommentary.pdfUploaded bycluj24
- FD1 2 DigestUploaded bypearl301010
- UNIT IUploaded byRam Prasad
- Bus-Impedance-Matrix.pptxUploaded byChristine Mae Barola
- hw1solUploaded byMaximiliano E. Asis Lopez
- THT 1 A.docxUploaded byMuhammad Rizki Zuhri
- Matrix Mult 09Uploaded byPranalistia Tiara Putri
- Gate18 Cs GforumUploaded byprabhu.swain3500
- Chap08Uploaded byAntonio Perez
- Matrices 1Uploaded byAlexander Corvinus

- PECostEstim_FinalReportUploaded bylfmz
- Chapter[1]Uploaded bySamuel Mawutor Gamor
- Petrochemical Process HandBook.pdfUploaded byrufino
- maintenance policyUploaded bySamuel Mawutor Gamor
- Donna Fenn-Upstarts!_ How GenY Entrepreneurs Are Rocking the World of Business and 8 Ways You Can Profit From Their Success (2009)Uploaded bySamuel Mawutor Gamor
- Distillation Column Control Design Using Steady StateUploaded byb95504048
- Doe Fundamentals Handbook Thermodynamics Heat Transfer and Fluid Flow Volume 3 of 3Uploaded byKonthon Heamaturin
- nabcoUploaded bySamuel Mawutor Gamor
- CHE_352[1]Uploaded bySamuel Mawutor Gamor
- 18 Lecture CEE452Uploaded byNishali Sam
- Absorption Packed ColumnUploaded byWalaman
- engineering principles for distillstionUploaded bySamuel Mawutor Gamor
- Published.pdfUploaded bySamuel Mawutor Gamor
- Reliability.pdfUploaded bymrtrixs
- MTN GHANA NEW 1Uploaded bySamuel Mawutor Gamor
- Calculus IIIUploaded byallanviento
- mtn-ghana-new-1Uploaded byHubert Anipa
- Paul Dawkins - Calculus III (Year2 Sem1)Uploaded byJojoe Sagoe
- coloursUploaded bySamuel Mawutor Gamor
- Accounting CV TemplateUploaded byasma246
- Health and Safety ManagementUploaded bySamuel Mawutor Gamor
- jornalUploaded bySamuel Mawutor Gamor
- wordUploaded bySamuel Mawutor Gamor
- ent22Uploaded byMurali Kanna
- che-infoUploaded bySamuel Mawutor Gamor
- Gnbank Account Opening Personal Form(1)Uploaded bySamuel Mawutor Gamor
- Cecon Chemical EngineeringUploaded bySamuel Mawutor Gamor
- Che 459-Unit 5-Sox ControlUploaded bySamuel Mawutor Gamor
- 4.Effects of Air PollutionUploaded bySamuel Mawutor Gamor

- VectorsUploaded byJitesh Tripathi
- Dinh 2018Uploaded byhaloanes
- The Handbook of Essential MathematicsUploaded byمكي مسرحي
- solutions2Uploaded byAsilah
- Chapter 3 - Algebra_unlockedUploaded byAlyssa L
- SyllabusF13_2415-2.pdfUploaded byjcastro237901
- 4037_w15_ms_22Uploaded byZareena Carrim
- Applied Linear AlgebraUploaded byMatthew Flowers
- Grade 7 Pre AssessmentUploaded byBarbie Custodio - Mangulabnan
- 2603_s05_qp1Uploaded bykaran79
- 19848_Number System PptUploaded bysingh11_aman
- Moylan 2009Uploaded byhappydude7632
- Jh AnswerUploaded bynislam57
- 08 Bayar Kog12Uploaded byAndré Corso
- Kalman -- A New Approach to Linear Filtering, etc. (1960)Uploaded byDerek O'Connor
- 10Remainder Factor TheoremUploaded byKiarrha Carmella Carino
- Strain 1Uploaded byBuddha Blessed
- Chapter10 Function of MatixUploaded byAliAlMisbah
- portfolioUploaded bySaiyed Obedullah
- Chapter 3- Functions With Solution20 Jun2013Uploaded byAzwa Nadhira
- MarsdenHoffmanBasSuppUploaded byAnabel Herr
- Std08-I-MSSS-EM-1Uploaded byMatthew Smith
- Chapter 3 FractionsUploaded byfayyzal
- datamining_book-20160121.pdfUploaded byDiego Tellez
- Inverse ImplicitUploaded bypietror_4
- : 10-sa1-Maths-sample-paper3Uploaded byHIMANSHU GUPTA
- bsc_trignoUploaded byleo_3455
- MATLAB posiotion analysisUploaded bysajjad_naghdi241
- Conic SectionsUploaded byMilos Tomic
- Mc Ty Quotient 2009 1Uploaded byAnointed Murara Anyway