AM  Vol.10 No.8 , August 2019
Consistency and Stability Issues in the Numerical Integration of the First and Second Order Initial Value Problem
Author(s) Isaac Fried
Abstract
In this note we consider some basic, yet unusual, issues pertaining to the accuracy and stability of numerical integration methods to follow the solution of first order and second order initial value problems (IVP). Included are remarks on multiple solutions, multi-step methods, effect of initial value perturbations, as well as slowing and advancing the computed motion in second order problems.

1. Introduction

Numerically following the solution of an evolution equation in time is one of the central tasks of numerical analysis and has received over the years vast and repeated attention, see [1] [2] . In this note we consider some essential and interesting, but possibly not widely known, aspects of the numerical solution of initial value problems. The rationale behind the procedures advocated here for the accurate and stable solution of the initial value problem, is often to greatly facilitate their introduction in the classroom. For the first order problem, we consider the usefulness of implicit methods, see [3] , for capturing multiple solutions emanating from a point of bifurcations, and also simple procedures for determining the accuracy and stability of multistep methods. For the second order problem, see [4] , we consider the means of slowing and advancing the computed speed of the numerical solution of the equation of motion.

2. The Generalized Mean Value Theorem—Taylor’s Theorem

The decisive significance of Taylor’s theorem (as can be looked up in any elementary calculus textbook) to applied mathematics in general, and to numerical analysis in particular, is that it ascertains that every differential function looks locally like a polynomial. Polynomials having the advantage of being easily computed, differentiated and integrated, relieving us by their use of the burden of possibly high complications in the symbolic manipulation of functions, often only implicitly given as the solution of an initial value problem (IVP) or a boundary value problem (BVP). We look at this theorem here from an unusual angle.

The mean value theorem (MVT) states that if function f(x), f ( 0 ) = 0 , f ( 0 ) 0 , is continuous in the closed interval [0, x] and differentiable on the open interval (0, x), then point ξ exists, strictly inside the interval, 0 < ξ < x , at which the slope of the chord equals to the slope of the tangent line to f(x) at point ξ, or

f ( x ) f ( 0 ) x = f ( ξ ) , or f ( x ) = x f ( ξ ) , 0 < ξ < x (1)

implying that f(x) is nearly linear near x = 0.

The MVT theorem is a direct result, of the geometrically intuitively plausible, Rolle’s theorem. The generalized mean value theorem (GMVT) is a result of the application of the MVT (or Rolle’s theorem) to the higher order derivative functions of f(x). Here it is in its most concise form: Let function f(x) be continuous at x = 0, and such that

f ( 0 ) = 0 , f ( 0 ) = 0 , f ( 0 ) = 0 , , f ( n 1 ) ( 0 ) = 0 , f ( n ) ( 0 ) 0. (2)

Then, function f(x) may be expressed in the form

f ( x ) = 1 n ! x n f ( n ) ( ξ ) , 0 < ξ < x (3)

implying that if f(n)(x) is bounded near x = 0, then f(x), like xn, is small if | x | 1 .

3. Where Is ξ

We consider first the simplest case of n = 1, for which Equation (3) is

f ( x ) = x f ( ξ ) , f ( 0 ) = 0 , f ( 0 ) 0 , 0 < ξ < x (4)

and take

f ( x ) = A x + B x 2 + C x 3 , f ( x ) = A + 2 B x + 3 C x 2 . (5)

such that A = f ( 0 ) , B = f ( 0 ) / 2 ! , C = f ( 0 ) / 3 ! .

We further assume that, approximately

ξ = k x + m x 2 (6)

and have from this that

y = 0 , y ( 0 ) = 1 , y ( t ) = 1. (68)

For α 0 = 3 / 4 , α 1 = 7 / 4 , and with y ( t ) = 0 , the two-step method becomes

y 2 = 1 4 ( 3 y 0 + 7 y 1 ) (69)

for which the characteristic equation is

4 z 2 7 z + 3 = 0 , z 1 = 1 , z 2 = 3 4 (70)

and hence

y n = c 1 ( 1 ) n + c 2 ( 3 4 ) n . (71)

Say we start the method with y 0 = 1 , y 1 = 1 + ε , such that

c 1 + c 2 = 1 , c 1 + 3 4 c 2 = 1 + ε (72)

resulting in c 1 = 1 + 4 ε , c 2 = 4 ε , and

y n = 1 + 4 ε 4 ε ( 3 4 ) n (73)

and

y = 1 + 4 ε . (74)

17. A Three Step Method

The integration method

