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.

Thus, iterative solvers for solving Aw = z (k−1) may be considered, see Sect. 4. However, the<br />

required accuracy is not clear a priori. Here we examine an approach that completely dispenses with<br />

an iterative solver and uses a preconditioner (→ Def. 4.3.1) instead.<br />

Idea:<br />

(for inverse iteration without shift, A = A H s.p.d.)<br />

Instead of solving Aw = z (k−1) compute w = B −1 z (k−1) with<br />

“inexpensive” s.p.d. approximate inverse B −1 ≈ A −1<br />

➣ B ˆ= Preconditioner for A, see Def. 4.3.1<br />

Code 5.3.18: preconditioned inverse iteration (5.3.18)<br />

1 function [ lmin , z , res ] = p i n v i t ( evalA , n , invB , t o l , maxit )<br />

2 z = ( 1 : n ) ’ ; z = z / norm( z ) ; res = [ ] ; rho = 0 ;<br />

3 for i =1: maxit<br />

4 v = evalA ( z ) ; rhon = dot ( v , z ) ; r = v − rhon∗z ;<br />

5 z = z − invB ( r ) ; z = z / norm( z ) ; res = [ res ; rhon ] ;<br />

6 i f ( abs ( rho−rhon ) < t o l ∗abs ( rhon ) ) , break ;<br />

7 else rho = rhon ; end<br />

8 end<br />

9 lmin = dot ( evalA ( z ) , z ) ; res = [ res ; lmin ] ,<br />

Example 5.3.19 (Convergence of PINVIT).<br />

Computational<br />

effort:<br />

1 matrix×vector<br />

1 evaluation of<br />

preconditioner<br />

A<br />

few<br />

AXPY-operations<br />

!<br />

Possible to replace A −1 with B −1 in inverse iteration ?<br />

NO, because we are not interested in smallest eigenvalue of B !<br />

Replacement A −1 → B −1 possible only when applied to residual quantity<br />

residual quantity = quantity that → 0 in the case of convergence to exact solution<br />

Ôº º¿<br />

S.p.d. matrix A ∈ R n,n , tridiagonal preconditioner, see Ex. 4.3.4<br />

1 A = spdiags ( repmat ( [ 1 / n, −1 ,2∗(1+1/n ) , −1 ,1/n ] , n , 1 ) ,[−n/2 , −1 ,0 ,1 ,n / 2 ] , n , n ) ;<br />

2 evalA = @( x ) A∗x ;<br />

3 % inverse iteration<br />

4 invB = @( x ) A \ x ;<br />

5 % tridiagonal preconditioning<br />

6 B = spdiags ( spdiags (A,[ − 1 ,0 ,1]) ,[ −1 ,0 ,1] , n , n ) ; invB = @( x ) B \ x ;<br />

Ôº º¿<br />

Natural residual quantity for eigenvalue problem Ax = λx:<br />

r := Az − ρ A (z)z , ρ A (z) = Rayleigh quotient → Def. 5.3.1 .<br />

Monitored: error decay during iteration of Code 5.3.17: |ρ A (z (k) ) − λ min (A)|<br />

Note: only direction of A −1 z matters in inverse iteration (5.3.16)<br />

(A −1 z) ‖ (z − A −1 (Az − ρ A (z)z)) ⇒ defines same next iterate!<br />

[Preconditioned inverse iteration (PINVIT) for s.p.d. A]<br />

error in approximation for λ max<br />

10 0<br />

10 −2<br />

10 −4<br />

10 −6<br />

10 −8<br />

10 −10<br />

INVIT, n = 50<br />

INVIT, n = 100<br />

INVIT, n = 200<br />

PINVIT, n = 50<br />

PINVIT, n = 100<br />

PINVIT, n = 200<br />

#iteration steps<br />

28<br />

26<br />

24<br />

22<br />

20<br />

18<br />

16<br />

14<br />

INVIT<br />

PINVIT<br />

(P)INVIT iterations: tolerance = 0.0001<br />

12<br />

z (0) arbitrary,<br />

w = z (k−1) − B −1 (Az (k−1) − ρ A (z (k−1) )z (k−1) ) ,<br />

z (k) =<br />

w ,<br />

‖w‖ 2<br />

k = 1, 2,... . (5.3.18)<br />

10 2 # iterationstep<br />

10 −12<br />

10 −14<br />

0 5 10 15 20 25 30 35 40 45 50<br />

10<br />

8<br />

Fig. 71 10 1 10 2 10 3 10 4 10 5<br />

n<br />

Fig. 72<br />

Observation:<br />

linear convergence of eigenvectors also for PINVIT.<br />

Ôº º¿<br />

Ôº º¿ ✸

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

Saved successfully!

Ooh no, something went wrong!