Hyperbolic equations have an unknown characterized by a second derivative with
respect to time, such as the wave equation:

where:

  • is the wave amplitude
  • is position
  • is time
  • is a constant. For the 1D wave equation, is replaced with and is the wave speed

The 1D wave equation is:

With initial conditions:

  • Shape of wave:
  • Velocity of wave:

Boundary conditions which represent the wave amplitudes at boundaries:

Notation

Subscript is for (displacement) h is the step size in the spatial coordinate
Subscript is for (time), is the step size in time
This is a 2D problem with grid points and .

We start by replacing the second derivative with the centered difference. Recall that:

So the substitution is:

We let . Rearranging for u at the next time point ():

However, we require values at two prior time steps: and, to solve for .

To address this challenge, we can approximate the first partial derivative of with respect to time (subscript ) as:

And using our initial condition:

Rearranging:

Substituting the above into the original finite difference formulation:

This formula is for the first time step () and includes the initial velocity g. For all later time steps, we use:

Since we have used 2nd order formulas for both space and time derivatives, the accuracy of the calculation will be .

We use the finite difference method. Define:

Then we can write the initial equation for the next time step :

in matrix form as:

Note that goes from to , based on the spatial step size . This vector is elements long, all zeros except for the first and last elements.

The subsequent time steps are:

Including initial boundary conditions:

Subsequent time steps are: