self-starting multistep methods for the numerical

30
NASA TECHNICAL NOTE NASA TN D-2936 --- i' f SELF-STARTING MULTISTEP METHODS FOR THE NUMERICAL INTEGRATION OF ORDINARY DIFFERENTIAL EQUATIONS I by WilZiam A. Mersman Ames Research Center Mofett Field, CdliJ: NATIONAL AERONAUTICS AND SPACE ADMINISTRATION WASHINGTON, D. C. 0 JULY 1965 f

Upload: others

Post on 16-Oct-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Self-starting multistep methods for the numerical

N A S A TECHNICAL NOTE N A S A TN D-2936 --- i' f

SELF-STARTING MULTISTEP METHODS FOR THE NUMERICAL INTEGRATION OF ORDINARY DIFFERENTIAL EQUATIONS

I

by WilZiam A. Mersman

Ames Research Center Mofett Field, CdliJ:

NATIONAL AERONAUTICS A N D SPACE A D M I N I S T R A T I O N WASHINGTON, D. C. 0 JULY 1965

f

Page 2: Self-starting multistep methods for the numerical

TECH LIBRARY KAFB, NM

I Illill 11111 llll lllll lllll Ill# lllll Ill1 Ill 02547b8

NASA T N D-2936

SELF-STARTING M U L T I S T E P METHODS FOR T H E NUMERICAL

INTEGRATION O F ORDINARY D I F F E R E N T I A L EQUATIONS

By Wi l l i am A. M e r s m a n

A m e s R e s e a r c h C e n t e r Moffet t Field, Cal i f .

NATIONAL AERONAUTICS AND SPACE ADMINISTRATION

For sale by the Clearinghouse for Federal Scientific and Technical lnformotion Springfield, Virginia 22151 - Price $2.00

Page 3: Self-starting multistep methods for the numerical

SELF-STAXTING MULTISTEP METHODS FOR THE NUMERICAL

IIYIEGRATION OF ORDINARY DIFFERENTIAL EQUATIONS

By W i l l i a m A. Mersman Ames Research Center

Classical , multistep, predictor-corrector procedures f o r the numerical integrat ion of systems of ordinary d i f f e r e n t i a l equations a re generalized t o provide compatible, s e l f - s t a r t i ng methods. Expl ic i t algorithms and t ab le s of numerical coeff ic ients a r e presented,

INTRODUCTION

The numerical in tegra t ion of systems of ordinary d i f f e r e n t i a l equations on modern automatic computers i s usually accomplished by means of so-called multistep methods, pa r t i cu la r ly t h e predictor-corrector methods associated with the names Adam, Bashforth, Moulton, StErmer, and Cowell. It i s usually assumed tha t these methods a re not self-s tar t ing, and recourse i s had t o s ingle-s tep methods l i k e t h a t of Runge-Kutta t o obtain s t a r t i n g values. This leads t o cumbersome computer programs requiring what amounts t o unessent ia l t a l l y ing t o determine whether enough s t a r t i n g values have been obtained.

The purpose of t h e present report i s t o derive simple generalizations of t he c l a s s i c a l predictor-corrector formulas t h a t i m e d i a t e l y y ie ld compatible s e l f - s t a r t i ng procedures t h a t produce a l l t h e required backward differences d i r ec t ly from the i n i t i a l conditions.

STATEDENT OF THE PROBUM

The problem i s t o devise a se l f - s ta r t ing , multistep procedure f o r the numerical solut ion of t h e i n i t i a l value problem

(1) I d x = y

- = f ( X , Y , t )

a t

dY at

Page 4: Self-starting multistep methods for the numerical

a t t h e discrete , equally spaced points tn , n = 1, 2, 3, . . . The var i - ables x, y, and f a re vectors, a l l of t he same ( f i n i t e ) dimension.

Let t h e common i n t e r v a l of t h e independent var iable be denoted by h, so t h a t

t n = t o + nh and introduce t h e usual notat ion

The index, n, w i l l be r e s t r i c t e d t o i n t e g r a l values, usual ly posit ive, although negative values w i l l be introduced i n some of t he s t a r t i ng procedures t o be discussed l a t e r .

The general problem, then, i s t o devise algorithms f o r calculat ing x,, yn, fn, f o r and the i n i t i a l values ( 2 ) . ignoring t h e variable, x, throughout t h e general theory.

n = 1, 2, 3, . , given s imply the d i f f e r e n t i a l equations (1) The theory f o r f i r s t - o r d e r systems i s obtained by

The procedure t o be used i s the conventional one of approximating the function, f , by a polynomial i n t of degree q. The problem i s then s p l i t i n t o two: t h e forward in tegra t ion problem and t h e s t a r t i n g problem.

The Forward Integrat ion Problem

The problem of backward difference xn, Yn, fn, and t h e

in tegra t ing forward one s t e p w i l l be solved by means of formulas of t he Adams type. Here it i s assumed tha t t n , first q backward differences of fn :

1 vofn = f n

k = l(1)q

are known. quant i t ies a t t = tn+l .

Several algorithms w i l l be derived f o r computing a l l these

The Star t ing Problem

Before the forward in tegra t ion algorithms can be applied, it i s necessary t o compute i n i t i a l values of the backward differences of preferably a t t = t o .

f a t some point, This w i l l be done by developing i t e r a t i v e algorithms

Page 5: Self-starting multistep methods for the numerical

