0% found this document useful (0 votes)
63 views11 pages

Differential Systems Exactly Solved by Multistep Finite Difference Schemes

This document describes a procedure for obtaining differential equation systems that are exactly solved by multistep finite-difference numerical methods. The procedure extends an existing technique for one-step methods to multistep schemes. Examples are provided to illustrate the procedure for obtaining first-order, second-order, and systems of differential equations exactly solved by methods like the Trapezoidal Rule, Adams-Bashforth, and Numerov method.

Uploaded by

nadamau22633
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views11 pages

Differential Systems Exactly Solved by Multistep Finite Difference Schemes

This document describes a procedure for obtaining differential equation systems that are exactly solved by multistep finite-difference numerical methods. The procedure extends an existing technique for one-step methods to multistep schemes. Examples are provided to illustrate the procedure for obtaining first-order, second-order, and systems of differential equations exactly solved by methods like the Trapezoidal Rule, Adams-Bashforth, and Numerov method.

Uploaded by

nadamau22633
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Contributions to the development of differential systems exactly solved

by multistep nite-difference schemes


Higinio Ramos
*
Scientic Computing Group, Universidad de Salamanca, Salamanca, Spain
Escuela Politcnica Superior de Zamora, Campus Viriato, 49022 Zamora, Spain
a r t i c l e i n f o
Keywords:
Exact nite-difference methods
Nonstandard nite-difference methods
Initial value problems
a b s t r a c t
The motivation underlying this contribution has been to complete some of the topics con-
cerning exact schemes for numerically solving ordinary differential equations. A procedure
for obtaining differential systems exactly solved by a given nite-difference method is
described. Examples illustrating the application of the procedure for obtaining rst-order,
second-order and systems of differential equations exactly solved by different numerical
methods are given. Among the numerical methods considered there are the Trapezoidal
Rule, the two-step AdamsBashforth method and the Numerov method. Some numerical
examples are presented to provide evidence that the procedure works properly.
2010 Elsevier Inc. All rights reserved.
1. Introduction
Given any sufciently differentiable real function yx, one can easily nd differential equations whose exact solution in
the appropriate domain is

yx. If in addition an initial value is also considered,

yx
0
y
0
, then the result is an initial value
problem (I.V.P.) with solution yx. On the other hand, given an I.V.P. of the form y
0
(x) = f(x, y(x)), y(x
0
) = y
0
, with solution
y(x) = /(y
0
, x
0
, x), there exists an exact nite-difference scheme given by y
k+1
= /(y
k
, x
k
, x
k+1
) that solves the problem exactly
(see [1, p. 71]). However, in general for a given I.V.P. there is no guidance as to how to construct an exact scheme. In fact,
the issue of obtaining this scheme is exactly the same as nding an exact solution for the I.V.P.
The topic of exact schemes began with the work on best schemes of Potts [2,3]. Exact nite-difference schemes may be
used to formulate a number of non-standard methods for a variety of ordinary differential equations. These methods will in
many situations afford difference equations that are superior to conventional ones for the purpose of providing numerical
solutions. This superiority refers to the fact that important properties of the solutions to the differential equations, such
as positivity conditions, boundedness of solutions or stability behavior, are shared by the corresponding solutions of the dif-
ference equations [4]. In [5], Le Roux used exact schemes for ordinary differential equations with blow-up to obtain non-
standard schemes for parabolic differential equations with blow-up solutions.
The aim of this article is to provide a procedure for obtaining I.V.P.s (with a differential equation of any order, or a dif-
ferential system) that are exactly solved, except for round-off errors, by a given numerical method. This procedure is the
extension of the technique developed in [6] for one-step methods for scalar differential equations to multistep methods
for systems of differential equations. The paper is organized as follows: In Section 2, we present a procedure for obtaining
k-order differential equations exactly solved by a given multistep method. Different examples of nite-difference methods
are included to illustrate the procedure. In Section 3 some considerations about the application of nite-difference methods
for solving systems of differential equations are included. Section 4 shows a procedure for obtaining rst-order systems
0096-3003/$ - see front matter 2010 Elsevier Inc. All rights reserved.
doi:10.1016/j.amc.2010.05.101
* Address: Scientic Computing Group, Universidad de Salamanca, Salamanca, Spain.
E-mail address: [email protected]
Applied Mathematics and Computation 217 (2010) 639649
Contents lists available at ScienceDirect
Applied Mathematics and Computation
j our nal homepage: www. el sevi er. com/ l ocat e/ amc
exactly solved by a numerical scheme. Some numerical examples are also provided along the paper to show the effectiveness
of the procedure. In Section 5 some conclusions complete the article.
2. A direct approach for obtaining exact differential equations for discrete schemes
Let us consider a general k-step method for the I.V.P.:
y
0
f x; y; ya y
0
;
y; f x; y 2 R; x 2 a; b R;
1
given by:
y
n1
y
n
hU
f
h; x
n
; y
n1
; y
n
; . . . ; y
nk1
; 2
where the subscript f on the increment function U means that the dependence of U on x
n
, y
j
, j = n + 1, n, . . . , n k + 1 is
through the function f (see [7]).
The method in (2) is said to be consistent of order q if the local truncation error given by:
LTE yx h yx hU
f
h; x; yx h; yx; . . . ; yx k 1h;
after expanding on Taylors series in powers of h proves to be:
LTE Lyh
q1
Ry; hh
q2
;
with Ly the principal term of the local truncation error, which depends on y(x) and its derivatives.
Evidently, a necessary condition for an I.V.P. of the form in (1) to be solved exactly by the method in (2) is that its solution
must solve the ordinary differential equation given by Ly 0 (see [6] for the case of one-step methods). That is, the dif-
ferential equations formed by the solutions of Ly 0 are candidates to be solved exactly by the numerical method. These
equations can be obtained as follows: assuming that the general solution of Ly 0 is given by:
y
L
x sx; C
1
; C
2
; . . . ; C
r
; 3
where the C
i
are arbitrary constants, we take the derivative with respect to the independent variable on both sides of the
above equation, obtaining:
y
0
L
x
dsx; C
1
; C
2
; . . . ; C
r

