322.061: Fundamentals of Numerical Thermo-Fluid Dynamics Exercise 4
The Runge-Kutta methods are iterative ways to calculate the solution of a differential equation. Starting from an initial condition, they calculate the solution forward step by step. The second-order formula (RK2) is:
k1 =hf(xn, yn), k2 =hf(xn+ h
2, yn+ k1 2), yn+1 =yn+k2+O(h3).
(1)
For the third-order formula, it holds:
k1 =hf(xn, yn), k2 =hf(xn+h
2, yn+ k1 2 ), k3 =hf(xn+h, yn−k1+ 2k2), yn+1 =yn+1
6(k1+ 4k2+k3) +O(h4);
(2)
and the forth-order formula (RK4) is:
k1 =hf(xn, yn), k2 =hf(xn+h
2, yn+k1 2), k3 =hf(xn+h
2, yn+k2 2), k4 =hf(xn+h, yn+k3), yn+1 =yn+1
6(k1+ 2k2+ 2k3+k4) +O(h5).
(3)
This method is reasonably simple and robust and is a good general candidate for numerical solution of differential equations. It should be noted that the methods explained here are all explicit.
1