+ All Categories
Home > Documents > Runge Kutta method for delay-differential systems

Runge Kutta method for delay-differential systems

Date post: 20-Sep-2016
Category:
Upload: gs
View: 215 times
Download: 3 times
Share this document with a friend
5
Runge Kutta method for delay-differential systems G.S. Virk, B.Sc. D.I.C.. Ph.D.. A.M.I.E.E., A.F.I.M.A. Indexing term: Mathematical techniques Abstract: The problem of numerically solving delay-differential equations is considered. The method proposed uses a Runge-Kutta method extended so that it is applicable to our delay case. 1 Introduction The development of the digital computer has been a tre- mendous boost in the study of engineering problems. It has been used in many aspects including design of circuits, controlling systems, performing simulations etc. In this paper we consider its applications to control problems where the solution to a differential equation is required. For example, consider the following nonlinear differential equation: z(t) = h(z(t), t) (1) This may describe the behaviour of the system under study, and so its solution is required if z(t) is to be studied or controlled. Conditions guaranteeing existence and uniqueness of the solution are well known, see for example References 5 and 6. We do not consider these technical details here, but merely assume that h has the necessary properties to ensure that the solutions are well defined. We shall, however, look at the numerical aspects in solving eqn. 1 on a digital computer. Assuming z(t 0 ) is known, we can find the solution at any time t > t 0 by solving (2) z(t) = z{t 0 ) + h(z{s), s) ds i.e. we need to perform integration. A digital machine cannot undertake this task since it only works at instants in time and integration is a continuous operation. However, all is not lost. Although true integration is not possible digitally, approximations to it can be made. Many sophisticated procedures that do this have been constructed; see, for example References 1 and 2. These rely on extending the solution in small steps and approximating z(t) using a Taylor series expansion to a specified number of terms. If z is sufficiently differentiable, we can expand z(t) to get .... (3) Comparing eqns. 2 and 3 we can deduce that h{z(s), s) ds = {t t o )h Jto where ... (4) h = h(z(t 0 ), t 0 ) dh h z = -^(z(t 0 ),t 0 ), etc. (5) Paper 3813D, (C8/C9), first received 11th July 1984 and in revised form 7th Feb- ruary 1985 The author is with the Department of Aeronautics and Astronautics, University of Southampton, Southampton SO9 5NH, United Kingdom To evaluate the integral in this way, partial derivatives of h are required explicitly. This may, in general, be difficult or impossible, since h may be quite complex or not known analytically. A procedure that avoids this successive differ- entiation is the Runge-Kutta method. Here the need for the derivatives is replaced by evaluating h at extra points within the interval (z(t), t) and (z(t 0 ), t 0 ). The accuracy of the integration is governed by how many evaluations are performed. Having decided upon this, the precise locations for evaluating h need to be determined. To do this we form the following: z(t) = z(t o )+ (6) where to,- are weighting functions, r is the number of evalu- ations and (7) k t = (t- t o )hl z(t 0 )•+ £ dijkj, t 0 + Ci (t - t 0 ) c . = 0, i= 1, 2, 3, ...,r After a Taylor series expansion has been applied to eqn. 6, it can be compared with eqn. 3 term by term to obtain the unknown parameters cot, a ip and c, for; = 1, 2, ..., i 1; i = 1, 2,..., r. For r 2 it can easily be shown that OJ2 = =1 c-, = a. (8) Here we have three equations and four unknowns. Thus one can be chosen arbitrarily and the others determined via eqn. 8. Substituting these back into eqn. 6 gives an approximation to the solution to eqn. 2. Terms up to second order are considered, and so the answer obtained is a second-order approximation, i.e. it is a second-order Runge-Kutta solution. In control engineering applications, the differential equations encountered are slightly different to eqn. 1 in that a control term is also present. One such example may be x(t) = h(x(t), u(t), t) (9) where x represents the behaviour of the system under study and u is the control to it. A solution to eqn. 9 can be obtained using the same procedure as for eqn. 1 if small steps are taken and the control is assumed to be constant over the interval [t, t + At]. Thus we have x(t + At) = x(t) + h(x{s), u(t), s) ds (10) The aim of this paper is to extend these results to systems with delays. Such systems are quite common, e.g. metal rolling systems, study of two competing populations, bio- IEE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985 119
Transcript

