12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

differential equation applications 201step 1step 2y 0y 1y 2y 3 h y Nt = atimet = bFigure 9.3 The steps of length h taken in solving a differential equation. The solution startsat time t = a and is integrated to t = b.this is somewhat like a castle built on sand; in contrast to interpolation, there areno tabulated values on which to anchor your solution.It is simplest if the time steps used throughout the integration remain constantin size, and that is mostly what we shall do. Industrial-strength algorithms, suchas the one we discuss in §9.5.2, adapt the step size by making h larger in regionswhere y varies slowly (this speeds up the integration and cuts down on round-offerror) and making h smaller in regions where y varies rapidly.9.5.1 Euler’s RuleEuler’s rule (Figure 9.4 left) is a simple algorithm for integrating the differentialequation (9.7) by one step and is just the forward-difference algorithm for they(t)Euler’sRuley(t)sloperk2∆∆ht n t n+1t n+1/2t n t n+1Figure 9.4 Left: Euler’s algorithm for the forward integration of a differential equation for onetime step. The linear extrapolation with the initial slope is seen to cause the error ∆. Right: Therk2 algorithm is also a linear extrapolation of the solution y n to y n+1 , but with the slope (boldline segment) at the interval’s midpoint. The error is seen to be much smaller.−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 201

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

Saved successfully!

Ooh no, something went wrong!