You are on page 1of 5

Runge-Kutta Methods By now you probably appreciate the fact that these integration methods are designed to improve

the accuracy of the results by coming up with more prcised estimates of derivatives. RungeKutta methods achieve the accuracy of a Taylor series approach without requiring the calculation of higher derivatives. A general form of integration is: +1 = + (1)

where is called an increment function, which can be interpreted as a representative slope over the integral and can be written in general form as That is, the increment function can be put together by a number of slopes,1 ,2 , .. and with weighting factors, 1 , 2 , . and . The slopes are 1 = ( , ) 2 = ( + 1 , + 11 1 ) 3 = ( + 2 , + 21 1 + 22 2 ) . . = ( + 1 , + 1,1 1 + 1,2 2 + + 1,1 1 ) = 1 1 + 2 2 + +

Special Cases

where the s and s are constants. Once is chosen, values for the s, s, and s are evaluated by setting Eq. 1 equal to terms in a Taylor series expansion. Thus, at least for the lower-order versions, the number of terms usually represents the order of the approach.

First-order RK method with = 1, the first-order RK uses an increment function with only one term, which is the Eulers method.

The second-order version of Eq. 1 is +1 = + (1 1 + 2 2 )

where

1 = ( , ) 2 = ( + 1 , + 11 1 ) Setting Eq. 1 equal to a second-order ( = 2) Taylor series yields three equations 1 + 2 = 1 2 1 = 2 11 =

Solving for four unknowns 1 , 2 , 1 , and 11 with three equations leaves one unknown undetermined: 1 = 1 2 1 = 11 = 1/22

If 2 = 1/2, then 1 = 1/2 and 1 = 11 = 1, resulting in

Such a solution gives a freedom to choose the value of 2 for the second-order RK methods! 1 1 +1 = + 1 + 2 2 2

where 1 = ( , ) 2 = ( + , + 1 )

Note that 1 is the slope at the beginning of the interval and 2 is the slope at the end of the interval. Actually, this second-order Runge-Kutta method is Heuns method without iteration of the corrector.

If 2 = 1, then 1 = 0 and 1 = 11 = 1/2 where 1 = ( , ) 2 = ( + /2, + 1 /2)

+1 = + 2

This is the midpoint method.

If 2 = 2/3, then 1 = 1/3 and 1 = 11 = 3/4 where 1 = ( , ) 3 3 2 = ( + 4 , + 4 1 )

1 2 +1 = + 1 + 2 3 3

This is Ralstons method.

Notice that the different weighting factors assigned to 1 and 2 for the Heuns, midpoint, and Ralstons methods in evaluating the increment function,. Third-Order Runge-Kutta Method For = 3, a derivation similar to the one for the second-order method can be performed. The result of this derivation is six equations with eight unknowns. Therefore, values for two of the unknowns must be specified a priori in order to determine the remaining parameters. One common version that results is 1 +1 = + (1 + 42 + 3 ) 6 where 1 = ( , )

Note that if the derivative is a function of only, this third-order method reduces to Simpsons 1/3 rule. The Classical Fourth-Order Runge-Kutta Method 1 +1 = + (1 + 22 + 23 + 4 ) 6 where 1 = ( , ) 1 1 2 = ( + 2 , + 2 1 ) 3 = ( + 2 , + 2 2 ) 4 = ( + , + 3 )
1 1

2 = ( + 2 , + 2 1 ) 3 = ( + , 1 + 22 )

Higher-Order Runge-Kutta Methods Where more accurate results are required, Butchers fifth-order RK method is recommended: See Eq. 22.45 in the text. The question: when to stop? In general, beyond fourth-order methods the gain in accuracy is offset by the added computational effort and complexity. Comparison of Runge-Kutta Methods Use first- through fifth-order RK methods to solve

= 4 0.8 0.5 with (0) = 2 from = 0 to = 4 with various step sizes. Compare the accuracy of the various methods for the result at = 4 based on the exact answer of (4) = 75.33896.

The computation is performed using Eulers, the noniterative Heun, the third-order RK, the classical fourth-order RK, and Butchers fifth-order RK methods. The results are presented in the following figure, showing the absolute value of the percent relative error vs. the computational effort, which is defined by the following expression: Effort = , where = the number of function evaluations involved in the particular RK computation.

For order 4, is equal to the order of the method. However, Butchers fifth-order technique requires six function evaluations. The quantity ( )/ is the total integration interval divided by the step size that is, it is the number of applications of the RK technique required to obtain the result. Thus, because the function evaluations are usually the primary time-consuming steps, the above equation provides a rough measure of the run time required to attain the answer. Inspection of the attached figure leads to a number of conclusions: first, that the higher-order methods attain better accuracy for the same computational effort and, second that the gain in accuracy for the additional effort tends to diminish after a point. Notice that the curves drop rapidly at first and then tend to level off.

You might also like