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.

Rewriting estimate of Thm. 2.5.9 with ∆b = 0,<br />

ǫ r :=<br />

‖x − ˜x‖<br />

‖x‖<br />

≤<br />

cond(A)δ A<br />

, δ<br />

1 − cond(A)δ A := ‖∆A‖<br />

A ‖A‖ . (2.5.8)<br />

(2.5.8) ➣ If cond(A) ≫ 1, small perturbations in A can lead to large relative errors in the<br />

solution of the LSE.<br />

★<br />

If cond(A) ≫ 1, a stable algorithm (→ Def. 2.5.5) can produce solutions<br />

with large relative error !<br />

✧<br />

Example 2.5.8 (Conditioning and relative error).<br />

→ Ex. 2.5.3 cnt’d<br />

✥<br />

✦<br />

cond 2<br />

(A)<br />

140<br />

120<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

0 50 100 150<br />

n<br />

200 250 300<br />

Fig. 8<br />

relative error (Euclidean norm)<br />

10 0<br />

10 −2<br />

10 −4<br />

10 −6<br />

Gaussian elimination<br />

10 −8<br />

QR−decomposition<br />

relative residual norm<br />

10 −10<br />

10 −12<br />

10 −14<br />

10 −16<br />

0 100 200 300 400 500<br />

n<br />

600 700 800 900 1000<br />

Fig. 9<br />

<strong>Numerical</strong> experiment with nearly singular matrix<br />

from Ex. 2.5.3<br />

A = uv T + ǫI ,<br />

cond(A)<br />

10 20<br />

10 19<br />

10 18<br />

10 17<br />

10 16<br />

u = 1 3 (1, 2, 3,...,10)T 10<br />

,<br />

−2<br />

10 15<br />

v = (−1, 1 2 , −1 3 , 1 4 , ..., 10 1 )T 10 −3<br />

10 14<br />

Ôº½¿¿ ¾º<br />

10 13<br />

10 −4<br />

relative error<br />

10 12<br />

10 −14 10 −13 10 −12 10 −11 10 −10 10 −9 10 −8 10 −7 10 −6 10 −5<br />

10−5<br />

ε<br />

Fig. 7 ✸<br />

Example 2.5.9 (Wilkinson’s counterexample cnt’d). → Ex. 2.5.2<br />

cond(A)<br />

10 2<br />

10 1<br />

10 0<br />

10 −1<br />

relative error<br />

These observations match Thm. 2.5.7, because in this case we encounter an exponential growth of<br />

ρ = ρ(n), see Ex. 2.5.2.<br />

2.5.5 Sensitivity of linear systems<br />

✸<br />

Ôº½¿ ¾º<br />

Blow-up of entries of U !<br />

↕ (∗)<br />

However, cond 2 (A) is small!<br />

✄ Instability of Gaussian elimination !<br />

Code 2.5.10: GE for “Wilkinson system”<br />

1 res = [ ] ;<br />

2 for n=10:10:1000<br />

3 A = [ t r i l (−ones ( n , n−1) ) +2∗[eye ( n−1) ;<br />

4 zeros ( 1 , n−1) ] , ones ( n , 1 ) ] ;<br />

5 x = (( −1) . ^ ( 1 : n ) ) ’ ;<br />

6 r e l e r r = norm(A \ ( A∗x )−x ) / norm( x ) ;<br />

7 res = [ res ; n , r e l e r r ] ;<br />

8 end<br />

9 plot ( res ( : , 1 ) , res ( : , 2 ) , ’m−∗ ’ ) ;<br />

(∗) If cond 2 (A) was huge, then big errors in the solution of a linear system can be caused by<br />

small perturbations of either the system matrix or the right hand side vector, see (2.5.6) and the<br />

message of Thm. 2.5.9, (2.5.8). In this case, a stable algorithm can obviously produce a grossly<br />

“wrong” solution, as was already explained after (2.5.8).<br />

Hence, lack of stability of Gaussian elimination will only become apparent for linear systems with<br />

well-conditioned system matrices.<br />

Ôº½¿ ¾º<br />

Recall Thm. 2.5.9:<br />

Ax = b<br />

(A + ∆A)˜x = b + ∆b<br />

cond(A) ≫ 1 ➣<br />

Terminology:<br />

for regular A ∈ K n,n , small ∆A, generic vector/matrix norm ‖·‖<br />

⇒<br />

‖x − ˜x‖<br />

‖x‖<br />

≤<br />

cond(A)<br />

1 − cond(A) ‖∆A‖/‖A‖<br />

( ‖∆b‖<br />

‖b‖ + ‖∆A‖<br />

‖A‖<br />

)<br />

.<br />

(2.5.9)<br />

small relative changes of data A,b may effect huge relative changes in<br />

solution.<br />

Sensitivity of a problem (for given data) gauges<br />

impact of small perturbations of the data on the result.<br />

cond(A) indicates sensitivity of “LSE problem” (A,b) ↦→ x = A −1 b<br />

(as “amplification factor” of relative perturbations in the data A,b).<br />

Ôº½¿ ¾º<br />

Small changes of data ⇒ small perturbations of result : well-conditioned problem<br />

Small changes of data ⇒ large perturbations of result : ill-conditioned problem

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

Saved successfully!

Ooh no, something went wrong!