WELCOME
TO THE
PRESENTATION
Study of Runge Kutta method of
higher order and their
Application
Presented By
Fahad Bin Mostafa
Department Of Mathematics
University Of Dhaka, 2014.
ABSTRACT
This project work is concerned with the study of Runge-
Kutta method of higher order and to apply in solving
initial and boundary value problems for ordinary as well as
partial differential equations. The derivation of fourth
order and sixth order Runge-Kutta method have been done
firstly. After that, Fortran 90/95 code has been written for
particular problems. Numerical results have been obtained
for various problems. The main focus has been given on
sixth order Runge-Kutta method. Exact and approximate
results have been obtained and shown in tubular and
graphical form.
Introduction
 The Runge-Kuttta methods are named after two German
mathematicians, Carl Runge (1856-1927) and Wilhelm Kutta
(1867-1944). The methods were devised by Runge in 1894 and later
extended by Kutta in 1901. These techniques were developed around
1900 by the German mathematicians C. Runge and M.W. Kutta. In
numerical analysis, the Runge–Kutta methods are an important
family of implicit and explicit iterative methods for the
approximation of solutions of ordinary differential equations.
 The use of Euler’s method to solve the differential equation
numerically is less efficient and is not very useful in practical
problems since it requires a very small step length h for obtaining a
reasonable accuracy. . The Runge-Kutta methods are designed to
give greater accuracy with the advantage of requiring only the
functional values at some selected points on the sub-interval. Our
aim is to show how the sixth order R-K method is giving better
accuracy than the four order R-K method. Then we have shown a
FORTRAN code to test which one is yielding less error
 OBJECTS OF THE
CONTENTS
 Deriving the General form of R-K method
 Deriving the forth order R-K method
 Deriving the sixth order R-K method
 Application to the forth order R-K method
 Fortran 90/95 codes for both R-K method with
particular problem.
Showing tubular and graphical representation
and comparisons
What is Runge-Kutta method ?
The Runge-Kutta method are designed to give
greater accuracy than Euler Method and they
(Runge-Kutta) possess the advantage of require
only the function values at some selected
points on the subinterval. The Runge-Kutta
method is essentially an attempt to match a
more complex Euler-like formula to a fourth
order Taylor method.
Deriving the General Form
Of Runge-Kutta Method :
Applying simpson’s rule to the integral produces the estimates.
k1=f(ti, yi)
k2=f(ti+ h/2, yi+hk1/2)
k3=f(ti+ h/2, yi+hk2/2)
k4=f(ti+ h, yi+hk3)
yi+1= yi+ h(k1+2k2+2k3+k4)/3
 Runge-Kutta of order Four :
