About the Project
3 Numerical MethodsAreas

§3.7 Ordinary Differential Equations


§3.7(i) Introduction

Consideration will be limited to ordinary linear second-order differential equations

3.7.1 d2wdz2+f(z)dwdz+g(z)w=h(z),

where f, g, and h are analytic functions in a domain D. If h=0 the differential equation is homogeneous, otherwise it is inhomogeneous. For applications to special functions f, g, and h are often simple rational functions.

For general information on solutions of equation (3.7.1) see §1.13. For classification of singularities of (3.7.1) and expansions of solutions in the neighborhoods of singularities, see §2.7. For an introduction to numerical methods for ordinary differential equations, see Ascher and Petzold (1998), Hairer et al. (1993), and Iserles (1996).

§3.7(ii) Taylor-Series Method: Initial-Value Problems

Assume that we wish to integrate (3.7.1) along a finite path 𝒫 from z=a to z=b in a domain D. The path is partitioned at P+1 points labeled successively z0,z1,,zP, with z0=a, zP=b.

By repeated differentiation of (3.7.1) all derivatives of w(z) can be expressed in terms of w(z) and w(z) as follows. Write

3.7.2 w(s)(z)=fs(z)w(z)+gs(z)w(z)+hs(z),


3.7.3 f0(z) =1,
g0(z) =0,
h0(z) =0,
f1(z) =0,
g1(z) =1,
h1(z) =0.

Then for s=2,3,,

3.7.4 fs(z) =fs-1(z)-g(z)gs-1(z),
gs(z) =fs-1(z)-f(z)gs-1(z)+gs-1(z),
hs(z) =h(z)gs-1(z)+hs-1(z).

Write τj=zj+1-zj, j=0,1,,P, expand w(z) and w(z) in Taylor series (§1.10(i)) centered at z=zj, and apply (3.7.2). Then

3.7.5 [w(zj+1)w(zj+1)]=A(τj,zj)[w(zj)w(zj)]+b(τj,zj),

where A(τ,z) is the matrix

3.7.6 A(τ,z)=[A11(τ,z)A12(τ,z)A21(τ,z)A22(τ,z)],

and b(τ,z) is the vector

3.7.7 b(τ,z)=[b1(τ,z)b2(τ,z)],


3.7.8 A11(τ,z) =s=0τss!fs(z),
A12(τ,z) =s=0τss!gs(z),
A21(τ,z) =s=0τss!fs+1(z),
A22(τ,z) =s=0τss!gs+1(z),
3.7.9 b1(τ,z) =s=0τss!hs(z),
b2(τ,z) =s=0τss!hs+1(z).

If the solution w(z) that we are seeking grows in magnitude at least as fast as all other solutions of (3.7.1) as we pass along 𝒫 from a to b, then w(z) and w(z) may be computed in a stable manner for z=z0,z1,,zP by successive application of (3.7.5) for j=0,1,,P-1, beginning with initial values w(a) and w(a).

Similarly, if w(z) is decaying at least as fast as all other solutions along 𝒫, then we may reverse the labeling of the zj along 𝒫 and begin with initial values w(b) and w(b).

§3.7(iii) Taylor-Series Method: Boundary-Value Problems

Now suppose the path 𝒫 is such that the rate of growth of w(z) along 𝒫 is intermediate to that of two other solutions. (This can happen only for inhomogeneous equations.) Then to compute w(z) in a stable manner we solve the set of equations (3.7.5) simultaneously for j=0,1,,P, as follows. Let A be the (2P)×(2P+2) band matrix

3.7.10 A=[-A(τ0,z0)I0000-A(τ1,z1)I0000-A(τP-2,zP-2)I0000-A(τP-1,zP-1)I]

(I and 0 being the identity and zero matrices of order 2×2.) Also let w denote the (2P+2)×1 vector

3.7.11 w=[w(z0),w(z0),w(z1),w(z1),,w(zP),w(zP)]T,

and b the (2P)×1 vector

3.7.12 b=[b1(τ0,z0),b2(τ0,z0),b1(τ1,z1),b2(τ1,z1),,b1(τP-1,zP-1),b2(τP-1,zP-1)]T.