y 3 = y 2 + 1 12 τ ( 23 y 2 16 y 1 + 5 y 0 ) (75)

is correct for y = 1, y = t, y = t2 and y = t3. For

y ( t ) = 1 24 M 4 t 4 (76)

we have from Equation (75) that

y ( 3 τ ) y 3 = 3 8 M 4 τ 3 . (77)

For y = y , y ( 0 ) = y 0 the characteristic equation of the three step method becomes

12 z 3 + ( 12 + 23 τ ) z 2 16 τ z + 5 τ = 0 (78)

and at τ = 0 it reduces to

12 z 3 12 z 2 = 0 , of roots z 1 = 1 , z 2 = z 3 = 0 . (79)

Implicit differentiation of Equation (78) with respect to τ yields

36 z 2 z + 23 z 2 + ( 12 + 23 τ ) 2 z z 16 z 16 τ z + 5 = 0 (80)

and at τ = 0, z = 1, we have that z = 1 , so that near τ = 0

z = 1 τ (81)

and the method is stable.

We further have from Equation (79) that at τ = 6/11, z3 = −1 and z1 = z2 = 1/2.

At the repeating root z = 0, the derivative function z does not exist. Instead we write τ in terms of z as

τ = 12 ( 1 z ) 23 z 2 16 z + 5 z 2 (82)

and if z = 0, nearly, then

τ = 12 5 z 2 (83)

and

z = ± 5 12 τ . (84)

18. Advancing and Retarding the Computed Motion

Next, we turn our attention to the second order IVP, see [6] and [7] , as typified by the model second order problem

y + y = 0 , y ( 0 ) = y 0 , y ( 0 ) = y 0 (85)

which we propose to approximate as

y 0 2 y 1 + y 2 τ 2 + ( 1 + ) y 1 = 0 , = α τ + β τ 2 . (86)

The characteristic equation of this method is

z 2 + ( 2 + τ 2 ( 1 + ) ) z + 1 = 0. (87)

For a sufficiently small τ, the roots of the characteristic equation are complex and | z | = 1 . Hence the closed-form prediction of the computed y at step n

y n = c 1 cos ( n θ ) + c 2 sin ( n θ ) (88)

where c1 and c2 are determined by the initial conditions.

From the characteristic Equation (87) we have that

cos ( θ ) = 1 1 2 τ 2 ( 1 + ) , sin ( θ ) = 1 2 4 ( 2 + τ 2 ( 1 + ) ) 2 (89)

or

θ = τ + 1 2 α τ 2 + 1 24 ( 1 3 α 2 + 12 β ) τ 3 + O ( τ 5 ) , = 2 τ 2 2 cos ( τ ) . (90)

To drop the τ2 term in the above equation we take α = 0, and are left with

θ τ = 1 + 1 24 ( 1 + 12 β ) τ 2 + O ( τ 4 ) (91)

suggesting that θ may be advanced or retarded relative to τ with a proper choice of β. For instance, for β = −1/12 we have that θ = τ, nearly.

19. Integration of the Equation of Motion Linear Prediction

Inasmuch as the initial conditions to the second order equation of motion are usually given in terms of initial position and initial velocity, we prefer to reduce the second order problem into a coupled system of first order equations for position and velocity, and follow them in tandem.

To remain both concise and specific, we consider the model initial value problem

x = y , y = x , x 0 = x ( 0 ) = 1 , y 0 = y ( 0 ) = 0 (92)

where x = x(t), y = y(t), t > 0, and where ( ) denotes differentiation with respect to time t. This initial value problem, that coincides with a single second order problem, is solved by x = cos ( t ) , y = sin ( t ) representing a constant circular motion of period T = 2 π .

We propose to follow the initial value problem with the explicit scheme

x 1 = x 0 + τ x 0 y 1 = y 0 + τ ( α 0 y 0 + α 1 y 1 ) (93)

in which τ is the time step, where x1 = x(τ) and y1 = y(τ), approximately, and with the coefficients α0, α1 to be presently determined by stability and accuracy considerations.

With x = y , y = x , system (93) becomes the system of recursions

x 1 = x 0 τ y 0 y 1 = y 0 + τ ( α 0 x 0 + α 1 x 1 ) (94)

that explicitly produces x1 and y1 out of x0 and y0, and then x2 and y2 out of x1 and y1, and so on up to xn and yn. System (94) is solved by x n = z n x 0 , y n = z n y 0 for magnification factor z that satisfies the pair of linear equations

z x 0 = x 0 τ y 0 z y 0 = y 0 + τ ( α 0 x 0 + α 1 z x 0 ) (95)

