Does Runge Kutta need future state of system?

177 Views Asked by At

In order to use the RK methods, you need to know the state of the system at future time-steps which can be expensive to compute (e.g., in physics simulations). As a simple example I'll use RK-2:

enter image description here

In order to evaluate K_2 I need to evaluate F at time step t + h. In a mechanics simulation you need to compute all the forces acting on an object to compute F -- therefore you need to know the state of the system at the current time step $t$ to evaluate K_1; and then you need to know the state at time step t + h to compute K_2. But how do you know this?

2

There are 2 best solutions below

4
On

It seems to me that you have already written the answer to your own question. The three lines you wrote defines a Runge-Kutta method (I believe that in this particalar case, it is also called the Heun method). Knowing $X$ (which is short for $X(t)$), you can easily get $K_1$. Knowing $K_1$, you can easily get $K_2$. Knowing $K_1$ and $K_2$, you can get $X(t+h)$, and loop the procedure.

The cases where such a calculation is possible are called "explicit methds" : you "only" have to evaluate $F$ for different $(t,X)$ points. There exist some methods however where the $K_i$ are given as functions of all $K_j$s, and a direct computation is not possible anymore. You have to solve for all the $K_i$s at once, and this is why those method are called "implicit".

If you can put your hands on it, I wamli recommand the book Hairer, E., Lubich, C., & Wanner, G. (2005). Geometric numerical integration, 22(5), 1. doi:10.1080/10640266.2014.951249, which is the very best I have read about numerical methods for ordinary differential equations.

Hope this helps !

2
On

When you solve a differential equation, and the independent variable is time, your goal is to calculate the future state of the system. Note that the final result is the description of the system, and not only a stage in the computation. The Runge-Kutta methods belong to the class of predictor-corrector methods, i.e. you predict first and later correct the estimation to increase accuracy. (Note that the most common RK method is of fourth order, or RK45 method.)

A simple example: calculate

$$ \frac{dy}{dx} = \frac{1}{4} \left( x^2 + y^2 \right) $$

with the initial condition $y(0)=0$. We determine the value $y(0.5)$ in one step, i.e. $h=0.5$.

\begin{array}{|c|c|c|} x & y & k=h \cdot f(x,y) \\ \hline x_0=0 & y_0=0 & k_1 = 0.5 \cdot \frac{1}{4} \left( 0^2 + 0^2 \right)=0 \\ \hline x_1=x_0+h/2=0.25 & y_1=y_0+k_1/2=0 & k_2 = 0.5 \cdot \frac{1}{4} \left( 0.25^2 + 0^2 \right)=0.0078125 \\ \hline x_3=x_0+h/2=0.25 & y_3=y_0+k_2/2 & k_3 = 0.5 \cdot \frac{1}{4} \left( x_3^2 + y_3^2 \right)=0.00781441 \\ \hline x_4=x_0+h=0.5 & y_4=y_0+k_3=0.00781441 & k_4 = 0.5 \cdot \frac{1}{4} \left( 0.5^2 + y_4^2 \right)=0.03125763 \end{array}

$$ y=y_0+\frac{1}{6} \left[ k_1+2k_2+2k_3+k_4 \right] $$

$$ y(0.5)=0+\frac{1}{6} \left[ 0+2 \cdot 0.0078125+2 \cdot 0.00781441+0.03125763 \right] =0.0104$$