21
il NORTH - H(KIAND Partitioning Ordinary Differential Equations Using Runge-Kutta Methods Mohamed B. Suleiman, Fudziah Bt. Ismail, and Kamel Ariffin B. M. Atan Department of Mathematics Universiti Pertanian Malaysia ~3~00 UPM Serdang Selangor Malaysia ABSTRACT Two techniques for detecting stiffness when using Runge-Kutta type of methods are discussed and compared, and a partitioning strategy for first-order system of equations into stiff and nonstiff subsystems is proposed. A few problems are solved using three-stage semi-implicit Runge-Kutta method. Newton iteration is used for the stiff part and simple iteration for the nonstiff. Finally, numerical results based on different criteria to detect stiffness are compared. 1. INTRODUCTION Many physical problems can be formulated into systems of ODEs (ordinary differential equations). These problems are classified into stiff and nonstiff ODEs. Most methods for solving stiff systems of ODEs are based on implicit formulae and require the use of Newton-like iteration, which con- sumes a considerable amount of computational effort. If the system can be partitioned dynamically into stiff and nonstiff subsystems, that is, a nonstiff equation is placed into the stiff subsystem at the point of its instability, which is commonly known as componentwise partitioning, then more effec- tive code can be developed so that the cost of solving such systems can be reduced. Methods commonly use to solve systems of ODEs do not partition the systems into stiff and nonstiff subsystems, instead the whole system is treated as stiff or nonstiff [1-3]. APPLIEDMATHEMATICSAND COMPUTATION 79:289-309 (1996) © Elsevier Science Inc., 1996 0096-3003/96//$15.00 655 Avenue of the Americas, New York, NY 1 0 0 1 0 SSD10096-3003(95)00247-F

Partitioning ordinary differential equations using Runge-Kutta methods

  • Upload
    upm

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

il N O R T H - H ( K I A N D

Partitioning Ordinary Differential Equations Using Runge-Kutta Methods

Mohamed B. Suleiman, Fudziah Bt. Ismail, and Kamel Ariffin B. M. Atan

Department of Mathematics Universiti Pertanian Malaysia ~3~00 UPM Serdang Selangor Malaysia

ABSTRACT

Two techniques for detecting stiffness when using Runge-Kutta type of methods are discussed and compared, and a partitioning strategy for first-order system of equations into stiff and nonstiff subsystems is proposed. A few problems are solved using three-stage semi-implicit Runge-Kutta method. Newton iteration is used for the stiff part and simple iteration for the nonstiff. Finally, numerical results based on different criteria to detect stiffness are compared.

1. I N T R O D U C T I O N

Many physical problems can be formulated into systems of ODEs (ordinary differential equations). These problems are classified into stiff and nonstiff ODEs. Most methods for solving stiff systems of ODEs are based on implicit formulae and require the use of Newton-like iteration, which con- sumes a considerable amount of computational effort. If the system can be partitioned dynamically into stiff and nonstiff subsystems, that is, a nonstiff equation is placed into the stiff subsystem at the point of its instability, which is commonly known as componentwise partitioning, then more effec- tive code can be developed so that the cost of solving such systems can be reduced.

Methods commonly use to solve systems of ODEs do not partition the systems into stiff and nonstiff subsystems, instead the whole system is treated as stiff or nonstiff [1-3].

APPLIED MATHEMATICS AND COMPUTATION 79:289-309 (1996) © Elsevier Science Inc., 1996 0096-3003/96//$15.00 655 Avenue of the Americas, New York, NY 1 0 0 1 0 SSD10096-3003(95)00247-F

290 M.B. SULEIMAN ET AL.

Studies on componentwise partitioning have been done by Suleiman and Baok [4], using multistep methods, while Rentrop [5] used the Rosenbrock Wanner method for the treatment of the stiff components and the Runge- Kutta-Fehlberg method for the nonstiff subsystem.

Before partitioning is done, the system of ODEs has to be identified as stiff. Here two techniques to detect stiffness were experimented, the first one is whenever h~c ¢ is greater than hirer where hac c is the largest stepsize that could achieve the desired local accuracy, and hiter is the largest stepsize for the iterations of the solution to converge. The second technique uses the nonconvergence property of the method to detect stiffness. Then component- wise partitioning using Runge-Kutta methods is performed if the criterion is satisfied.

The method used is a third-stage Runge-Kutta semi-implicit method with Newton iteration for the stiff part and simple iteration for the nonstiff.

The cost of solving the systems can be obtained by counting the number of Jacobian evaluations and the number of steps. Finally, numerical results based on the two techniques to detect stiffness are compared.

2. STIFFNESS DETECTION CRITERIA

Bruder et al. [1] used the explicit Runge-Kutta method to solve nonstiff problems and the adaptive Runge-Kutta method for stiff problems. Their criterion to detect stiffness is

hfl fyil < c . r , (2.1)

where h is the stepsize, r is the maximal radius for the half circle included in the stability region of the explicit Runge-Kutta method, ]ifyl] is an approximation for the spectral radius for the system, and c is a safety factor. The whole system is considered stiff if (2.1) is satisfied.