f o r t he backward calculat ion of X-n, Y-n, f -n at n = l ( l ) q , from which t h e backward differences of f o a re eas i ly calculated.

It sometimes happens t h a t t he i n i t i a l values l i e near a s ingular i ty . I n t h i s case t h e backward s t a r t e r may f a i l . For t h i s reason, i t e r a t i v e forward s t a r t e r s w i l l a l so be derived f o r t h e calculat ion of Xn, yny fn, a t n = l (1 )q .

I n e i the r case the f i n a l "output" of t h e s t a r t i n g procedure w i l l be xo, yo, fo, and t h e f irst q backward differences of f,, s o t h a t t h e s t a r t e r w i l l be compatible with the forward integrat ion procedures.

In the following sect ion t h e basic backward difference equations w i l l be

It i s derived. These a re general izat ions of t he equations usually ascribed t o Adam, Bashforth, Moulton, StGrmer, and Cowell ( r e f . 1, chs. 5 and 6 ) . t h e generalization of t he c l a s s i c a l formulas t h a t makes se l f - s t a r t i ng proce- dures possible.

GENEFKGIZED BACKWARD DIFFERENCE EQUATIONS

Normal Form

The basic difference equations, r e l a t ing Vy,.Vx, and v2x a t t = t j t o f and i t s backward differences a t t = tn , both J and n being arb i t ra ry , a r e

W

k=o

These a re wr i t ten formally as i n f i n i t e s e r i e s t o simplify ce r t a in index manip- ulat ions. They terminate and a re exact whenever f i s a polynomial i n t .

The proof i s a straightforward generalization of Henrici 's ( r e f . 1, pp. 191-194 and 290-293). Write y j as a Taylor's s e r i e s with remainder centered a t t j -1 ( r e f . 2, p. 95):

Now note t h a t

3

Page 6: Self-starting multistep methods for the numerical

