21
Numer. Math. 37, 235-255 (1981) Numerische Mathemafik Springer-VerIag 1981 Numerical Treatment of Delay Differential Equations by Hermite Interpolation H.J. Oberle and H.J. Pesch Institut Rir Mathematik der Technischen Universit~t Mi.inchen, Arcisstr. 21, D-8000 M~inchen 2, Germany (Fed Rep.) Summary. A class of numerical methods for the treatment of delay differen- tial equations is developed. These methods are based on the weltknown Runge-Kutta-Fehlberg methods. The retarded argument is approximated by an appropriate multipoint Hermite Interpolation. The inherent jump discontinuities in the various derivatives of the solution are considered automatically. Problems with piecewise continuous right-hand side and initial function are treated too. Real-life problems are used for the numerical test and a comparison with other methods published in literature. Subject Classifications: AMS(MOS): 65L05, 65Q05; CR: 5.17 1. Introduction In recent years there has been a growing interest in the numerical treatment of delay differential equations. This is due to the versatility of such equations in the mathematical modeling of processes in various application fields, where they provide the best and sometimes the only realistic simulation of observed phenomena. In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation of the right-hand side of the differential equation y'(x) =f(x, y(x), y(x - ~)), x > x o (1.1) an approximation of the retarded argument y(x-c 0 is used. Secondly, the in- tegration routine has to pay attention to the jump discontinuities 1 of the so- lution in various derivatives, which are inherent for delay differential equations. x In this paper the name 'jump discontinuities' is used for the values of the abszissa 0029-599X/81/0037/0235/$04.20

Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numer. Math. 37, 235-255 (1981) Numerische Mathemafik �9 Springer-VerIag 1981

Numerical Treatment of Delay Differential Equations by Hermite Interpolation

H.J. Oberle and H.J. Pesch

Institut Rir Mathematik der Technischen Universit~t Mi.inchen, Arcisstr. 21, D-8000 M~inchen 2, Germany (Fed Rep.)

Summary. A class of numerical methods for the treatment of delay differen- tial equations is developed. These methods are based on the weltknown Runge-Kutta-Fehlberg methods. The retarded argument is approximated by an appropriate multipoint Hermite Interpolation. The inherent jump discontinuities in the various derivatives of the solution are considered automatically.

Problems with piecewise continuous right-hand side and initial function are treated too. Real-life problems are used for the numerical test and a comparison with other methods published in literature.

Subject Classifications: AMS(MOS): 65L05, 65Q05; CR: 5.17

1. Introduction

In recent years there has been a growing interest in the numerical treatment of delay differential equations. This is due to the versatility of such equations in the mathematical modeling of processes in various application fields, where they provide the best and sometimes the only realistic simulation of observed phenomena. In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation of the right-hand side of the differential equation

y'(x) = f ( x , y(x), y(x - ~)), x > x o (1.1)

