03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

34 CHAPTER 3. SOLVING LINEAR SYSTEMS<br />

3.3.2 Using LU Factorizations<br />

We see that the G.E. algorithm can be used to actually calculate the LU factorization. We will look<br />

at this in more detail in another example. We now examine how we can use the LU factorization<br />

to solve the equation<br />

Ax = b,<br />

Since we have A = LU, we first solve<br />

then solve<br />

Lz = b,<br />

Ux = z.<br />

Since L is lower triangular, we can solve for z with a forward substitution. Similarly, since U is<br />

upper triangular, we can solve for x with a back substitution. We drag out the previous example<br />

(which we never got around to solving):<br />

⎛<br />

⎜<br />

⎝<br />

We had found the LU factorization of A as<br />

A =<br />

⎡<br />

⎢<br />

⎣<br />

2 1 1 3 7<br />

4 4 0 7 11<br />

6 5 4 17 31<br />

2 −1 0 7 15<br />

1 0 0 0<br />

2 1 0 0<br />

3 1 1 0<br />

1 −1 −1 1<br />

⎤ ⎡<br />

⎥ ⎢<br />

⎦ ⎣<br />

⎞<br />

⎟<br />

⎠<br />

2 1 1 3<br />

0 2 −2 1<br />

0 0 3 7<br />

0 0 0 12<br />

⎤<br />

⎥<br />

⎦<br />

So we solve<br />

We get<br />

Now we solve<br />

We get the ugly solution<br />

⎡<br />

⎢<br />

⎣<br />

⎡<br />

⎢<br />

⎣<br />

1 0 0 0<br />

2 1 0 0<br />

3 1 1 0<br />

1 −1 −1 1<br />

z =<br />

⎡<br />

⎢<br />

⎣<br />

2 1 1 3<br />

0 2 −2 1<br />

0 0 3 7<br />

0 0 0 12<br />

z =<br />

⎡<br />

⎢<br />

⎣<br />

⎤ ⎡<br />

⎥<br />

⎦ z = ⎢<br />

⎣<br />

7<br />

−3<br />

13<br />

18<br />

⎤<br />

⎥<br />

⎦<br />

⎤ ⎡<br />

⎥<br />

⎦ x = ⎢<br />

⎣<br />

37<br />

24<br />

−17<br />

12 5<br />

6 3<br />

2<br />

⎤<br />

⎥<br />

⎦<br />

7<br />

11<br />

31<br />

15<br />

7<br />

−3<br />

13<br />

18<br />

⎤<br />

⎥<br />

⎦<br />

⎤<br />

⎥<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!