Lec6 - Solving many systems of linear equations LU...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Solving many systems of linear equations LU decomposition
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 6 2 LU decomposition … … is used when you need to solve many systems of equations of the form: 1 2 3 4 [] {} {} A xb A A A = = = = M Each system of equations has the same matrix [A] but has different constants { b } on the right hand side. 1234 12 3 4 3 4 22521 32 6 52 7 4 3 53 4 1 xxxx xx x x x x + ++ = + = + ++= +− + = 3 4 2252 3 2 7 4 3 . 5 4 1 . 4 x x x x + = + = +++= + = 3 4 5 3 7 4 2 . 9 4 9 x x x x + = + = + = 3 4 8 0 7 4 6 4 1 x x x x + = + = + + =
Background image of page 2
Lecture 6 3 How to save some work 11 1 1 1 22 1 33 1 44 []{} {} [] []{} [] {} {} [] {} {} []{} A xb A Ax A b xA b b b b b −− = = = = = = = 1 2 3 4 {} {} A A A A = = = = M Find [ A ] -1 once and use it to solve as many equations as you want But, remember that computing an inverse is expensive ~2N 3 flops! Perhaps there is a better way…
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 6 4 LU decomposition: A more efficient alternative We want to solve a system of equations: [] {} {} A xb = Suppose we can write [ A ] as the product of 2 matrices [ L ] & [ U ] where: 11 12 13 1 21 22 2 31 32 33 3 123 [ ] [] 100 0 10 0 0 0 1 0 [ ] 0 0 0 0 n n n nn n n n LU A uuu u lu u Ll l U u u ll l u = ⎛⎞ ⎜⎟ == ⎝⎠ LL MMM O M M M M O M L ower triangular U pper triangular Choice of 1’s on diagonal arbitrary --> Doolittle vs. Crout
Background image of page 4
Lecture 6 5 () [] {} {} [ ] [ ] { } { } { }{ } {} [ ]{} {} A xb LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution LU decomposition: A more efficient alternative We want to solve a system of equations: A = With [ L ][ U ] = [ A ] , the problem becomes:
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 6 6 () [] {} {} [ ] [ ] { } { } { }{ } {} [ ]{} {} A xb LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution LU decomposition: A more efficient alternative We want to solve a system of equations: A = With [ L ][ U ] = [ A ] , the problem becomes:
Background image of page 6
Lecture 6 7 () [] {} {} [ ] [ ] { } { } { }{ } {} [ ]{} {} A xb LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution LU decomposition: A more efficient alternative We want to solve a system of equations: A = With [ L ][ U ] = [ A ] , the problem becomes: 21 31 32 123 100 0 10 0 1 0 1 nn n l Ll l lll ⎛⎞ ⎜⎟ = ⎝⎠ L L L MMM O M L
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 6 8 () [] {} {} [ ] [ ] { } { } { }{ } {} [ ]{} {} A xb LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution LU decomposition: A more efficient alternative We want to solve a system of equations: A = With [ L ][ U ] = [ A ] , the problem becomes: 21 31 32 123 100 0 10 0 1 0 1 nn n l Ll l lll ⎛⎞ ⎜⎟ = ⎝⎠ L L L MMM O M L
Background image of page 8
Lecture 6 9 LU decomposition: A more efficient alternative We want to solve a system of equations: [] {} {} A xb = With [ L ][ U ] = [ A ] , the problem becomes: () [ ] [ ] { } { } { }{ } {} [ ]{} {} A LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution 11 12 13 1 22 2 33 3 00 0 0 000 n n n nn uuu u uu Uu u u ⎛⎞ ⎜⎟ = ⎝⎠ L L L MMM O M L
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture 6 10 LU decomposition: A more efficient alternative We want to solve a system of equations: [] {} {} A xb = With [ L ][ U ] = [ A ] , the problem becomes: () [ ] [ ] { } { } { }{ } {} [ ]{} {} A LU x b LUx b Ux y Ly b y y y x x = = =≡ = = Let Solve for by forward substitution Solve for by backward substitution Solution 11 12 13 1 22 2 33 3 00 0 0 000 n n n nn uuu u uu Uu u u ⎛⎞ ⎜⎟ =
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course CHE 132b taught by Professor Ceweb during the Fall '09 term at UCSB.

Page1 / 35

Lec6 - Solving many systems of linear equations LU...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online