Shampine [2] suggested stiffness index to detect stiffness, where

haf~c stiffness index --- . (2.2)

biter

If the stiffness index is large, the system is considered stiff. Billington [3] used this idea and implemented it for the semi-implicit third-stage Runge- Kut ta method where his stiffness detection is

h~c c > 10 × hiter. (2,3)

Partitioning ODEs U'sing Runge-Kutta Methods 291

In all the above criteria, componentwise partitioning is not being done, but the whole system is considered stiff or nonstiff.

In the case of componentwise partitioning, Suleiman and Baok [4] used the nonconvergence property to detect stiffness. The component that caused the instability is identified and changed to stiff and solved using Backward Differentiation method. Rentrop [5] used the Runge-Kutta-Fehlberg (RKF) method to solve nonstiff components, while the stiff components were solved using the Rosenbrock Wanner (ROW) method. The stiffness detection depends essentially on the comparison of the proposed stepsizes for compo- nent i of the two methods HRKF(i) for the RKF method and HROW(i) for the ROW method, correspondingly. A switch to stiff computation is per- formed on component i if

H R K F ( i ) . HFAK < HROW(i ) (2.4)

where HFAK = 1.4 is the additional computational amount of the ROW method.

Here first order systems of ODEs are solved using the semi-implicit Runge-Kutta method, which is given by

( ) k i = f x~+ cih, Yn + h ~ airk r r = l

3

Y~+ I = Yn + h ~ b,k i. i = l

(2.5)

Let the first w equations be in the nonstiff subsystem and the next n - w equations in the stiff subsystem. For the nonstiff subsystem, calculate h~c and hiter. For the stiff subsystem, they axe denoted correspondingly by h~c¢1 and hiter 1. Our first criterion to detect stiffness is when h~c c is greater than hiter for the nonstiff subsystem or when h~¢ d is greater than hiter 1 for the stiff subsystem.

The second criterion is using the nonconvergence property. Stiffness may be suspected in both subsystems if the iterations on ki(j) do not converge or the local truncation error is greater than the chosen tolerance. Once stiffness is confirmed by a further test, the component that is associated with the largest perturbation, which is the cause of stiffness, is identified. Note that

292 M.B. SULEIMAN ET AL.

stiffness may occur in the equation already stiff, due to coupling to a nonstiff component.

3. IMPLEMENTATION

First order system of ODEs,

y ' = f ( x , y ) , y( a) = ~?; ~q, y, f e R " (3.1)

is solved using the three-stage semi-implicit Runge-Kutta method, given in (2.5), where ci, b,, and air are given by the following

Ci air

1 - - - 1 - - - 2 2

- 1 8 + 27 - 1 9 + 14~/2 2

53 - 5 ~ 2 -

2 62

2 9 + 5 ~

62 (3.2a)

2

bi 263 - 95¢~ 47 + 33¢~ -2 +¢~

186 186 3

For the error calculation, the second stage Runge-Kutta method is used with the values of ci, air and b i are given as follows

Ci air

~/2 v~2 1 - - - 1 - - -

2 2 27~/2 ~/2

- 1 8 + ~ - 1 9 + 14¢2 1 - - - 2 2

(3.2b)

bi 53 - 5¢2 9 + 5¢2

62 62

Codes used in this paper are divided into two parts, one for solving the nonstiff subsystem using the method in (2.5) with simple iteration, and the

Partitioning ODEs Using Runge-Kutta Methods 293

other for solving the stiff subsystem, using the same method with a Newton-type iteration. Initially, all the equations are treated as nonstiff. When stiffness is detected, the necessary equation is placed in the stiff subsystem. We continue the process until all the equations have been placed in the right subsystem and the end of the integration interval has been reached.

It is customary to initially treat the system in (3.1) as nonstiff. Let the rate of convergence---when the system is solved using simple iteration--be denoted by p. To obtain p, first form the lower bound for k i from its iterations as follows. Let (m)k i denote the mth iteration of k e Then the difference of the (m + 1)th and rath iteration is given by

