Lecture 21: Ordinary Differential Equations - Single Step Methods

1.Ordinary differential equations

An nth-order ordinary differential equation given in explicit form

y(n)=f(t,y,y',,y(n-1)) (1)

is a statement of equality between the action of two operators. On the left hand side the linear differential operator

=ddtn

acts upon a sufficiently smooth function, yC(n)(), :C(n)()C(). On the right hand side, a nonlinear operator acts upon the independent variable t and the first n-1 derivatives

:×C()××C(n-1)().

An associated function f:n+1 has values given by

f(t)=f(t,y(t),y'(t),,y(n-1)(t)).

The numerical solution of (1) seeks to find an approximant of y through:

  1. Approximation of the differentiation operator ;

  2. Approximation of the nonlinear operator ;

  3. Approximation of the equality between the effect of the two operators

    (y)=(t,y,,y(n-1)).

These approximation problems shall be considered one-by-one, starting with approximation of assuming that the action of is exactly represented through knowledge of f.

Note that an nth-order differential equation can be restated as a system of n first-order equations

𝒛'=𝑭(t,𝒛) (2)

by introducing

𝒛=[ z1 z2 zn-1 zn ]T=[ y y' y(n-2) y(n-1) ]T,
𝑭(t,𝒛)=[ z2(t) z3(t) zn(t) f(t,z1(t),,zn(t)) ]T.

Approximation of the differentiation operator for the problem

y'=f(t,y) (3)

can readily be extended to the individual equations of system (2).

Construction of approximants to (3) is first considered for the initial value problem (IVP)

y'=f(t,y),y(0)=y0. (4)

The two procedures are:

  1. Approximation of the differentiation operator;

  2. Differentiation of an approximation of y.

Often the two approaches leads to the same algorithm. The problem (4) has a unique solution over some rectangle R=[0,T]×[y1,y2] in the ty-plane if f is Lipschitz-continuous, stated as the existence of K+ such that

|f(t,y2)-f(t,y1)|K|y2-y1|.

Note that Lipschitz continuity is a stronger condition than standard continuity in that it states |f(t,y2)-f(t,y1)|=𝒪(|y2-y1|). Differentiability implies Lipschitz continuity.

Consider approximation of d/dt through forward finite differences

ddt=1h(Δ-12Δ2+13Δ3--), (5)

and denote by yi the approximation of y(t), yiy(ti) at the equidistant sample points ti=ih. Evaluation of (2) with a kth order truncation of (5) then gives

f(ti,y(ti))=(dydt)(ti)1h(Δ-12Δ2+13Δ3--(-1)k1kΔk).

2.Differentiation operator approximation from polynomial interpolants

2.1.Euler forward scheme

For k=1, the resulting scheme is

1hΔyi=yi+1-yih=f(ti,yi)=fiyi+1=yi+hfi,

where fif(ti,y(ti)), and is known as the Euler forward scheme. New values are obtained from previous values. Such methods are said to be explicit schemes. As to be expected from the truncation of (5) to the first term in the series, the scheme is first-order accurate. This can be formally established by evaluation of the error at step i

ei=y(ti)-yi.

At the next step, ei+1=y(ti+1)-yi, and subtraction of the two errors gives upon Taylor-series expansion

ei+1-ei=y(ti+1)-y(ti)-(yi+1-yi)=y(ti)+hy'(ti)+h22y''(ξi)-y(ti)-hfi.

Since fi=f(ti,y(ti)), the one-step error is given by

τi=ei+1-ei=h22y''(ξi).

After N steps,

eN-e0=h22i=1Ny''(ξi).

Assuming e0=0 (exact representation of the initial condition),

eNNh22||y''||.

Numerical solution of the initial value problem is carried out over some finite interval [0,T], with T=Nh, hence

eNhT2||y''||=𝒪(h), (6)

indeed with first-order convergence.

Alternatively, one could use the backward or centered finite difference approximations of the derivative

ddt=1h(+122+133+)=1h(δ-124δ3+3640δ5--). (7)

2.2.Backward Euler scheme

Truncation of the backward operator at first order gives

f(ti,y(ti))=(dydt)i1h(y)i=yi-yi-1hyi=yi-1+hfi=yi-1+hf(ti,yi).

Note now that the unknown value yi appears as an argument to f, with fi=f(ti,yi), the approximation of the exact slope f(ti,y(ti)). Some procedure to solve the equation

yi-yi-1-hf(ti,yi)=0,

must be introduced in order to advance the solution from ti-1 to ti. Such methods are said to be implicit schemes. The same type of error analysis as in the forward Euler case again leads to the conclusion that the one-step error is 𝒪(h2), while the overall error over a finite interval [0,T] satisfies (6), and is first-order.

2.3.Leapfrog scheme

Truncation of the centered operator at first order gives

f(ti,y(ti))=(dydt)i1h(δy)i=yi+1/2-yi-1/2hyi+1/2=yi-1/2+hfi=yi-1/2+hf(ti,yi).

The higher-order accuracy of the centered finite differences leads to a more accurate numerical solution of the problem (4). The one-step error is third-order accurate,

ei+1/2-ei-1/2=y(ti+1/2)-y(ti-1/2)+hf(ti,yi)=h33y'''(ξi),

and the overall error over interval [0,T=Nh] is second-order accurate

eNh23T||y'''||.