# Runge Kutta for wave equation

Recently I work on mechanical shocks (e.g. impact) in FE (fenics). I've already put together simple timesteppers (Euler, Crank-Nicolson). I use higher order basis, so I think of higher order time integration schemes like RK4. Is it worth the effort in mechanics?

I can't find any appropriate example of this method in elastic waves, so maybe it's pointless. I'm not sure, how to apply it in my case, since it's written in "incremental" form:

$$y_{i+1} = y_i+\frac{1}{6}(k_1+2k_2+2k_3+k_4)h$$

and I'm trying to apply it to system:

$$\begin{eqnarray*} \frac{\partial v}{\partial t} - \nabla u &=& f \\ \frac{\partial u}{\partial t} &=& v \end{eqnarray*}$$

• Sorry to dig out this quite old thread but were you able to implement Runge Kutta time stepping on your FEniCS problem? I'm currently struggling to do just that. Commented May 16, 2021 at 10:44

## 1 Answer

High order RK methods work fine for a large number of wave propagation (an elastic example using a DG discretization). The procedure is usually to discretize the spatial derivatives in the first order form of the wave equation. This is called semi-discretization and it results in a system of ODEs involving a vector of solution coefficients $U$ (for both $u$ and $v$).

$\frac{dU(t)}{dt} = AU(t)$

where $A$ is defined by your choice of discretization and the wave equation you want to solve. You can then apply Runge-Kutta methods directly to the equation - this involves computing RHS evaluations. Since the wave equation is linear, marching from $t_n$ to $t_n + dt$ with RK4 method requires computing four vectors

\begin{align*} k_1 &= AU(t_n)\\ k_2 &= A(U(t_n) + ({dt/2}) k_1)\\ k_3 &= A(U(t_n) + ({dt/2}) k_2)\\ k_4 &= A(U(t_n) + (dt) k_3) \end{align*}

then computing the final update $U(t_n + dt) = \frac{dt}{6}(k_1+2k_2+2k_3+k_4)$. Repeat this to march forward in time again.

• Thank You for the attached paped, it turned out really useful. I have some more 'implementation' problems, that I posted in another question.
– bjp
Commented Feb 6, 2016 at 19:41