Concept:
\(\frac{{dy}}{{dx}} = f\left( {x,y} \right),\;y\left( {{x_0}} \right) = {y_0}\)
Runge-Kutta Method of first order:
k1 = h f(x0, y0)
y1 = y0 + k where k = k1 = h f (x0, y0)
y2 = y1 + k where k = h f (x1, y1)
Runge-Kutta Method of Second order:
k1 = h f(x0, y0)
k2 = h f (x0 + h, y0 + k1)
\(k = \frac{{{k_1} + {k_2}}}{2}\)
y1 = y0 + k
Runge-Kutta Method of Third order:
k1 = h f (x0, y0)
\(\begin{array}{l} {k_2} = hf\left( {{x_0} + \frac{h}{2},{y_0} + \frac{{{k_1}}}{2}} \right)\\ k' = hf\left( {{x_0} + h,{y_0} + {k_1}} \right) \end{array}\)
\(\begin{array}{l} {k_3} = hf\left( {{x_0} + h,{y_0} + k'} \right)\\ k = \frac{1}{6}\left( {{k_1} + 4{k_2} + {k_3}} \right) \end{array}\)
y1 = y0 + k
Runge-Kutta Method of fourth order:
k1 = h f (x0, y0)
\(\begin{array}{l} {k_2} = hf\left( {{x_0} + \frac{h}{2},{y_0} + \frac{{{k_1}}}{2}} \right)\\ {k_3} = hf\left( {{x_0} + \frac{h}{2},{y_0} + \frac{{{k_2}}}{2}} \right) \end{array}\)
\(\begin{array}{l} {k_4} = hf\left( {{x_0} + h,{y_0} + {k_3}} \right)\\ k = \frac{1}{6}\left( {{k_1} + 2{k_2} + 2{k_3} + {k_4}} \right) \end{array}\)
y1 = y0 + k
Calculation:
Question is about third order Runge Kutta method with step-size h = 0.1.
\(\frac{{dy}}{{dx}} = - y = f\left( {x,y} \right);{x_0} = 0,\;{y_0} = 1\)
f(x0, y0 ) = f(0, 1) = -1
k1 = h f (x0, y0) = 0.1 × (-1) = -0.1
\({k_2} = hf\left( {{x_0} + \frac{h}{2},{y_0} + \frac{{{k_1}}}{2}} \right) = hf\left( {0.05,\;0.95} \right)\)
= 0.1 [-0.95] = -0.095
k’ = h f (x0 + h, y0 + k1) = h f (0.1, 0.9) = =0.9 h
k’ = -0.09
k3 = h f (x0 + h, y0 + k’) = h f (0.1, 0.91) = -0.91 h
k3 = -0.091
\(\begin{array}{l} k = \frac{1}{6}\left( {{k_1} + 4{k_2} + {k_3}} \right)\\ = \frac{{ - 1}}{6}\left( {0.1 + 4\left( {0.095} \right) + 0.091} \right) = - 0.095167 \end{array}\)
y
1 = y
0 + k = 1 - 0.095167 = 0.9