G. H. Patel College of
Engineering & Technology
Subject : Numerical and Statistical Method for Computer Engineering
(2140706)
Topic : Runge Kutta Methods
Guided by : Prof. Tejas Jani
Made by : Vashi Bhavik (160110116061)
Shivam Zala (160110116062)
Aakash Godhani (160110116063)
Harshal Dankhara (160110116064)
Shreya Patel (160110116065)
Content
Introduction
First Order Runge-Kutta Method
Second Order Runge-Kutta Method
Third Order Runge-Kutta Method
Fourth Order Runge-Kutta Method
Example
Runge Kutta Method : Introduction
 Developed by two German mathematicians Runge and kutta .
 It is also called R-K method.
 Runge-kutta method distinguished by their order
First Order Runge –Kutta Method
 Considering the differential equation
dy/dx=f(x,y)
With the initial condition y(x0)=y0
By the Euler’s method
yn+1=yn + h*f(xn,yn)
yn+1=yn + h*y’n + (h2/2!)y’’n + ... (by Taylor’s series)
Second Order Runge –Kutta Method
 Yn+1=yn + k
Where k=(1/2)(k1+k2)
K1=h*f(xn , yn)
K2=h*f(xn + h , yn + k1)
Third Order Runge –Kutta Method
 Yn+1=yn + k
Where k=(1/6)(k1+4k2+k3)
K1=h*f(xn , yn)
K2=h*f(xn + (h/2) , yn + (k1/2) )
K3=h*f(xn + h , yn + 2k2 – k1 )
Fourth Order Runge –Kutta Method
Yn+1=yn + k
Where k=(1/6)(k1+2k2+2k3+k4)
K1=h*f(xn , yn)
K2=h*f(xn + (h/2) , yn + (k1/2) )
K3=h*f(xn + (h/2) , yn + (k2/2) )
K4=h*f(xn + h, yn + k3 )
Example
 Solve the differential equation dy/dx=x+y , with the fourth order Runge-Kutta
method ,where y(0)=1 with x=0.2 with h=0.1.
 Given data y(0)=1 and h=0.1
 dy/dx = x+y
f(x,y)=dy/dx=x+y
 1st iteration
X0=0 , y0=1 , h=0.01 , n=0
K1 =h*f(x0,y0)
=0.1*(0,1)
=0.1*(0+1)
=0.1
K2 =h*f(x0 + (h/2) , y0 + (k1/2) )
=0.1*f(0 + (0.1/2) , 1 + (0.1/2) )
=0.1*f(0.05,1.05)
=0.1*(0.05+1.05)
=0.11
K3 =h*f(x0 + (h/2) , y0 + (k2/2) )
=0.1*f(0+ (0.1/2) , 1+ (0.11/2) )
=0.1*f(0.05,1.055)
=0.1*(0.05+1.055)
=0.1105
K4 =h*f( x0 +h , y0 + k3 )
=0.1*f(0+0.1 , 1+0.1105)
=0.1*f(0.1,1.1105)
=0.1*(0.1+1.1105)
=0.1211
So y1 =y0+k
=y0 + (1/6)(k1 + 2k2 + 2k3 + k4)
=1 + (1/6)(0.1 + 2(0.11) + 2(0.1105) + 0.1211 )
=1.1103
 2nd iteration
X1=0.1 , y0=1.1103 , h=0.01 , n=1
K1 =h*f(x1,y1)
=0.1*(0.1,1.1103)
=0.1*(0.1+1.1103)
=0.1210
K2 =h*f(x1 + (h/2) , y1 + (k1/2) )
=0.1*f(0.1 + (0.1/2) , 1.1103 + (0.1210/2) )
=0.1*f(0.15,1.1708)
=0.1*(0.15+1.1708)
=0.1321
K3 =h*f(x1 + (h/2) , y1 + (k2/2) )
=0.1*f(0.1+ (0.1/2) , 1.1103+ (0.1321/2) )
=0.1*f(0.15,1.1764)
=0.1*(0.15+1.1764)
=0.1326
K4 =h*f( x1 +h , y1 + k3 )
=0.1*f(0.1+0.1 , 1.1103+0.1326)
=0.1*f(0.2,1.2429)
=0.1*(0.2+1.2429)
=0.1443
So y1 =y1+k
=y1 + (1/6)(k1 + 2k2 + 2k3 + k4)
=1 + (1/6)(0.1210 + 2(0.1321) + 2(0.1326) + 0.1443 )
=1.2428
Hence y(0.2)=1.2428
Thank You

Runge Kutta Method

  • 1.
    G. H. PatelCollege of Engineering & Technology Subject : Numerical and Statistical Method for Computer Engineering (2140706) Topic : Runge Kutta Methods Guided by : Prof. Tejas Jani Made by : Vashi Bhavik (160110116061) Shivam Zala (160110116062) Aakash Godhani (160110116063) Harshal Dankhara (160110116064) Shreya Patel (160110116065)
  • 2.
    Content Introduction First Order Runge-KuttaMethod Second Order Runge-Kutta Method Third Order Runge-Kutta Method Fourth Order Runge-Kutta Method Example
  • 3.
    Runge Kutta Method: Introduction  Developed by two German mathematicians Runge and kutta .  It is also called R-K method.  Runge-kutta method distinguished by their order
  • 4.
    First Order Runge–Kutta Method  Considering the differential equation dy/dx=f(x,y) With the initial condition y(x0)=y0 By the Euler’s method yn+1=yn + h*f(xn,yn) yn+1=yn + h*y’n + (h2/2!)y’’n + ... (by Taylor’s series)
  • 5.
    Second Order Runge–Kutta Method  Yn+1=yn + k Where k=(1/2)(k1+k2) K1=h*f(xn , yn) K2=h*f(xn + h , yn + k1)
  • 6.
    Third Order Runge–Kutta Method  Yn+1=yn + k Where k=(1/6)(k1+4k2+k3) K1=h*f(xn , yn) K2=h*f(xn + (h/2) , yn + (k1/2) ) K3=h*f(xn + h , yn + 2k2 – k1 )
  • 7.
    Fourth Order Runge–Kutta Method Yn+1=yn + k Where k=(1/6)(k1+2k2+2k3+k4) K1=h*f(xn , yn) K2=h*f(xn + (h/2) , yn + (k1/2) ) K3=h*f(xn + (h/2) , yn + (k2/2) ) K4=h*f(xn + h, yn + k3 )
  • 8.
    Example  Solve thedifferential equation dy/dx=x+y , with the fourth order Runge-Kutta method ,where y(0)=1 with x=0.2 with h=0.1.  Given data y(0)=1 and h=0.1  dy/dx = x+y f(x,y)=dy/dx=x+y
  • 9.
     1st iteration X0=0, y0=1 , h=0.01 , n=0 K1 =h*f(x0,y0) =0.1*(0,1) =0.1*(0+1) =0.1
  • 10.
    K2 =h*f(x0 +(h/2) , y0 + (k1/2) ) =0.1*f(0 + (0.1/2) , 1 + (0.1/2) ) =0.1*f(0.05,1.05) =0.1*(0.05+1.05) =0.11 K3 =h*f(x0 + (h/2) , y0 + (k2/2) ) =0.1*f(0+ (0.1/2) , 1+ (0.11/2) ) =0.1*f(0.05,1.055) =0.1*(0.05+1.055) =0.1105
  • 11.
    K4 =h*f( x0+h , y0 + k3 ) =0.1*f(0+0.1 , 1+0.1105) =0.1*f(0.1,1.1105) =0.1*(0.1+1.1105) =0.1211 So y1 =y0+k =y0 + (1/6)(k1 + 2k2 + 2k3 + k4) =1 + (1/6)(0.1 + 2(0.11) + 2(0.1105) + 0.1211 ) =1.1103
  • 12.
     2nd iteration X1=0.1, y0=1.1103 , h=0.01 , n=1 K1 =h*f(x1,y1) =0.1*(0.1,1.1103) =0.1*(0.1+1.1103) =0.1210
  • 13.
    K2 =h*f(x1 +(h/2) , y1 + (k1/2) ) =0.1*f(0.1 + (0.1/2) , 1.1103 + (0.1210/2) ) =0.1*f(0.15,1.1708) =0.1*(0.15+1.1708) =0.1321 K3 =h*f(x1 + (h/2) , y1 + (k2/2) ) =0.1*f(0.1+ (0.1/2) , 1.1103+ (0.1321/2) ) =0.1*f(0.15,1.1764) =0.1*(0.15+1.1764) =0.1326
  • 14.
    K4 =h*f( x1+h , y1 + k3 ) =0.1*f(0.1+0.1 , 1.1103+0.1326) =0.1*f(0.2,1.2429) =0.1*(0.2+1.2429) =0.1443 So y1 =y1+k =y1 + (1/6)(k1 + 2k2 + 2k3 + k4) =1 + (1/6)(0.1210 + 2(0.1321) + 2(0.1326) + 0.1443 ) =1.2428 Hence y(0.2)=1.2428
  • 15.