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.

92 CHAPTER 7. APPROXIMATING DERIVATIVES<br />

PSfrag replacements<br />

h<br />

φ(h)<br />

1.0 0.39269908169872408<br />

<strong>0.1</strong> 0.33395069677431943<br />

0.01 0.33333950618106845<br />

0.001 0.33333339506169679<br />

0.0001 0.33333333395058062<br />

1 × 10 −5 0.33333333334106813<br />

1 × 10 −6 0.33333333332441484<br />

1 × 10 −7 0.33333333315788138<br />

1 × 10 −8 0.33333332760676626<br />

1 × 10 −9 0.33333336091345694<br />

1 × 10 −10 0.333333360913457<br />

1 × 10 −11 0.333333360913457<br />

1 × 10 −12 0.33339997429493451<br />

1 × 10 −13 0.33306690738754696<br />

1 × 10 −14 0.33306690738754696<br />

1 × 10 −15 0.33306690738754691<br />

1 × 10 −16 0<br />

The data are illustrated in Figure 7.1. Notice that φ(h) gives at most 10 decimal places of<br />

accuracy, then begins to deteriorate; Note however, we get 13 decimal places from D(2, 2). ⊣<br />

1<br />

total error<br />

0.01<br />

0.0001<br />

1e-06<br />

1e-08<br />

1e-10<br />

1e-12<br />

1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 0.0001 0.01 1<br />

Figure 7.1: The total error for the centered difference approximation to f ′ ( √ 2) is shown versus<br />

h. The total error is the sum of a truncation term which decreases as h decreases, and a roundoff<br />

term which increases. The optimal h value is around 1 × 10 −5 . Note that Richardson’s D(2, 2)<br />

approximation with h = 0.01 gives much better results than this optimal h.

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

Saved successfully!

Ooh no, something went wrong!