Runge Kutta method fordelay-differential systems

G.S. Virk, B.Sc. D.I.C.. Ph.D.. A.M.I.E.E., A.F.I.M.A.

Indexing term: Mathematical techniques

Abstract: The problem of numerically solving delay-differential equations is considered. The method proposeduses a Runge-Kutta method extended so that it is applicable to our delay case.

1 Introduction

The development of the digital computer has been a tre-mendous boost in the study of engineering problems. Ithas been used in many aspects including design of circuits,controlling systems, performing simulations etc. In thispaper we consider its applications to control problemswhere the solution to a differential equation is required.For example, consider the following nonlinear differentialequation:

z(t) = h(z(t), t) (1)

This may describe the behaviour of the system understudy, and so its solution is required if z(t) is to be studiedor controlled. Conditions guaranteeing existence anduniqueness of the solution are well known, see for exampleReferences 5 and 6. We do not consider these technicaldetails here, but merely assume that h has the necessaryproperties to ensure that the solutions are well defined. Weshall, however, look at the numerical aspects in solvingeqn. 1 on a digital computer.

Assuming z(t0) is known, we can find the solution at anytime t > t0 by solving

(2)z(t) = z{t0) + h(z{s), s) ds

i.e. we need to perform integration. A digital machinecannot undertake this task since it only works at instantsin time and integration is a continuous operation.However, all is not lost. Although true integration is notpossible digitally, approximations to it can be made. Manysophisticated procedures that do this have beenconstructed; see, for example References 1 and 2. Theserely on extending the solution in small steps andapproximating z(t) using a Taylor series expansion to aspecified number of terms. If z is sufficiently differentiable,we can expand z(t) to get

. . . . (3)

Comparing eqns. 2 and 3 we can deduce that

h{z(s), s) ds = {t — to)hJto

where

... (4)

h = h(z(t0), t0)

dhhz = -^(z(t0),t0), etc. (5)

Paper 3813D, (C8/C9), first received 11th July 1984 and in revised form 7th Feb-ruary 1985

The author is with the Department of Aeronautics and Astronautics, University ofSouthampton, Southampton SO9 5NH, United Kingdom

To evaluate the integral in this way, partial derivatives of hare required explicitly. This may, in general, be difficult orimpossible, since h may be quite complex or not knownanalytically. A procedure that avoids this successive differ-entiation is the Runge-Kutta method. Here the need forthe derivatives is replaced by evaluating h at extra pointswithin the interval (z(t), t) and (z(t0), t0). The accuracy ofthe integration is governed by how many evaluations areperformed. Having decided upon this, the precise locationsfor evaluating h need to be determined. To do this we formthe following:

z(t) = z(to)+ (6)

where to,- are weighting functions, r is the number of evalu-ations and

(7)

kt = (t- to)hl z(t0)•+ £ dijkj, t0 + Ci(t - t0)

c . = 0, i= 1, 2, 3, ...,r

After a Taylor series expansion has been applied to eqn. 6,it can be compared with eqn. 3 term by term to obtain theunknown parameters cot, aip and c, for; = 1, 2, . . . , i — 1;i = 1, 2 , . . . , r. For r — 2 it can easily be shown that

OJ2 =

= 1

c-, = a.

(8)

Here we have three equations and four unknowns. Thusone can be chosen arbitrarily and the others determinedvia eqn. 8. Substituting these back into eqn. 6 gives anapproximation to the solution to eqn. 2. Terms up tosecond order are considered, and so the answer obtained isa second-order approximation, i.e. it is a second-orderRunge-Kutta solution.

In control engineering applications, the differentialequations encountered are slightly different to eqn. 1 inthat a control term is also present. One such example maybe

x(t) = h(x(t), u(t), t) (9)

where x represents the behaviour of the system understudy and u is the control to it. A solution to eqn. 9 can beobtained using the same procedure as for eqn. 1 if smallsteps are taken and the control is assumed to be constantover the interval [t, t + At]. Thus we have

x(t + At) = x(t) + h(x{s), u(t), s) ds (10)

The aim of this paper is to extend these results to systemswith delays. Such systems are quite common, e.g. metalrolling systems, study of two competing populations, bio-

