25
3/17/2010 http://numericalmethods.eng.usf.edu 1 LU Decomposition Major: All Engineering Majors Authors: Autar Kaw http://numericalmethods.eng.usf.edu Transforming Numerical Methods Education for STEM Undergraduates

LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

  • Upload
    others

  • View
    15

  • Download
    2

Embed Size (px)

Citation preview

Page 1: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

3/17/2010 http://numericalmethods.eng.usf.edu 1

LU Decomposition

Major: All Engineering Majors

Authors: Autar Kaw

http://numericalmethods.eng.usf.eduTransforming Numerical Methods Education for STEM

Undergraduates

Page 2: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

LU Decomposition

http://numericalmethods.eng.usf.edu

Page 3: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

LU DecompositionLU Decomposition is another method to solve a set of

simultaneous linear equations

Page 4: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

MethodFor most non-singular matrix [A] that one could conduct Naïve Gauss Elimination forward elimination steps, one can always write it as

[A] = [L][U]where

[L] = lower triangular matrix

[U] = upper triangular matrix

http://numericalmethods.eng.usf.edu

LU Decomposition

Page 5: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

How does LU Decomposition work?If solving a set of linear equations

If [A] = [L][U] thenMultiply by

Which givesRemember [L]-1[L] = [I] which leads to

Now, if [I][U] = [U] thenNow, let

Which ends withand

[A][X] = [b][L][U][X] = [b][L]-1

[L]-1[L][U][X] = [L]-1[b][I][U][X] = [L]-1[b][U][X] = [L]-1[b][L]-1[b]=[Z][L][Z] = [b] (1)[U][X] = [Z] (2)

Page 6: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

LU DecompositionHow can this be used?

Given [A][X] = [b]

1. Decompose [A] into [L] and [U]

2. Solve [L][Z] = [b] for [Z]

3. Solve [U][X] = [Z] for [X]

Page 7: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Method: [A] Decompose to [L] and [U]

[ ] [ ][ ]

==

33

2322

131211

3231

21

000

101001

uuuuuu

ULAll

l

[U] is the same as the coefficient matrix at the end of the forward elimination step.

[L] is obtained using the multipliers that were used in the forward elimination process

Page 8: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Finding the [U] matrixUsing the Forward Elimination Procedure of Gauss Elimination

11214418641525

( ) 11214456.18.40

152556.212;56.2

2564

−−=−= RowRow

( ) 76.48.16056.18.40

152576.513;76.5

25144

−−−−=−= RowRow

Step 1:

Page 9: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Finding the [U] Matrix

Step 2:

−−−−

76.48.16056.18.40

1525

( ) 7.00056.18.40

15255.323;5.3

8.48.16

−−=−=

−− RowRow

[ ]

−−=

7.00056.18.40

1525U

Matrix after Step 1:

Page 10: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Finding the [L] matrix

Using the multipliers used during the Forward Elimination Procedure

101001

3231

21

ll

l

56.22564

11

2121 ===

aa

l

76.525

144

11

3131 ===

aa

l

From the first step of forward elimination

11214418641525

Page 11: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Finding the [L] Matrix

[ ]

=

15.376.50156.2001

L

From the second step of forward elimination

−−−−

76.48.16056.18.40

15255.3

8.48.16

22

3232 =

−−

==aa

l

Page 12: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Does [L][U] = [A]?

[ ][ ] =

−−

=

7.00056.18.40

1525

15.376.50156.2001

UL ?

Page 13: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Using LU Decomposition to solve SLEs

Solve the following set of linear equations using LU Decomposition

=

227921778106

11214418641525

3

2

1

.

.

.

xxx

Using the procedure for finding the [L] and [U] matrices

[ ] [ ][ ]

−−

==

7.00056.18.40

1525

15.376.50156.2001

ULA

Page 14: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Example

Set [L][Z] = [C]

Solve for [Z]

=

2.2792.1778.106

15.376.50156.2001

3

2

1

zzz

2.2795.376.52.17756.2

8.106

321

21

1

=++=+

=

zzzzz

z

Page 15: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

ExampleComplete the forward substitution to solve for [Z]

( )

( ) ( )735.0

21.965.38.10676.52.2795.376.52.279

2.968.10656.22.177

56.22.1778.106

213

12

1

=−−−=

−−=−=

−=−=

=

zzz

zzz

[ ]

−=

=

735.021.968.106

3

2

1

zzz

Z

Page 16: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

ExampleSet [U][X] = [Z]

Solve for [X] The 3 equations become

−=

−−

735021968106

7.00056.18.40

1525

3

2

1

...

xxx

735.07.021.9656.18.48.106525

3

32

321

=−=−−

=++

aaaaaa

Page 17: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

Example

From the 3rd equation

050170

7350735070

3

3

3

.a.

.a

.a.

=

=

=

Substituting in a3 and using the second equation

219656184 32 .a.a. −=−−

( )

701984

0501561219684

5612196

2

2

32

.a.

...a

.a..a

=−+−

=

−+−

=

Page 18: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu

ExampleSubstituting in a3 and a2 using the first equation

8106525 321 .aaa =++

Hence the Solution Vector is:

=

050.170.19

2900.0

3

2

1

aaa

( )

2900025

05017019581062558106 32

1

.

...

aa.a

=

−−=

−−=

Page 19: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

http://numericalmethods.eng.usf.edu19

Page 20: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

Pop Quizn LU decompose

http://numericalmethods.eng.usf.edu20

Page 21: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

Pop Quizn Answer:

http://numericalmethods.eng.usf.edu21

Page 22: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

Pop Quizn Solve the system Ax =b for

http://numericalmethods.eng.usf.edu22

Page 23: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

Pop Quizn Answer:

http://numericalmethods.eng.usf.edu23

Page 24: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

Additional ResourcesFor all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit

http://numericalmethods.eng.usf.edu/topics/lu_decomposition.html

Page 25: LU Decomposition - IISER Punepgoel/LUDecomposition.pdf · Using LU Decomposition to solve SLEs Solve the following set of linear equations using LU Decomposition œ œ œ ß ø Œ

THE END

http://numericalmethods.eng.usf.edu