Chapter 7
Ordinary Differential
Equations
Matlab has several different functions for the numerical solution of ordinary dif-
ferential 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 parisons.
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 indepen-
dent 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 be-
tween differential equations and integrals:
Z t+h
y(t + h) = y(t) + f(s, y(s))ds.
t
December 26, 2005
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:
Z tn+1
yn+1 = yn + f(s)ds.
tn
Throughout this chapter, we frequently use “dot” notation for derivatives:
dy(t) d2y(t)
y˙= andy ¨ = .
dt dt2
Systems of Equations
Many mathematical models involve more than one unkn
Numerical Computing with MatLab, Ordinary Differential Equations 来自淘豆网m.daumloan.com转载请标明出处.