IEE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985 119

logical and economical systems, etc. In fact every systemhas some inherent delay. Thus it is desirable that a tech-nique for handling these delays is available.

The question of stability, i.e. whether the approximationconverges or not, is not considered here since results pre-sented elsewhere, see for example References 2 and 3, aredirectly applicable to delay cases.

2 Runge-Kutta method for delay-differentialequations

We shall consider a general n-dimensional nonlinearsystems with multiple delays in the state. These take thefollowing form:

x(t) = f(x(t), x(t - T l ) , . . . , x(t - xq), u{t), t)

forte[0, T] (11)

x(t) = 4>(t) f o r t 6 [ - T , , 0 ] (12)

where the delays are arranged so that 0 < xx < x2 < ... <xq and T e (0, oo) is the time up to which solution isrequired, x e R" represents the state of the system andu e Rm represents the control. The functions / and 0 areassumed to be smooth enough to be differentiable to anydegree necessary.

One method for obtaining a solution to eqn. 11 is toreduce the delay-differential equation to an ordinary differ-ential equation and to apply the normal Runge-Kuttamethod to it. For example, if x is known up to time t wecan extend it to t + At by forming the unaugmented equa-tion

x(t) = f(x(t), u(t), t)

± f(x(t), x(t - xx), ..., x(t - xX u(t), t)

(13)

(14)

where x is some polynomial interpolation of the discreteapproximation on the interval already covered. Then theresults of Section 1 can be applied to eqn. 13 to extend x(t)to x(t + At). Although a valid procedure, it does haveseveral drawbacks. Since the integrating procedure isapplied to an approximate system, the solution obtained islikely to be worse than one which is obtained directly viaeqn. 11. Also, for achieving high integration accuracy, wecan either reduce At or increase the accuracy of eqn. 13. Inany practical system At will have a lower limit belowwhich excessive computing is required, so a good estimateto eqn. 11 must be made. This may require a high-orderpolynomial for estimating x over the past interval. Thesituation is made worse by the fact that x needs to beupdated at each sampling instant. Consequently the com-puting necessary to obtain a good solution may wellbecome too large.

To avoid this need for having to determine an equationof the form of eqn. 13, we propose to tackle eqn. 11directly and obtain a Runge-Kutta method that is suitablefor our needs. Assume that the solution is known up totime t and we are required to extend it to time t + At. Letus initially assume that / is to be evaluated r times inbetween this interval, i.e. we want an rth-orderRunge-Kutta solution. By extending results in Section 1 wehave

x(t + At) = x(t) + 5>ik«(

where w, are the weights and

120

(15)

i - l

= Atft x(t) + £ ai.k}{t), x(t - x,)

-xX u(t), t + CiAt

cx = 0, i = 1, 2, 3, . . . , r

where we define

kt{s) = 0

dmds

for s < — xq

At fo rse [ -T . ,0 ]

(16)

(17)

so that eqn. 16 holds for all t. The unknown parametersco^ aijt b\p c, for i = 1, 2 , . . . , r;j = 1, 2 , . . . , i - 1; / = 1, 2,. . . , q have to be determined. This is done by expandingeqn. 16 in powers of At and comparing the result with theTaylor series expansion of the solution to eqns. 11 and 12.Note that we are assuming that the control is constantover the interval [t, t + At]. If this is too strong anassumption we can modify the definition of kt{t) to

ki(t) = Atf(x(t)+

u(t) —rr ctAt

= ei = 0, i = 1, 2, . . . , r (18)

Here smoothness of / with respect to u is also required sothat it can be expanded about u(t) as well. Note that in thiscase we require not only u(t) but also the partial deriv-atives

du

Itd2u

h ' df

In the remainder of this paper we shall assume eqn. 16rather than eqn. 18, so that the e{ parameters do not needto be determined.

If r = 1 we only need to determine k^t) and can easilyobtain

x{t + At) = x(t) + Atf(x(t),

x(t-xi),...,x(t-xq),u(t),t) (19)

which is the familiar Euler's formula. For larger values ofr, more terms need to be considered to determine the extraunknown parameters. For illustration purposes we willshow how this is done for the case r = 3. Here we have

x(t + At) = x(t)

where

a>2 k2(t) k3(t) (20)

, x{t - xx), ...,x(t- xX u(t), t)

k2{t) = Atf(x(t)

x(t - xq)

k3(t) = Atf(x(t)

x(t - xt)

x(t - xq)

u{t),t +

x(t - xt) + b2lkx{t -

- xq), u(t), t + c2 At)

+ «32 MO,

b\2k2(t -

- xq) + b%2 k2(t - xq),

(21)

1EE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985

Using the Taylor series to expand the left-hand side of eqn. Expanding eqn. 21 up to (At)3 in the same manner we have20 up to the third order we get

x(t + At) = x(t) + (At)x(t) + ^ - x(t) + ̂ - x(t) (22) k2it) = At/(t)

Using eqn. 11, this becomes + (At)2<| fxit)fit)a2i + fit)c2