for any x0 and y0. Equation (95) is recast in the matrix-vector form to assume the form

[ z 1 τ τ ( a 0 + a 1 z ) z 1 ] [ x 0 y 0 ] = 0 (96)

and the condition that it have a nontrivial solution is that the determinant of the system’s matrix of coefficients be zero, leading to the characteristic equation

det [ z 1 τ τ ( a 0 + a 1 z ) z 1 ] = 0 , z 2 + 2 ( 1 + 1 2 a 1 τ 2 ) z + 1 + a 0 τ 2 = 0 (97)

for z. The periodic nature of the solution to this initial value problems dictates that z be complex. Let | z | be the modulus of complex z. If | z | < 1 , then | z | n 0 as n , and if | z | > 1 , then | z | n as n . To avoid these undesirable eventualities of an artificial energy sink and an artificial, numerically induced, energy source, we select α0 = 0 in Equation (94), and are left with the reduced characteristic equation

z 2 + 2 ( 1 + 1 2 α 1 τ 2 ) z + 1 = 0 , a z 2 + b z + c = 0 (98)

that possesses two complex roots z1 and z2 such that z 1 z 2 = c / a = | z | 2 = 1 .

In fact,

z = 1 1 2 α 1 τ 2 ± i τ α 1 1 4 α 1 2 τ 2 (99)

where i2 = −1, and z is complex if

α 1 > 0 , 4 α 1 τ 2 > 0. (100)

By the fact that | z | = 1 , the complex solution to Equation (98) is energy conserving, and may be written as

z 1 = cos ( θ ) i sin ( θ ) , z 2 = cos ( θ ) + i sin ( θ ) (101)

with

cos ( θ ) = 1 1 2 α 1 τ 2 , sin ( θ ) = τ α 1 1 4 α 1 2 τ 2 . (102)

Now, xn and yn are generally written as

x n = c 1 z 1 n + c 2 z 2 n , y n = c 1 z 1 n + c 2 z 2 n (103)

with constants c 1 , c 2 , c 1 , c 2 determined by the initial conditions. Given x0 = 1, y0 = 0 we get from Equation (94), x1 = 1, y1 = α1τ. Writing xn and yn in Equation (102) for n = 0 and n = 1 we obtain the two systems of linear equations

[ 1 1 z 1 z 2 ] [ c 1 c 2 ] = [ 1 1 ] , [ 1 1 z 1 z 2 ] [ c 1 c 2 ] = a 1 τ [ 0 1 ] (104)

readily solved for c 1 , c 2 , c 1 , c 2 as

[ c 1 c 2 ] = 1 z 2 z 1 [ z 2 1 z 1 + 1 ] , [ c 1 c 2 ] = a 1 τ z 2 z 1 [ 1 1 ] (105)

in which z 1 = cos ( θ ) i sin ( θ ) , z 2 = cos ( θ ) + i sin ( θ ) , z 2 z 1 = 2 i sin ( θ ) . Writing z1 and z2 in terms of θ recasts Equation (103) into the form

x n = ( c 1 + c 2 ) cos ( n θ ) + i ( c 2 c 1 ) sin ( n θ ) , y n = ( c 1 + c 2 ) cos ( n θ ) + i ( c 2 c 1 ) sin ( n θ ) (106)

and we have from Equation (105) that

c 1 + c 2 = 1 , c 2 c 1 = i ( sin ( θ ) ) 1 α 1 τ 2 c 1 + c 2 = 0 , c 2 c 1 = i ( sin ( θ ) ) 1 α 1 τ (107)

with which we finally get

x n = cos ( n θ ) + 1 2 α 1 τ 2 ( sin ( θ ) ) 1 sin ( n θ ) , y n = α 1 τ ( sin ( θ ) ) 1 sin ( n θ ) (108)

as the general numerical solution to our initial value problem.

20. Period Control

A cycle is completed when sin ( n θ ) = 0 or n θ = 2 π . Then, according to Equation (108) yn = 0 and xn = 1. From τ n θ = 2 π τ and T = nτ we obtain the computed period as

T = 2 π τ θ (109)

and to retain T = 2 π we select α1 in Equation (93) so as to guarantee τ = θ or sin ( τ ) = sin ( θ ) . This condition becomes, in view of Equation (102),

sin ( τ ) = τ α 1 1 4 α 1 2 τ 2 (110)

leading to the quadratic equation

1 4 τ 2 α 1 2 α 1 + sin 2 ( τ ) τ 2 = 0 (111)

