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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

frag replacements<br />

1<strong>0.1</strong>. ELEMENTARY METHODS 127<br />

10000<br />

truncation<br />

roundoff<br />

total error<br />

1000<br />

100<br />

10<br />

1<br />

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

0.01<br />

1e-07 1e-06 1e-05 0.0001 0.001 0.01<br />

Figure 10.2: The truncation, roundoff, and total error for a fictional ODE and approximation<br />

method are shown. The total error is apparently minimized for an h value of approximately 0.0002.<br />

Note that the truncation error appears to be O (h), thus the approximation could be Euler’s Method.<br />

In reality, we expect the roundoff error to be more “bumpy,” as seen in Figure 7.1.<br />

This solution can diverge from the correct one because of the different starting conditions. We<br />

illustrate this with the usual example.<br />

Example 10.3. Consider the ODE<br />

dx(t)<br />

= x.<br />

dt<br />

This has solution x(t) = x(0)e t . The curves for different starting conditions diverge, as in Figure<br />

10.3(a).<br />

However, if we instead consider the ODE<br />

dx(t)<br />

dt<br />

= −x,<br />

which has solution x(t) = x(0)e −t , we see that differences in the initial conditions become immaterial,<br />

as in Figure 10.3(b).<br />

Thus the latter ODE exhibits stability: roundoff and truncation errors accrued at a given step<br />

will become irrelevant as more steps are taken. The former ODE exhibits the opposite behavior–<br />

accrued errors will be amplified.

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

Saved successfully!

Ooh no, something went wrong!