Ordinary Differential
Equations
Matlab has several different functions for the numerical solution of ordinary differential equations. This chapter describes the simplest of these functions and then compares all of the functions for efficiency, accuracy, and special features. Stiffness is a subtle concept that plays an important role in these comparisons.
7.1
Integrating Differential Equations
The initial value problem for an ordinary differential equation involves finding a function y(t) that satisfies dy(t) = f (t, y(t)) dt together with the initial condition y(t0 ) = y0 .
A numerical solution to this problem generates a sequence of values for the independent variable, t0 , t1 , . . . , and a corresponding sequence of values for the dependent variable, y0 , y1 , . . . , so that each yn approximates the solution at tn : yn ≈ y(tn ), n = 0, 1, . . . .
Modern numerical methods automatically determine the step sizes hn = tn+1 − tn so that the estimated error in the numerical solution is controlled by a specified tolerance. The fundamental theorem of calculus gives us an important connection between differential equations and integrals:
∫ t+h f (s, y(s))ds. y(t + h) = y(t) + t September 17, 2013
1
2
Chapter 7. Ordinary Differential Equations
We cannot use numerical quadrature directly to approximate the integral because we do not know the function y(s) and so cannot evaluate the integrand. Nevertheless, the basic idea is to choose a sequence of values of h so that this formula allows us to generate our numerical solution.
One special case to keep in mind is the situation where f (t, y) is a function of t alone. The numerical solution of such simple differential equations is then just a sequence of quadratures:
∫
tn+1
yn+1 = yn +
f (s)ds. tn Throughout this chapter, we frequently use “dot” notation for derivatives: y= ˙
7.2
d2 y(t) dy(t) and y =
¨
. dt dt2
Systems of Equations
Many
Bibliography: [1] U. M. Ascher and L. R. Petzold, Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations, SIAM, Philadelphia, 1998. [3] P. Bogacki and L. F. Shampine, A 3(2) pair of Runge-Kutta formulas, Applied Mathematics Letters, 2 (1989), pp. 1–9. Knuth, On the Lambert W function, Advances in Computational Mathematics, 5 (1996), pp [7] L. F. Shampine and M. W. Reichelt, The MATLAB ODE suite, SIAM Journal on Scientific Computing, 18 (1997), pp [8] C. Sparrow, The Lorenz Equations: Bifurcations, Chaos, and Strange Attractors, Springer-Verlag, New York, 1982. [9] J. C. G. Walker, Numerical Adventures with Geochemical Cycles, Oxford University Press, New York, 1991.