Approximating f by means of Newton’s in te rpola t ing polynomial ( ref . 1, PP. 190-1911

where the symbol

r(s + 1) (’1 = k!r(s + 1 - k)

yields equation (4), with y given by

Equation ( 5 ) i s obtained s imi la r ly by wri t ing the Taylor’s s e r i e s f o r x j and X j - 2 centered a t tj-1

adding and inser t ing Newton’s in te rpola t ing polynomial yields equation ( 5 ) , with cr given by

Before deriving equation (6 ) it i s convenient t o discuss equations ( 4 ) and ( 5 ) and some of t he properties of y and cr.

Equation (4 ) with j = n + 1 i s t h e Adam-Bashforth predictor ( r e f . 1, pp. 192-193). Henrici uses t h e notation

yk = y-l,k

Equation ( 4 ) with j = n i s t h e Adam-Moulton corrector ( r e f . 1, pp. 194-195). Henrici uses the notation

yk* = Yo,k

Equation ( 5 ) with j = n + 1 i s the StGrmer predictor (ref. 1, pp. 291- 292). Henrici uses the notation

4

Page 7: Self-starting multistep methods for the numerical

Equation ( 5 ) with j = n is t h e Cowell corrector (ref. 1, pp. 292-293). Henrici uses the notation

o,k Ok* = 0

A s w i l l be seen later, equations ( 4 ) t o (6) with j = n - q ( l > n - 1 form t h e bas is f o r t h e se l f - s t a r t i ng procedures t o be developed.

The most important property of y and CT i s t h a t each row i s the first backward difference of t h e preceding r o w :

1 bp+i,k = ap,k - ap,k-i

while yp, = ap,o = l. These follow immediately from the def ini t ions, equa- t i ons (7) , ( 8 ) , and the well-known recurrence r e l a t i o n f o r t h e binomial coef- f i c i e n t s :

Equations (9) can be rearranged i n the useful form

where the subscript on V j i s used t o emphasize tha t V here operates on j , not on n or k.

The t ab le s of y and a a t t h e end of t he report were computed by means of t he def ini t ions, equations (7) and ( 8 1 , f o r t he f i r s t row ( p = -l), and the difference equations (9) f o r subsequent rows.

To re turn t o the der ivat ion of equation (61, note f i rs t t h a t x bears t he same re l a t ion t o y as y does t o f . Hence, we can wri te equation ( 4 ) i n t h e t r ans l i t e r a t ed form

00

Writing equation ( 4 ) with j = n gives

and taking the ( m - 1)s t backward difference gives 03

5

Page 8: Self-starting multistep methods for the numerical

Subst i tut ing i n equation (4a) and rearranging gives

k=o r=o Applying t h e backward difference operator

V j and using equations (10) gives

k v2xj = h2 f Yo,rYn-j,k-rV f n k=o n=o

Comparison with equation ( 5 ) gives t h e important i d e n t i t y

k

U r = o

Hence,

and t h i s reduces equation (11) t o equation (6 ) . Q.E.D.

Equation (12) cons t i tu tes a valuable check on t h e t ab le s of y and o and has been used. t h e exp l i c i t formulas

I n addition, f o r small values of k, it i s convenient t o have

Yp,o = 1

Equation (6), with j = n + 1 o r n, cons t i tu tes a new predictor- corrector scheme, t o be discussed l a t e r , which appears t o have some advantages over t he St8rmer-Cowell scheme of equation ( 3 ) . j = n - q(1)n - 1, equa- t i o n (6), l i k e equations ( 4 ) and ( 5 ) , forms the bas i s f o r an i t e r a t i v e s t a r t e r .

For

This completes the der ivat ion of t h e basic backward difference equations Closely r e l a t ed t o these are similar equations using the i n t h e normal form.

6

Page 9: Self-starting multistep methods for the numerical

first and second sums. and fu r the r confirmation of t h e i r effectiveness i s offered by Henrici ( r e f . 1, pp. 327-339).

Astronomers have long used these concepts (ref. 3 ) ,

These s m e d forms w i l l be derived i n the next section.

Summed Form

The basic difference equations, i n t h e summed form, r e l a t ing x and y a t t = t j t o f , i t s backward differences and i t s backward sums at j and n being arb i t ra ry , a re

t = tn , both

J k=o where the backward sums j = n:

A, and Bn a re defined by these same equations with

1 W

An = yn - 1 yo,k+l.Dkfn

J k=o The names f i rs t and second sum for An and h, respectively, a r e j u s t i f i e d by t h e property

1

The proof i s qui te straightforward. Replace t h e coeff ic ient , y, i n equa- t i o n ( 4 ) by i t s equivalent value from equations (10) :

where, again, t h e subscript j i s aff ixed t o v t o emphasize t h a t t h e opera- to r , especial ly i n t h e r i g h t member, a c t s on j ra ther than n or k. This i s a simple, l i n e a r difference equation whose solut ion i s obviously t h e first of equations (l?), i n which An i s an a r b i t r a r y constant vector, independent of j, whose value i s determined by se t t i ng j = n, equations (16).

If y i s now eliminated from equation (6) by means of t h e first of equations ?16), and i f t h e coeff ic ient , 0, is replaced by means of equa- t ions(10) , t h e r e s u l t i s again a simple, l i nea r difference equation:

7

Page 10: Self-starting multistep methods for the numerical

h2 1 an- j,k+z*n ( : o ) V j X j = hAn + V j

whose solut ion i s c l ea r ly t h e second of equations (l?), where a r b i t r a r y constant vector independent of s e t t i n g j = n (eqs. (16)) .

% i s another j, whose value i s determined by

Equations (17) follow immediately from equations (16) on taking t h e back- w a r d difference and applying equations (4) and (6) with j = n.

As w i l l be seen i n l a t e r sections, equations (16) w i l l be used only once,

j = n +l

n replaced by LI -k 1 and j = n + 1, w i l l

i n connection with the s t a r t i n g procedure, t o obtain i n i t i a l values, A0 and BO, of t he f irst and second sums. w i l l y ie ld the summed versions of t he Adams-Bashforth and Stzrmer predictors, while equations (13) and (l7), with y ie ld the summed versions of t he Adams-Moulton and Cowell correctors.

Subsequently, equations (13) with

Before discussing s t a r t i n g procedures, it i s necessary t o convert t h e basic difference equations ( k ) , ( 3 ) , ( 6 ) , (l?), and (16) t o the backward ordi- nate form, i n which e a r l i e r values of f are used ra ther than i t s backward differences.

GENERALIZED BACKWARD OFDINATE EQUATIONS

The backward difference equations of previous sect ions have been wr i t ten formally as i n f i n i t e s e r i e s merely f o r manipulative convenience. it i s assumed t h a t f i s approximated by a polynomial i n t of degree q, say, and the se r i e s are a l l truncated a t If, then, t h e backward d i f - ferences i n equations (15) and (16) a re eliminated by means of t h e well-known

I n practice,

k = q.

i den t i ty ( r e f . 1, p. 190) k

&, = E ( - 1 ) m m=o

and t h e order of su"a,tion i s reversed i n following backward ordinate equations a r e

6) fn-m

the resu l t ing double sums, t h e obtained i n summed form:

I y j = An + h t Yq,n-j,m f n-m

m=o q

x = Bn + ( j - n - 1)- + hzCDq,n-j,m f n-m j

m=o

where the coef f ic ien ts y and cr are

8

Page 11: Self-starting multistep methods for the numerical

k=m I

1 k=m

Again the sums An and are given by setting j = n: q 1

(20) I m=o

Bn xn + hAn - h2 f 09, o,mfn-m m=o

Eliminating An and Bn from equations (18) and (20) then gives the normal form of the backward ordinate equations :

q

= yn - h 1 aq,n- j ,dn-m m=o

Y j

q

x j = Xn - ( n - j)hyn + h2CPq,n-j,mfn-m m=o

where the coef f ic ien ts a and P a r e

(22) I aq,p,m = Yq,o,m - Yq,p,m

Pq,p,m - Oq,p,m - Gq,o,m + PYq,o,m

The t ab le s of y , 6, a, and P a t the end of t he report were computed

-

using equations (19) and (22) together with the e a s i l y proved re la t ions :

9

Page 12: Self-starting multistep methods for the numerical

Taking f ( t ) = tr i n equations (21), r = O(l)q, gives the i d e n t i t i e s q

which were used as a f i n a l check on t h e tab les .

All t h e basic formulas, summed and n o m l , i n backward difference and backward ordinate forms, have now been derived. The remaining sect ions of t h e report a r e devoted t o t h e presentation of general and spec i f ic algorithms f o r s t a r t i n g and continuing the integrat ion.

EUICKNARD STARTING ALGORITHMS

A backward s t a r t i n g algorithm i s one t h a t produces the backward d i f f e r - ences of Po, up t o order q, given merely the i n i t i a l conditions, equa- t i ons ( 2 ) , and, of course, t he d i f f e r e n t i a l equations (1). t o an algorithm t h a t w i l l produce backward values of t he ordinates, f,p, f o r p = l (1 )q ; it i s then a simple matter t o obtain t h e backward differences a t fo.

This i s equivalent

(See the appendix for de ta i l s . )

The desired algorithm, i n normal f o r m , i s impl ic i t ly contained i n equa- t i ons (21) with n = 0, j = -p:

q - Y-p = Yo -

m=o

U m=o

f-p = f ( t o - Ph,X-p,Y-p) J f o r p = l ( 1 ) q . This i s a s e t of 3q implici t equations f o r t he 3q unknowns Y-p, x-p.' f -p*

If an approximate solution i s known, an improved solution i s readi ly obtained by i t e r a t i n g equations (23); inser t ing "old" values i n the r igh t mem- bers produces "new" values in the l e f t members. exhib i t s the a f o r q = 2, 3 and discusses the convergence of the i t e r a t i o n , but does not derive the general formulas. Two methods of obtaining an i n i t i a l approximation w i l l now be given.

Collatz ( r e f . 4, pp. 99-101)

10

Page 13: Self-starting multistep methods for the numerical

Bootstrap S t a r t e r

Since only one value of f , namely fo, i s known i n i t i a l l y , t he simplest possible procedure i s t o take Set t ing p = 1 gives t h e "predicted" values of x, y, and f a t t-1. Then se t t i ng q = 1, p = 1, gives corrected values. Keeping q = 1 and now se t t i ng p = 2, gives pre- dicted values a t t-2. This bootstrapping procedure can be repeated u n t i l t he desired value of q i s reached. The exp l i c i t algorithm i s

q = 0 i n equations (23).

Mult i g l e correct or k = l(1)p P 7

Y-k = Yo - h l a p , k , m f -m m=o

Experienced computer programers w i l l recognize t h i s as a simple, nested DO LOOP.

To make the procedure more tangible, t h e f irst few algorithms are writ ten exp l i c i t l y below:

p = 1; predictor y-l = yo - hfo

h2 X-1 = xo - hyo + e f o

f-1 = f ( t - l , X - L , Y - d

h y-1 = yo - E ( f o + f-1) k = 1; corrector

h2 X - 1 = xo - hyo + 7 (2fo + f-1)

f-1 = f ( t - l ,x - l ,Y- l )

11

Page 14: Self-starting multistep methods for the numerical

p = 2; predictor y-2 = yo - 2hf-1

h2 3 X-2 = xo - 2hyo + - (2fo + 4f-1)

f-2 = f(t-2+2,y-2)

h Multiple corrector y-1 = yo - (3f0 + 8f-1 - f-2)

h2 24

k = 1 X-1 = xo - hyo + - (7fo + 6f-1 - f-2)

f-1 = f(t-1yx-1,y-d

h 3

y-2 = YO - - ( f o + 4f-1 + f-2)

X-2 = xo - 2hyo + - (2fo + 4f-1) h2 3

I [

[ I I f-3 = f(t-3JX-3.9y-3)

k = 2

f-2 = f(t-2+-2,y-2)

h

h2

(3f0 + 9f-2)

X-3 = XO - 3hy0 + 8 (gfo + 18f-1 + 9f-2)

y-3 = yo - p = 3; predictor

f-3 = f(t-3+3,y-3)

h 24

Multiple corrector y-1 = yo - - (gfo + lg f -1 - 3f-2 + f-3)

h2 k = 1 X-1 = XO - hyo + - (97fo + 114f-1 - 39f-2 + 8f-3) 360

f-1 = f ( t - l y x - l y Y - l )

Y-2 = Yo - - ( f o + 4f-1 + f-2)

x-2 = xo - 2hyo + - (28fo + 66f-1 - 6f-2 + 2f-3) 3

h2 k = 2 45

f -2 = f(t-2+-2,y-2)

h Y-3 = Yo - 8 (3fo 9f-1 gf-2 + 3f-3)

h2 X - 3 = X o - 3hYo + - (331fo + 972f-1 + 243f-2 + 54f-3). k = 3

360

The bootstrap s t a r t e r seems t o be qui te e f f i c i e n t i n prac t ice , but it i s awkward and space-consuming when programmed for automatic computers, because of t he mul t ip l ic i ty of matrices and algorithms required. following logica l ly simpler method.

This suggests t he

12

Page 15: Self-starting multistep methods for the numerical

I t e r a t ed S ta r t e r

The bootstrap starter i s e s sen t i a l ly an e f f i c i en t method of obtaining first approximations f o r use i n t h e r igh t members of equations (23), which a re then i te ra ted . i z e by se t t i ng t h e s ingle set of equations (23).

A l og ica l ly simpler, but less e f f i c i en t method i s t o i n i t i a l - f - m = fo, m = l ( l ) q , i n t he r igh t members, and then i t e r a t e

Backward Star te r , Summed Form

Star t ing with equations (18) and ( 2 0 ) , instead of (23) and again s e t t i n g n = 0, j = -p gives t h e impl ic i t , swnmed form of t h e backward s t a r t e r :

Y v

Bo = XO + hAo - m=o

I I n i t i a l values can be obtained by t h e obvious bootstrap procedure or by s t a r t - ing with f - m = fo, m = l (1 )q .

h A 0 = Yo + f o

L

Bo = xo + hA0 - - h2 = xo + hyo + (&) h2fo 12 f o Equations ( 2 5 ) can then be i t e r a t e d u n t i l they converge.

This algorithm i s mentioned mainly f o r t h e sake of completeness. The pr inc ipa l reason f o r introducing the first and second sums i s t o obtain b e t t e r control of t he accumulated round-off e r ro r during a long integration, but t h i s consideration may be i r re levent t o a s t a r t i n g procedure.

Before turning t o t h e subject of forward s t a r t i n g procedures, it may be noticed t h a t t h e backward s t a r t e r (eqs. ( 2 3 ) ) produces t h e ordinates p = l (1 )q .

fmp, f o (see t h e These are e a s i l y converted t o backward differences a t

Page 16: Self-starting multistep methods for the numerical

appendix). If summed forms of t he forward in tegra t ion procedure a re t o be used subsequently, t h e i n i t i a l values of A. and Bo are eas i ly computed from equations(16), with n = 0. Thus even here there i s no compulsion t o use the summed form of the s t a r t e r .

FORWARD STARTING ALGORITHMS

The der ivat ion of forward s t a r t i n g algorithms i s almost t r i v i a l . Each of t he backward s t a r t e r s discussed previously becomes a forward s t a r t e r by means of t h e simple transformation

h 4 -h

f - m --* f m

This produces t h e forward ordinates, fa, m = O(1)q.

J

The conversion t o backward differences a t tq i s straightforward. How- ever, t o do t h i s on an automatic computer would involve e i the r losing a l l information a t the points between requirements excessively. Furthermore, e i t h e r choice leads t o a procedure t h a t i s d i f fe ren t , i n i t s external appearance and mode of usage, from t h e backward s t a r t e r .

to and tq, or else increasing t h e storage

A preferable procedure i s t o compute the backward difference t ab le a t tq and then extend it back t o to by holding Vqf constant; t h i s , of course, i s consistent with t h e s t a r t i n g procedure. This i s e a s i l y done, and program- ming d e t a i l s a re given i n the appendix.

Choosing the l a t t e r a l te rna t ive provides computer programmers with a ba t t e ry of s t a r t i ng procedures, forward or backward, bootstrap o r i t e r a t i v e , . i n normal or summed form, with iden t i ca l ex terna l appearance. I n every case the input data consis t of the i n i t i a l conditions, and the-output data consis t of t h e t a b l e of backward differences (and sums) at t h e i n i t i a l point, i n a form compatible with the forward in tegra t ion procedures t o be discussed next.

PEIEDICTOR-COFXECTOR ALGORITHMS FOR FORWARD INTEGRATION

The purpose of t h i s sect ion i s t o present a va r i e ty of algorithms f o r the forward integrat ion from t n t o tn+l . Specif ical ly , it i s assumed t h a t t h e input consis ts of tn , xn, yny fn, and t h e first q backward differences of fn, together with t h e sums An and Bn when appropriate. The output i s t o be

14

Page 17: Self-starting multistep methods for the numerical

the same l i s t of quant i t ies a t tn+l . r i thms with any of t h e s t a r t e r s provides t h e complete solut ion of t he i n i t i a l - value problem.

The combination of any of these algo-

All t he algorithms t o be presented involve the use of a predictor f o l - lowed by a corrector, requiring two calculat ions of f (x ,y , t ) . Conflicting philosophies regarding the need f o r a corrector can be found i n references 3 and 5 . The general consensus among automatic computer users seems t o favor the use of one corrector. In t h e algorithms given below t h e user can, of course, omit t h e corrector i f he chooses.

The backward difference equations (4 ) through (6) and (15) through (17) give predictor formulas when j = n + 1. Taking j = n and then replacing n by n + 1 yields corrector formulas. I n every case, i f both predictor and corrector a re truncated a t t he same value k = q, then subtracting the pre- d ic tor from t h e corrector and using t h e recurrence re la t ions (eqs. ( 9 ) ) f o r t he coef f ic ien ts y and 0 gives a shorter formula f o r t h e corrector.

Throughout, predicted values a re indicated by an a s t e r i s k (*).

Normal Form

Firs t -order system.- The Adams-Bashforth predictor i s

q r 7

= yn + h l Y - l , k v k 'n %+l

k=o and t h e Adam-Moulton corrector i s

Simple second-order system.- If t h e f i r s t derivative, y, does not occur i n the d i f f e r e n t i a l equation and i s not required, t he formulas f o r x are:

StGrmer predictor q

k=o

General second-order system.- When the f i r s t derivation, y, i s present, equations ( 4 ) and (6) y ie ld the predictor

15

Page 18: Self-starting multistep methods for the numerical

The predictor i s

The corrector i s

Summed Form

- I * - B, + h2 1 xn+i -

I k=o

and, of course,

I n a l l these predictor-corrector algorithms, t he calculat ion of t h e d i f - ference t ab le i s f a c i l i t a t e d by noting tha t , on defining

* E = fn+i - fn+l

t h e differences a re

V k fn+l = &",+I + E , k = l(l)q

(see r e f . 1, p. 196). course, d i r e c t l y from the def in i t ion :

The predicted differences, $f",+,, are obtained, of

16

Page 19: Self-starting multistep methods for the numerical

CONCLUDING REMARKS

The present report displays a var ie ty of algorithms f o r s t a r t i ng and continuing the numerical in tegra t ion of systems of ordinary d i f f e r e n t i a l equa- t ions . The exhaustive t e s t i n g of these algorithms, f o r t h e purpose of compar- ing t h e i r effectiveness, would be an expensibe process. deal of relevant experience has been obtained i n recent years i n computing in s t a l l a t ions throughout t h e world. compromise between t h e conf l ic t ing desiderata of speed, accuracy, and program- ming compactness can be achieved by the following choice:

Fortunately, a grea t

I n t h e present writer's opinion t h e bes t

(1) Use t h e fourth-order methods f o r f i r s t -o rde r equations, sixth-order methods f o r second-order equations ( q = 4, 6, respect ively) .

Use the i t e r a t e d s t a r t e r , i t e r a t e d eight times.

Use the swnmed form of t h e predictor-corrector algorithm, i n back- ward difference form.

( 2 )

( 3 )

(4) Carry four ex t ra s ign i f icant decimal d ig i t s , i n floating-point form, t o control round-off e r rors .

The effectiveness of t h e summed form of the predictor-corrector algo- rithms has long been known t o astronomers ( r e f . 3 ) , and addi t ional evidence i s furnished by Henrici ( r e f . 1, pp. 336-339). l e s s e f f i c i e n t than t h e boots t rap version, but i s far simpler t o program and i s much more modest i n i t s storage requirements.

The i t e r a t e d s t a r t e r i s somewhat

The use of backward differences i n the forward integrat ion i s preferable t o the use of backward ordinates f o r t w o reasons: formula tends t o add near ly equal quant i t ies of a l te rna t ing sign, whereas the backward difference formula adds monotonically decreasing quant i t ies ; and ( 2 ) t he ava i l ab i l i t y of t he difference t ab le makes e r ro r estimation and automatic adjustment of t he in t e rva l s ize a straightforward procedure.

(1) the backward ordinate

Ames Research Center National Aeronautics and Space Administration

Moffett F ie ld , C a l i f . , Apri l 19, 1965

Page 20: Self-starting multistep methods for the numerical

CONVERSION O F ORDINATES TO DIFFEXENCES

The calculat ion of a t ab le of backward differences from a t ab le of ordi- nates, and i t s extension i n e i t h e r d i rec t ion when higher order differences a re neglected, is a familiar procedure t o computers working with penci l and paper. The programming of such procedures f o r automatic computers i s l e s s familiar, and the purpose of t h i s appendix i s t o give some t y p i c a l algorithms i n FORTRAN format, t h e most widely used s c i e n t i f i c programming language.

The algorithms exhibited here a re wr i t ten as though x, y, f , A, and B were scalars . When they are vectors, t h e algorithms a re e a s i l y generalized by t h e addi t ion of a second subscript and su i tab le addi t iona l "DO LOOPS" over t he range of t h e second subscript ( t he dimension of t h e vectors) .

Since the FORTBAN language does not permit subscr ipts nor indices i n loops t o assume nonpositive values, ce r t a in log ica l a r t i f i c i a l i t i e s appear i n these algorithms. Experienced programmers should have no d i f f i c u l t y i n removing them f o r other, less r e s t r i c t ed , programing languages.

Backward S t a r t e r

All t h e versions of t h e backward s t a r t e r discussed i n the main body of t he report produce t h e backward ordinates, f-p, p = o(1)q. placed i n the a r ray L:

Suppose these a re

~ ( p + m) = f - p

where m i s an a rb i t ra ry , posi t ive integer . Then t h e nested DO LOOP

DO k = l , q r

w i l l y ie ld VPfo i n L ( p + m), p = O(l)q, g _> 1. The s t ruc ture of t he algo- rithm is i l l u s t r a t e d by t h e following diagram, i n which v io la t ion of t h e FORTRAN res t r ic t ion! ) :

q = 3 and m = 0 ( i n

18

Page 21: Self-starting multistep methods for the numerical

I n i t i a l values

L(3) = f-3

- . -

L(2) = f-2

L ( 1 ) = f -1

. .. -

k = l , 2 = 3

j = l , n = 2

= f -2 - f-3

= vf-2 ~ _ _ _ _ _ _

j = 2, n = 1

L(2) = L ( 1 ) - L(2)

= f -1 - f-2

= vf-1

j = 3 , n = O

L ( 1 ) = L ( 0 ) - L ( 1 )

= f o - f -1

= v f o

k = 2 , 2 = 2 I k = 3 , 2 = 1

j = 2 , n = 1

L(2) = L ( 1 ) - L(2)

= v f o - vf-1

= F f o

It i s evident from t h e diagram t h a t increasing q by uni ty adds one row t o each column and adds an addi t iona l column on t h e r igh t with one row.

Forward S t a r t e r

i All t h e versions of t h e forward s t a r t e r discussed i n the main body of t he

Suppose these a re placed report produce the forward ordinates, fp, p = O(1)q. i n t h e a r ray L :

~ ( p + m) = f p

Then the nested DO LOOP

DO k = l , q

Z = q + l - k

. DO j = 1 , 2

n = m + q - j

- ~ ( n + 1) = L(n + 1) - L(n)

Page 22: Self-starting multistep methods for the numerical

w i l l y ie ld vpf, i n L(p + m), p = O(1)q. The diagram i l l u s t r a t e s t h e case q = 3 , m = 0 .

~

I n i t i a l values

L ( 3 ) = f3

L(2) = f2

~

L ( 1 ) = f l

L(0) = f o

k = 3 , 2 = 1 k = l , 2 = 3

j = l , n = 2 j = 1, n = 2 j = l , n = 2

L(3) = L(3) - L(2)

= vf3 - v f2 = v-3 - v-2

= V2f3 = v3f3 -

j = 2 , n = 1

= vf2 - vf l

= Ff2 -

= f 3 - f 2

= v f3

j = 2 , n = 1

L(2) = L(2) - L ( 1 ) L(2) = L(2) - L ( 1 )

= f2 - f l

= vf2

j = 3 , n = O

L(1) = L ( 1 ) - L(0)

= f l - f,

= vp1 _ _ _ _

To obtain backward differences of f , it i s necessary t o make t h e assumption t h a t Vq+lf = 0. Then Vqf i s constant:

vqfp = $-fo = vqf , p = l(1)q Then t h e addi t ional nested DO LOOP

r = q - 1

DO k = l , r

2 z q - k

DO j = l , l

n = m + q - j

L(n) = L(n) - L(n + 1) yields @fo i n L(p + m), p = O(l)q, t he desired r e s u l t . The diagram i l l u s t r a t e s the case q = 4, m = 0.

20

Page 23: Self-starting multistep methods for the numerical

~

I n i t i a l values

L(4) = V4.f

L(2) = f f 2

L(0) = f,

k = l , 2 = 3

j = l , n = 3

L(3) = L(3) - L(4)

= a”f3 - V4f3 = v3f2

~

j = 3 , n = l

L(1) = L(1) - L(2)

= v f 1 - ffl = Vf,

k = 2 , 2 = 2 k = 3 , 2 = 1 I I

21

Page 24: Self-starting multistep methods for the numerical

REFERENCES

1. Henrici, Peter: Discrete Variable Methods i n Ordinary Di f f e ren t i a l Equa- t ions . John Wiley and Sons, Inc., 1962.

2. Whittaker, E. T.; and Watson, G. N.: A Course of Modern Analysis. Fourth ed., Cambridge Univ. Press, 1940.

3. Herrick, Samuel: Step-by-step Integrat ion of x = f(x,y,z, t) Without a "Corrector ." no. 34, Apri l 1931, pp. 61-67.

Mathematical Tables and Other Aids t o Computation, vol. 5 ,

4. C o l l a t z , L.: The Numerical Treatment of D i f f e ren t i a l Equations. Third Edition, Springer, 1960.

5 . H u l l , T. E.; and Creemer, A. L.: Efficiency of Predictor-Corrector Pro- cedures. Journal of the Association f o r Computing Machinery, vol . 10, no. 3, Ju ly 1963, pp. 291-301.

22

Page 25: Self-starting multistep methods for the numerical

P/k -1 0 1 2 3 4 5 6 7

60480 y 6 19087 -863 2 71 -191 271 -863 19087 198721 943759

-

0

1

0 -1 -2 -3 -4 -5 -6 -7 -8

120960 y 7 36799 -1375 351 - 191 191 -351 13 75

-36799 -434241

Y 0

1 1 1 1 1 1 1 1 1

-

73 121 181 253 337

2Y 1

1 -1 -3 -5 -7 -9

- 11 - 13 - 15

-51- -124 -245 -426 -679

12Y 2

5 -1 5 23 53 95 149 215 293

120 1. 120 . - . 2 I.

1 1 l l 0

37 13 I -14 -1

24Y ~

3 9 -1 1 -9 -55 -161 -351 -649

- 10 79

72OY 4 - 251 - 19 11

- 19 25 1 1901 6731 17261 36731

1440 y 5 475 -27 11

- 11 27

- 475 - 4277 -17739 -52261

2400 4 19 -I -I 19 299 13 19 3 799 8699 17219

2400

5 18 -1 0 1

- 18 -317

- 1636 -5435

- 1413 4

604800 6 43 15 -221 31 31

-221 43 15 84199

1866091 496471

604800 7

~~

4125 -190 31 0

-31 190

- 4125 -88324

- 5 84795

3 6288000

23 7671 - 9829 1571 -289 -289 15 71 -9829 23 76 71 5537111

8

Page 26: Self-starting multistep methods for the numerical

g = 0: 2y P/" 0

0 -1 1 -3 2 3

- ~ -- ~~ ~~

g = 1: 12y I q =- 2: 24y- . . ~

0 1 0 - 1-2 12- -7 1 -15 4 -1

-13 -5 -25 -12 1 -7 -23 -23 -28 -9

-33 4 -55 -_ ~ - - ~- -

- 1

462 - 830

-1522 - 13 74 -1586

962 _ ~

P/m 0 1 2 3 4 5

~ ___- -

3 -

0 1 2 3

-469 177 -87 19 -739 -393 63 -11 -709 -783 -327 1-9 -739 -633 -897 -251

_I_

-469 -1743 873 -1901

. - . . ..

g = 6: 1209603. 0

- 84161 -122335 - 120609 - 121151 -120769 - 1213 11 -119585 - 15 775 9

1 55688 - 74536

-119272 - 122488 -118312

13 8008

- 124792

-130936

2 ~ -.

-66109 26813

-67165 - 128803 -115261 -129859 -8943 7

- 903 715 _ - _

3

-17984

-60480

- .

5 7024

14528

-135488 - 1029 76 - 177984 1198528

- +

4

-31523 8899

-5699 7843

-53795 -147773 -54851

-1465949

5 . -_ -

9976

1528 -1688 3832

-2648

-46424 -176648 717928

.-

6 -

- 13 75 351 - 191 191

-351 13 75

-36 799 - 43 4241 ~-

Page 27: Self-starting multistep methods for the numerical

2

-4234 244 5730 60104 120526 184476 178874

3 4

-434 186 -376 31 5730 -376 60724 5265 116726 63574 266976 54851

3036 -1171 4125 60290

i 120991 1 181440 241889 302590 I358755

' P/m 0 0 1

0 1 1 0 1 1.3 12 1 2 23 14 3

q = 3: 2400 I q = 4: 604800 1 1 2 3 4 2144 5 420 60104 120 83 6 1825 76 220124

-2334 - 66 5730 60414 118626 225 726

1136 - 124 -3 76 5 420 62624 75476

-221 31 31

-221 43 15 84199

= 5: 604800 1 q 1

- 190 4 88324 4125

.-

p/m 0 1 2 3 4

0

3094 5265

181626

327340

60104 120991

240749 5 6

I q = 6: 36288000 1 0 1 2 3 4 5 6

244614 306474 3607974 7261194 10 88813 4 14503914 182143 74 20099274

- 401475 3 8205 339465 3601905 7255125 10921125 14297505 2320 5 465

3 78740 -57460 - 16 780 3 495 80 3612020

11265140 5979020

7200140

-217695 3 4725 -2475 -26895 339465 366 7005 6 856 125 19583 625

703 74 - 11286 173 4 3594

-20826

3 873 414 306474

186503 4

~~

- 9829 15 71 -289 -289 15 71 -9829 23 76 71 553 7111

7259171 10886111 14514911 181455 71 21762971 25639271

5 6 7

25

Page 28: Self-starting multistep methods for the numerical

~ - .

q = 0: a ] g = 1: 2a

q = 3 : 24a p / m ~ 1 2 3 1 9 19 -5 1 2 8 32 8 o 3 9 27 27 9 4 0 64 -32 64 5

q = 4: 720a 2- 1 3 1 - 4 ~-

o 1

251 646 -264 106 -19 232 992 192 32 -8 243 918 648 378 -27 224 1024 384 1024 224 475 -250 3000 -1750 2125

P/" 0 1 1 19087 65112

3 18495 87480

5 18575 87000

2 18224 90240

4 18304 89088

6 17712 93312 7 36799 -41160

26

__ ~

2 3 4 5 6 -46461 37504 -20211 6312 -863

31347 58752 -19683 5832 -783

31875 80000 58125 28200 -1375

528 21248 -12912 4224 -592

24576 96256 11136 3072 -512

11664 117504 11664 93312 17712 418803 -570752 717213 -353976 216433

Page 29: Self-starting multistep methods for the numerical

1 2 3 4 5 6 7

6 -1 16 32 27 54 27

I q = 4: 14 1 2

2048

-

0 1 1 - 2 3 4 5 7386 12945 -9132 5646 -2046 321

17040 52224 -17760 13056 -4848 768

36096 136704 16896 58368 -7680 1536 45750 178125 37500 93750 18750 4125 53136 233280 23328 176256 11664 46656

26568 94527 -1944 23490 -7776 1215

0

28549 65728

102465 139264 176125 212544 257593

NASA-Langley, 1965 A-2116

-

57750 223 488 400950 577536 753 750 933120

1051638 . ~~~

q = 6: 120960~ 2

-51453

-64881 - 10 7520

-9216 46875 93312

324135

3 42484

100864 170100 335872 512500 705024 585844

4

-23109 -55872 - 88209

- 28125 46656

4393 83

- 10 7520

5 ~~

725 4 17664 27702 36864 5 7750

186624 129654

-2432 -3807 -5120 -6875

175273

Page 30: Self-starting multistep methods for the numerical

“The aeronautical and space activities of the United States shall be conducted so as to contribute . . . to the expansion of hriman knowl- edge of phenomena in the atmosphere and space. The Administrdtion shall provide for the widest practicable and appropriate dissetnination of information concerning its actiuities and the results thereof . I J

-NATIONAL AERONAUTICS A N D SPACE ACT OF 1958

NASA SCIENTIFIC AND TECHNICAL PUBLICATIONS

TECHNICAL REPORTS: important, complete, and a lasting contribution to existing knowledge.

TECHNICAL NOTES: of importance as a contribution to existing knowledge.

TECHNICAL MEMORANDUMS: Information receiving limited distri- bution because of preliminary data, security classification, or other reasons.

CONTRACTOR REPORTS: Technical information generated in con- nection with a NASA contract or grant and released under NASA auspices.

TECHNICAL TRANSLATIONS: Information published in a foreign language considered to merit NASA distribution in English.

TECHNICAL REPRINTS: Information derived from NASA activities and initially published in the form of journal articles.

SPECIAL PUBLICATIONS Information derived from or of value to NASA activities but not necessarily reporting the results .of individual NASA-programmed scientific efforts. Publications indude conference proceedings, monographs, data compilations, handbooks, sourcebooks, and special bibliographies.

Scientific and technical information considered

Information less broad in scope but nevertheless

Details on the availability of these publications may be obtained from:

SCIENTIFIC AND TECHNICAL INFORMATION DIVISION

NATIONAL AERONAUTICS AND SPACE ADMINISTRATION

Washington, D.C. PO546