21.06.2014 Views

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

Numerical Methods Contents - SAM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Code 5.4.1: Ritz projections onto Krylov space (5.4.2)<br />

1 function [ V,D] = k r y l e i g (A,m)<br />

2 n = size (A, 1 ) ; V = ( 1 : n ) ’ ; V = V/ norm(V) ;<br />

3 for l =1:m−1<br />

4 V = [ V, A∗V ( : , end ) ] ; [Q,R] = qr (V, 0 ) ;<br />

5 [W,D] = eig (Q’∗A∗Q) ; V = Q∗W;<br />

6 end<br />

✁ direct power method with<br />

Ritz projection onto Krylov<br />

space from (5.4.2), cf.<br />

Code 5.3.21.<br />

Note: implementation for<br />

demonstration purposes only<br />

(inefficient for sparse matrix<br />

A!)<br />

Ritz value<br />

40<br />

35<br />

30<br />

25<br />

20<br />

15<br />

10<br />

µ 1<br />

µ 2<br />

µ 3<br />

error of Ritz value<br />

10 2 dimension m of Krylov space<br />

10 1<br />

10 0<br />

10 −1<br />

|λ 1<br />

−µ 1<br />

|<br />

|λ 2<br />

−µ 2<br />

|<br />

|λ 2<br />

−µ 3<br />

|<br />

10 −2<br />

Terminology: σ(Q T AQ) ˆ= Ritz values µ 1 ≤ µ 2 ≤ · · · ≤ µ m ,<br />

eigenvectors of Q T AQ ˆ= Ritz vectors<br />

Example 5.4.2 (Ritz projections onto Krylov space).<br />

1 n=100;<br />

M= g a llery ( ’ t r i d i a g ’ ,−0.5∗ones ( n−1,1) ,2∗ones ( n , 1 ) ,−1.5∗ones ( n−1,1) ) ;<br />

2 [Q,R]= qr (M) ; A=Q’∗ diag ( 1 : n ) ∗Q; % eigenvalues 1, 2, 3,...,100<br />

5<br />

0<br />

10 −3<br />

5 10 25 5 10 15 20 25 30<br />

15 20<br />

dimension m of Krylov space<br />

30<br />

Fig. 75<br />

Observation: Also the smallest Ritz values converge “vaguely linearly” to the smallest eigenvalues of<br />

A. Fastest convergence of smallest Ritz value → smallest eigenvalue of A.<br />

Fig. 76<br />

Ôº½ º<br />

✸<br />

Ôº¿ º<br />

?<br />

Why do smallest Ritz values converge to smallest eigenvalues of A?<br />

100<br />

10 1<br />

|λ m<br />

−µ m<br />

|<br />

|λ m−1<br />

−µ m−1<br />

|<br />

|λ m−2<br />

−µ m−2<br />

|<br />

Consider direct power method (5.3.5) for à := νI − A, ν > λ max(A):<br />

Ritz value<br />

95<br />

90<br />

85<br />

Ritz value<br />

10 2<br />

10 0<br />

10 −1<br />

10 −2<br />

dimension m of Krylov space<br />

z (0) arbitrary , ˜z (k+1) (νI − A)˜z(k)<br />

=<br />

∥<br />

∥<br />

∥(νI − A)˜z (k) (5.4.3)<br />

∥∥2<br />

As σ(νI − A) = ν − σ(A) and eigenspaces agree, we infer from Thm. 5.3.2<br />

80<br />

10 −3<br />

λ 1 < λ 2 ⇒ z (k) k→∞<br />

−→ u 1<br />

& ρ A (z (k) ) k→∞ −→ λ 1 linearly . (5.4.4)<br />

75<br />

70<br />

5 10 15 20 25 30<br />

dimension m of Krylov space<br />

µ m<br />

µ m−1<br />

µ m−2<br />

Fig. 73<br />

10 −4<br />

10 −5<br />

5 10 15 20 25 30<br />

Observation: “vaguely linear” convergence of largest Ritz values to largest eigenvalues. Fastest<br />

convergence of largest Ritz value → largest eigenvalue of A<br />

Fig. 74<br />

By the binomial theorem (also applies to matrices, if they commute)<br />

(νI − A) k =<br />

k∑<br />

j=0<br />

( k<br />

j)<br />

ν k−j A j ⇒ (νI − A) k˜z (0) ∈ K k (A,z (0) ) ,<br />

K k (νI − A,x) = K k (A,x) . (5.4.5)<br />

Ôº¾ º<br />

➣ u 1 can also be expected to be “well captured” by K k (A,x) and the smallest Ritz value should<br />

provide a good aproximation for λ min (A).<br />

Recall from Sect. 4.2.2 , Lemma 4.2.5:<br />

Ôº º

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

Saved successfully!

Ooh no, something went wrong!