## The scalar wave equation in Method of Lines form

Date

Abstract

WaveMoL is an example implementation of a thorn that uses the method of lines thorn MoL. The wave equation in ﬁrst order form is implemented.

### 1 Purpose

WaveToy is the simple test thorn that comes with Cactus as standard. This is written so that it solves the wave equation

 ${\partial }_{t}^{2}\varphi ={\partial }_{{x}^{i}}^{2}{\varphi }^{i}$ (1)

directly using the leapfrog scheme. This form of the equations isn’t suitable for use with the method of lines.

The purpose of this thorn is to rewrite the equations in ﬁrst order form

$\begin{array}{rcll}{\partial }_{t}\Phi & =& {\partial }_{{x}^{i}}{\Pi }^{i},& \text{(2)}\text{}\text{}\\ {\partial }_{t}{\Pi }^{j}& =& {\partial }_{{x}^{j}}\Phi ,& \text{(3)}\text{}\text{}\\ {\partial }_{t}\varphi & =& \Phi ,& \text{(4)}\text{}\text{}\\ {\partial }_{{x}^{j}}\varphi & =& {\Pi }^{j}.& \text{(5)}\text{}\text{}\end{array}$

The ﬁrst three equations (which expand to ﬁve separate PDEs) will be evolved. The ﬁnal equation is used to set the initial data and can be thought of as a constraint.

This will be implemented using simple second order diﬀerencing in space. Time evolution is performed by the method of lines thorn MoL.

### 2 How it works

The equations are evolved entirely using the method of lines thorn. So all we have to provide (for the evolution) is a method of calculating the right hand side of equation (2) and boundary conditions. The boundary conditions are standard from wavetoy itself. The right hand side is calculated using second order centred ﬁnite