A(m)ki _-('~+ 1)ki -(m)k~

( ) ( ) r ~ 1 r = 1

Thus, for the method in (2.5),

II (m+ ~)k~ -("%ill < h~/Ll~m)ki _(m- 1)k~ll '

where ~ = 1 - ~/2/2, the diagonal element of the method. Hence, the lower bound for L - [[ 8 f /8 yI[ is

1 IIA(")k~ll h~, liA(m-~)k,II"

Define the rate of convergence

IIA¢m)kll] p iiA¢m_ 1)kill. (3.3)

Then

p = 7h[18f/8 y[I. (3.4)

At least three iterations are needed to estimate p in (3.3). Initially, when k, has not been computed yet, we estimate p using (3.4) by forming a simple

294

estimate for the norm of the Jacobian as follows:

with

M. B. SULEIMAN ET AL.

118f/,~yll ~ II f ( x . , y~ ÷ 8 ) - f ( x ~ , y~)ll/8

l e y j , if 118yjll ~ 8 8 =

~ , if Ileyj[I < e ,

where 8 = 10 -8 and j = 1 , . . . , n, is the number of equations. The first steplength is

hstar t = [ tol /2]l /(P+ 1)

where p is the order of the method which, in this case, is three, and tol is the tolerance chosen. When the program has started, the step control mechanism will change hstar t t o an appropriate value.

For example, if our first estimate of p is greater than or equal to 1, meaning the value of hstar t is not suitable, calculate a n e w hstar t where

hstar t = hold//(2p), ( hold is the old hstart).

After a suitable hstar t has been obtained, k 1 can be computed allowing three iterations before testing for convergence. The test used is the same as Soderlind [6].

3.1. Convergence Test For the Nonstiff Subsystem There are three iterations; thus, for every component y( j ) of y we want,

p ) y - y(x) ll ~ c.tol, j-- 1 , . . . , n.

However,

I?)y - y(x) II _ _ H _ ( a . ) y + ~(5)y + ... )H

< Ila(4)yll(1 + p* + p*u + ... )

= 1 1 ~ ( 4 ) y l l / ( 1 - p * )

= p*l[A(a)yl[/(1 - p*), (3.5)

Partitioning ODEs Using Runge-Kutta Methods ~295

where p* = Jl~(m)y[l/l[A(m-1)yll and y(x) is the true solution.

IIA (3) yll = 11 (4) y -¢3) yll

3

~< h ~ bJlA¢3)k~ll i = 1

3

= hp ~ , b~llA¢e)k~ll i = l

(3.6)

(3.7)

where p = IIACm)/z~ll/llA <m- 1)k~11. Let us say the term of largest magnitude is [IA(r)k2]]; then from (3.6),

IIA(3) yll [Ihb 2 A(3)k2]l

]IA(2) yll Hhb 2 A(e)k21J P"

Hence, approximating p* with p and using (3.7) in (3.5), we obtained

(3 ) ] P Y - Y(X)l] "<< h P 2 / ( 1 - P) E [bi[ [[A(2)k~H •

i = l

(3.8)

From (3.8), 1~4)y - y(x)[] is a linear function of the kis and hence, after evaluating each of the k~s, we test

h( p2 / (1 - p))[ b i] IIA(e)kJl < c(tol).

( c = 0.1, a safety factor)

(3.9)

If k 1 satisfies the.condition in (3.9), compute k 2 and k 3 and test whether the condition is fulfilled. If the test failed, halve the stepsize and restart the process. When all the k~s have met the condition in (3.9), form a local error estimate (LTE), where

3

L T E ( j ) = h ~., ( b , k , ( j ) - -b~k~(j)) 1 <~ j <~ w. (3.10) i = 1

296 M. B. SULEIMAN ET AL.

b i is the coefficient of ki for third-stage method given in (3.2a) and bi is the coefficient of k i for second-stage method given in (3.2b). The local trunca- tion error for the nonstiff subsystem denoted by LTEN, where

LTEN = m a x l L T E ( j ) ]. J

If the local truncation error is greater than the chosen tolerance, we have not achieved the required accuracy; therefore, calculate a new h and restart the process. We want the method to meet a certain accuracy; hence, require h~e such that

h~cc = I Tol / (2 (LTEN) ) 11/( ' + 1) hold" (3.11)

If LTEN is less than tol, the accuracy needed has been obtained. Compute h~c as described above, and hirer the stepsize needed for the method to converge, where

hirer = hold~ p. (3.12)

The above discussion is for a nonstiff system. If the system is already partitioned, then the same discussion follows for the nonstiff subsystem. For the stiff subsystem, first form the norm of the Jacobian J1 and the rate of convergence Pl. Here J1 is given by

J1 = 1182f/82 y]l,

where f and y axe as in (3.1) and the nonstiff and stiff subsystems axe indicated by indices 1 and 2, respectively, and can be written as

f= (lf, 2f),

v =

(/i,..., L),

l Y = ( Y l , ' . ' , Yw),

2 f = ( f ~ + 1 , . . . , f n ) .

2Y = ( Y~,+l . . . . , Y , ) .

Then Pl is given directly by

Pl -- "Y hJ1.

Further, k i in (2.5) can be written as

k~ -- ( lk, , 2k3 ,

Part i t ioning ODEs Using Runge-Kut ta Methods 297

where 1 ki is for the nonstiff subsystem and 2 ki is for the stiff subsystem. The (rn + 1)th iteration of 2 k~ for the stiff subsystem is given by

(m+l)2ki 2 f 1 Yn ÷ h - i t 1)lki,2 Y. + h bi(m+l)2k i . r= 1 r= 1

