I study the wave equation in conservation form. I do this to check whether I have understood and implemented DG methods correctly.
The conservation form of the wave equation is given in (leveque1992?).
The wave equation in 1D reads \[ u_{tt} = c^2 u_{xx}, \] where \(c\) is the wave speed, which I set to \(c = 1\) for the remainder.
Introduction of the variables \[ v = u_{x}, \qquad w = u_{t} \] allows to rewrite the wave equation into a coupled system of first order PDEs. Using commutation of partial derivatives, e.g. \(v_{t} = w_{x}\) then gives \[ v_{t} - w_{x} = 0, \qquad w_{t} - v_{x} = 0. \]
Initial conditions for the wave equation \[ u(x, 0) = u_{0}(x), \qquad u_{t}(x, 0) = u_{1}(x), \] transform to initial conditions for \(v,w\) according to \[ v(x,0) = u_{0}'(x), \qquad w(x,0) = u_{1}(x). \]
In the implementation I use a Lax-Friedrich flux as the numerical flux for \(v,w\) with local wave speed given by \(c = 1\).
To check my implementation I evolve the initial data \[ u_{0}(x) = a e^{-b(x-x_{0})^2}, \qquad u_{1}(x) = 2 a b (x - x_{0}) e^{-b(x-x_{0})^2}, \] which has the following analytic solution \[ u(t, x) = a e^{-b((x-x_{0})- t)^2}. \]
This can be done either by a line integral or by solving the equation \(u_{t} = w\). I chose the latter approach, because I am already working with an ODE solver in my DG program.