dx
; 4
where y
0
L
x
dy
L
x
dx
.
We now consider the algebraic system given by (3) and (4), and after eliminating different combinations of the param-
eters and the variables in this system, we obtain some differential equations which are susceptible to be solved exactly by
the numerical method. A later verication for each of the differential equations obtained is required.
Application of this procedure to multistep methods designed for higher order differential equations is straightforward, as
can be seen in the following examples. All we have to do is to take derivatives of the general solution as many times as the
required order of the differential equation. Thus, for a numerical method designed for a nth-order differential equation the
resulting algebraic system consists of n + 1 equations.
We summarize the above in the following proposition:
Proposition 1. Given any discrete numerical scheme aimed at solving a kth-order I.V.P., let Ly be the principal term of the local
truncation error of the method, and y
L
x sx; C
1
; C
2
; . . . ; C
r
the general solution of Ly 0, with the C
i
arbitrary constants.
Thus, the differential equations obtained after eliminating all different combinations of parameters and variables in the algebraic
system:
y
L
x sx; C
1
; C
2
; . . . ; C
r
;
y
0
L
x
dsx;C
1
;C
2
;...;Cr
dx
;
.
.
.
y
k
L
x
d
k
sx;C
1
;C
2
;...;Cr
dx
k
;
_

_
are candidates for exact resolution by the numerical scheme, assuming that appropriate initial values are provided.
This procedure is the extension of the technique developed in [6] from one-step methods to multistep methods for scalar
differential equations. In what follows we will illustrate the procedure considering different examples of discrete numerical
methods.
2.1. Trapezoidal rule
The well-known Trapezoidal Rule for solving the I.V.P. in (1) is given by (see [7, p. 46]):
640 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649
y
n1
y
n

h
2
f x
n
; y
n
f x
n1
; y
n1
; 5
and the local truncation error is:
LTE yx h yx
h
2
y
0
x y
0
x h
h
3
12
y
000
x Oh
4
: 6
The necessary condition for an I.V.P. to be solved exactly by this method is y
000
(x) = 0, whose general solution is
y(x) = C
1
+ C
2
x + C
3
x
2
, where C
1
, C
2
and C
3
are arbitrary constants. We consider the algebraic system given by:
yx C
1
C
2
x C
3
x
2
;
y
0
x C
2
2C
3
x;
_
and after eliminating the constants C
1
, C
2
, C
3
and the variable x, we obtain respectively the following differential equations:
y
0
x C
2
2C
3
x;
xy
0
x y C
1
C
3
x
2
;
xy
0
x 2y 2C
1
C
2
x;
y
0
x
2
C
2
2
4C
3
y 4C
1
C
3
:
7
Note that the last differential equation in (7) can be split into two differential equations of the form in (1):
y
0
x