Because (m+ 1) 1 ki has been computed in the nonstiff subsystem, it is the stiff (m+ 1) 2 ki which is not known here. Writ ing

(m+l)2k i =(m)2k i ÷ A(m+l)2ki,

and solving for A (m+ 1) 2 k~ using the Newton method gives

( I - ~hJ1) A(~+1)2 k ~

3.2. Convergence Test For the St i f f Subsystem We want

IIA(3)yill < (0.1) Tol.

Note that [[A(a) 2 Yill 3 A(3) 2 = h E i . 1 bill kill. Because IIA(2 3) yJl are linear combinations of IlA(a) 2 kill, we hence require

hbillA(a) 2 kill < (0.1) Tol. ( i = 1, 2, 3)

However,

IIA(2)2 kill = CllA(1)2 kill 2.

(the rate of convergence for Newton iteration is 2). Thus,

IIA(2)2 kill C =

iIA(1) 2 kill 2

and

[IA(2) 2 kill hb~llA(a) 2 kill = hb i IIA(1) 2 ky-IIA(:)~ k,II 2 < (0.1) Tol.

298 M.B. SULEIMAN ET AL.

Therefore, the test for convergence for the stiff subsystem is

( ]lA(~)2 k~ll hb~HA(2)2ki[[ < ]]A(2):k~]]

2

(0.1) Tol. (3.13)

When Pl and J1 have been computed, form the iteration matrix and the corresponding LU factorization. When this has been done, compute 2 kl, and test whether it satisfies the condition in (3.13). If it does, compute the next 2 hi. This process is continued until all the 2 his have been computed and tested. If they failed the test, form a new estimate of J l - - i f this has not been done in the last ten steps. Otherwise, halve the h and restart the step again.

When all the 2 k~s have satisfied the condition in (3.13), form the local truncation error estimate as in (3.10) for the stiff subsystem. Denote the componentwise local truncation error of largest magnitude for the stiff subsystem by LTES.

If both LTEN and LTES are less than tol, the accuracy required has been obtained. Calculate h~d and niter 1 for the stiff subsystem, which is given by

and

haccl = [ T o l / ( 2 ( L T E S ) ) [1/(p + 1)hold (3.14)

hiter 1 ~- hold/p1. (3.15)

Both h=~ and h~ccl are not allowed to increase by more than a factor of 20. The new h is

rain{ h~c , haod} ; (3.16)

now start a new step. If LTES > tol, calculate h~ccl and niter I as described above, not allowing

hac c and haccl t o decrease by more than a factor of 5, and repeat the step using the new h as in (3.16).

There are two programs used in this paper. The first program detects stiffness when ha¢ ¢ > hirer for the nonstiff subsystem and when ha¢¢1 > hiterl, for the stiff subsystem. The second program detects stiffness in the nonstiff subsystem if (3.9) is not satisfied for 1 ~< j ~< w or LTEN > tol, and in the stiff subsystem if (3.13) failed for w ÷ 1 < j < n or LTEN > tol. Once stiffness is detected, equations associated with the largest perturbations are identified and treated as stiff.

Partitioning ODEs Using Runge-Kutta Methods 299

4. P A R T I T I O N I N G S T R A T E G Y

Once the earlier test is fulfilled, we proceed with another test which measures the magni tude of the per turbat ion. Note tha t

A(m)kl = (r~+ l)k~ _(m)k~

i

- - h( f/sy) E a ra(m-1% + O(h2). (4.1) r = 1

Componentwise, it can be wri t ten as

i

A(m)ki(j) ~- h E ~ a,r(3fy/Syt) A(~-l)k~(j), (4.2) r = l t = l

( j = 1 , . . . , n.)

We have the first w equations nonstiff and the next ( n - w) equations s t i f . Define

= max[A(2)k3(0] l = 1 . . . . , w. N m a x l

and

S max = maxLA(2)k3( l)l l

l = w + l , . . . , n .

Using the first criterion, stiffness is suspected in the nonstiff subsystem if

N m a x > / to l (10 ) - l ' 5 and hac ¢ > hiter , (4.3)

and it is suspected in the stiff subsystem if

S m a x >/ to l (10) -1"5 and ha¢cl > hiter 1. (4.4)

If

Y m a x = IA(2)k3( P)I 1 ~< p < w, (4.5)

300

and

M. B. SULEIMAN ET AL.

Smax = IA(2)ka( q)l w + 1 < q ~< n, (4.6)

then stiffness is suspected at equation p in the nonstiff subsystem and at equation q in the stiff subsystem. We would expect the fourth iteration for k3(p) and k3(q) to converge poorly, giving

and

IA(3)k3( P ) I - IA(2)k3( P)I (4.7)

If

max1 v = Ih%3 a/p/a y, A(2)k3(i)l, (4.11)

then the equation associated with the largest perturbation is equation i . And if

maxlp > K ( N m a x ) (4.12)

where K ~ [0, 1.0], change equation i to stiff if it is still not stiff, else find the next largest component and repeat test (4.12).

Note that we do the test at a point of very poor convergence. If at this point Newton iteration does not converge, then simple iteration definitely will not converge either because the rate of convergence for Newton iteration

]A(3)k3( q)l ~ [A(2)k3( q)]. (4.8)

Let us look at the nonstiff subsystem first. For computational convenience, and taking into account that k 1 and k 2 are embedded in k3, neglect the terms involving k 1 and k 2 in (4.2); thus, A(3)k3(p) can be simplified as

[ A'2'k3(i) 1 a3)k3(p) = ha33 [ 8 5 / 8 y l . . . 8 f p / S y , ~ ] l ! . (4.9)

L a2,k3( )

Denote the largest component by max lv, where

maxlp = maxlha33 a S / a y , a2)k3( l)l, l = 1 . . . . , n. (4.10) l

Partitioning ODEs Using Runge-Kutta Methods 301

is higher, compared to simple iteration. Based on this fact, the technique of partitioning for the nonstiff subsystem which used simple iteration can be used for the stiff subsystem which used Newton iteration by substituting p with q into equations (4.9), . . . , (4.12).

The same technique of partitioning is implemented if we had used the nonconvergence property to detect stiffness. A(3)k3 in (4.9) can be replaced by A(~)k~, {m = 1,2, 3}, and {i = 1, 2, 3}, depending on which iteration and which k~ failed the convergence test. If the second iteration of k 2 failed the test, then A(2)k2 can be approximated using A°)k2 and equation (4.9) will be

a(~)k:(p) -- ha2~[ 8 / p / 8 y~ , . . . , ~ /p /8 y.] A(1)k2(1) ] , (4.13)

a(1)k2(n)

A<2)k3 and a33 in (4.10) and (4.11) will be replaced by A(1)k2 and %2, correspondingly. If all the k 1 s converged, but the solution is greater than the tolerance chosen, then use (3)A k 3 as in (4.9) and the rest of the technique follows.

