On A General Form of Rk4 Method
On A General Form of Rk4 Method
On A General Form of Rk4 Method
Method
Delin Tan
Zheng Chen
Abstract
In this paper, we obtain a general formula of Runge-Kutta method in order 4
with a free parameter t. By picking the value of t, it can generate many RK
methods in order 4 including some known results. Numerical calculation shows
that those new formulas have the same accuracy as the classical RK4 has.
Although the higher order of Runge-Kutta methods can increase the error
accuracy, but it would need to pay the cost of calculation complexity. Therefore
the most mathematicians think that the fourth order Runge-Kutta method is the
most efficient method to solve numerical solution for IVP. It is naturally to ask:
Do there exist other fourth order Runge-Kutta methods? If yes, then what are
they look like? In this paper, we obtain a general formula fourth order Runge-
Kutta method with a free parameter as the following
K = f ( x + h, w + ( ) K h + K h ) ,
1 1 1 1
3 k 2 k 2 t 1 t 2
K = f ( x + h, w + (1 ) K h + K h ) ,
t t
4 k k 2 2 2 3
K = f ( x + h, w K h + K h ) ,
1 1
3 k 2 k 2 1 2
K = f ( x + h, w + K h + K h ) .
1 1
4 k k 2 2 2 3
Remark 4: Pick t = 3 we get the second new formula for Runge-Kutta method
1
wk +1 = wk + ( K + K2 + 3K3 + K 4 ) h,
6 1
K1 = f ( xk , wk ),
(5)
( )
K 2 = f xk + h, wk + K1h ,
1
2
1
2
K = f ( x + h, w + K h + )
1 1 1
3 k k 1 K2h ,
2 6 3
K = f ( x + h, w K h + K h).
1 3
4 k k 2 2 2 3
Remark 5: Pick t = 5, we get the third new formula for Runge-Kutta method
1
wk +1 = wk + ( K K2
6 1
+ 5K3 + K 4 ) h,
K1 = f ( xk , wk ),
(6) ( )
K 2 = f xk + h, wk + K1h ,
1
2
1
2
K = f ( x + h, w + K h + K h ) ,
1 3 1
3 k 2 k 10 1 5 2
K = f ( x + h, w K h + K h ) .
3 5
4 k k 2 2 2 3
RK4 methods Classical R. England Formula (4) Formula (5) Formula (6)
RK4 methods Classical R. England Formula (4) Formula (5) Formula (6)
Our last example is to calculate the numerical solution for the second order
differential equation
y = y + 2sin x (0 x 4) with y (0) = 1, y(0) = 0 and h = 0.2.
y
Define vector variable Y = and apply the different fourth order Runge-
y
Kutta methods to the following vector differential equation
dY 1
= f ( x, Y ) with initial condition Y (0) =
dx 0
0 1 0
where f ( x, Y ) =
Y+
1 0 2sin x
After comparing to the analytic solution y = e x sin x , we get the following
results
RK4 methods Classical R. England Formula (4) Formula (5) Formula (6)
The above calculating results show that the new fourth order Runge-Kutta
methods formulas (4) (5) and (6) have the exactly same error accuracy as the
classical method (1) does.
x + ( q3a + q3b ) h
Then K4 =
x + p3h
Similarly, we obtain
(14) p3 = q3a + q3b .
K2 = =
x + p1h x + p1h
= 3 x 2 + 2 p1 xh 2 ( p1h )
2
+ O (h3 )
3 ( y + q2 a K1h + q2b K 2 h )
K3 =
x + p2 h
3 ( x3 + 3q2 a x 2 h + 3q2b x 2 h + 6 p1q2b xh 2 )
= + O(h3 )
x + p2 h
3 ( x3 + 3 p2 x 2 h + 6 p1q2b xh 2 )
= + O ( h3 )
x + p2 h
= 3 x + 2 p2 xh 2 ( p2 h ) + 6 p1q2b h 2 + O( h3 )
2 2
3 ( y + q3a K 2 h + q3b K 3h )
K4 =
x + p3h
3 ( x 3 + 3q3a x 2 h + 6 p1q3a xh 2 + 3q3b x 2 h + 6 p2 q3b xh 2 )
= + O (h3 )
x + p3h
3 x 3 + 3 p3 x 2 h + 6 ( p1q3a + p2 q3b ) xh 2
= + O (h3 )
x + p3h
= 3 x 2 + 2 p3 xh 2 x ( p3h ) + 6 ( p1q3a + p2 q3b ) h 2 + O( h3 )
2
+ 3c x 2 + 2 p2 xh 2 ( p2 h ) + 6 p1q2b h 2 h
2
+ 3d x 2 + 2 p3 xh 2 x ( p3 h ) + 6 ( p1q3 a + p2 q3b ) h 2 h + O( h 4 )
2
=
(
4 x 4 + 4q2 a x3h + q2b 4 x3 + 12 p1 x 2 h 12 ( p1h ) x h
2
) + O(h 4 )
x + p2 h
4 x 4 + 4 p2 x 3h + 12 p1q2b x 2 h 2 12 p12 q2b xh3
= + O( h 4 )
x + p2 h
= 4 x 3 + 3 ( p2 h ) x 2 3 ( p2 h ) x + 3 ( p2 h )
2 3
+4q3b x 3 + 3 ( p2 h ) x 2 3 ( p2 h ) x + 12 p1q2b xh 2 h + O (h 4 )
2
Remark 1: Equations in lemma are the necessary conditions to make the RK4
constants a, b, c, d, p1, p2, p3, q1, q2a, q2b, q3a and q3b. They might not be enough
make (8) to be true for some f(x,y).
b + c + 2d = 1 2
3 3
b+c = 1
3
b+ c + 3d =1 a= .
4 4 1 6
1 1
d=
6
b+ c + 4d =1
2 2
Then the equation 6 ( cp1q2 b + dp1q3a + dp2 q3b ) = 1 becomes
6 ( 1
2
cq2b +
1
q
12 3a
+
1
q
12 3b ) =1 .
6 ( 1
cq
2 2b
+
1
12 ) =1 cq2b =
1
6
1
Set q2b = and t as a free parameter. We obtain
t
t 2
c = and b = c = 4 t
6 3
1
6
( )
From the equation
( 1
4 1 + q3a + q3b q3b = 1.
2
1
2
1
4
2
t )
4 ( 5
4
2
q3b = 1.
t )
t t
Therefore q3b = and q3a = 1
2 2
Then we obtain the general RK4 formula with a parameter t
( 1
K2 = f xk + h, wk + K1h ,
2 ) 1
2
K = f ( x + h, w + ( ) K h + K h ) ,
1 1 1 1
3 k 2 k 2 t 1 t 2
K = f ( x + h, w + (1 ) K h + K h ) .
t t
4 k k 2 2 2 3
Moreover, we can check that all constants in this formula satisfy conditions of
(21) for any constant t. That proves that is a general Runge-Kutta method in
order of 4. Actually, there is no other Runge-Kutta method in order of 4 under
the formation (7).
References
[1] R. England, Error estimate for Runge-Kutta type solutions of ordinary
differential equation. Computer Journal 12 (1969) 166-170.
[2] L. F. Shampine, R. C. Allen and S. Pruess, Fundamentals of Numerical
Computing, (1997) John Wiley & Sons.
[3] J. H. Mathews and K. D. Fink, Numerical Methods: Using Matlab, Fourth
Edition, (2004), Prentice-Hall Pub. Inc.