C
2
2
4C
3
y 4C
1
C
3
_
if C
2
2C
3
x P0; 8
y
0
x

C
2
2
4C
3
y 4C
1
C
3
_
if C
2
2C
3
x < 0: 9
We observe that, in view of the fact that the C
i
are arbitrary constants, the rst three differential equations in (7) and the
differential equation in (9), are the same as those in Section 3.2 of [6].
For proof of the exactness, we apply the method in (5) to each of these differential equations in (7)(9) and solve for y
n+1
.
These values of y
n+1
coincide with each of the corresponding exact solutions evaluated at x
n
+ h (for details see [6] and [8]),
except for the differential equation in (9). The resulting differential equations for the Trapezoidal Rule are valid for any other
method for which the local truncation error is similar to that in (6), and also for the second-order Taylor method, and for the
two-step AdamsBashforth method in Section 2.3.
In [8], the autonomous case is dealt with and Corollary 5.1 there holds that the Trapezoidal Rule is exact for differential
equations of the form y
0

Cy D
_
; C > 0; D 2 R. This case is a particularization of (8) taking C = 4C
3
and D C
2
2
4C
1
C
3
.
The restriction C > 0 limits the application of the method, and for example the problem y
0


y
p
is explicitly excluded. How-
ever, the above problem would have been excluded only if choice of the initial value had resulted in an I.V.P. without a solu-
tion. For example, the problem y
0


y
p
; y0 1 has the solution y = 1/4(x 2)
2
over the interval [0, 2], and we may use
the Trapezoidal Rule to solve it; indeed, the method is exact for this problem. Nevertheless, the problem y
0


y
p
; y0 1
with C = 1 > 0 is of the type in [8], but we cannot use the numerical method to solve it, because it has no real solution.
Remark 1. We insist that the initial value problems corresponding to the differential equations in (8) must be well
formulated so that the numerical method can be applied. We have to take into account not only the differential equation, but
also the initial value. Thus, we must have an I.V.P. for which a solution exists.
For example, the I.V.P. y
0
x

y
p
; y0 1 has no solution, even though the differential equation is of the type in (8).
This observation remains valid for any numerical method.
2.2. A non-standard method
Let us consider the non-standard method for solving the problem in (1) given by:
y
n1
y
n
e
h

y
n
y
n
e
2h
1y
n
f
n

_
;
whose local truncation error is:
LTE yx h yxe
h

yx
yx e
2h
1yx y
0
x


y
00
x
2

3y
0
x
2
2yx
y
0
x
_ _
h
2
Oh
3
:
By solving the differential equation resulting from equating the principal term of the LTE to zero, we obtain the family of
solutions e
2xC
1
1
_ _
yx
2
e
2x
C
2
where C
1
and C
2
are arbitrary constants. In particular, upon taking C
1
2C
1
and
C
2
e
2C
1
we obtain the subfamily of solutions given by e
2x
e
2C
1
_ _
yx
2
e
2x
, where C
1
is a constant. From this subfamily
H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 641
we shall obtain some differential equations for which the above method is exact. After differentiating the last equation, we
deduce the algebraic system:
e
2x
e
2C
1
_ _
yx
2
e
2x
;
e
2x
yx
2
e
2C
1
e
2x
_ _
yxy
0
x e
2x
;
_
10
from which we obtain:
eliminating C
1
or x on (10) we have the differential equation:
y
0
y1 y
2
; 11
eliminating y(x) on (10) we have the differential equation:
e
4C
1
x
e
2x
e
2x
e
2C
1
_ _
3
y
0

2
: 12
To check that the method is exact for these differential equations the true solutions are required. With no loss of gener-
ality, for the differential equation in (11) we may consider that the initial value is located at the origin, y(0) = y
0
, and in this
case the solution of the I.V.P.
y
0
y1 y
2
; y0 y
0
; 13
is given by:
yx
e
x

e
2x
e
2k
1
p
if y
0
> 1;
e
xk
1

e
2xk
1

1
p
if 0 < y
0
< 1;
e
xk
1

e
2xk
1

1
p
if 1 < y
0
< 0;
e
x

e
2x
e
2k
1
p
if y
0
< 1;
y
0
if y
0
1; 0; 1;
_

_
where the integration constant k
1
takes the values
k
1

1
2
log 1
1
y
2
0
_ _
if jy
0
j > 1;
log
jy
0
j