. PROBLEMS TESTED

The following are some of the problems tested. Problem 1

Problem 2

y' = - ( 5 5 + Y3) Yl + 65y2

y ' ~- 0 , 0785 ( Yl -- Y2) yi(O) = 1, i = 1, 2

y' = 0 . 1 y l 0 < x < 20 y3(0) = 0

Y'I = - 1 0 y l + 3Y2

~/2 = - 3 Y l - 10Y2

L = -Y4

= - O . l y ~

y~(0) = 1,

0~<x~<20

i = 1 , . . . , 6

302 M.B. SULEIMAN ET AL.

Problem 3

~f2 = - 1 0 y 2 + 10( y2 + y2)

y~(0) = 1,

O~<x~<20

Y~3 = - 4 0 y 3 + 40y 2 i = 1 . . . . ,4

~4 = -100y4 + 2

Problem 4

yt 1 = 0.01 - (1 + ( Yl + 1000)( Yl + 1))(0.01 + Yl + Y2)

¢2 = 0 .01 - (1 - y l ) ( 0 . 0 i + yl + y2) y i ( 0 ) = 0,

O ~ < x < 2 0

Problem 5

Y'I = Y3 - 100 Yl Y2

Y'2= Y3 + 2 y 4 - 1 0 0 Y l Y 2 - 2 × 104y22

Y'3 = - Y3 + 100 Yl Y2

~4 = -Y4 + 104y2

i = 1 , 2

Y l ( 0 ) ~--- Y 2 ( 0 ) = 1

y 3 ( 0 ) = y 4 ( 0 ) = 0

0 ~ x ~ < 1 0

6. NUMERICAL RESULTS AND REMARKS

The third stage semi-implicit Runge-Kutta method and partitioning strategy discussed in Section 4 have been used to solve the five problems given. Numerical results on the two techniques to detect stiffness are compared and given in the Appendix.

In the tables given in the Appendix, we observed that for the same techniques (either A1 or A2), the stepsizes at which a certain equation becomes stiff are almost of the same order for different tolerances. For example, in Problem 3, Technique A1, Equation 4 becomes stiff at h = 3.4142(-3), 3.2352(-3), and 0.1832(-3) for tol 10 -2, 10 -4, and 10 -6, correspondingly. For Technique A2, it goes to stiff at h = 1.7071(-2), 1.7071( - 2), and 2.6591(- 2) for the corresponding tolerances.

For both the techniques, the sequence of equations going to stiff are the same. As in Problem 3, Equation 4 becomes stiff first followed by Equation 3, 2, and 1, and this is true for both A1 and A2.

For technique A1, problem 2, for tol 10 -2, Equation 2 is the first equation to become stiff and then Equations 1, 3, 4, 5, and 6. But for tol