for α1, and resulting in

α 1 = 2 ( 1 cos ( τ ) ) / τ 2 (112)

or

α 1 = 1 1 12 τ 2 + 1 360 τ 4 . (113)

if τ is small.

21. Quadratic Prediction

Inclusion of the acceleration in the prediction of x1 suggests the higher order scheme

x 1 = x 0 + τ x 0 + 1 2 τ 2 x 0 y 1 = y 0 + 1 2 τ ( α 0 y 0 + α 1 y 1 ) (114)

that becomes for

x = y , y = x , x = x x 1 = x 0 τ y 0 1 2 τ 2 x 0 , y 1 = y 0 + 1 2 τ ( α 0 x 0 + α 0 x 1 ) . (115)

Substitution of x1 = zx0, y1 = zy0 in Equation (115) results in the system

[ z 1 + 1 2 τ 2 τ 1 2 τ ( a 0 + a 1 z ) z 1 ] [ x 0 y 0 ] = 0 (116)

from which we obtain the quadratic characteristic equation

det [ z 1 + 1 2 τ 2 τ 1 2 τ ( a 0 + a 1 z ) z 1 ] = 0 , z 2 + 2 ( 1 + 1 4 τ 2 + 1 4 a 1 τ 2 ) z + 1 + 1 2 τ 2 ( a 0 1 ) = 0 (117)

for magnification factor z. To assure | z | = 1 for the complex roots of Equation (117) we set α0 = 1 and are left with

z 2 + 2 ( 1 + 1 4 τ 2 β ) z + 1 = 0 (118)

where β = 1 + α1. The two roots of Equation (118) are

z = 1 1 4 τ 2 β ± i τ 1 2 β 1 16 τ 2 β 2 (119)

and z is complex if

β > 0 , 8 τ 2 β > 0. (120)

Because | z | = 1 we may write the complex roots of Equation (118) as

z = cos ( θ ) ± i sin ( θ ) , cos ( θ ) = 1 1 4 τ 2 β , sin ( θ ) = τ 1 2 β 1 16 τ 2 β 2 . (121)

The numerical scheme is period conserving if τ = θ, or sin θ = sin τ . This is assured, according to Equation (121), by β such that

sin ( τ ) = τ 1 2 β 1 16 τ 2 β 2 (122)

or

1 16 τ 2 β 1 2 β + ( sin ( τ ) τ ) 2 = 0 (123)

resulting in

β = 4 ( 1 cos ( τ ) ) / τ 2 (124)

or

α 1 = 1 1 6 τ 2 + 1 180 τ 4 (125)

if τ is small.

22. Conclusion

We accomplished here showing how to routinely determine the consistency and stability of any multistep method, explicit as well as implicit, for the stepwise integration of the first order initial value problem. We have also demonstrated here the advantage of using implicit methods to capture different solutions emanating from a branch-off point. For the integration of the second order equation of motion we have shown how to advance and retard the motion of the computed solution.

Cite this paper
Fried, I. (2019) Consistency and Stability Issues in the Numerical Integration of the First and Second Order Initial Value Problem. Applied Mathematics, 10, 676-690. doi: 10.4236/am.2019.108048.
References

[1]   Hairer, E., Norset, S.P. and Wanner, G. (1980) Solving Ordinary Differential Equations. Springer-Verlag, Berlin, Heidelberg.

[2]   Gautschi, W. (2010) Numerical Analysis. 2nd Edition, Birkhauser, Berlin.

[3]   Fried, I. (2000) The Advantage of an Implicit Correction at Bifurcation. Journal of Sound and Vibration, 235, 153-155.
https://doi.org/10.1006/jsvi.1999.2829

[4]   Fried, I. and Waldrop, L. (2001) Kira Is Energy Consuming. Journal of Sound and Vibration, 244, 169-172.
https://doi.org/10.1006/jsvi.2000.3467

[5]   Dahlquist, G. (1963) A Special Stability Problem for Linear Multistep Methods. BIT Numerical Mathematics, 3, 27-43.
https://doi.org/10.1007/BF01963532

[6]   Lambert, J.D. and Watson, I.A. (1976) Symmetric Multistep Methods for Periodic Initial Value Problems. IMA Journal of Applied Mathematics, 18, 189-202.
https://doi.org/10.1093/imamat/18.2.189

[7]   Quinlan, G.D. and Tremaine, S. (1990) Symmetric Multistep Methods for the Numerical Integration of Planetary Orbits. The Astronomical Journal, 100, 1694-1700.
https://doi.org/10.1086/115629

 
 
Top