1y
2
0
p
_ _
if 0 < jy
0
j < 1:
_

_
After some calculations, we see that y
n+1
= y(x
n
+ h) for x
n
P0, and hence the method is exact for the I.V.P.
Note that the differential equation in (12) can be split into two differential equations of the form in (1), and that the solu-
tions may easily be obtained by solving an integral. It is straightforward to check that the numerical method is also exact for
these differential equations.
We observe that for the differential equation in (13) the numerical method has the same three xed points as those for
the differential equation (for this problem a discrete non-exact model has been proposed in [1, p. 103]).
For the problem in (13) the non-standard method reduces to:
y
n1

e
h
y
n

1 e
2h
1y
2
n
_ :
The above method has been checked in the problem in (13) with step sizes from 1/10,000 to 1, and with initial values of y
0
from 0 up to 200,000 (in some cases resulting in a very stiff problem), and in all cases the value obtained at the nal point
(x = 2) results in an error close to the machine epsilon. Indeed, the iteration function gy exphy=

1 exp2h 1y
2
_
_ _
has a condition number given by c(y) = 1/(1 + (exp(2h) 1)y
2
), which for h > 0 is less than 1 and so no rounding error accu-
mulation is expected.
In Fig. 1 we see the exact and numerical solutions (represented by lines and dots respectively) with the above method,
taking a step size of h = 0.2 for different initial values: y
0
= 2, 0.2, 0.2, 2. The integration interval was [0, 2]. The errors, due
to round-off considerations, are of order 10
16
, and the numerical solutions converge to the xed points 1 and 1 (both sta-
ble), reproducing the behavior of the exact solutions. It is worth mentioning here that if we use an exact arithmetic instead of
a binary oating-point one, the errors are exactly zero.
Remark 2. Although we have analyzed a particular case for this non-standard method in detail, the procedure could be
applied similarly to the general solution e
2xC
1
1
_ _
yx
2
e
2x
C
2
with two arbitrary constants.
642 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649
2.3. Two-step AdamsBashforth method
This is a well-known method for numerically solving the I.V.P. in (1) that reads ([9, p. 358]):
y
n1
y
n

h
2
3f x
n
; y
n
f x
n1
; y
n1
; 14
and the local truncation error is given by:
LTE yx h yx
h
2
3y
0
x y
0
x h
5
12
h
3
y
000
x Oh
4
;
and hence the necessary condition for exactness is the same as for the Trapezoidal Rule, and the differential equations are the
same as in (7) and (8).
For proof of the exactness, we apply the method in (14) to each of the differential equations and solve for y
n+1
. These val-
ues of y
n+1
coincide with each of the corresponding exact solutions evaluated at x
n
+ h. Thus, the differential equations ob-
tained for which the two-step AdamsBashforth method is exact are the same as for the Trapezoidal Rule.
2.4. Numerov method
The Numerov method [10] (also known as two-steps Cowell method, see [11, p. 67], or [12, p. 292]) is one of the most
widely used techniques for numerically solving second-order differential I.V.P.s of the special form:
y
00
x f x; yx; yx
0
y
0
; y
0
x
0

_
y
0
; 15
and is given by:
y
n1
2y
n
y
n1

1
12
h
2
f x
n1
; y
n1
10f x
n
; y
n
f x
n1
; y
n1

_ _
;
with local truncation error:
LTE yx h 2yx yx h
h
2
12
y
00
x h 10y
00
x y
00
x h
1
240
h
6
y
6
x Oh
8
:
The general solution of the equation Ly 0 is y(x) = C
1
+ C
2
x + C
3
x
2
+ C
4
x
3
+ C
5
x
4
+ C
6
x
5
and hence we consider the algebraic
system:
yx C
1
C
2
x C
3
x
2
C
4
x
3
C
5
x
4
C
6
x
5
;
y
0
x C
2
2C
3
x 3C
4
x
2
4C
5
x
3
5C
6
x
4
;
y
00
x 2C
3
6C
4
x 12C
5
x
2
20C
6
x
3
;
_