3.7.13 Aw=b.

This is a set of 2P equations for the 2P+2 unknowns, w(zj) and w(zj), j=0,1,,P. The remaining two equations are supplied by boundary conditions of the form

3.7.14 α0w(z0)+β0w(z0) =γ0,
α1w(zP)+β1w(zP) =γ1,

where the α’s, β’s, and γ’s are constants.

If, for example, β0=β1=0, then on moving the contributions of w(z0) and w(zP) to the right-hand side of (3.7.13) the resulting system of equations is not tridiagonal, but can readily be made tridiagonal by annihilating the elements of A that lie below the main diagonal and its two adjacent diagonals. The equations can then be solved by the method of §3.2(ii), if the differential equation is homogeneous, or by Olver’s algorithm (§3.6(v)). The latter is especially useful if the endpoint b of 𝒫 is at , or if the differential equation is inhomogeneous.

It will be observed that the present formulation of the Taylor-series method permits considerable parallelism in the computation, both for initial-value and boundary-value problems.

For further information and examples, see Olde Daalhuis and Olver (1998, §7) and Lozier and Olver (1993). General methods for boundary-value problems for ordinary differential equations are given in Ascher et al. (1995).

§3.7(iv) Sturm–Liouville Eigenvalue Problems

Let (a,b) be a finite or infinite interval and q(x) be a real-valued continuous (or piecewise continuous) function on the closure of (a,b). The Sturm–Liouville eigenvalue problem is the construction of a nontrivial solution of the system

3.7.15 d2wkdx2+(λk-q(x))wk=0,
3.7.16 wk(a)=wk(b)=0,

with limits taken in (3.7.16) when a or b, or both, are infinite. The values λk are the eigenvalues and the corresponding solutions wk of the differential equation are the eigenfunctions. The eigenvalues λk are simple, that is, there is only one corresponding eigenfunction (apart from a normalization factor), and when ordered increasingly the eigenvalues satisfy

3.7.17 λ1<λ2<λ3<,

If q(x) is C on the closure of (a,b), then the discretized form (3.7.13) of the differential equation can be used. This converts the problem into a tridiagonal matrix problem in which the elements of the matrix are polynomials in λ; compare §3.2(vi). The larger the absolute values of the eigenvalues λk that are being sought, the smaller the integration steps |τj| need to be.

For further information, including other methods and examples, see Pryce (1993, §2.5.1).

§3.7(v) Runge–Kutta Method

The Runge–Kutta method applies to linear or nonlinear differential equations. The method consists of a set of rules each of which is equivalent to a truncated Taylor-series expansion, but the rules avoid the need for analytic differentiations of the differential equation.

First-Order Equations

For w=f(z,w) the standard fourth-order rule reads

3.7.18 wn+1=wn+16(k1+2k2+2k3+k4)+O(h5),

where h=zn+1-zn and

3.7.19 k1 =hf(zn,wn),
k2 =hf(zn+12h,wn+12k1),
k3 =hf(zn+12h,wn+12k2),
k4 =hf(zn+h,wn+k3).

The order estimate O(h5) holds if the solution w(z) has five continuous derivatives.

Second-Order Equations

For w′′=f(z,w,w) the standard fourth-order rule reads

3.7.20 wn+1 =wn+16h(6wn+k1+k2+k3)+O(h5),
wn+1 =wn+16(k1+2k2+2k3+k4)+O(h5),


3.7.21 k1 =hf(zn,wn,wn),
k2 =hf(zn+12h,wn+12hwn+18hk1,wn+12k1),
k3 =hf(zn+12h,wn+12hwn+18hk2,wn+12k2),
k4 =hf(zn+h,wn+hwn+12hk3,wn+k3).

The order estimates O(h5) hold if the solution w(z) has five continuous derivatives.

An extensive literature exists on the numerical solution of ordinary differential equations by Runge–Kutta, multistep, or other methods. See, for example, Butcher (1987), Dekker and Verwer (1984, Chapter 3), Hairer et al. (1993, Chapter 2), and Hairer and Wanner (1996, Chapter 4).