Runge kutta method for order 4 for ODE x'=f(t)

269 Views Asked by At

Question: What is the simplified form of Runge kutta method when applied to order 4 for ODE x'=f(t)?

The runge kutta method is

$$k_1 = f(t_0,x(t_0))$$ $$k_2 = f(t_0+h/2,x(t_0)+k_1/2)$$ $$k_3 = f(t_0+h/2,x(t_0)hk_2/2)$$ $$k_4 = f(t_0+h,x(t_0)+k_3)$$ Then $$x(t_0+h)= x(t_0) + h\frac{k_1+2k_2+2k_3+k_4}{6}$$

How would I apply it to the ODE here? DO i expand taylor series like expand $x(t_0+h)= x(t_0) + h\frac{k_1+2k_2+2k_3+k_4}{6}$? thanks.

1

There are 1 best solutions below

0
On

You just follow the equations. You start at a time $t_0$, a position $x_0(t_0)$, and choose a step size $h$. You now just compute each line in turn. When you are done you are at time $t_1=t_0+h$ and (an approximation of) position $x_1(t_1)$. Now take another step which might be at the same step size or not. There is a nice discussion of how to choose the step size based on the desired error in section 17.2 of Numerical Recipes. Other numerical analysis texts should have a section as well.