_
16
where we can choose different possibilities for eliminating the parameters C
i
and the variables x, y(x) and y
0
(x) (note that the
resulting differential equation must be of second-order). For the sake of brevity, in what follows we analyze one case in de-
tail; the other possibilities may be obtained in a similar way and will be shown below.
Eliminating C
3
and y
0
(x) in the above system, the following differential equation is obtained:
x
2
y
00
x 2yx 2C
1
2C
2
x 4C
4
x
3
10C
5
x
4
18C
6
x
5
: 17
0.5 1.0 1.5 2.0
2
1
1
2
Fig. 1. Exact and numerical solutions for problem (13) with the exact non-standard method, taking h = 0.2 for initial values y
0
= 2, 0.2, 0.2, 2.
H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 643
Let us check whether the Numerov method is exact for this equation. The general solution of this differential equation is:
yx C
1
C
2
x C
4
x
3
C
5
x
4
C
6
x
5
k
1
x
2

k
2
x
;
where k
1
and k
2
are arbitrary constants. From this we may easily obtain the value y(x
n
+ h).
After applying the Numerov method to the differential equation, bearing in mind the localization hypothesis that y
n1
and
y
n
are the exact values, the value y
n+1
is obtained. We have that the above two values are different, with:
yx
n
h y
n1

k
2
h
6
5h
2
9x
2
n
_ _
3 x
3
n
h
2
x
n
_ _
3
; 18
and therefore the Numerov method in general is not exact for the above differential equation. However, by choosing k
2
= 0 it
is evident that y(x
n
+ h) = y
n+1
; that is, the Numerov method is exact for the differential equations of the type in (17), whose
solutions are of the form:
yx C
1
C
2
x C
4
x
3
C
5
x
4
C
6
x
5
k
1
x
2
:
Proceeding in a similar way, we have found the following differential equations for which the Numerov method is exact:
eliminating any combination of C
1
, C
2
, y(x) or y
0
(x) in (16) results in the differential equation:
y
00
2C
3
6C
4
x 12C
5
x
2
20C
6
x
3
;
eliminating C
4
in (16) results in the differential equation:
x
2
y
00
x 6C
1
6C
2
x 4C
3
x
2
6C
5
x
4
14C
6
x
5
6y;
for which the Numerov method is exact if the solution is of the form:
yx C
1
C
2
x C
3
x
2
C
5
x
4
C
6
x
5
k
1
x
3
;
eliminating C
5
in (16) results in the differential equation:
x
2
y
00
x 12C
1
12C
2
x 10C
3
x
2
6C
4
x
3
8C
6
x
5
12y;
for which the Numerov method is exact if the solution is of the form:
yx C
1
C
2
x C
3
x
2
C
4
x
3
C
6
x
5
k
1
x
4
;
eliminating C
6
in (16) results in the differential equation:
x
2
y
00
x 20C
1
20C
2
x 18C
3
x
2
14C
4
x
3
8C
5
x
4
20y;
for which the Numerov method is exact if the solution is of the form:
yx C
1
C
2
x C
3
x
2
C
4
x
3
C
5
x
4
k
1
x
5
;
where k
1
is an arbitrary constant.
Any other combination of the parameters and variables to be eliminated for which the method is exact leads to some of
the previous cases. Note that the resulting differential equations must be of the form in (15).
3. Considerations about systems of differential equations
Let us consider the numerical method shown in [13] for solving the I.V.P. in (1) given by:
y
n1
y
n

2hf
2
n
2f
n
hf
0
n
; 19
where y
n
= y(x
n
), y
n+1
y(x
n+1
), f
n
= f(x
n
, y
n
) and:
f
0
n

@f
@x
x
n
; y
n

@f
@y
x
n
; y
n
f
n
;
whose local truncation error may be expressed as:
LTEyx; h
y
00
x
2
4y
0
x

y
3
x
6
_ _
h
3
Oh
4
: 20
We observe that the method in (19) can also be written in the form:
644 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649
y
n1
y
n
h
2 y
0
n
_ _
2
2y
0
n
hy
00
n
; 21
as presented in [6], or as previously appeared in [14]. In fact, the procedure presented in [13] for obtaining one-step methods
for solving I.V.P.s leads in the simpler case to the rst method of the family of rational one-step methods of van Niekerk [14].
This method has appeared elsewhere in the literature without properly citing [14], such as in [15] (cf. Eq. (8)) or in [16] (cf.
Eq. (8)).
The method in (19) is not appropriate for solving higher order differential equations directly. In [6], the above method is
applied to the third-order I.V.P.
2y
0
xy
3
x 3y
00
x
2
; y0 y
0
; y
0
0
_
y
0
; y
00
0

