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.

3.4. ITERATIVE SOLUTIONS 39<br />

We start with an arbitrary x (0) , say x (0) = [2 2 2] ⊤ . We get x (1) = [−2 − 10 − 10] ⊤ , and x (2) =<br />

[42 34 78] ⊤ .<br />

Note the real solution is x = [2 − 1 1] ⊤ . The Richardson Iteration does not appear to converge<br />

for this example, unfortunately.<br />

⊣<br />

Example Problem 3.5. Apply Richardson Iteration with ω = 1/6 on the previous system.<br />

Solution: Our iteration becomes<br />

⎡<br />

⎤ ⎡ ⎤<br />

0 −1/6 −1/6<br />

2<br />

x (k+1) = ⎣ −1/3 1/3 0 ⎦ x (k) + ⎣ 0 ⎦ .<br />

−1/6 −1/3 0<br />

1<br />

We start with the same x (0) as previously, x (0) = [2 2 2] ⊤ . We get x (1) = [4/3 0 0] ⊤ , x (2) =<br />

[2 − 4/9 7/9] ⊤ , and finally x (12) = [2 − 0.99998 0.99998] ⊤ .<br />

Thus, the choice of ω has some affect on convergence.<br />

⊣<br />

We can rethink the Richardson Iteration as<br />

x (k+1) = (I − ωA) x (k) + ωb = x (k) + ω<br />

(<br />

b − Ax (k)) .<br />

Thus at each step we are adding some scaled version of the residual, defined as b − Ax (k) , to the<br />

iterate.<br />

3.4.5 Jacobi Iteration<br />

The Jacobi Iteration chooses Q to be the matrix consisting of the diagonal of A. This is more<br />

similar to A than the identity matrix, but nearly as simple to invert.<br />

Example Problem 3.6. Use Jacobi Iteration, with ω = 1, to solve the system<br />

⎡<br />

6 1<br />

⎤<br />

1<br />

⎡ ⎤<br />

12<br />

A = ⎣ 2 4 0 ⎦ , b = ⎣ 0 ⎦ .<br />

1 2 6<br />

6<br />

Solution: We let<br />

⎡<br />

6 0<br />

⎤<br />

0<br />

⎡<br />

Q = ⎣ 0 4 0 ⎦ , (Q − A) = ⎣<br />

0 0 6<br />

0 −1 −1<br />

−2 0 0<br />

−1 −2 0<br />

⎤<br />

⎡<br />

⎦ , Q −1 = ⎣<br />

1<br />

6<br />

0 0<br />

1<br />

0<br />

4<br />

0<br />

0 0<br />

1<br />

6<br />

⎤<br />

⎦ .<br />

We start with an arbitrary x (0) , say x (0) = [2 2 2] ⊤ . We get x (1) = [ 4<br />

3 − 1 0] ⊤ . Then x (2) =<br />

[ 13<br />

6<br />

− 2 ]<br />

10 ⊤<br />

3 9 . Continuing, we find that x (5) ≈ [1.987 − 1.019 0.981] ⊤ .<br />

Note the real solution is x = [2 − 1 1] ⊤ .<br />

⊣<br />

There is an alternative way to describe the Jacobi Iteration for ω = 1. By considering the update<br />

elementwise, we see that the operation can be described by<br />

⎛<br />

⎞<br />

x (k+1)<br />

j<br />

= 1<br />

n∑<br />

⎝b j − a ji x (k) ⎠<br />

i<br />

.<br />

a jj<br />

i=1,i≠j<br />

Thus an update takes less than 2n 2 operations. In fact, if A is sparse, with less than k nonzero<br />

entries per row, the update should take less than 2nk operations.

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

Saved successfully!

Ooh no, something went wrong!