x(t + At) = x(t) + (At)/(x(t), x(t - T l ) , . . . , x(t - T,), u(t), t)

+ — i - -r /(x(t), x(t - T l) , . . . , x(t - xX uit), t)

x(t-rq),u(t),t) (23)

Now

-f(X(t),...,x(t-Tq),u(t),t)

= Lit)fit) + X fyft)f(t - rf) + fit) (24)i= 1

where

fit) = f(x(t)t xit-x,),..., x(t - xq), uit), t)

d

{f(t)hJyiX/ dxit - T,.)

i.e. yt denotes the delayed argument x(t — T,) for i = 1, 2,

fit) = Jt {fit)}

and we define

(25)

= 0 for s < — xq (26)

so that eqn. 24 holds for all t.Similarly we can show

dV= fTit)fxxit)fit) 2fxtit)fit)

+

(27)

IEE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985

+

i Z Z / ( t - tj)/WJ(0/(t1=1j=l

fx,it)fit)ia31 + a32)c3 + \fltit)cl

fl(t)f(t)a2la32 + fxit)fit)a32c

i = 1

(28)

(29)

+

• + z z /,xo/,/t - *,)/(' - 1 , - TjMMt 00).=1 j = i j

Using eqns. 24 and 27-30 in eqns. 20 and 23 andcomparing coefficients term by term, we can deduce thefollowing:

3 = 1 (31)cox + ct)2

co2 a2l + a32) =

= j

co2b2l+co3ib3l+b32) = ± i=l,2,...,

(32)

(33)

(34)

121

co2a22l + <

co2c\ + co

co2c2a2l •

co2a2lb21

to2b2XV2,

co2b21c2 H

co3a2la32

co3a32c2 =

co3a32bl21

co3a2lb32

co3 b32 c2 -.

CO3 H ^ 3 2

y3(«31 +

3 C | = 4

+• w 3 ( a 3 1

+ «3(fe31

+ fl>3(^31

h co3(b31 •

= 6

_ 1- 6

= * i =

= e i =

= 4 »' == 4 », 7

«32)2 = i

+ «32)C3 = 3

+ ^32)(«31 "

+ *32)(*3l "

-r- fc32)C3 = 4

= 1, 2, ...,q

• i , z, . . . , q

1,2, ...,q

= 1, 2, . . . ,<

1-032)

i

HM2)

i

= i= 1,2,..

= 1

= 1 ,2 , . .

= 1 ,2 , . .

(35)

(36)

(37)

•,<? (38)

. , 9 (39)

.,q (40)

(41)

(42)

(43)

(44)

(45)

(46)

From eqns. 35-37 we have

c2 = a21 and c3 = a3i + a32

eqns. 41 and 43

=>a21 = b2l

eqns. 41 and 44

=>«32 = *32

Using this in eqns. 32 and 34

=>a3l = b'3l for i = 1, 2, . . . , q

These relationships can be used in eqns. 31-46 to obtainfour equations containing six unknowns, i.e.

Wj + CO2 + CO3 = 1

CO2C2 +CO3C3 =j