y
0
: 22
To do this, the third-order equation may be rewritten as a rst-order system and so the method in (19) could be applied
using a component-wise implementation, as indicated in [6]. The corresponding rst-order system for (22) is:
y
0
z; z
0
w; w
0

3w
2
2z
: 23
The component-wise implementation of method (19) for this system results in the difference system:
y
n1
y
n

2hz
2
n
2z
n
hw
n
;
z
n1
z
n

4hz
n
w
n
4z
n
3hw
n
;
w
n1
w
n

3hw
2
n
2z
n
2hw
n
;
(compare this system with that in [6, p. 1063], where the two rst equations were written incorrectly as y
n+1
= y
n
+ hz
n
,
z
n+1
= z
n
+ hw
n
).
The exact solution for the system in (23) may be written as:
yx C
3

C
2
C
1
x
; zx
C
2
C
1
x
2
; wx
2C
2
C
1
x
3
;
where C
1
, C
2
and C
3
are arbitrary constants. Assuming the localization hypothesis for numerical methods that in previous
points the values were exact, we have that the local truncation error for the rst component is:
LTEyx; h yx h yx
2hzx
2
2zx hwx
0;
as would be expected in view of the local truncation error in (20). Nevertheless, for the other components the local trunca-
tion errors are not zero, and the method is not exact for the above system.
At this point it is necessary to make an observation about the comment in [6]: Method (27)[cf. (21)] can only be applied . . .
using a componentwise implementation. For the autonomous system in (23), it is also possible to use a matrix formulation of
the method in (19), following a similar procedure as in [15] for the Lintrap scheme. Let y
0
= f(y) be the autonomous system
with y; fy 2 R
m
; the scheme in (21) for this problem may be written as:
y
n1
y
n
2hk
n
;
2I hJ
n
k
n
fy
n
;
where I is the identity matrix, and J
n
is the Jacobian of the system evaluated on the nth iteration. The matrix formulation of
the method for solving systems of differential equations is not applicable in the non-autonomous case. Nevertheless, it
should be recalled that it is possible, at the cost of raising the dimension by 1, to write a non-autonomous problem in auton-
omous form.
The method thus obtained is different from that of component-wise implementation. We have done some computations
using both approaches and the numerical results are better for the component-wise implementation than for the matrix one.
The largest number of calculations with the matrix implementation results in slightly larger errors and takes about twice the
amount of computation time. Table 1 shows the performance of the method in (19) for the problem in (23) taking initial
values y
0
= 0, z
0
= 1, w
0
= 0.1 over the integration interval [0, 1.5]. We have considered the number of steps, N, the computa-
tion time, and the maximum errors measured in the innity norm:
Err max
i1;...;N
kvx
i
v
i
k
1
;
where v(x
i
) = (y(x
i
), z(x
i
), w(x
i
)) are the exact values, and v
i
= (y
i
, z
i
, w
i
) are the approximate values obtained with the numerical
method.
H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 645
4. Procedure for obtaining a rst-order system for which a numerical method is exact
Now, the next question is as follows: given a numerical method, how can we obtain a system of rst-order differential
equations for which the method is exact? We show how to proceed with an example.
We consider the system of two ordinary differential equations given by:
y
0
x f
1
x; yx; zx; z
0
x f
2
x; yx; zx;
for which we wish the method in (19) to be exact using a component-wise implementation. Based on the local truncation
error in (20), we consider the system given by:
y
3
x
3y
00
x
2
2y
0
x
; z
3
x
3z
00
x
2
2z
0
x
;
obtained after equating the principal term of the local errors for each component to zero. The general solution of the above
system is given by:
yx C
3

C
2
2C
1
x
; zx C
6

C
5
2C
4
x
;
where C
1
, . . . , C
6
are arbitrary constants. From this solution we form the algebraic system:
yx C
3

C
2
2C
1
x
;
y
0
x
C
2
2C
1
x
2
;
zx C
6

C
5
2C
4
x
;
z
0
x
C
5
2C
4
x
2
;
_

_
24
where we can eliminate different combinations of the values:
x; yx; y
0
x; zx; z
0
x; C
1
; . . . ; C
6
f g;
to obtain rst-order systems of differential equations for which the numerical method could be exact.
We can consider 55 different pairs of variables to be eliminated in (24), although not all of them lead to a well formed
system of rst-order differential equations. If we had considered one, two or three variables to be eliminated, the total num-
ber of combinations would have risen to 231. For the sake of brevity we only show a few of the systems obtained:
eliminating C
1
and C
4
in (24), we obtain the system:
y
0