The fourth-order Runge-Kutta method (RK4) simulates the
accuracy of the Taylor series method of order N = 4. The
method is based on computing yk+1 as follows:
yk+1= yk+w1k1+w2k2+w3k3 +w4k4 (2)
Where k1,k2,k3, and k4 have the form
k1= hf(tk,yk) ,
k2= hf(tk+a1h,yk+b1k1),
k3= hf(tk+a2h,yk+b2k1+b3k2),
k4= hf(tk+a3h,y+b4k1+b5k2+b6k3).
By matching coefficients with those of the Taylor series
method of order N = 4 so that the local truncation error is of
order O(h^5),
Runge and Kutta were able to obtain the following system of
equations:
b1= a1,
b2+b3= a2,
b4+b5+b6= a3,
w1+w2+w3+w4= 1,
w2a1+w3a2+w4a3 = 1/2 ,
w2+w3+w4 =1/3 , (3)
w2+w2+w4= 1/4,
w3a1b3+w4(a1b5+a2b6) =1/6 ,
w3a1a2b3+w4a3(a1b5+a2b6) =1/8,
w3b3+w(b5+b6) =1/12 ,
w4a1b3b6=1/24 ,
The system involves 11 equations in 13 unknowns. Two
additional conditions must be supplied to solve the system. The
most useful choice is a1 = 1/2 and b2 = 0 (4)
Then the solution for the remaining variables is
a2 = 1/2 , a3 = 1, b1 =1/2 , b3 =1/2 , b4 = 0, b5 = 0, b6 = 1,
(5)
w1 =1/6 , w2 = 1/3 , w3 = 1/3, w4 = 1/6.
The values in (4) and (5) are substituted into (2) and (1) to obtain the
formula for the standard Runge-Kutta method of order N = 4, which is
stated as follows. Start with the initial point (t0,y0) and generate the
sequence of approximations using
yk+1= yk + (f1 +2 f2 +2 f3 + f4 )/6, (6)
where
f1= f(tk , yk),
f2= f(t+ , yk + f1),
f3= f(tk + , yk + f1) ,
f4= f(tk+ h, yk+hf3).
Example
Compute y(0.1) and y(0.2) using Runge-Kutta method of fourth for the
differential equation y’ = -y with the initial condition y(0) = 1.
Solution: Given = -y; y(0) = 1
= -y, x0 = 0, y0 = 1
Let us take h = 0.1
By 4th order Runge-Kutta method , we have
Explicit R-K method of order Six (N=6)
Here, v is a real parameter which is not zero.
FORTRAN CODE:
PROGRAM RK4_RK6_method
OPEN(1,'ab.dat') ! Input File
OPEN(2,'bc.dat') ! Output File
READ (1,*)A,B,YO,N
CALL RK64(A,B,YO,N)
END PROGRAM
SUBROUTINE RK64(A,B,YO,N)
REAL H,X,Y,K1,K2,K3,K4,k5,k6,k7,j1,j2,j3,j4,z
H=(B-A)/N ! h is step size
X=A ! Initial approximation
Y=YO ! Initial value of y ( given values)
z=YO
WRITE (2,*)" Results of Runge Kutta method of Order 6"
WRITE(2,*)'__________________________________________'
WRITE(2,*)' '
WRITE (2,30)
30 FORMAT (" ITE",1X," (X)",2X,"By RK-6:(Y)",2X," EXACT(Y)",5X,"ERROR %"," By
RK-4:(Y)",2x,"Error %")
WRITE(2,*)' '
WRITE (2,20)I,X,y,G(X),((ABS(G(X)-z))/z)*100.0,z,((ABS(G(X)-Y))/y)*100.0
FUNCTION G(X)
G=(X+1)**2-0.5*EXP(X)
RETURN
END
DO I=1,N
j1=H*F(X,z)
j2=H*F(X+H/2,z+j1/2)
j3=H*F(X+H/2,z+j2/2)
j4=H*F(X+H,z+j3)
z=z+(j1+2*j2+2*j3+j4)/6.0
K1=H*F(X,Y)
K2=H*F(X+H,Y+K1)
K3=h*f(x+(h/2),y+(3*k1+k2)/8)
K4=h*f(x+(2*h)/3,y+(8*k1+2*k2+8*k3)/27)
k5=h*f(x+((7-21**(1/2))*h)/14,y+(3*(3*21**(1/2)-7)*k1-8*(7-21**(1/2))*k2+48*(7-21**(1/2))*k3-
3*(21-21**(1/2))*k4)/392)
k6=h*f(x+((7+21**(1/2))*h)/14,y+(-5*(123+51*21**(1/2))*k1-40*(7+21**(1/2))*k2-
320*21**(1/2)*k3+3*(21+121*21**(1/2))*k4 &
+392*(6+21**(1/2))*k5)/1960)
k7=h*f(x+h,y+(15*(22+7*21**(1/2))*k1+120*k2+40*(7*21**(1/2)-5)*k3+63*(3*21**(1/2)-2)*k4-
14*(49+9*21**(1/2))*k5 &
+70*(7-21**(1/2))*k6)/180)
Y=y+(9*k1+64*k3+49*k5+49*k6+9*k7)/180
X=A+I*H
WRITE (2,20)I,X,y,G(X),((ABS(G(X)-z))/z)*100.0,z,((ABS(G(X)-Y))/y)*100.0
END DO
20 FORMAT (I2,F 10.3,1X,F10.7,1X,F10.7,1X,F10.7,1x,F10.7,1x,F10.7)
END SUBROUTINE
FUNCTION F(X,Y)
F=Y-X**2+1
RETURN
END
Output of the Program:
ITE (X) By RK-6:(Y) EXACT(Y) ERROR % By RK-4:(Y) Error %
0 0.000 0.5000000 0.5000000 0.0000000 0.5000000 0.0000000
1 0.100 0.6592928 0.6574146 0.8046837 0.6521667 0.2848922
2 0.200 0.8334174 0.8292986 0.7476951 0.8231440 0.4941978
3 0.300 1.0218238 1.0150707 0.7075466 1.0079390 0.6608914
4 0.400 1.2239038 1.2140876 0.6786026 1.2059044 0.8020329
5 0.500 1.4389843 1.4256394 0.6576112 1.4163254 0.9273840
6 0.600 1.6663206 1.6489407 0.6425841 1.6384125 1.0430111
7 0.700 1.9050888 1.8831236 0.6322126 1.8712931 1.1529733
8 0.800 2.1543772 2.1272295 0.6256444 2.1140034 1.2601162
9 0.900 2.4131775 2.3801985 0.6222648 2.3654790 1.3666195
10 1.000 2.6803739 2.6408591 0.6216570 2.6245434 1.4742279
11 1.100 2.9547317 2.9079170 0.6235414 2.8898973 1.5843960
12 1.200 3.2348850 3.1799417 0.6277146 3.1601052 1.6984625
13 1.300 3.5193226 3.4553518 0.6340468 3.4335814 1.8177012
14 1.400 3.8063726 3.7323999 0.6424673 3.7085736 1.9433907
15 1.500 4.0941854 4.0091553 0.6529772 3.9831464 2.0768452
16 1.600 4.3807139 4.2834840 0.6655937 4.2551618 2.2195032
17 1.700 4.6636939 4.5530262 0.6804032 4.5222569 2.3729575
18 1.800 4.9406199 4.8151765 0.6975217 4.7818222 2.5390234
19 1.900 5.2087207 5.0670528 0.7171242 5.0309744 2.7198226
20 2.000 5.4649291 5.3054719 0.7394682 5.2665277 2.9178267
Graphical Representation of Runge-Kutta Methods
So, we have seen from the graphical representation of R-K method of orders
four and six with their exact solutions.
Hence we come to a conclusion that R-K six Method is better than R-K four Method .
Application in Partial Differential Equation
Conclusion
1. Accuracy depends on step size.
2. R-K method of sixth order gives better accuracy
than R-K method of forth order.
REFERENCES
Books:
 Lee W. Johnson & R.Dean Riess (1982). Numerical Analysis (2nd
edition). Addison-Wesley Publishing Company, Inc.
 Richard L. Burden & J. Douglas Faires (2005). Numerical Analysis
(6th edition). Thomson Asia Pte Ltd.
 Sastry, S.S (2005). Introductory Methods Of Numerical Analysis
(2nd edition). Prentice Hall India Private Limited.
 William E. Mayo, Martin Cwiakala. Schaum’s Outline Series.
Programming With FORTRAN 77.Mcgraw-Hill Publishing Comany
Ltd.
 Howard Anton. Calculus (6th edition). John Wiley and Sons, Inc.
Article:
 H. A. Luther, An Explicit Sixth Order R-K Formula, SIAMS Rev.,
v.7,1965, pp. 551-558.MR 32#3796
Website:
 Wikipedia, Wolfram math world.
THANK YOU

Runge Kurta method of order Four and Six

  • 1.
  • 2.
    Study of RungeKutta method of higher order and their Application Presented By Fahad Bin Mostafa Department Of Mathematics University Of Dhaka, 2014.
  • 3.
    ABSTRACT This project workis concerned with the study of Runge- Kutta method of higher order and to apply in solving initial and boundary value problems for ordinary as well as partial differential equations. The derivation of fourth order and sixth order Runge-Kutta method have been done firstly. After that, Fortran 90/95 code has been written for particular problems. Numerical results have been obtained for various problems. The main focus has been given on sixth order Runge-Kutta method. Exact and approximate results have been obtained and shown in tubular and graphical form.
  • 4.
    Introduction  The Runge-Kutttamethods are named after two German mathematicians, Carl Runge (1856-1927) and Wilhelm Kutta (1867-1944). The methods were devised by Runge in 1894 and later extended by Kutta in 1901. These techniques were developed around 1900 by the German mathematicians C. Runge and M.W. Kutta. In numerical analysis, the Runge–Kutta methods are an important family of implicit and explicit iterative methods for the approximation of solutions of ordinary differential equations.  The use of Euler’s method to solve the differential equation numerically is less efficient and is not very useful in practical problems since it requires a very small step length h for obtaining a reasonable accuracy. . The Runge-Kutta methods are designed to give greater accuracy with the advantage of requiring only the functional values at some selected points on the sub-interval. Our aim is to show how the sixth order R-K method is giving better accuracy than the four order R-K method. Then we have shown a FORTRAN code to test which one is yielding less error
  • 5.
     OBJECTS OFTHE CONTENTS  Deriving the General form of R-K method  Deriving the forth order R-K method  Deriving the sixth order R-K method  Application to the forth order R-K method  Fortran 90/95 codes for both R-K method with particular problem. Showing tubular and graphical representation and comparisons
  • 6.
    What is Runge-Kuttamethod ? The Runge-Kutta method are designed to give greater accuracy than Euler Method and they (Runge-Kutta) possess the advantage of require only the function values at some selected points on the subinterval. The Runge-Kutta method is essentially an attempt to match a more complex Euler-like formula to a fourth order Taylor method.
  • 7.
    Deriving the GeneralForm Of Runge-Kutta Method : Applying simpson’s rule to the integral produces the estimates. k1=f(ti, yi) k2=f(ti+ h/2, yi+hk1/2) k3=f(ti+ h/2, yi+hk2/2) k4=f(ti+ h, yi+hk3) yi+1= yi+ h(k1+2k2+2k3+k4)/3
  • 8.
     Runge-Kutta oforder Four : The fourth-order Runge-Kutta method (RK4) simulates the accuracy of the Taylor series method of order N = 4. The method is based on computing yk+1 as follows: yk+1= yk+w1k1+w2k2+w3k3 +w4k4 (2) Where k1,k2,k3, and k4 have the form k1= hf(tk,yk) , k2= hf(tk+a1h,yk+b1k1), k3= hf(tk+a2h,yk+b2k1+b3k2), k4= hf(tk+a3h,y+b4k1+b5k2+b6k3). By matching coefficients with those of the Taylor series method of order N = 4 so that the local truncation error is of order O(h^5),
  • 9.
    Runge and Kuttawere able to obtain the following system of equations: b1= a1, b2+b3= a2, b4+b5+b6= a3, w1+w2+w3+w4= 1, w2a1+w3a2+w4a3 = 1/2 , w2+w3+w4 =1/3 , (3) w2+w2+w4= 1/4, w3a1b3+w4(a1b5+a2b6) =1/6 , w3a1a2b3+w4a3(a1b5+a2b6) =1/8, w3b3+w(b5+b6) =1/12 , w4a1b3b6=1/24 , The system involves 11 equations in 13 unknowns. Two additional conditions must be supplied to solve the system. The most useful choice is a1 = 1/2 and b2 = 0 (4)
  • 10.
    Then the solutionfor the remaining variables is a2 = 1/2 , a3 = 1, b1 =1/2 , b3 =1/2 , b4 = 0, b5 = 0, b6 = 1, (5) w1 =1/6 , w2 = 1/3 , w3 = 1/3, w4 = 1/6. The values in (4) and (5) are substituted into (2) and (1) to obtain the formula for the standard Runge-Kutta method of order N = 4, which is stated as follows. Start with the initial point (t0,y0) and generate the sequence of approximations using yk+1= yk + (f1 +2 f2 +2 f3 + f4 )/6, (6) where f1= f(tk , yk), f2= f(t+ , yk + f1), f3= f(tk + , yk + f1) , f4= f(tk+ h, yk+hf3).
  • 11.
    Example Compute y(0.1) andy(0.2) using Runge-Kutta method of fourth for the differential equation y’ = -y with the initial condition y(0) = 1. Solution: Given = -y; y(0) = 1 = -y, x0 = 0, y0 = 1 Let us take h = 0.1 By 4th order Runge-Kutta method , we have
  • 12.
    Explicit R-K methodof order Six (N=6)
  • 13.
    Here, v isa real parameter which is not zero.
  • 14.
    FORTRAN CODE: PROGRAM RK4_RK6_method OPEN(1,'ab.dat')! Input File OPEN(2,'bc.dat') ! Output File READ (1,*)A,B,YO,N CALL RK64(A,B,YO,N) END PROGRAM SUBROUTINE RK64(A,B,YO,N) REAL H,X,Y,K1,K2,K3,K4,k5,k6,k7,j1,j2,j3,j4,z H=(B-A)/N ! h is step size X=A ! Initial approximation Y=YO ! Initial value of y ( given values) z=YO WRITE (2,*)" Results of Runge Kutta method of Order 6" WRITE(2,*)'__________________________________________' WRITE(2,*)' ' WRITE (2,30) 30 FORMAT (" ITE",1X," (X)",2X,"By RK-6:(Y)",2X," EXACT(Y)",5X,"ERROR %"," By RK-4:(Y)",2x,"Error %") WRITE(2,*)' ' WRITE (2,20)I,X,y,G(X),((ABS(G(X)-z))/z)*100.0,z,((ABS(G(X)-Y))/y)*100.0 FUNCTION G(X) G=(X+1)**2-0.5*EXP(X) RETURN END
  • 15.
    DO I=1,N j1=H*F(X,z) j2=H*F(X+H/2,z+j1/2) j3=H*F(X+H/2,z+j2/2) j4=H*F(X+H,z+j3) z=z+(j1+2*j2+2*j3+j4)/6.0 K1=H*F(X,Y) K2=H*F(X+H,Y+K1) K3=h*f(x+(h/2),y+(3*k1+k2)/8) K4=h*f(x+(2*h)/3,y+(8*k1+2*k2+8*k3)/27) k5=h*f(x+((7-21**(1/2))*h)/14,y+(3*(3*21**(1/2)-7)*k1-8*(7-21**(1/2))*k2+48*(7-21**(1/2))*k3- 3*(21-21**(1/2))*k4)/392) k6=h*f(x+((7+21**(1/2))*h)/14,y+(-5*(123+51*21**(1/2))*k1-40*(7+21**(1/2))*k2- 320*21**(1/2)*k3+3*(21+121*21**(1/2))*k4 & +392*(6+21**(1/2))*k5)/1960) k7=h*f(x+h,y+(15*(22+7*21**(1/2))*k1+120*k2+40*(7*21**(1/2)-5)*k3+63*(3*21**(1/2)-2)*k4- 14*(49+9*21**(1/2))*k5& +70*(7-21**(1/2))*k6)/180) Y=y+(9*k1+64*k3+49*k5+49*k6+9*k7)/180 X=A+I*H WRITE (2,20)I,X,y,G(X),((ABS(G(X)-z))/z)*100.0,z,((ABS(G(X)-Y))/y)*100.0 END DO 20 FORMAT (I2,F 10.3,1X,F10.7,1X,F10.7,1X,F10.7,1x,F10.7,1x,F10.7) END SUBROUTINE FUNCTION F(X,Y) F=Y-X**2+1 RETURN END
  • 16.
    Output of theProgram: ITE (X) By RK-6:(Y) EXACT(Y) ERROR % By RK-4:(Y) Error % 0 0.000 0.5000000 0.5000000 0.0000000 0.5000000 0.0000000 1 0.100 0.6592928 0.6574146 0.8046837 0.6521667 0.2848922 2 0.200 0.8334174 0.8292986 0.7476951 0.8231440 0.4941978 3 0.300 1.0218238 1.0150707 0.7075466 1.0079390 0.6608914 4 0.400 1.2239038 1.2140876 0.6786026 1.2059044 0.8020329 5 0.500 1.4389843 1.4256394 0.6576112 1.4163254 0.9273840 6 0.600 1.6663206 1.6489407 0.6425841 1.6384125 1.0430111 7 0.700 1.9050888 1.8831236 0.6322126 1.8712931 1.1529733 8 0.800 2.1543772 2.1272295 0.6256444 2.1140034 1.2601162 9 0.900 2.4131775 2.3801985 0.6222648 2.3654790 1.3666195 10 1.000 2.6803739 2.6408591 0.6216570 2.6245434 1.4742279 11 1.100 2.9547317 2.9079170 0.6235414 2.8898973 1.5843960 12 1.200 3.2348850 3.1799417 0.6277146 3.1601052 1.6984625 13 1.300 3.5193226 3.4553518 0.6340468 3.4335814 1.8177012 14 1.400 3.8063726 3.7323999 0.6424673 3.7085736 1.9433907 15 1.500 4.0941854 4.0091553 0.6529772 3.9831464 2.0768452 16 1.600 4.3807139 4.2834840 0.6655937 4.2551618 2.2195032 17 1.700 4.6636939 4.5530262 0.6804032 4.5222569 2.3729575 18 1.800 4.9406199 4.8151765 0.6975217 4.7818222 2.5390234 19 1.900 5.2087207 5.0670528 0.7171242 5.0309744 2.7198226 20 2.000 5.4649291 5.3054719 0.7394682 5.2665277 2.9178267
  • 17.
    Graphical Representation ofRunge-Kutta Methods So, we have seen from the graphical representation of R-K method of orders four and six with their exact solutions. Hence we come to a conclusion that R-K six Method is better than R-K four Method .
  • 18.
    Application in PartialDifferential Equation
  • 20.
    Conclusion 1. Accuracy dependson step size. 2. R-K method of sixth order gives better accuracy than R-K method of forth order.
  • 21.
    REFERENCES Books:  Lee W.Johnson & R.Dean Riess (1982). Numerical Analysis (2nd edition). Addison-Wesley Publishing Company, Inc.  Richard L. Burden & J. Douglas Faires (2005). Numerical Analysis (6th edition). Thomson Asia Pte Ltd.  Sastry, S.S (2005). Introductory Methods Of Numerical Analysis (2nd edition). Prentice Hall India Private Limited.  William E. Mayo, Martin Cwiakala. Schaum’s Outline Series. Programming With FORTRAN 77.Mcgraw-Hill Publishing Comany Ltd.  Howard Anton. Calculus (6th edition). John Wiley and Sons, Inc. Article:  H. A. Luther, An Explicit Sixth Order R-K Formula, SIAMS Rev., v.7,1965, pp. 551-558.MR 32#3796 Website:  Wikipedia, Wolfram math world.
  • 22.