an approximation of the retarded argument y ( x - c 0 is used. Secondly, the in- tegration routine has to pay attention to the jump discontinuities 1 of the so- lution in various derivatives, which are inherent for delay differential equations.

x In this paper the name ' jump discontinuities' is used for the values of the abszissa

0029-599X/81/0037/0235/$04.20

Page 2: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

236 H.J. Oberte and H.J. Pesch

Using stepsize control mechanisms, the retarded argument y(x-c~) in gener- al does not occur in the ' train' of integration points (x i,yi), i=O, 1 .. . . already computed. Two different procedures are conceivable for an approximation of the retarded argument. The first one is a repeated integration of the differential equations up to the abszissa x-c~. This idea leads to the method of steps due to Bellman [1], Bellman, Buell, Kalaba [2], Bellman, Cooke [3]. This method has the advantage of low storage place requirements; on the other hand the number of differential equations which have to be handled increases drastically with the length of the integration interval.

Due to the disadvantage of the method of steps a direct approximation of the retarded argument from the integration points seems to be more favour- able. First investigations have been made by Feldstein [12] for the method of Euler. Stetter [24] suggests the use of Hermite interpolation for the approxi- mation of the retarded argument. Algorithms based on fourth-order Runge- Kutta methods and two-point Hermite interpolation are presented by Neves [18, 19] and Oppelstrup [21].

In this paper we present methods for the numerical solution of retarded initial value problems which are based on Runge-Kutta-Fehlberg methods and Hermite interpolation of appropriate order for the approximation of the re- tarded arguments. The methods avoid the disadvantage of the method of steps, because the number of differential equations to be integrated remains inde- pendent of the integration interval. The methods are restricted to the case of one constant retardation. This restriction enables an efficient handling of the storage place. Contrary to [19, 21] we use multipoint Hermite interpolation. The order of interpolation is adapted to the order of consistency of the in- tegration method. This enables the use of high-order integration methods, and, thus, the numerical integration of retarded differential equations with high pre- cision.

Special attention is paid to an automatic consideration of the jump discon- tinmties. In addition, the algorithms allow the treatment of problems with piecewise continuous right-hand sides or piecewise continuous initial functions.

In this paper we treat jump-discontinuities ~ of the right-hand side f (x,y, z) with respect to the variable x. However, this technique can be extended easily to jump-discontinuities depending on the second or third argument. For those problems one may use a so-called switching function technique, i_e. the (pri- mary) jump-discontinuity ~ is determined as root of a switching function S(x,y(x), y(x-c~)), for example by use of Newton's method. This technique is well-known in the numerical treatment of optimal control problems (comp. Bulirsch [5]).

Two selected methods called R K F R 4 and RKFR7 of order four and seven, respectively, are tested with respect to reliability, fastness and precision. The numerical results are discussed for four real-life problems. Finally, these meth- ods are compared with other methods published in literature.

The experiments were run on the CYBER 175 computer of the Leibniz- Rechenzentrum der Bayerischen Akademie der Wissenschaften in F O R T R A N single precision witl~ a 48 bit mantissa.

Page 3: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of DeIay Differential Equations 237

2. Description of the Problem

We consider initial value problems for retarded differential equat ions (RDEs) of the form

y ' (x )=f (x ,y (x ) ,y (x -~) ) , x>=x o

Y(Xo) = Yo (2.1)

y(x)=q~(x), X o - ~ < x <x o.

y(x) is an n-vector-valued function, c~>0 is a constant delay (retardation), and qo(x) is the initial function, which is assumed to be piecewise cont inuous on the interval xo -a<-x<-x o. The case ~0(xo)+y o is included.

A solution of (2.1) is a piecewise differentiable function y(x) defined on the interval xo-c~<x<-xs (x I>xo) which is cont inuous for all x > x o and satisfies the differential equat ions (2.1). The R D E s are satisfied merely in the sense of left- and r ight-hand limit at x o + c~ and at ~ + c< where { is a j u m p point of ~0.

In analogy to ordinary initial value problems the (local) existence and un- iqueness of a solution is guaranteed, provided that f (x ,y , z ) is cont inuous and (locally) Lipschitzian with respect to the a rguments y and z (comp. Bellman, Cooke [4], Driver [7]). However , the smoothness of f and ~0 does not imply the smoothness of the solution, even if q0(Xo)=y o holds.

Lemma 2.1. Let the functions f (x ,y , z ) and (o(x) be analytic with respect to all arguments, and let y(x) denote a solution of (2.1) defined on an interval Dy. Then the following properties hold:

(i) I f qo(xo)4=Yo and xi:=xo +io:ED ~. ( iGN), then y(x) has ( i - 1 ) continuous derivatives at x~, and, in general, y{i)(x) has a jump discontinuity at x~.

(ii) I f ~o(xo)=y o and xi :=Xo+i~EDy ( i eN) , then y(x) has i continuous derivatives at x~, and, in general, y"+ :)(x) has a jump discontinuity at x~.

In many examples the assumptions of Lemma 2.1 are not valid, because the Junctions f and qo are merely piecewise analytic with respect to the independent variable x. In analogy to Lemma 2.1 the jump discontinuities can be described as follows.

Lemma 2.2. (i) I f ~ is a jump discontinuity oleo(x), then y(x) is of the class C i - i at ~i: = ~ + is, but, in general, y(x) is not of the class C i at {i (i = 1,2 . . . . ).

(ii) I f ~ is a jump discontinuity o f f (x , y, z}, i.e. for sufficiently small g > 0 :

f (x ,y , z ) : ~ f l ( x ' y ' z ) ' ( - e < x < { =~fz(x ,y ,z) ,~ <x <~ +e

holds, where f l and f2 are analytic on [ ~ - e , { ] x l R 2" and [ { , { + e ] • 2", respectively, then y(x) is of the class C ~ at {i .'= { +ic~, but, in general, y(x) is not of the class C i+l at {~( i=0 ,1 ,2 . . . . ).

The jump discontinuities x~=xo + iC~ caused by the initial point x o are called primary d~scontinuities. The jump discontinuities {~={+ic~ caused by discon- tinuities of ~0 or f are called secondary discontinuities.

Page 4: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

238 H.J . O b e r l e a n d H.J. Pesch

One may develop one-step methods for retarded initial value problems (RIVPs) by combining one-step methods for ordinary initial value problems (OIVPs) and approximation formulae for the retarded argument.

Let u. + 1 = u. + h ~ ( x . , u. ; h; g)

X,,+ 1 = x n + h

denote a one-step method for the OIVP

u'(x) = g(x, u(x))

and let U(Xo) -~- u o

] q~(x - ~),

z(x)--]yo, (y,), (y3),

X < X I : = X o q- 0~

X ~ X 1

x ' ~ x I

(2.2)

(2.3)

(2.4)

0(x, y; z ;h) := ~(x, y; h; f (x, y, z(x))) (2.5)

we define the following one-step method for the RIVP

Y,+ 1 = Y. + h O(x,, y. ; z(x); h)

x,+ 1 = x , + h (2.6)

Y'.+ 1 = f ( x . + i, Y.+ 1 , Z(Xn+ 1))"

In (2.6) we assume that the approximation formula z(x) is smooth during one integration step. Thus, the set of the support points can only be changed from one step to the next one.

In order to preserve the global order of the method (2.2), the order of in- terpolation in (2.4) has to be suitably adapted to the order of consistency of (comp. [18, 21]).

Lemma 2.3. Let p > 1 denote the order of consistency of the method g), let f and q) be sufficiently differentiable, and let O(x,y; z; h) be Lipschitzian with respect to y and z. Then, the one-step method (2.6) has the global order of convergence: rain {p, q}.

Proof The proof of this Lemma is similar to the proof of the convergence theorem given in [21]. Let y(x) denote the solution of the RIVP (2.1). From y(x,+ O= y(x,)+hA and

1 xn+h

d : = ~ ~ f (~ ,y ( ( ) , y (~-a) )d~ Xn

denote an approximation for the retarded argument y(x-c~), where Pq(x;(yi), (Y'i)) denotes the Hermite interpolation polynomial of the degree q(odd) due to an appropriate set of support points (xi, y~,y'~).

With the abbreviation

Page 5: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 239

one obtains the following recurrence formula for the global discretization error e . ; = y ( x . ) - y. ,

e. + 1 = e. + h { 0 (x., y. ; Pq(x - c~; (y,), (y'/)); h) - A }.

By adding and substract ing the terms

~,(x., y~ ~ ( x - c,; (y(x~)), (y'(x,))); h),

tp(x., y. ; y(x --c0; h),

tp(x., y(x.); y(x - c0; h).

one obtains an es t imat ion of the form

lie.+ ~ 11 < (1 + hK) max ([le~H)+ L. h mi"~v'ql+ 1 i < n

In analogy to the case of OIVPs this inequality implies

Ile.Jl=O(hS), s=min{p,q}. []

L e m m a 2.3 yields a lower bound for the interpolat ion order to be used for a me thod of the order p.

3. Description of the Numerical Method

In this section we describe a class of one-step methods for the solution of R IVPs of the type (2.6). The basic one-step methods used are the Runge-Kut - ta -Fehlberg methods with stepsize control (see Fehlberg [10, 11]). The retarded a rgument is app rox ima ted by Hermi te interpolation. To illustrate the class of integrators we give a brief descript ion of the R K F - m e t h o d of order seven found in [-9, 10].

3.1. The Integrator RKF7

For the numerical solution of O I V P s

y'(x) =f(x , y(x)) (3.1)

Y(Xo) = Yo

two imbedded R u n g e - K u t t a methods of order seven and eight, respectively, are coupled:

Ym+I=Y,, +h L ciki i=1

)3 , ,+ l=Y, ,+h ~ ciki, i=1

(3.2)

Page 6: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

240 H.J. Ober le and H.J. Pesch

where s = 1 1, g = 1 3, and k i denote the increment functions

k l = f ( x m , Y,.) (3.3)

i - 1 )

k i = f x , , + ~ h , y , , + h ~ ~ i j k i . j = l

The coefficients c~i, f lu, ci and ci can be found in [9]. For the control of the stepsize the following est imat ion of the local error

per unit step is used:

EST = [133,.+ 1 --Y,.+ 1 ]l 0o _ 41 h 840 N(kl - -k12)+(k l 1 - k13)t[ ~" (3.4)

Due to the prescribed tolerance T O L for the m a x i m u m norm of the absolute error estimate, we obtain the following a lgor i thm for the stepsize control (see Enright et at. [8]):

given m, xm, h, y, , , T O L

start : compute Ym + ~ ; 33,, + ~ ; Xm + 1 : = Xm + h ;

= h 1133m+ 1 --Ym+ 1]I oo ; EST:

{TOL ~"71 } ;

/f EST < T O L then m: = m + 1 ;

h . - = f a c t o r . h ;

go to start ;

The es t imat ion of the local error (3.4) is useless for quadra tu re problems, i.e. f ( x , y ) = f ( x ) , because in this case the two imbedded R K - f o r m u l a s are identical quadra tu re formulas of order eight.

In order to avoid the uncontrol led increase of the stepsize we pick up an idea of Shampine [23] and replace the R K - f o r m u l a for 33,.+ 1 by a quadra tu re formula of order seven using the nodes %., i = 1, 2, 3, 5, 7, 9 and 1 1.

We obtain the following es t imat ion of the local error :

167 b 9034497 k 2 _ l _ 2 5 2 9 6 3 k 3 E S T = I I - ~6-0-6 '- ~ 84952000 _~_ 82 27 84 13389

2492875 k s - ~ - ~ s k 6 466375 k 7 - 9 k 8 (3.5) t- 1193 /z 9 [i -.t- 2143

3.2. Spec i f i ca t ion o f the In tegra t ion Subin tervals

The control of the stepsize as described in Sect. 3.1 requires that the local error of the methods depends on the stepsize by fixed order. This assumpt ion is satisfied only if the solution is sufficiently smooth in x m < = x < x m + h . In the numerical solut ion of R I V P s the inherent j u m p discontinuities must be check- points of the numerical integration.

Page 7: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 241

Using a RKF-method of order p the jumps of the derivatives y~J) have to be considered up to a maximum order jp(j= 1 . . . . ,jp) given as jp=p +2.

If we use Hermite interpolation for the approximation of the retarded argu- ment due to ip support points, the requirement for smooth interpolation yields an eventually larger value of jp namely 2 ip+ l (cf. Sect. 3.3). This value is in- creased by 1 to provide enough support points for an eventually following discontinuous re- entry in the subroutine. However, this last checkpoint is not a restriction point for the interpolation.

In summary we have

jp : = max {p + 2, 2ip + 2}. (3.6)

The primary jump discontinuities occur at points in the set

So := {x)=x o + ic~lj= t . . . . ,jp}. (3.7)

For simplicity we do not distinguish the cases ~0(x0)=y o and ~O(Xo)+y o. At the beginning of the integration the set of the primary checkpoints is determined.

Secondary jump discontinuities are induced by jump points o f f and q~. If q is a jump point of ~p, then, in general, f(x,y(x),q~(x-~)) is discontinuous at ~ : = q + ~ . Thus, jump points of q~ can be handled as jump discontinuities o f f

at ~ =tt +c~. Let ~ be a jump point of f (cf. Lemma 2.2). Then the set of secondary jump

discontinuities induced by ~ is given by

S~:= {~j = ~ +j~lj = 1,... , j p - 1}. (3.8)

For the numerical treatment of such problems with merely piecewise con- tinuous data the user has to check the integration at ~ and then continue the integration using the new right-hand side or the new initial function, respec- tively. After the re-entry the additional checkpoints are computed and inserted into the previous set of checkpoints.

3.3. Approximation of the Retarded Argument

For the approximation of the retarded argument y ( x - ~ ) at x > x l : = x 0 + c~ it is natural to use Hermite interpolation, because the derivatives at the integration points are known.

The interpolation order and thereby the number of support points have to be adapted to the order of the method as established in Lemma 2.3. If p de- notes the order of consistency of the RKF-method, the interpolation order q must be greater than p. Let ip denote the number of support points for the Hermite interpolation. Then the following inequality must hold

2 i v >= p. (3.9)

The numerical solution of many problems using variable ip shows, that, in general, the choice of a minimal number of nodes is not optimal with respect to the computing time needed and the precision of the numerical solutions obtained. Larger values for ip yield more accurate results, but the expense in-

Page 8: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

242 H.J. Oberle and H.J. Pesch

creases, too, in spite of fewer integration steps. Simultaneously, the stepsize control becomes more reliable, and this reduces the number of nonsuccessful integration steps expressed as percentage of the total number of steps, In Table 1 the optimal numbers of interpolation nodes ip for R K F R 4 and R K F R 7 based on numerical experiments are listed. In addition, the corresponding val- ues jv for the maximal order of the jump discontinuities according to (3.6) are given.

Table 1, Number of interpolation nodes ip and maximal order of jump discontinuities for RKF-methods of order p(p + 1) p(p+l) i )~

40) 3 8 7(8) 5 12

For the numerical evaluation of the interpolating polynomial Pq(x) the use of Newton's divided differences for coinciding nodes (cf. Bulirsch, Rutishauser [6]) is advantageous, because, in general, Pq(x) must be evaluated at many neighbouring points.

Let x~_~<x_~+~ < . . . < x ~ (3.10)

be the set of nodes for the Hermite interpolation at x , x : = x - ~ , x : actual in- tegration abscissa, where

K: = ip - 1. (3.11)

The values of the function and the derivative are denoted by y, and Y'i, re- spectively. Then Pq(~): = P~v(ff) is evaluated by

P~v(X) = [y~] + ( i f - x~) [Yv, Yv] +

-1- ( '~-- Xv) 2 [f ly- , , Y~, Yv] + .. . + (3.12)

+ ( x - - x v - , , ) ~I ( X - - x j ) 2 [Y . . . . Y . . . . . . . . Y~,Y~], j = v - K + l

where the divided differences are computed recursively as follows:

[YJ]: = YJ ; [Y J, Yi]: = Y}, j = v - K . . . . , v

[ Y J , , , YJ~- ,] - [Yh, . . . . Y J J , [yj,, y ~ j : - (3.13) Xjl -- Xjm

V-- K.<jl <j , , ,< V.

The backward numeration in (3.12) has the advantage that only the last as- cending diagonal row of the divided difference tableau has to be stored.

3.4. Spec i f ica t ion o f the In terpola t ion N o d e s

In this section we describe the rules for the specification of an appropriate set of interpolation nodes

x~_ , ,<x~_ , ,+ 1 < "" <x~, (3.14)

where K : = i ~ - I .

Page 9: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 243

The nodes are fixed by determining an appropria te index v. This is done for every evaluation of the r ight-hand side. The use of a fixed set of nodes for an entire integration step is not recommended for the following reason. In case of ' smal l ' stepsizes near x, ,-c~ and ' la rge ' stepsizes near xm this would lead to an extrapolat ion by the evaluation of Pq(x- c0, x,, < x < x,, + h.

This extrapolat ion can be avoided only if certain interior nodes are omitted. This, however, would lead to serious organizational difficulties.

On the other hand, the algori thm has to take care of the validity of the convergence Lemma 2.3, that is, the interpolation nodes must remain un- changed during an integration step, if the stepsize is sufficiently small.

The numerous determinations of interpolation nodes require an efficient method for the fixation of the index v. The following two requirements must be satisfied:

1. The interior nodes xv_~+ I . . . . . xv_ 1 must not be j u m p discontinuities (in the sense of Sect. 3.2).

2. Extrapolat ion must be avoided, i.e. x ~ _ K < ~ < x ~. Addit ional ly a third (weak) requirement is regarded, if it does not contradict the above (strong) requirements:

3. The variable )~ should be close to the center of the interpolation interval [x . . . . x~], i.e.

x r < Y~ < x r + I, (3.15)

where v' is defined by

v '= v'(v):= v - K + [2 ] . (3.16)

The rules 1 and 2 can be satisfied only if certain additional restrictions on the stepsize are made. In subintervals ~ < x < ~ + l , where ~ and ~i+1 are neigh- bouring jump discontinuities, the stepsize has to be limited by

HMAX~t) = 1 ( ~ +1 - ~i). ( 3 . 1 7 ) K

In addition, the rule 2 forces a limitation of the stepsize in the interval ~max<X <X I, where ~ma• denotes the maximal j ump discontinuity. This bound is given by

HMAXt/~ = c~. (3.18)

Algor i thm for the determinat ion of v:

1. In the interval [Xo,Xo+C~ ] the retarded argument is determined by the initial function r At x = x o + c~ we define v: = 0. For further evaluations of f one has to proceed by item 2.

2. The following variables are given:

x: actual abscissa, ff = x - c~, ~i, ~i+ 1 : neighbouring jump discontinuities,

If ~ i=~ . . . . define: ~i+ 1 : = x y .

Page 10: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

244 H.J. Oberle and H.J. Pesch

h 0.8-

0.6

0.4

V 0 0 10

6

IX 20

Fig. 1. Stepsize h, versus abszissa x,

v: interpolat ion index due to the last function evaluat ion m: index of the actual integrat ion step, x m < x __< xm + h.

Then the new interpolat ion index v is defined by:

while xv_~<~i do v . ' = v + l ; while (xv, + 1 <= ~ and v < m and x~ + 1 < ~i+ 1) do v: = v + 1.

Here v '=v ' (v) is given by (3.16). Figure 1 shows typical examples of stepsize sequences chosen by the code

R K F R 7 . The stepsizes h i are plot ted versus the abszissa x i and these points are linearly connected. Figure 1 cor responds to Example 4.2. One recognizes the reduct ion of the stepsizes due to the severe peaks of the solution t ra jectory (cf. Fig. 3) and the l imitat ion of the stepsizes in the first eleven subintervals [( i-- 1) ~, i~], i = 1 . . . . . 11, which is more active for lower precision requirements. This somet imes causes a nonpropor t iona l behavior of the actual error versus the tolerance required.

3.5. Simpli f ied F lowchar t o f the A lgor i thm

The following simplified f lowchart summar izes the elements of the a lgor i thm as described in the Sects. 3.t-3.4. For simplicity the following items are not conta ined

(i) Rep lacement of left-hand derivative by r ight-hand derivat ive of the solution at j u m p points.

Page 11: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations

(ii) Re-entry in the subroutine. (iii) Complete description of the termination. For these omitted parts we refer to [20].

245

m=0, x~,,y,,,TOL, H, xy Specification of the jump dis- continuities ~ 1, ---, ~jp INT.'= 1

no

no

Specification of the subintervals XEN D=J 'x l , if INT>jp or ~INT>X f

"I[.~INT, else

t /

Computation of the k i. 1 Computation of: y,,+ 1, EST, factor

I H = factor* H

I ( E S T = < T O L ~

l yes

Rearrangement of the storage, if necessary. m . ' = m + l If (H > (XEND - x,,)):

H: = XEND - x m.

I no / x, __XEND 5 \

yes

I N T : = I N T + I I

I ~ X E N D = x ; ~

i Yes

Evaluation of the right-hand side f ( x , y, z), where x,,< x < x,, + H, y = y(y,., k,, H),

'rp(x-c~), if X<Xo+C~ Z=(Pq(x-c0, if x > x o + ~ .

1 Computation of z = Pq(x - a) (i) Specification of the inter-

polation nodes (ii) Computation of the divided

difference tableau (iii) Evaluation of Pq(x -c~)

Page 12: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

246 HJ. Oberle and H.J. Pesch

4. Numerical Examples

The reliability, precision and speed of the integration routines RKFR4 and RKFR7 are demonstrated by the numerical treatment of four examples from real-life applications.

The results for the test problems are given in tables, where the following abbreviations are used:

TOL tolerance for the maximum norm of the absolute error estimate. NFC number of evaluations of the right-hand side. TIME total computing time in seconds to solve the RIVP by the computer

CYBER 175. (accuracy of measurement: 10 p.c.)

ERR maximum relative error of the solution components at the final in- tegration point x s.

For the calculation of ERR the knowledge of the exact solution is necessary. Since an analytical expression for the solution is not known, the exact solution is approximated by a so-called reference solution which is obtained by numeri- cal integration of the RIVP with high precision ( T O L = 1 0 -12) and by use of both integration routines. Both results are compared and only the coincident leading digits are accepted as valid. Note that the coincidence of leading digits of results which are obtained by use of merely one integration routine and different tolerances does not in general provide an argument for the validity of such digits. This is because small values of the delay affect the stepsizes according to (3.17) and (3.18). Thus, the control of the stepsizes may be nearly independent of TOL, especially for high-order methods, small delays, and low precision requirements.

Example 4.1. Following Minorsky [17] and Pinney [22] the propagation of a delayed impulse in an electric circuit can be described by the following RIVP. (I(t): intensity of current):

I'(t) = --a 1 [ ( t ) - a z [ ( t - ~ ) - a 3 I ( t ) + b ( [ ( t - ~ ) ) 3, t>O

I(0)=0.5 (4.1)

[(t)=2r~cos(2Orct), -c~<_t<O.

where: a 1 = 10, a 2 =25, a 3 = 100, b =0.05, c~ = 0.1.

After a short transient period the solution describes an almost periodic oscil- lation with nearly constant amplitude, see Figure 2.

Reference solution: (t I = 10)

I ( t l ) = - 0 . 5 7 3 5 8 4156410~

[(t l )= 0.11195 59210101.

The results for the numerical integration are given in the Table 2.

Page 13: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 247

i 5

~ I -0.6

Fig. 2. Solution I(t) of Example 4.1

Table 2. Numerical results for example 4.1

TOL RKFR4 RKFR7

ERR NFC TIME ERR NFC TIME

10 -4 5.1o_4 7473 0.49 2.1o_~ 3219 0.19 10 -6 3.io 6 20698 1.35 3. lo , 7863 0.49 10 -8 2.1o_~ 60727 3.90 3.1o_9 13495 0.82 10 -1~ 5.20 ~o 367569 23.36 9.1o ~o 33224 2.00

The computing time for the method RKFR4 is significantly higher than for the method RKFR7 and becomes intolerable if more stringent tolerances are pre- scribed. The method RKFR7 loses accuracy if lower tolerances are required.

Example 4.2. The second example has been extensively studied in in the litera- ture (see e.g. Wright [26, 27], Kakutani, Markus [15] and Jones [14]).

Fig. 3. Solutions y(x) of Example 4.2

Page 14: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

248 H.J. Oberle and H.J. Pesch

y ' ( x ) = - ;~ y ( x - 1) (1 + y ( x ) ) ,

y(x)=x, - l < x _ < 0 .

x>_0 (4.2)

Figure 3 shows the solutions for the parameters 2: = 1.5, "~2 =2, ) ~ 3 = 2 . 5 , and 24 = 3 in the integration interval O<_x<<_xf= 20. The numerical sensitivity of the problem increases with increasing values of the parameter 2 due to the periodic peaks in the solution. Hence one might expect a loss of accuracy. Table 3 shows the numerical results for x f = 20 and 2 = 24.

Table 3. Numerical results for Example 4.2

T O L R K F R 4 R K F R 7

E R R N F C T I M E E R R N F C T I M E

10 -4 2.1o , 1000 0.05 1.:0_3 1268 0.06 10 -6 2-10- 2 2632 0.14 1.: 0- 3 1726 0.09 10 -8 4.1o_, 7661 0.39 7.1o-~ 2655 0.14 10- : 0 2.1o_ ~ 23544 1.20 6.1o- ~ 4372 0.22

Reference solution: y(xf)=0.46714 3:o~. The error behavior in dependence on xf shows oscillations with increasing

values of the extremas. Therefore in this example as well as in example 4.1 the final point xf is chosen such that the error at x I is representative of the maxi- mum error in the entire interval [0,xf] .

Example 4.3. The following example describes a model of chronic granulocytic leukemia due to Wheldon et al. [,25], see also MacDonald [,16].

Let G,,(t) and G~(t), respectively, denote the marrow and the total granulo- cytic numbers (in cells per kilogram body weight). The following RDEs de- scribe the model

dG~ ~ 2G~(t)

dt I +/~[,G,,(t- :)] ~ 1 + #[-G~(t)] ~

dGB_ )~G,,(t) wGs(t). dt 1 +/t[,Gs(t)] ~

(4.3)

Parameters: ~z=l.llolo cells k g - : d - I , f l = l . l o ~2 cells-Vkg ~, 7=1.25, 6=1 , 2 = 10d- :, # = 4.: 0- 8 cells -~ kg ~, w = 2.43 d - i, z = 7d, 20d. z denotes the matur- ing time of the granulocytes in the marrow.

Wheldon et al. relate the increasing period in G m in case of a chronic granulocytic leukemia to a change in the maturing time of the cells ( z=7d : normal maturing time; z = 2 0 d : case of disease).

For the numerical treatment of (4.3) the data are scaled according to yl(t): = t0 - t ~ G,,(t), y2(t):-- 10 -9 GB(t ). The R D E has the steady-state solution: y1-1-0576 70270, y2-1 .0307 13491. The initial functions are given by y:(t)= 1/3 y: , y2(t)= 1/3 Y2, - z -< t_< 0.

Page 15: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 249

Figure 4 shows the time history of G m for z = 7 d and r = 2 0 d .

Gm

6.i0 ~o

5.101o

4.10 ~~

3. lOi~

2.10 ~o

I. 101o

0

T=20d

t [d] 50 100

Fig. 4. Solution G,,(t) of Example 4.3

The numerical results for r = 20 d can be gathered from the Table 4.

Table 4. Numerical results for example 4.3

T O L R K F R 4 R K F R 7

ERR N F C T I M E E R R N F C T I M E

10 4 2.1o_~ 1454 0.12 1.~0 , 2500 0.19 10 -~' 4.~o-7 3913 0.30 2.Io , 3370 0.25 10 - s 4.1o-9 11500 0.91 2.1o ~ 6242 0.48 10-- ~o F F F 3.io.,~ 11624 0.88

The failure of R K F R 4 for T = 2 0 d and T O L = 1 0 -1~ is caused by the limited storage for 1000 support points. Reference solutions (z = 20d):

y1(ts)=0.94908 59882 291o_1, y2(ty)=0.30820 19175 311oo.

E x a m p l e 4.4. This example is concerned with a model for the spread of an infection, see Hoppensteadt, Wal tman [13].

Let S(t ) and I(t) , respectively, denote the number of susceptibles and in- fectives. The model is described by the following RIVP:

S(t)= S(t) [Io(t)+So-eUS(t)], to <t<=to+~ (4.4)

S(t ) e u [S( t - a) - S(t)], t o + a <= t

1 s(t) xtt) . . . .

r S( t )

S(O) = So,

Page 16: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

250

where

H.J. Oberle and H.J. P e s c h

1 2 So=10 , c r = l , t o = l - 2 ] / 2 ,

r=0.2, 0.3, 0.4, 0.5, p=0.1 .r,

_ ~ 0 . 4 ( 1 - t), 0_<t_<l I o ( t ) - [ 0 , t > 1.

The R I V P conta ins three j u m p d i scont inu i t i e s of the r ight -hand side at t o, cr and t o + o.

Figures 5 and 6 s h o w the s o l u t i o n s S(t) and I(t) in 0 < t < t~ = 10.

S 10

8

6

4

2

0 0

~ r = Ct2

[ i t 5 ~0

Fig. 5. Solution S(t) of Example 4.4

8 / /~= 0.5

6 / / ~-0"40. 3

4 / / / / / \ r=0.2

0 , , 5

Fig. 6. Solution I(t) of Example 4.4

Reference solutions for r = 0.5 : S ( t y ) = 0.63020 898691 o-,

i t ~0

Page 17: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations

Table 5. Numerical results for Example 4.4 (r=0.5)

251

TOL RKFR4 RKFR7

ERR NFC TIME ERR NFC TIME

10 r 1.~o ~ 360 0.02 1.10 6 1148 0.06 10 - 6 2.1o ~ 646 0.04 6.1o ~ 1198 0.06 10-8 5.1o 8 1484 0.08 2. io 9 1288 0.06 10-10 1.10 ~ 4004 0.21 1.10-,o 1558 0.08

5. A Comparison with Other Methods

In this section the proposed methods R K F R 4 and R K F R 7 are compared with two other methods for the numerical t rea tment of RIVPs with respect to pre- cision and speed.

These methods are:

1. The rout ine D M R O D E 1-18, 19]. This method is based on a fourth order Runge -Ku t t a -Merson algori thm and uses either a two-point Hermite in terpola t ion or a one-point fourth order in terpola t ion for the approx imat ion of the retarded arguments. The method D M R O D E allows the integrat ion of more general prob- lems, i,e. the t rea tment of RIVPs with variable and multiple delays.

2. The routines B E L L M A N 4 and BELLMANT. These procedures are based on the method of steps [1], [2], [3] and use the Runga -Ku t t a -Feh lbe rg methods R K F 4 and R K F 7 [8].

The compet ing routines are compared for the Examples 4.1 and 4.2.

5.1. Comparison for Example 4.1

The results of the five routines are given in Table 6 (for BELLMA N 4, B E L L M A N 7 and D M R O D E ) and in Table 2 (for R K F R 4 and R K F R 7 ) :

Table 6. Comparison for Example 4.1

TOL BELLMAN4 BELLMAN7 DMRODE

ERR NFC TIME ERR NFC TIME ERR NFC TIME

10 .4 2.1o_~ 14273 6.33 6. to ~ 8373 4.36 3.1o_, 37379 2.96 10 -o 6.1o_~ 42486 18.98 2.~o ~ 16647 8.70 5.1o 6 111296 8.81 10 -8 1.1o_, 132061 58.99 4.1o_7 28392 14.83 F F F t0 - l~ 2.1o_~ 415697 186.09 4.1o ~ 50413 26.39 F F F

The failure of the rout ine D M R O D E at higher precision levels is caused by the limited storage capacity of 50,000 r e a l , 4 numbers . The choice of the value for the min ima l stepsize as recommended by Neves avoids this fail exit, but leads to a loss of accuracy. The choice of lower values for the min imal stepsize partly improves the accuracy of the numerica l solut ion; on the other hand it may lead to a lack of storage place.

Page 18: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

252 H.J+ Oberte and H.J. Pesch

1. Precision. The precision of the numerical results differs for the five tested integrators, as shown in Fig. 7.

ERR 10-Io

lo-8

10-6

10 -z.

10 -2

~o-~ lo-6 to-8 Fig. 7. Comparison with respect to the relative precision

- \

- =~..~,~, \?=

1 1 1 I

10-~o TOL

t RKFR 7

�9 RKFR4

�9 Bellman 7

r~ Bellman 4+

o DMRODE

For low precision requirement RKFR7 loses accuracy compared with the other methods. For more stringent tolerances the methods of steps are ex- cessively inaccurate; it may be that round-off errors caused by the large num- ber of integration steps performed play a role. Only the methods RKFR4 and RKFR7 hold the accuracy with tolerable storage place requirements.

2. Speed. Figure 8 shows the total computing time versus the actual error

6O

50

~O U3

30 E

~- 20

10

X• Bellman/.,

/ 4

Ilman 7 m

] + + 1 J _ 1 0 ~ O 10 -2 10 -4 10 -6 10 La ERR

Fig. 8. Compar ison with respect to the computing time

K FR/-,

RKFR7

i 1 ii. 10 -2 10 -4 10 -6 10 !-8 101-10 ERR

The computing times of D M R O D E for T O L = 10 - 4 and 10 - 6 nearly coincide with those of BELLMAN7. Despite the large number of oscillations occurring in the solution, the amount of computation for R K F R 4 and RKFR7 remains tolerable.

Page 19: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 253

5.2. Comparison for Example 4.2

Table 7 shows the results for the me thods D M R O D E , B E L L M A N 4 and B E L L M A N 7 . The results for the methods R K F R 4 and R K F R 7 can be gath- ered from Table 3.

Table 7. Comparison for Example 4.2

TOL BELLMAN4 BELLMAN7 DMRODE

ERR NFC TIME ERR NFC TIME ERR NFC TIME

10 -4 7.1o ~ 3166 0.21 3.10 2 3031 0.22 1.2o-, 4880 0.18 10 -6 2.1o 3 8399 0.56 2.~o ~ 4858 0.34 4.2o-3 14173 0.53 10 -8 6.io_~ 25842 1.73 4.1o ~ 6945 0.48 1.1o_, 43880 1.65 10 -1~ 2.to_6 80913 5.42 9.1o_, 12603 0.89 5.2o_, 132664 5.02

I. Precision. Concern ing the accuracy of the numer ica l results all five compet - ing rout ines are app rox ima te ly comparab le .

2. Speed. The a m o u n t of c o m p u t a t i o n is shown in Fig. 9. The compu t ing t imes for B E L L M A N 4 and D M R O D E are cons iderab ly to large c o m p a r e d with the comput ing t imes for the o ther methods . F o r more s t r ingent to lerances R K F R 7 is the fasted method , whereas for lower precis ion requi rement R K F R 4 is the fastest routine.

E F- -

DMRODE l Bellmon4

1.0

0.5 I---

- RKFR4

I I I I I

10 -2 10 -4 10 -6 t0 -8 10 -10 ERR

Fig. 9. Comparison with respect to the computing time

RKFR4

Bellmon7

y RKFR7

I I 1 I

10-2 10-~ 10-6 10-8 10 I-1~ ERR

Because the compu t ing t ime grows quadra t i ca l ly with the final in tegra t ion po in t xj., an impor t an t d i sadvan tage of the me thods of steps is given by the fact tha t a severe behav iour of the so lu t ion in some subin terva l (peaks) l imits the stepsizes for the ent ire fur ther integrat ion.

Page 20: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

254 H.J. Oberle and H.J. Pesch

6. Conclus ion

R u n g e - K u t t a m e t h o d s a n d H e r m i t e i n t e r p o l a t i o n o f a p p r o p r i a t e o r d e r a re

c o m b i n e d for the n u m e r i c a l s o l u t i o n o f r e t a r d e d ini t ia l va lue p r o b l e m s wi th o n e c o n s t a n t delay. T w o such m e t h o d s o f respec t ive o rde r s four and seven have been s h o w n to p r o v i d e rel iable, prec ise and fast i n t e g r a t i o n me thods . T h e g e n e r a l i z a t i o n to mul t ip le , t i m e - d e p e n d e n t and s t a t e - d e p e n d e n t de lays will be the a i m of a la te r work.

Acknowledgement. The authors wish to thank Professor Donald R. Smith for his careful reading of the manuscript.

References

1. Bellman, R.: On the Computational Solution of Differential-Difference Equations. J. Math. Anal. and Appl. 2, 108-110 (1961)

2. Bellman, R., Buell, J., Kalaba, R.: Numerical Integration of a Differential-Difference Equation with a Decreasing Time-Lag. Comm. ACM 8, 227-228 (1965)

3. Bellman, R., Cooke, K.L.: On the Computational Solution of a Class of Functional Differential Equations. J. Math. Anal. Appl. 12, 495-500 (1965)

4. Bellman, R., Cooke, K.L.: Differential-Difference Equations. New York-London: Academic Press 1963

5. Bulirsch, R.: Die Mehrzielmethode zur numerischen L6sung vot~ nichtIinearen Randwertpro- b[emen und Aufgaben der optimaten Steuerung Report der Carl-Cranz-Gesetlschaft, 1971

6. Bulirsch, R., Rutishauser, H.: Interpolation und gen~iherte Quadratur. In: Sauer, R., Szab6, I., (eds.): Mathematische Hilfsmittel des Ingenieurs. Berlin-Heidelberg-New York: Springer 1968

7. Driver, R.D.: Ordinary and Delay Differential Equations, Applied Mathematical Sciences, VoI. 20 Berlin-Heidelberg-New York: Springer 1977

8. Enright, W.H., Bedet, R., Farkas, I., Hull, T.E.: Test Results on Initial Value Methods for Non- stiff Ordinary Differential Equations. Teeh. Rep. No. 68, Department of Computer Science, University of Toronto (1974)

9. Fehlberg, E.: Classical Fifth-, Sixth-, Seventh- and Eighth-Order Runge-Kutta Formulas with Slepsize Control. NASA Tech. Rep. No. 287, Huntsville (1968)

10. Fehlberg, E.: Klassische Runge-Kutta-Formeln ftinfter und siebenter Ordnung mit Schritt- weitenkontroUe. Computing 4, 93-106 (1969)

11~ Fehlberg, E.: Klassische Runge-Kutta-Formeln vierter und niedrigerer Ordnung mil Schritt- weitenkontrolle und ihre Anwendung auf W~irmeleitungsprobleme. Computing 6, 61-71 (I970)

12. Fe[dstein, M.A.: Discretization Methods for Retarded Ordinary Differential Equations. Uni- versity of California, Los Angeles, Dissertation (1964)

13. Hoppensteadt, F., Waltman, P.: A Problem in the Theory of Epidemics I. Math. Biosciences 9, 71-91 (1970)

14. Jones, G.S.: On the Nonlinear Differential-Difference Equation f'(x)= c~f(x- 1) (1 +f(x)). J. Math. Anal. Appl. 4, 440-469 (1962)

15. Kakutani, S., Markus, L.: On the Nonlinear Difference-Differential Equation y'(t)=(A-By(t -r))y(t). In: Contributions to the Theory of Nonlinear Oscillations. Princeton, New Jersey: Princeton University Press 1-18 (1958)

16. MacDonald, N.: Time Lags in Biological Models. Lecture Notes in Biomathematics, Vol. 27. Berlin-Heidelberg-New York: Springer 1978

17. Minorsky, N.: Nonlinear Oscillations. Princeton, New Jersey: D. van Nostrand 1962 18. Neves, KW.: Automatic Integration of Functional Differential Equations: An Approach.

ACM Trans. Math. Software Vol. 1, No. 4 357-368 (1975) t9. Neves, KW.: Automatic Integration of Functional Differential Equations. Collected Algor-

ithms from ACM, Algorithm 497 (1975)

Page 21: Numerical treatment of delay differential equations by ... · In the numerical treatment of delay differential equations two es- sential difficulties occur. First, for the evaluation

Numerical Treatment of Delay Differential Equations 255

20. Oberle, H.J., Pesch, H.J.: A Seventh-Order-Integration Method for Delay Differential Equa- tions, to be published; for FORTRAN-subroutines it is refered to 'Numerical Treatment of Delay Differential Equations by Hermite Interpolation', TUM-Report Nr. M8001, Technische Universit~it Mtinchen (1980)

2I. Oppelstrup, J.: The RKFHB4 Method for Delay-Differential Equations, In: Butirsch, R., Grigorieff, R.D., Schr6der, J. (eds.): Numerical Treatment of Differential Equations. Proceed- ings of a Conference held at Oberwotfach, 1976, Lecture Notes in Mathematics, Vol. 631, 133- 146. Berlin-Heidelberg-New York: Springer 1978

22. Pinney, E.: Ordinary Differential-Difference Equations. Los Angeles, 1958 23. Shampine, L.F.: Quadrature and Runge-Kutta Formulas. Appl. Math. Comput. 2, 161-171

(1976) 24. Stetter, H.J.: Numerische Li3sung von Differentialgleichungen mit nacheilendem Argument.

ZAMM 45, T 79-80 (1965) 25. Wheldon, T.E., Kirk, J., Finlay, H.M.: Cyclical Granulopoiesis in Chronic Granulocytic

Leukemia: A Simulation Study. Blood 43, 379-387 (1974) 26. Wright, E.M.: A Functional Equation in the Heuristic Theory of Primes. Math. Gaz.

45, 15-16 (1961) 27. Wright, E.M.: A Nonlinear Difference-Differential Equations. J. Reine Angew. Math. 194,

66-87 (1955)

Received February 26, 1980