C
2
3
2C
3
y y
2
C
2
; z
0

C
2
6
2C
6
z z
2
C
5
_ _
;
eliminating C
1
and C
5
in (24), we obtain the system:
y
0

C
2
3
2C
3
y y
2
C
2
; z
0

C
6
z
2C
4
x
_ _
;
eliminating x and C
5
in (24), we obtain the system:
y
0

C
2
3
2C
3
y y
2
C
2
; z
0

C
3
C
6
C
3
z C
6
y yz
2C
1
y 2C
4
y C
2
2C
3
C
4
2C
1
C
3
_ _
;
eliminating x and z(x) in (24), we obtain the system:
Table 1
Data for problem (23) on [0, 1.5] taking initial values y
0
= 0, z
0
= 1, w
0
= 0.1, using the component-wise and matrix implementations.
N Componentwise Matrix
Err Time (s) Err Time (s)
250 5.4701 10
9
0.015 9.1682 10
8
0.032
500 1.3680 10
9
0.031 2.2920 10
8
0.063
1000 3.4208 10
10
0.062 5.7301 10
9
0.110
2000 8.5529 10
11
0.109 1.4325 10
9
0.250
646 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649
y
0

C
2
3
2C
3
yy
2
C
2
;
z
0

C
5
C
2
3
2C
3
yy
2

C
2
2C
1
C
3
2C
1
y2C
3
C
4
2C
4
y
2
;
_

_
eliminating z(x) and C
2
in (24) we obtain the system:
y
0

C
3
y
2C
1
x
; z
0

C
5
2C
4
x
2
_ _
:
We have checked that for these systems the numerical method in (19) applied in a component-wise implementation is
exact. The analytical solutions were obtained using the Mathematica command DSolve [17]. The use of Mathematica was
also helpful for obtaining the second derivatives, which are needed to obtain the values y
n+1
, z
n+1
by using the numerical
method in (19).
To illustrate the above results we have considered a differential system of one of the above types given by:
y
0
y
2
;
z
0
y yz;
_
25
which for initial values y(0) = y
0
, z(0) = z
0
has the exact solution:
yx
y
0
1 xy
0
; zx
xy
0
z
0
1 xy
0
:
Each component of the solution has a singularity of the movable pole type [18] located at the same point, x = 1/y
0
, and for
y
0
> 0 each corresponding curve on [0, 1) consists of two branches separated by a vertical asymptote, near which the solu-
tion has a two-sided innite discontinuity. Taking y
0
= 1/3, z
0
= 0, we have solved the problem with the method in (19) over
the interval [x
0
, x
N
] = [0, 5]. In Figs. 2 and 3 the exact and numerical solutions for each component (when N = 32) are shown,
where the vertical lines reect the existence of the singularity. We observe that the numerical solution reproduces the
behavior of the true solution faithfully and the method has no difculties in crossing the singularity.
Table 2 presents the results for each component taking different number of steps, N = 2
j
for j = 3, . . . , 9. The errors Err
max
have been obtained as the maximum of the absolute errors at the nodal points x
j
= x
0
+ jh, j = 1, . . . , NI. For this problem with
unbounded solutions, the relative error is a useful quantity, so we have included the error ErrRel
max
, which is the maximum
of the relative errors at the nodal points. Since the errors are due only to round-off considerations, we note that as the num-
ber of steps increases so does the corresponding error. In fact, using exact arithmetic the errors prove to be zero.
The procedure in this Section may be summarized as follows:
Proposition 2. Given any discrete numerical scheme aimed at solving a rst-order I.V.P., let Ly be the principal term of the local
truncation error of the method, and y(x) = s(x, C
1
, C
2
, . . . , C
r
) the general solution of Ly 0, with the C
i
arbitrary constants. Thus,
the m-systems of rst-order differential equations obtained after eliminating all the different combinations of parameters and
variables in the algebraic system:
y
j
x sx; C
1j
; C
2j
; . . . ; C
rj
;
y
0
j
x
dsx;C
1j
;C
2j
;...;C
rj

dx
; j 1; . . . ; m;
_
1 2 3 4 5
4
2
2
4
Fig. 2. Exact and numerical solutions for y(x) with the method in (19), taking N = 2
5
.
H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 647
are candidates to be solved exactly by the numerical scheme on the basis of a component-wise implementation, assuming that
appropriate initial values are provided.
5. Conclusions
A procedure for obtaining differential equations for which a given discrete numerical method is exact is shown. The pro-
cedure applies not only to one-step methods, but also to multistep methods, either linear or nonlinear. If the numerical
method is intended for higher order initial value problems, the procedure allows us to obtain the corresponding higher order
differential equations. Moreover, it is shown how to proceed for obtaining a system of rst-order ordinary differential equa-
tions for which the component-wise application of a numerical method results to be exact.
Acknowledgements
The author wishes to thank the anonymous referees for their careful reading of the manuscript.
References
[1] R.E. Mickens, Nonstandard Finite Difference Models of Differential Equations, World Scientic, Singapore, 1994.
[2] R.B. Potts, Best difference equation approximation to Dufngs equation, J. Aust. Math. Soc. Ser. B 23 (1982) 349456.
[3] R.B. Potts, Nonlinear difference equations, Nonlinear Anal. 6 (1982) 659665.
[4] R.E. Mickens, Applications of Nonstandard Finite Difference Schemes, World Scientic, Singapore, 2000.
[5] M.N. Le Roux, Semidiscretization in time of nonlinear parabolic equations with blowup of the solution, SIAM J. Numer. Anal. 31 (1994) 170195.
[6] F.R. Villatoro, Given a one-step numerical scheme, on which ordinary differential equations is it exact?, J Comput. Appl. Math. 223 (2009) 10581065.
1 2 3 4 5
15
10
5
5
10
Fig. 3. Exact and numerical solutions for z(x) with the method in (19), taking N = 2
5
.
Table 2
Errors for each component of the problem in (25) on [0, 5], taking initial values y
0
= 1/3,
z
0
= 0, with the method in (19).
j Err
max
ErrRel
max
y(x) 3 1.7763 10
14
2.2204 10
15
4 1.5099 10
14
2.8310 10
15
5 8.1712 10
14
2.5535 10
15
6 9.5568 10
13
2.9865 10
14
7 9.0949 10
13
1.0658 10
14
8 1.7848 10
11
1.3944 10
13
9 1.4142 10
10
2.7622 10
13
z(x) 3 5.6843 10
14
2.2737 10
15
4 4.7961 10
14
3.1974 10
15
5 2.2737 10
13
2.4158 10
15
6 2.8137 10
12
2.9618 10
14
7 2.7853 10
12
1.0712 10
14
8 5.3205 10
11
1.3819 10
13
9 4.2518 10
10
2.7699 10
13
648 H. Ramos / Applied Mathematics and Computation 217 (2010) 639649
[7] J.D. Lambert, Numerical Methods for Ordinary Differential Systems, John Wiley, England, 1991.
[8] M.J. Gander, R. Meyer-Spasche, An introduction to numerical integrators preserving physical properties, in: R.E. Mickens (Ed.), Applications of
Nonstandard Finite Difference Schemes, World Scientic, Singapore, 2000, pp. 181246.
[9] E. Hairer, S.P. Norsett, G. Wanner, Solving Ordinary Differential Equations I. Nonstiff problems, Springer, Berlin, 1993.
[10] B.V. Numerov, A method of extrapolation of perturbations, R. Ast. Soc. Mon. Not. 84 (1924) 592601.
[11] L.G. Ixaru, Numerical Methods for Differential Equations and Applications, Editura Academiei, Romania, 1984.
[12] P. Henrici, Discrete Variable Methods in Ordinary Differential Equations, John Wiley, New York, 1962.
[13] H. Ramos, A non-standard explicit integration scheme for initial-value problems, Appl. Math. Comput. 189 (2007) 710718.
[14] F.D. van Niekerk, Rational one-step methods for initial value problems, Comput. Math. Appl. 16 (1988) 10351039.
[15] R. Meyer-Spasche, Difference schemes of optimum degree of implicitness for a family of simple ODEs with blow-up solutions, J. Comput. Appl. Math.
97 (1998) 137152.
[16] F.J. Solis, B. Chen-Charpentier, Nonstandard discrete approximations preserving stability properties of continuous mathematical models, Math.
Comput. Model. 40 (2004) 481490.
[17] S. Wolfram, Mathematica. A System for Doing Mathematics by Computer, Addison-Wesley, Redwood City, CA, 2000.
[18] E. Hille, Ordinary Differential Equations in the Complex Domain, John Wiley & Sons, New York, 1976.
H. Ramos / Applied Mathematics and Computation 217 (2010) 639649 649

You might also like