Nge Kutta
Nge Kutta
Nge Kutta
1 step methods:
yi +1 = yi + φ ( xi , yi , h)h
φ = a1k1 + a2 k 2 + L + an k n (increment function)
yi +1 = yi + k 2 h Midpoint corrector
1 1
k 2 = ( xi + h, yi + k1h)
k1 = f ( xi , yi ) 2 2
1 2
yi +1 = yi + ( k1 + k 2)h Raltson’s method
3 3 3 3
k1 = f ( xi , yi ) k 2 = f ( xi + h, yi + k 1h)
4 4
Comparison of three 2nd-order RK methods with the true solution
Runge Kutta
1
3rd order: yi +1 = yi + (k1 + 4k 2 + k3 )h
6
k1 = f ( xi , yi )
1 1
k 2 = f ( xi + h, yi + k1h)
2 2
k3 = f ( xi + h, yi − k1h + 2k 2 h)
Classical RK
4th order: 1
yi +1 = yi + (k1 + 2k 2 + 2k3 + k 4 )h
6
k1 = f ( xi , yi )
1 1
k 2 = f ( xi + h, yi + k1h)
2 2
1 1
k3 = f ( xi + h, yi + k2 h)
2 2
k 4 = f ( xi + h, yi + k3h)
4th order Runge Kutta
Butcher’s
5th order: 1
yi +1 = yi + (7k1 + 32k3 + 12k 4 + 32k5 + 7 k6 )h
90
k1 = f ( xi , yi )
1 1
k 2 = f ( xi + h, yi + k1h)
4 4
1 1 1
k3 = f ( xi + h, yi + k1h + k 2 h)
4 8 8
1 1
k 4 = f ( xi + h, yi − k2 h + k3h)
2 2
3 3 9
k5 = f ( xi + h, yi + k1h + k 4 h)
4 16 16
3 2 12 12 8
k6 = f ( xi + h, yi − k1h + k2 h + k3h − k 4 h + k5 h)
7 7 7 7 7
f(x,y)=4e0.8x-0.5y
b−a
Effort = n f
h
nf = no. function
System of equations
dy1
= f1 ( x, y1 , y2 , L , yn )
dx
dy2
= f 2 ( x, y1 , y2 , L , yn )
dx
M
dyn
= f n ( x, y1 , y2 , L , yn )
dx
1 1
k 2 = f ( xi + h, yi + k1h)
2 2
1 1
k3 = f ( xi + h, yi + k2 h)
2 2
k 4 = f ( xi + h, yi + k3h)
1
yi +1 = yi + (k1 + 2k 2 + 2k3 + k 4 )h
6
x y1 y2
0 4 6
∆ = y2 − y1
For 4th order RK, the correction is
∆
y2 ← y2 +
15
This estimate is fifth-order accurate.
Example 25.12: (Adaptive RK)