Partitioning ODEs Using Runge-Kutta Methods 303

1 0 - 4 , Equation 1 first becomes stiff, followed by Equations 2, 3, 4, 5, and 6. Observe that Equations 1 and 2 axe coupled and have eigenvalues - 10 _ 3i because the real part is very dominant, the effect is of two eigenvalues of

- 10, so they have the same tendency to become stiff; either Equation 1 or Equation 2 will go to stiff first.

Problem 5 is an example where the equation associated with the largest perturbation is different from the equation on which instability is detected. For Technique A1, Equation 2 become stiff first, due to instability detected on the equation itself. This is followed by 3, which is due to instability detected on 2. Then, instability is detected on Equation 3 which caused Equation 1 to become stiff. This is true for both the techniques and for all the tolerances.

Comparing the two techniques, Technique A1 is definitely preferred to A2 in terms of Jacobian formed and total number of steps, especially for lower tolerances. Furthermore, a particular equation becomes stiff at a smaller stepsize in technique A1 as compared to A2, it shows that A1 detected stiffness earlier than A2. Technique A1 detected stiffness when instability was about to occur, while A2 is only able to detect it after instability has occurred which may be too late for some problems because the numerical solutions may tracked off from the true solutions. Due to this reason, too, the number of equations that become stiff are more in A1 compared to A2.

Most of the time we tend to think that once the equation is already stiff, it would not cause any problems, but this is not always true, there are times when instability is due to this particular equation. The advantage of using the above techniques is that such difficulty can be overcome by finding the component associated with the largest perturbation which is not stiff yet.

The result gives a preference for technique A1. The discussion on identify- ing the stiff component as that component with the largest perturbation when instability occurs, should be extended for developing componentwise- insensitive code. That is, partitioning is done from nonstiff to stiff and vice versa.

For instance, in technique A1, we could say that a certain equation in the stiff subsystem is no longer stiff if the reverse of (4.4) is true, that is,

Smax ~< tol (10) -1'~ and hirer I > haccl. (6.1)

Then try to identify which equation should be changed back to nonstiff. By doing so, the cost of solving the systems could be reduced further because the number of equations in the stiff subsystem that are computationally expensive is further reduced.

304 M. B. SULEIMAN ET AL.

A P P E N D I X

Tables 1 -5 give the numerical results of solving the five sys tems of ODEs given in Section 5. The nota t ions used are as follows

T O L ~ The chosen tolerance. S T E P ~ The number of successful steps. F S T E P ~ The number of failed steps.

J A C O ~ The number of Jacobian evaluations.

The nota t ion (i); [ p, x, h] means equat ion p is identified as stiff due to instabil i ty detected on the i th equation, a t the point x and stepsize h. [max, m a x 1] will imply K(Nmax) and m a x l p if instabi l i ty is detected in the nonstiff subsystem, and it will imply K(Smax) and m a x l q if it is detected in the stiff subsystem. And 3 .1275 ( -5 ) will mean 3.1275 × 10 -5.

Technique

A1 ~ Solving first order sys tem of ODEs using h~c c is greater t han hiter to detect stiffness.

A2 ~ Solving the sys tem using the nonconvergence p roper ty to detect stiffness.

TABLE 1 PROBLEM 1

Method TOL STEP JACO FSTEP i[p, x, h], [max, max 1]

A1 10 -2 19 2 3

A2 10 -2 18 2 8

A1 10 -4 35 2 3

A2 10 -4 35 2 4

A1 10 -6 1977 2 5

A2 10 -8 1977 2 4

i; [I, 1.0637(- 2), 1.0637(- 2)] [8.5263(- 2), 0.1826] I; [i, 0.2659, 0.2659] [14,7121, 787.7700]

i; [1, 3.4806(- 2), 5.6701(- 3)] [5.2957(- 3), 6.0468(- 3)]

i; [i, 8.4090(- 2), 8.4090(- 2)] [1.4708, 24.9046]

1; [i, 0.1201, 5.8242(-3)] [5.1289( - 5), 6.0166( - 5)]

i; [1, 2.6591( - 2), 2.6591( - 2)] [0.14707, 0.7875]

Partitioning ODEs Using Runge-Kutta Methods 305

T A B L E 2 P R O B L E M 2

Me thod T O L S T E P J A C O F S T E P i[p, x, h], [max, m a x 1]

A1 10 -2 20 6 1 2; [2, 5.6302( - 2), 3.0038( - 2)] [3.0324( - 2), 3 . 3 3 4 9 ( - 2)]

