11.1. The classical wave equation and its solution#
The classical wave equation in 1D can be written:
, where \(\eta\) represents the vertical displacement of the wave surface. In the ocean this would mean the deviation from the mean sea surface heigh.
The general solution to the wave equation (2.18) can be expressed as:
The solution represents one wave moving eastward (\(f(x+ct)\)) and one wave moving westward (g(x-ct)). If a surface is initially disturbed, such as from depressing the surface, waves will spread in all directions. If you throw a pebble in a puddle, you will see waves spreading like rings from the center of where you threw the pebble. For the 1D case, you can think of it as a transect cutting across the 2D case, or alternatively as throwing a pebble in a very narrow and long puddle. Here, the waves spread in only 2 directions, as is indicated in the solution to the wave equation (2.19).
11.1.1. Proving the general solution#
We can prove that this solution is correct, by differentiating the solution twice using the chain rule and inserting the expressions into the equation. To make the calculations tidier, we can introduce a variable transform set \(\phi=x+ct\) and \(\psi=x-ct\). Our general solution now becomes \(\eta(x,t)=f(\phi)+g(\psi)\).
Inserting these expressions into the wave equation yields:
11.1.2. Solving the wave equation numerically#
We can use the centered scheme for second deriatives (Equation (3.23)) for both the time derivative and the space derivative, yielding a CTCS scheme:
The CTCS scheme for the classical wave equation includes three time steps for \(\eta\). To start a time marching algorithm, we need to now both \(\eta_m^0\) and \(\eta_m^1\).
A common workaround to make life easy, is to use the same initial condition for both time step \(n=0\) and \(n=1\).
A more common method, is to assign both a Dirichlet initial condition for \(\eta_m^0\) and a von Neumann initial condition for the derivative \(\frac{\partial\eta_m^0}{\partial t}\):
Equation (11.7)can be expressed through a second order centered difference scheme:
We can rearrange the numerical scheme of our CTSC model and insert \(n=0\) (Equation (11.5)) to yield:
Now, we can add Equation (11.8) and (11.9) to obtain an equation for \(\eta_m^1\) (the \(\eta_m^{-1}\) terms will cancel out). Together with the Dirichlet booundary condition (Eq. (11.6)), we now have:
