Runge-Kutta 4th Order Method
Runge-Kutta 4th Order Method
PRESENTED BY :
JITANTDRA TRIPATHI
STREAM:
M.Sc.(MATHMETICS)
SECOUND SEM
Runge-Kutta 4th Order Method
Learning Objectives
5 CISE301_Topic8L4&5
Alternative Form
Second Order Rung e Kutta
K1 h f ( xi , yi )
K 2 h f ( xi h, y i K1 )
yi 1 yi w1K1 w2 K 2
Alternativ e Form
k1 f ( xi , yi )
k2 f ( xi h, yi h k1 )
yi 1 yi h w1 k1 w2 k2
6 CISE301_Topic8L4&5
Second order Runge-Kutta Method
Example
Solve the following system to find x (1.02) using RK2
x (t ) 1 x 2 t 3 , x (1) 4, h 0.01, 1
STEP 1 :
K1 h f (t0 1, x0 4) 0.01(1 x02 t03 ) 0.18
K 2 h f (t0 h, x0 K1 )
0.01(1 ( x0 0.18)2 (t0 .01)3 ) 0.1662
x (1 0.01) x (1) K1 K 2 / 2
4 (0.18 0.1662) / 2 3.8269
7
Second order Runge-Kutta Method
STEP 2
8
Higher-Order Runge-Kutta
9
3rd Order Runge-Kutta RK3
Know as RK3
k1 f ( x i , y i )
h 1
k 2 f ( x i , y i k1 h )
2 2
k 3 f ( xi h, y i k1 h 2k 2 h)
y i k1 4k 2 k 3
h
y i 1
6
10 CISE301_Topic8L4&5
Runge-Kutta 4th Order Method
For dy
f ( x, y ), y (0) y0
dx
Runge Kutta 4th order method is given by
yi 1 yi k1 2k2 2k3 k4 h
1
6
where
k1 f xi , yi
1 1
k2 f xi h, yi k1h
2 2
1 1
k3 f xi h, yi k2 h
2 2
k4 f xi h, yi k3h
11
Example: RK4
Problem : h 0.2
dy
1 y x2 , y (0) 0.5 f ( x, y ) 1 y x 2
dx
x0 0, y0 0.5
Use RK 4 to find y (0.2), y (0.4)
k1 f ( x0 , y0 ) (1 y0 x02 ) 1.5
2 2
k3 f ( x0 h, y0 k2h ) 1 y0 0.164 x0 0.12 1.654
1 1
2 2
k4 f ( x0 h, y0 k3h ) 1 y0 0.16545 x0 0.2 2 1.7908
y1 y0
h
k1 2k2 2k3 k4 0.8293
6
12
Example: RK4
Problem :
h 0.2
dy
1 y x2 , y (0) 0.5 f ( x, y ) 1 y x 2
dx
x1 0.2, y1 0.8293
Use RK 4 to find y (0.2), y (0.4)
k1 f ( x1 , y1 ) 1.7893
1 1
k 2 f ( x1 h, y1 k1 h) 1.9182
Step 2
2 2
1 1
k 3 f ( x1 h, y1 k 2 h) 1.9311
2 2
k 4 f ( x1 h, y1 k 3 h) 2.0555
y 2 y1
0.2
k1 2k 2 2k 3 k 4 1.2141
6
13
Example: RK4
Problem :
dy
1 y x2 , y (0) 0.5
dx
Use RK 4 to find y (0.2), y (0.4)
14