ordinary differential equations T. D. Bui Department o f Computer Science, Sir George Willianzs Campus, Coneordia University, Montrdal, Qudbec, Canada T. R. Bui Depart ment o f Applied Sciences, Universitd du Quebec, Chicoutimi, Quebec, Canada (Received October 19 78; revised April 19 79) Comput er si mul ati on of dynami c systems very of t en leads t o the sol ut i on of a set of st i f f or di nar y di f f er ent i al equations. The sol ut i on of this set of equati ons involves t he eigenvalues of its Jacobian mat r i x. The greater the spread in eigenvalues, t he more t i me consumi ng t he sol uti ons become when existing numeri cal methods are empl oyed. Ext r emel y st i f f di f f er - ential equations can become a very serious problem f or some systems, rendering accurate numerical sol uti ons compl etel y uneconomic. In this paper, we propose new techniques f or solving ext r emel y st i f f systems of di f f er ent i al equat i ons. These al gori thms are based on a class of i mpl i ci t Runge- Kut t a procedure wi t h compl et e error esti mate. The new techniques are appl i ed t o solving mat hemat i cal models of t he rel axat i on pr obl em behi nd blast waves. I n t r o d u c t i o n St i f f differential equat i ons arise in physi cal equat i ons due t o t he existence o f great l y di fferi ng t i me const ant s. Time const ant is a t er m used b y engioeers and physi ci st s t o refer t o t he rat e o f decay. For exampl e, t he equat i on dy/ dt = Xy has t he sol ut i on y = c ext. I f X is negative, t h e n y decays by a f act or o f l i e in t i me T = I]X. Ti s called t he time const ant f or a syst em descri bed by t he above differential equat i on. The larger t he value o f ?,, tile smaller t he t i me const ant . I n a syst em o f differential equat i ons, di fferent state variables decay at di fferent rates. For t he syst em: d Y = F( Y) ( l ) dt wher e: Y =( Y l , Y 2 . . . . . y, , ) T F= ( f l , f 2 . . . . . L, ) T t he decay rates may be related l ocal l y t o t he eigenvalues o f t he Jacobi an mat r i x o f t he syst em (i.e. OF/3 Y). I f some o f t he decay rates are slow and ot her s are fast, t he fast ones will cont r ol t he st abi l i t y o f t he numeri cal met hod used t o solve t he syst em o f equat i ons (1). Consider, for exampl e, t he mot i on o f a damped har moni c oscillator whi ch is descri bed by t he pair o f equat i ons: dy - v y = di spl acement dt do ( 2 ) - --TV -- w2y V = vel oci t y dt Assuming t hat : 7 = I 000. I ; w = 1 ; y ( 0 ) = 0; v( 0) = 999. 9. To a good appr oxi mat i on, t he sol ut i ons are: y = _ e - 1 0 0 0 t + e -O-It v = 1000e -1000t - 0.1 e -OAt (3) 0307-904X/79/050355-04/$02.00 1979 IPC Business Press Ltd Appl. Math. Modelling, 1979, Vol 3, Oct ober 355 Numeri cal methods f or di fferenti al equations: T. D. Bui and T. R. Bui In tiffs syst em, t he eigenvalues of the Jacobi an mat ri x are X1 = - 1000, k2 = - 0 . I . Bot hy and v have a rapidly decaying component corresponding t o Xt, which very quickly becomes insignificant. However, for a stable numerical solution, most explicit met hods require t hat lit kl] and Ih X2I be bounded by a small region. This region is called the region of absolute stability. Tile stability of the numerical integration o f tile system of equations (2) is governed by 1- 1000h I. I f the well- known Runge-Kutta fourth-order met hod is empl oyed, t hen we must have 1- 1000hl < 2.8 giving the maxi mum stable step-size h = 0.0028. Thus, nearly 100 000 integration steps would be required to reach the point where the slowly varying t erm is one-tenth of the maxi mum value. Ne w d e v e l o p me n t s We are concerned here with the numerical solutions of the system of differential equations: dy - - = f ( y ) , t > t o dt y ( t o ) =Yo (4) where t E R, y @ R' , Y0 E R n and f : R" ~ R" is assumed analytic in the nei ghbomhood ofYo. Tim system of differential equations (4) is called stiff in an interval I, i f for Vt C I the eigenvalues ~ i ( t ) of the Jacobian mat ri x a l l a y satisfy the following conditions: l Real Xi ( t ) "( 0, i = 1, 2 . . . . . n ( i ) max [ Real ;~ i ( t ) [ >> rain [ Real k i ( t ) [ (ii) t t New developments for st i ff differential equations are based upon one o f the following two approaches. The first approach is tO build into the comput er program logic that notes the fact t hat some t erms in the solution are no longer i mport ant and then modifies or eliminates certain equations from the system. An example of this first approach is a program called NEST developed by Emanuel 2 for large systems of equations arising in chemical kinetics. The second approach aims at developing met hods having a large region of stability on the compl ex hX-plane (where h is the t i me step-length and X is the largest eigenvalue of the Jacobi an mat ri x of the system). Examples of this latter category include work done by others. 3-7 The region of stability for a met hod is defined as the domain on the ;kh-complex plane, in which we obt ai n lyre + l [Yml = c < 1, when the met hod is applied to the test equation: dy - - = Xy, Y ( to) = X o ( S ) dt where X is a compl ex constant with negative real part. Def i ni t i on 1 A met hod is stiffly-stable if its region of stability contains a region R = R I tO R2 where: R l = {Real(~,h) < D < 0} R2 = {D < Real(Xh) < t~, I hn(;~h)l < 0} Def i ni t i on 2 A met hod is called A-stable in the sense of Dahlquist i f the region of stability associated with that met hod contains the open left half-plane. De f i ni t i on 3 A met hod is called L-stable if it is A-stable and c --+ 0 as Xh -+ _oo. The concept of L-stability is a very i mport ant one, since in general A-stable met hods which are not damped maxi- mally as Xh -+ _co are unsatisfactory. This undesirable asympt ot i c behaviour oft en results in oscillatory solutions for very st i ff systems. These oscillatory solutions may be meaningless but are considered suitable as long as the oscillations gradually die out. Oscillatory solutions are associated with, for exampl e, the A-stable implicit trapezoidal rule since the asympt ot i c behaviour for this met hod is: l Y ' " ~------2~ I - ~ I a s ~ h ~ _ o o I )' -~ I i For ext remel y stiff systems, it is desirable t o develop L-stable met hods rather than non-maxiinally damped A-stable met hods or stiffly stable met hods. The develop- ment of L-stable met hods has not received adequate at t ent i on in lhe past. Most available packages for st i ff differential equations are based on met hods which are not A-stable or met hods which are A-stable but not damped maximally as Xh ~ - , ~. The aim of this work is to develop met hods with variable orders which are L-stable and to implement these met hods into a package for handling ext remel y stiff systems. De v e l o p me n t a nd i mp l e me n t a t i o n o f L- s t a bl e me t h o d s We will derive and i mpl ement some L-stable met hods based on a class of Runge-Kutta met hods known as the Rosenbrock procedure. The conditions of L-stability require that the met hods must be implicit in nature. Fully implicit Runge-Kutta as well as semi-implicit Runge-Kutta met hods are known t o satisfy the condition of strong stability. 6,s However, these met hods require to solve a system of nonlinear equations at each step. The Rosen- brock procedure requires onl y the solution of a system of linear equations at each step, a much simpler task compared to fully implicit or semi-implicit approaches. 9 The Rosenbrock procedure for solving the system of equations (4) is defined by: $ Ym+l =Ym +h ~. w i k i i =I i - - 1 k i = f ( Y m +h E a ijk j) ] =1 + dh m + Z bi l k i j =l where wi , aij, bi i and d are constants to be defined so that the condition of L-stability is satisfied. (6) Two-st age second-order me t h o d Rosenbrock l has proved that tile following two-stage, second-order scheme is L-stable: wl = 0, w2 = 1, a21 = ( x / ' 2 - 1)]2,~b21 = 0, and d = 1 - X/~/2. The met hod is defined as follows: Ym l =Ym +hk 2 k l = A ( y , , , ) - l f ( y , , , ) (7) k2 = A ( Y m ) - If(y, , , + ha21k l ) 356 Appl . Math. Model l i ng, 1979, Vol 3, October where: Three-stage t hi rd- order me t h o d For s = 3, we have proved tllat t he fol l owi ng scheme is = 1 L-stable: wt = O, Iv2 = w3 7, a2t = - 0 . 5 0 9 643 6824, a31 = 0. 327 025 8661, a32 = 0. 310 884 7731, d = 0. 435 866 5216. The met hod is defi ned by: Y, n+l =Ym + {h( k2 + k3) k l = A ( y , , , ) - ' f ( y , , , ) k2 = A ( Y m ) - I f ( Y , , , + ha21 k i t k 3 = A ( y m ) - I f ( y m + h a 3 1 k l + h a 3 2 k 2 ) where b q = 0 for all i and L Four-st age f o u r t h - o r d e r me t h o d A four-stage, f our t h- or der L-stable met hod based on procedure (6) was devel oped in one o f our previ ous papers.H, 12 Tile paramet ers are defi ned by: wl = 0. 945 156 478 6 w2 = 0. 341 323 172 w 3 =0 . 5 6 5 513 957 5 w4 = - 0 . 8 5 1 993 608 1 a21 =--0. 5 a31 = --0. 101 223 611 5 a32 = 0. 976 223 611 5 a41 = - - 0. 392 209 676 3 a42 =0 . 7 1 5 114025 1 a43= 0. 143 037 1 6 2 5 d =0 . 5 7 2 816 062 5 4 Ym+l = y m + h ~. w i k i i=1 k l = A ( ) ' m ) - I f ( Y , , , ) k2 = A ( y m ) - I f ( Y m + ha21 k l ) k3 = A ( Y m ) - I f ( Y , , , + h ( a 3 1 k l + a32k 2) ) k4 = A ( y m ) - I f ( y m + h(a41 k l + a42k2 + a43k3)) The LSTI FF program wor ks wi t h a fixed formul a selected by t he user at t he start o f t he i nt egrat i on f r om among tile above tllree formul ae, designated by number o f stages and or der : LSTWF (2, 2) LSTI FF (3, 3) LSTI FF (4, 4) Equat i on ( 7) Equat i on (8) Equat i on (9) Tiffs program was i mpl ement ed on tile CDC Cyber 172 at t he Comput i ng Cent er o f Co]lcordia University. The step- size is cont rol l ed by est i mat i ng local error using Ri chard- son' s ext r apol at i on scheme. First a step-size h is t aken f r om Ym t o comput e Y m +l. Next , t he value ofy*~ +l is r ecomput ed using twice t he step-size h i 2 . The est i mat e o f tile local t r uncat i on error is t aken t o be: I l y * , + 1 - - Yt H +dl Em+l = 2 s - 1 where s is the or der o f t he filethod, [l " II is t he wei ght ed RMS nor m: [ l yl l =[1 ~ ( y i / y i a x ) 2 ] 1/2 L I I i = I Numeri cal methods f or di f f erent i M equations: T. D. Bui and "1-. R. Bui and yi~ax is the maxi mum i nodul us o f tile ith component so far in tile i nt egrat i on. This is mot i vat ed by t he idea that, if tile user specifies a local error t ol erance c, . t hen errors o f order e'.1'~nax are allowed wl l e ny i is neary~nax, and it is not in general useful t o require later errors t o be smaller t han t hat . Tile following st rat egy is empl oyed: 13 (it I f E m + 1 > e, tile st ep is rejected and h is reduced t o make tile expect ed error -~ e l 5 . (ii) I f 3e[4 < E m + i ~< e, t he st ep is accept ed, but h is reduced t o make the expect ed error on tile next st ep ~ e / 5 . (iii) I f e [ l O < E m + l <. 3 d 4 , the step is accept ed and t he (8) same h is used for t he next step. (iv) I f E m +1 ~< e/ 10, t he step is accept ed and h is in- creased t o make an expect ed error on tile next st ep ~e / 2 . The mat ri ces [A(Ym) ] are eval uat ed f r om t he Jacobi an supplied by t he user. Equat i on ( 9) o f this package was tested on t he system of t wo st i ff or di nar y differential equat i ons: d x - I 0 0 0 0 4 x + 1 0 0 0 0 y 4 dt d y - - = X - - . 1 ' - - . t , 4 dt wi t h initial condi t i ons x( 0) = y( 0) = 1.0. The stiffness ratio for this pr obl em is 104 . Some compar i sons wi t h ot her A-stable met hods were publ i shed elsewhere. 12 It was concl uded t hat L-stable met hods are very i mpor t ant for ext r emel y st i ff systems. (9) Ap p l i c a t i o n s The package described in tills paper was empl oyed t o solve t he rel axat i on equat i ons for t he t wo modes o f vibrational coupl i ng Of t he CO2 mol ecul es in a CO2 - N2 - He mi xt ure behi nd blast waves.14 The mat hemat i cal model l i ng o f tllis pllysical syst em produces t wo rel axat i on equat i ons f or t he vibrational energies e v t and ev2: d e v i ( T v l ) 1 = - - { e v l ( T ) - e v l ( Tv t ) } d t T 1 ( 1 0 ) dev2(Tv2 ) 1 - - = - - {ev2( T) - ev2(Tv2)} d t r2 where Tvl and Tv2 are t he vibrational t emperat ures for t he t he t wo modes: evt -Xc~_l _Vc2 ~ [ ~ ( e h v , l k T v l - - 1 ) - ' IV /~C2 2hv2 I] + "--'if- (e hv21kTvl - - 1 ) - Xco~l eco~ ~ hv3 (ehvdkTv2 _ 1) - I ev 2 - it--- 7 KCO~ ~ "~ X N IItN, h v ll t RN "--~. (e hv/krv2 -- 1 ) - 1 wltere Xi , Wi and R i are t he mol e fract i on; mol ecul ar weight and tile gas const ant o f species i respectively, I = Xi Xi l Vi ; Vl, v2, v3 denot e t he vibrational frequenci es o f tile sym- met ri c, bendi ng and asymmet r i c modes for CO 2 respec- tively, v denot es tile vibrational f r equency o f N2, h and k are t he Planck and Bol t zmann const ant s respectively. Appl. Math. Modelling, 1979, Vol 3, October 357 Numeri cal methods f or di fferenti al equations: 7-. D. Bui and 7". R. Bui T denot es t he t ransl at i onal t emper at ur e, and t he relaxation times r l and r2 are as given as: 7"1 =Tc I"2 = ( Xc o 2 + XN 2) ( Xc o ' i. a I -t- XN21" b 1) - 1 where ra, r b and ~'c refer t o t he rel axat i on times whi ch are averages o f t he detailed COz - CO2 , CO2 - N2 , CO2- He , N2 - N 2 and Nz - He collisions, i.e.: - 1 Sc 0 2 XN2 Xtte = - t - - I - 1"a (Ta) CO2- CO2 (l"a) CO2 - N 2 (Ta) CO2- He . SHe T~ 1 = XCO~ "l- XN2 + (l' b) N2 - C0 2 (7b) N2 - N2 ( r b) N2 - He --1 _ XCO2 XN2 XHe re - + + (' tc) CO2- CO2 ('/'c) CO2- N2 ('/'c) CO2- He The values (' r)i _j are t aken f r om t he compi l at i on by Tayl or and Bi t t erman. is The pr ogr am LSTI FF was used t o solve t he syst em o f equat i ons (10) f or Tvl and Tv2. These vibra- t i onal t emper at ur es can be used t o calculate t he particle popul at i ons o f t he upper and l ower laser levels behi nd t he shock f r ont . Due t o t he very fast quenchi ng rat e o f t he t ransl at i onal t emper at ur e (i.e. T) behi nd t he blast f r ont , t he syst em o f equat i ons (10) becomes very stiff. The well- known Runge- Kut t a met hod o f or der f our requires a t i me step-size in t he or der o f 10 -22 t o obt ai n stable solutions. Our package allows t he use o f large i nt egrat i on step-sizes t hus reduci ng comput i ng t i me by a significant f act or while mai nt ai ni ng small t r uncat i on errors. The coupl i ng bet ween the gas dynami cs o f t he blast wave and t he chemi cal syst em is an ext r emel y nonl i near pr obl em. Due t o t he di fferences bet ween t he react i on rates, t he stiffness ratio f or this pr obl em can be as high as 1012. Ther ef or e, packages based on met hods whi ch are onl y st i ffl y stable such as Gear' s DI FSUB will not be able t o solve probl ems o f this ki nd. Co n c l u s i o n s While most ot her t echni ques f or integrating st i f f differ- ential equat i ons are not A-st abl e, or are A-stable but not damped as kh -+ _0% t he met hods devel oped in tiffs paper are all L-stable. The package LSTI FF combi nes t he desir- able condi t i on o f st rong st abi l i t y (L-stable) wi t h a reason- able or der o f accur acy while still mai nt ai ni ng comput at i onal effi ci ency by preserving the one-st ep nat ure o f t he met hod. Ac k n o wl e d g e me n t This wor k was suppor t ed in part by t he Nat i onal Research Counci l o f Canada t hr ough its grant A-9265. Re f e r e n c e s 1 Lambert, J. D. 'Computational methods in ordinary differ- ential equations', Wiley, New York, 1973 2 Emanuel, G. Rep. TDR-269(4230-20)-3, The Aerospace Corporation, E1 Segundo, California, 1964 3 Liniger, W. and Willoughby, R. A. SIAMJ. Nunzer. AnaL, 1970, 7, 47 4 Treanor, C. E. Math. Comp., 1966, 20, 39 5 Gear, C. W. 'Numerical initial value problems in ordinary differential equations', Prentice-flail, Englewood Cliffs, New Jersey, 1971 6 Butcher, J. C. Math. Comp., 1964, 18, 50 7 Butcher, J. C. BIT, 1976, 16, 237 8 N6rsett, S. P. Math. and Computation Rep. 6/74. Dept of Math., Univ. of Trondheim, Norway, 1974 9 Bui , T. D. Math. Comp., 1979, 33, No. 147 10 Rosenbrock, It. II. Comptlt. J., 1963, 5, 329 I1 Bui, T. D. blf. Process. Lett., 1977, 6, 158 12 Bui , T. D. J. A. C. 3L, 1979, 27(3), 483 13 Alexander, R. SIAMJ. Numer. AnaL, 1977, 14, 1006 14 Bui , T. D. etal. ActaAstron. , 1974, 1, 1085 15 Taylor, R. L. and Bitterman, S. ,Rev. Mod. Phys., 1969, 41, 26 358 AppI. Math. Modelling, 1979, Vol 3, October