1; [1, 8.8306( - 2), 3.2004( - 2)] [3.4211 ( - 3), 4.0085( - 3)] 3; [3, 0.2720, 7.5760( - 2)] [ 4 .5501 ( - 3), 5.0483( - 3)1

4; [4, 1.2525, 0.3414] [1 .2566( - 3), 1 . 5 7 0 7 ( - 3)]

5; [5.2.2599, 0.6660] [6.718( - 4), 8.1898( - 4)1

6, [6, 10.7135, 2.9793] [1 .1141 ( - 4), 1 .2152(" 4)1

A2 10 -2 53 3 2 2;{[2, 0.1313, 0.1313] [0.1897, 0.9120]

1; [1, 0.4868, 3 . 7 2 7 8 ( - 2)] [1.5282( - 4), 7 . 7 1 7 2 ( - 4)]

A1 10 -4 67 5 2 1; [1, 0.3871, 2 . 9 1 7 4 ( - 2)] [8.8430( - 4), 9.4454( - 4)] 2; [2, 0.4191, 3 . 2 0 1 3 ( - 2)]

[5.2672( - 5), 4.6110( - 4)] 3; [3, 0.9145, 7.8843( - 2)] 3.8008( - 4), 4.3885( - 4)]

4; [4, 3.8356, 0.3323] [8.9278( - 5), 1.0860( - 4)]

5; [5, 7.2107, 0.6211] [4 .8394 ( - 5), 5.5021( - 5)]

A2 10-4 75 3 3 2; [2, 8 . 4 0 9 0 ( - 2), 8.4090( - 2)] [7.7791( - 2), 0.2395]

1; [1, 0.5350, 3 . 7 1 4 4 ( - 2)] [1.0346( - 4), 5.4319( - 4)]

A1 10 -6 288 0 3 [NONE O F T H E EQNS B E C O M E S T I F F ]

A2 10 -~ 288 0 3 [NONE O F T H E E Q N S B E C O M E S T I F F ]

306 M . B . SULEIMAN ET AL.

TABLE 3 PROBLEM 3

Method TOL STEP JACO FSTEP i[p, x, h], [max, max 1]

A1 10 -2 24 4 1 4; [4, 3 .4142(- 3), 3 .4142(- 3)] [0.3126, 0.3907]

3; [3, 2 .6334(- 2), 8 .1434(- 3)] [5.1634(- 2), 6 .1577(- 2)]

2, [2, 6.717( - 2), 1 .8838(- 2)] [2.1201(- 3), 2.6017( - 3)]

1; [1, 1.2195(0), 0.3333] [1.3523( - 3), 1.6502( - 3)]

A2 10 -2 126 2 4 4; [4, 1 .7071(- 2), 1 .7071(-2)] [1.9600, 12.2500]

3; [3, 4.0478, 0.2847] [5.5854( - 4), 2.3285( - 2)1

A1 10 -4 81 4 6 4; [4, 3 .7445(-2) , 3 .2352(-3)] [9.2176(- 3), 1.0918( - 2)1

3; [3, 9.7845( - 2), 7.9610( - 3 ) ] [3.7576( - 3), 4.3809( - 3)] 2; [2, 0.4086, 3 .3491(- 2)] [8.8428( - 4), 1.0843( - 3)]

1; [1, 3.8988, 0.3293] [9.0241( - 5), 1 .0880(- 4)]

A2 10 -4 139 2 5 4; [4, 1 .7071(- 2), 1.7071( - 2)] [1.9600, 12.2500]

3; [3, 3.5602, 0.2570] [4.0674( - 5), 1.5311( - 3)]

A1 10 -6 671 3 6 4; [4, 4.5062, 1 .8319(- 2)] [2.3642(- 6), 1.5856( - 5)]

3; [3, 6.1316, 0.1607] [2.2893(- 6), 5.3871( - 5)]

1; [1, 8.4870, 0.3277] [9.0780( - 7), 1 .0890(- 6)]

A2 10 -6 372 2 6 4; [4, 2 .6591(-2) , 2 .6591(-2)] [4.7558, 46.3000]

3; [3, 6.3019, 0.1219] [4.36701(- 7), 7 .7951(- 6)]

Partitioning ODEs Using Runge-Kutta Methods

TABLE 4 PROBLEM 4

307

Method TOL STEP JACO FSTEP i[p, x, h], [max, max 1]

A1 10 -2 525 35 6 1; [1, 8 .4846(- 4), 8 .4846(- 4)] [0.1666, 0.5232]

2; [2, 3.7609, 0.1358] [7.8971(- 3), 1.2187(- 2)]

A2 10 -2 TOO MANY STEPS A1 10 -4 404 8 70

A2 10 -4 402 8 76

A1 10 -6 479 8 83

A2 10 .6 434 7 80

1; [1, 9.6819(-4), 3.0159(-4)1 [1.2607(- 2), 1.3938( - 2)]

2; [2, 5.4797, 0.3568] [9.2221( - 6), 1.2079(- 5)]

1; [1, 8.4846(- 4), 8 .4346(- 4)] [5.0207( - 2), 0.1577] 2; [2, 4.4553, 0.2740]

[3.605( - 5), 3.6234( - 5)] 1; [1, 3.8305(- 3), 3 .3249(- 4)]

[8.9253( - 4), 1.0774( - 3)] 2; [2, 0.2781,0.1837]

[6.4526( - 9), 6 .6897(- 9)] 1; [1, 8.4846( - 4), 8 .4846(- 4)]

[5.0207(- 2), 0.1577] 2; {2, 5.9970, 0.3056]

[5.2864( - 6), 5.9333( - 6)]

TABLE 5 PROBLEM 5

Method TOL STEP JACO FSTEP i[p, x, h], [max, max 1]

A1 10 -2 3392 5 11 2; [2, 8 .4937(- 6), 8 .4937(- 6)] [46.1233, 57.5150]

2; [3, 0.5013, 0.1603] [2.4691( - 4), 9 .8692(- 3)] 4; [1, 0.5082, 3.4806(- 3)] [4.7160( - 3), 4.7165( - 3)] 2; [4, 0.5082, 3.4806( - 3)] [6.0484( - 3), 9.4420( - 3)]

A2 TOO MANY STEPS

308 M . B . SULEIMAN ET AL.

TABLE 5- - (Cont inued) PROBLEM 5

Method TOL STEP JACO FSTEP i[p, x, h], [max, max 1]

A1 10-4 253 12 30 2; [2, 6.9488( - 4), 8.9554( - 5)] [0.1870, 0.1876]

2; [3, 7 .0752(- 2), 1 .1743(- 2)] [3 .6096(- 7), 1 .1824(- 6)]

3; [1, 8.9933( - 2), 1.9181( - 2)] [4.8159( - 6), 7.8209( - 6)]

4; [4, 9 .5901(-2) , 5 .9677(-3)] [4 .2781(- 7), 8 .8355(- 7)]

A2 10-4 338 7 22 2; [2, 4.2468( - 5), 4.2468( - 5)] [281.9291,1757.8046]

2; [3, 6 .6871(- 2), 1 .2256(- 2)] [5.5007( - 7), 2 .3556(- 6)]

A1 10 -6 310 6 10 2; [2, 1.3875(-2) , 1 .0362(-3)] [2.7198( - 4), 3.2113( - 4)]

2, [3, 3 .0688(- 2), 3 .8954(- 3)] [6 .5019(- 7), 7 .1719(- 7)]

[3; [1, 4.2881( - 2), 6.7904( - 2)] [5.8216( - 7), 6 .0210(- 7)]

4; [4, 5.4890( - 2), 1.2009( - 2)] [1.7128( - 6), 5.6051( - 6)]

A2 10-8 441 7 7 2; [2, 4 .2468(- 5), 4 .2468(- 5)] [281.9291,1757.8045]

2;[3, 6 .4320(- 2), 1.7910( - 2)] [9.6081( - 7), 6.0355( - 6)]

A1 10 - s 1709 67 635 2; [2, 2 .9361(- 2), 1 .0978(- 3)] [2 .7965(- 6), 3.2444( - 6)] 2; [3, 2.0441, 5.1958( - 3 ) ] [1.5204( - 8), 1.5236( - 8)] 3; [1, 3.0286, 2.0631( - 2)] [9.6096( - 8), 9.6097( - 8)] 4; [4, 3.0494, 2.0834( - 2)] [1.1681( - 7), 3 .7793(- 7)]

A2 10- s 3850 7 9 2; [2, 4 .2468(- 5), 4 .24681(- 5)] [281.9291,1757.8046]

2; [3, 4 .7686(- 2), 4 .3220(- 3)] [1 .2396(- 7), 1 .8817(- 7)] 3; [1, 1.8218, 1 .1710(-2)] [1.3399(- 7), 1.4052( - 7)]

Partitioning ODEs Using Runge-Kutta Methods 309

REFERENCES

1 J. Bruder, K. Strehmel, and R. Weiner, Partitioned Adaptive Runge-Kutta Methods for the Solution of Nonstiff and Stiff Systems, Numer. Math. 52:621-638 (1988).

2 L.F. Shampine, Type-Insensitive Codes Based on Implicit A-Stable Formulas. Report SAND 79-2444, Sandia National Laboratories, Albuquerque, New Mexico, 1980.

3 S. R. Billington, Type-lnsensitive Codes for the Solution of Stiff and Nonstiff Systems of Ordinary Differential Equations. Master Thesis, University of Manch- ester, United Kingdom, 1983.

4 M.B. Suleiman, and S. Baok, Using Nonconvergenee of Iteration to Partition ODEs, Applied Mathematics and Computation 49:111-139 (1992).

5 P. Rentrop, Partitioned Runge-Kutta Method with Stiffness Detection and Stepsize Control, Numer. Math. 47:545-564 (1985).

6 G. Soderlind, Some Stability Properties of Linear Multistep Compound Dis- cretizations of Partitioned Differential Systems. TRITNA-NA-7910, Royal Insti- tute of Technology, Stockholm, 1970.