Consistency and Stability Issues in the Numerical Integration of the First and Second Order Initial Value Problem ()
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),
,
, is continuous in the closed interval [0, x] and differentiable on the open interval (0, x), then point ξ exists, strictly inside the interval,
, at which the slope of the chord equals to the slope of the tangent line to f(x) at point ξ, or
(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
(2)
Then, function f(x) may be expressed in the form
(3)
implying that if f(n)(x) is bounded near x = 0, then f(x), like xn, is small if
.
3. Where Is ξ
We consider first the simplest case of n = 1, for which Equation (3) is
(4)
and take
(5)
such that
.
We further assume that, approximately
(6)
and have from this that
(7)
Annulling the first two terms of the above equation results in
(8)
or generally, for any n in Equation (2)
(9)
4. Polynomial Approximations
Some examples will convince us of the decisive usefulness of the GMVT theorem to numerical analysis. As a first example, we use the theorem to get a good polynomial approximation to ex near x = 0. We start by writing
(10)
and propose to fix free parameters a and b such that
,
, namely, such that
(11)
Now, by fundamental Equation (3), we may write r(x) of
,
, as
(12)
providing us with a good linear polynomial approximation to ex in the vicinity of x = 0.
Moreover, since ex is an increasing function, we readily obtain from Equation (12) the strict inequalities
(13)
or
(14)
5. Improving the Polynomial Approximation with ξ
The reason the lower bound on ex in the above inequality (14) is better then the upper bound is due to the fact that as the order of the approximation increases, ξ moves rather ever closer to the osculation point x = 0. Here, since
,
,
, then, according to Equation (9), ξ = x/3, nearly, if
.
Replacing eξ in Equation (12) by 1 + ξ, with ξ = x/3, we obtain, forthwith, the better approximation
(15)
Otherwise we may start from
(16)
take
, expand further
(17)
or
(18)
To have in the above equation as many correct terms as possible we set
(19)
resulting in
(20)
6. Trigonometric Function Approximations
Taylor’s theorem is not restricted to polynomials, but may be advantageously used to directly construct other approximating functions. For instance, we may start with
(21)
and use free numbers a and b to enforce
and
, to have
(22)
Consequently, the Taylor, or the GMVT, form of r(x) is
(23)
or, asymptotically, as
,
(24)
7. Rational Function Approximations
Rational approximations are also desirable, and efficient. Here we start with, say
(25)
of the three free parameters a, b, c. Imposing on r(x) the conditions
(26)
we readily have
(27)
If the point of osculation is not x = 0, but x = a, then x in the theorem is shifted to x − a.
8. First Order Linear Homogeneous Recursions
In the numerical integration of IVPs we are constantly confronted by the need to solve linear homogeneous recursions.
The first order, homogeneous, recursion
(28)
where b is a constants independent of n, is brought, without much ado, to the explicit, closed-form, representation
(29)
by merely repeating the recursion. We note that if
, then yn keeps growing with n, while if
, then
, as
.
9. Second Order Linear Homogeneous Recursions
Next we consider the three-term homogeneous recursion.
Let the sequence
be generated by the homogeneous recursion
(30)
with coefficients b and c assumed independent of n. Recursion (30) is satisfied by
provided z is a root the characteristic equation
(31)
In case the two roots z1, z2 of Equation (31) are distinct,
, then by the linearity of the recursion we have the general solution of this recursion in the form
(32)
with c1 and c2 determined by the initial conditions y0 and y1.
In case the roots of Equation (31) are equal,
,
, then we verify that
, with
(33)
In case the roots of Equation (31) are complex conjugates,
,
,
, then we may put z in the form
(34)
where
. Now,
becomes
(35)
with c1,c2 fixed by the initial conditions y0, y1.
For example, the recursion
(36)
results in
(37)
10. The Advantage of an Implicit Method at a Branching Point
Implicit methods for the numerical integration of the first-order IVP hold some stability advantages, but they may require the solution of a nonlinear equation for the next predicted value.
At a point of bifurcation they hold the extra advantage of capturing multiple solutions, otherwise missed by an explicit method. Here is an example. The initial value problem
(38)
is solved by both
(39)
Using the Euler explicit method
(40)
where y1 is an approximation to y(τ), we have
(41)
which is only the first solution y(t) = 1 of IVP (38).
Using the implicit method
(42)
we obtain
(43)
then the quadratic equation
(44)
for y1, solved by
a first
, and a second
(45)
as compared with
(46)
11. Sensitivity to Initial Conditions
The solution of the IVP
(47)
is
(48)
and if
, then
, but if
, then
as
.
12. Determination of the Order of Consistency of Multistep Methods
To fully, yet concisely, demonstrate the consistency and stability issues in the integration of first order IVP, and their resolution, we shall look in detail at the general two-step method
(49)
in which y2 is the computed approximation to the correct y(2τ), in which err is the error y(2τ) − y2, and in which α0, α1, β0, β1 are free parameters to be determined for highest accuracy and method stability.
In accordance with Taylor’s theorem we require, for the highest possible order of consistency, that the calculated y2 is the correct y(2τ), namely err = 0, for
(50)
leading to the system of equations
(51)
and then to
(52)
in which we leave α0 free for now, to use it next to guarantee the stability of the method.
According to Taylor’s theorem the worst case error arises from the next order polynomial, or the function with a constant third derivative. Accordingly, we take next
(53)
and have from Equation (49) and Equation (51) that
(54)
which is the local error per step. After n steps the error rises to the global O(τ2).
13. Stability of the Multistep Method
The following Lemma is greatly useful for ascertaining the stability of an integration method.
Lemma. Let real roots z(τ) of the characteristic equation for the integration scheme of the first-order IVP be such that
. Then, a sufficient condition for the (conditional) stability of the method is that at
,
and that at
,
.
Proof. It results directly from the continuity and differentiability of z(τ) that if
and
at τ = 0, then z(τ) < 1 for some τ > 0. See also [5] .
Specifically, for the model IVP
(55)
the two-step method of Equation (49) becomes
(56)
of the characteristic equation
(57)
At τ = 0 the equation reduces to
(58)
which is of the two roots
(59)
To verify the stability of the method we seek
at τ = 0.
Implicitly differentiating characteristic Equation (57) with respect to τ we have
(60)
At τ = 0, the above equation reduces to
(61)
and for
we obtain from the above equation that
(62)
and since for stability z1(τ) needs to come down at τ = 0, hence
.
14. The Adam-Bashforth Method
In this method
, for which the characteristic equation reduces to
(63)
We set z = 1 in the above equation and get from it the corresponding τ = 0. Then we set in the above equation z = −1 and obtain from it τ = 1, at which
, implying that the method is stable for
.
Actually
(64)
15. Other Possibilities
For
the characteristic equation of the multistep method becomes
(65)
and by implicit differentiation with respect to τ
(66)
where
. At τ = 0, z = 1, the above equation yields
, and the method is stable for some τ. We set z = 1 into the characteristic equation and get for it but τ = 0. We set into the characteristic equation z = −1 and get from it τ = 7/4, implying that the method is stable now for
.
Actually,
(67)
16. Amplification of an Initial Error
We shall consider now the application of the two-step method of the previous section to the IVP
(68)
For
,
, and with
, the two-step method becomes
(69)
for which the characteristic equation is
(70)
and hence
(71)
Say we start the method with
,
, such that
(72)
resulting in
,
, and
(73)
and
(74)
17. A Three Step Method
The integration method
(75)
is correct for y = 1, y = t, y = t2 and y = t3. For
(76)
we have from Equation (75) that
(77)
For
,
the characteristic equation of the three step method becomes
(78)
and at τ = 0 it reduces to
, of roots
. (79)
Implicit differentiation of Equation (78) with respect to τ yields
(80)
and at τ = 0, z = 1, we have that
, so that near τ = 0
(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
does not exist. Instead we write τ in terms of z as
(82)
and if z = 0, nearly, then
(83)
and
(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
(85)
which we propose to approximate as
(86)
The characteristic equation of this method is
(87)
For a sufficiently small τ, the roots of the characteristic equation are complex and
. Hence the closed-form prediction of the computed y at step n
(88)
where c1 and c2 are determined by the initial conditions.
From the characteristic Equation (87) we have that
(89)
or
(90)
To drop the τ2 term in the above equation we take α = 0, and are left with
(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
(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
,
representing a constant circular motion of period
.
We propose to follow the initial value problem with the explicit scheme
(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
,
, system (93) becomes the system of recursions
(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
,
for magnification factor z that satisfies the pair of linear equations
(95)
for any x0 and y0. Equation (95) is recast in the matrix-vector form to assume the form
(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
(97)
for z. The periodic nature of the solution to this initial value problems dictates that z be complex. Let
be the modulus of complex z. If
, then
as
, and if
, then
as
. 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
(98)
that possesses two complex roots z1 and z2 such that
.
In fact,
(99)
where i2 = −1, and z is complex if
(100)
By the fact that
, the complex solution to Equation (98) is energy conserving, and may be written as
(101)
with
(102)
Now, xn and yn are generally written as
(103)
with constants
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
(104)
readily solved for
as
(105)
in which
,
,
. Writing z1 and z2 in terms of θ recasts Equation (103) into the form
(106)
and we have from Equation (105) that
(107)
with which we finally get
(108)
as the general numerical solution to our initial value problem.
20. Period Control
A cycle is completed when
or
. Then, according to Equation (108) yn = 0 and xn = 1. From
and T = nτ we obtain the computed period as
(109)
and to retain
we select α1 in Equation (93) so as to guarantee τ = θ or
. This condition becomes, in view of Equation (102),
(110)
leading to the quadratic equation
(111)
for α1, and resulting in
(112)
or
(113)
if τ is small.
21. Quadratic Prediction
Inclusion of the acceleration in the prediction of x1 suggests the higher order scheme
(114)
that becomes for
(115)
Substitution of x1 = zx0, y1 = zy0 in Equation (115) results in the system
(116)
from which we obtain the quadratic characteristic equation
(117)
for magnification factor z. To assure
for the complex roots of Equation (117) we set α0 = 1 and are left with
(118)
where β = 1 + α1. The two roots of Equation (118) are
(119)
and z is complex if
(120)
Because
we may write the complex roots of Equation (118) as
(121)
The numerical scheme is period conserving if τ = θ, or
. This is assured, according to Equation (121), by β such that
(122)
or
(123)
resulting in
(124)
or
(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.