(D2c\ + CO3C3 = j

W3C3«32 = 6

The solutions to these equations can be determined interms of two parameters, say c2 and c3. It is straightfor-ward to deduce that

3 c , - 2 2 -3c,co1 =

co-> =

6c2(c2 - c3) 6c3(c2 - c3)

2 - 3 c 3

co3 =

6c2(c2 - c3)

3c2 - 2

6c3(c2 - c3)

3VC2 C 3 ^

c2(3c2 - 2)

3 Numerical results

The theoretical results of Section 2 were applied to solvetwo delay differential equations. These experimental resultsare presented in this Section. The problems wereprogrammed in Basic 11 on a small DEC system

consisting of an LSI 11/23 processor with 96 kbyte MOSRAM. A step size of 0.05 was used in both cases.

3.1 Example 1The first problem is to solve the following scalar delay dif-ferential equation with one delay:

x{t) = x(t - 0.5)u{t) for all t e [0, 1]

x(t) =t + 0.5 for t e [ - 0 . 5 , 0]

where the input u(t) = 10 sin lOt for all t e [0, 1].The analytical solution can be obtained using the

method of steps. l-4th-order Runge-Kutta solutions wereobtained. These results are compared with the actual solu-tion in Figs. 1-3. From Fig. 1 the RK1 solution appears to

-0.5

Fig. 1 Runge-Kutta solution for example 1Exact solutionRunge-Kutta order 1

0.25r

0.125

-0.125

-0.25LFig. 2 First-order Runge-Kutta error

0.01

0.005 "

-0.005 •

-0.01L

Fig. 3 Runge-Kutta errorsRunge-Kutta order 2Runge-Kutta order 3Runge-Kutta order 4

be a delayed version of the exact solution. This falseappearance is totally due to quantisation errors and is cer-tainly not the case as Fig. 2 shows the error is not con-stant. 2-4th-order Runge-Kutta solutions cannot bedistinguished graphically from the actual solution, and

122 IEE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985

therefore the errors are compared. The maximum errorwith each order is shown in Table 1.

Table 1: Maximum error for Runge-Kutta solutions(example 1)

Order of MaximumRunge-Kutta solution error

Table 2: Maximum(example 2)

error for Runge-Kutta solutions

0.250.013 x 1 0 " 3

5 * 1 O - 5

3.2 Example 2The second problem is to solve the followingtwo-dimensional delay differential equation with twodelays in the state:

Xi(0 = x^t) + x^t - 0.5) + x2(t - 0.75) for all t e [0, 1]

x2(t) = x1(t)«(t) for all t e [0, 1]

xl(t) = t+ 0.5 for t e [-0.5, 0]

x2(t)=l for re [-0.75,0]

where

u(t) = 10 sin lOt for all t e [0, 1]

l-4th-order Runge-Kutta solutions were determinedtogether with the analytical state trajectories. The resultsobtained for r = 1 are shown in Figs. 4 and 5. Themaximum error for r = 1-4 is shown in Table 2.

4 Conclusion

The Runge-Kutta method has been extended to systemsincorporating multiple delays in the state. Numerical per-formance of the integration procedure on test equationsare also presented.

5 References

1 LAPIDUS, L., and SEINFELD, J.H.: 'Numerical solution of ordinarydifferential equations'. (Academic Press, New York, 1971)

2 MIKHLIN, S.G., and SMOLITSKIY, K.L.: 'Approximate methodsfor solution of differential and integral equations'. (American ElsevierPublishing Company, New York, 1967)

3 BELLMAN, R., and COOKE, K.L.: 'Differential-difference equations'.(Academic Press, New York, 1963)

4 OGUZTORELI, M.N.: 'Time-lag control systems'. (Academic Press,England, 1966)

Order of Maximum errorRunge-KuttaSolution State x. State x2

0.25

1 x 10-

0.30.042.5 xi4x 10-

u

3

2

1

-0.75 -0.5 -0.25 0

r

/

0.25 0.5 0.75 1.0

Fig. 4 State x, Runge-Kutta solutionExact solutionRunge-Kutta order 1

3.0

2.25

1.5

0.75

-0.75 -0.5 -0-25 0

-

-

0.25 0.5

tj

0.75 1.0

Fig. 5 State x2 Runge-Kutta solutionExact solutionRunge-Kutta order 1

5 LUKES, D.L.: 'Differential equations: classical to controlled'.(Academic Press, London, 1982)

6 MILLER, R.K., and MICHEL, A.N.: 'Ordinary differential equations'.(Academic Press, London, 1982)

1EE PROCEEDINGS, Vol. 132, Pt. D, No. 3, MAY 1985 123


Recommended