# Variable Depth Shallow Water Wave Equation

We consider here the problem of waves reflected by a region of variable depth in a finite region or in an otherwise uniform depth region assuming the equations of Shallow Depth (assuming the problem is linear). We consider slightly more general equations of motion so that the same method could be used for a variable density string.

## Contents |

## Equations

We begin with the shallow depth equation

subject to the initial conditions

where is the displacement, is the string density and is the variable depth (note that we are unifying the variable density string and the wave equation in variable depth because the mathematical treatment is identical).

## Waves in a finite basin

We consider the problem of waves in a finite basin . At the edge of the basin the boundary conditions are

We solve the equations by expanding in the modes for the basin which satisfy

normalised so that

The solution is then given by

where we have assumed that .

### Calculation of

We can calculate the eigenfunctions by an expansion in the modes for the case of uniform depth. We use the Rayleigh-Ritz method. The eigenfunctions are local minimums of

subject to the boundary conditions that the normal derivative vanishes (where is the eigenvalue).

We expand the displacement in the eigenfunctions for constant depth

where

and substitute this expansion into the variational equation we obtain

this equation can be rewritten using matrices as

where the elements of the matrices **K** and **M** are

and

### Matlab Code

Code to calculate the solution in a finite basin can be found here finite_basin_variable_h_and_rho.m

## Waves in an infinite basin

We assume that the density and the depth are constant and equal to one outside the region . We can therefore write the wave as

for waves incident from the right. To solve we use a solution to the problem on the interval subject to arbitrary boundary conditions and match.

### Solution in Finite Interval of Variable Properties

Taking a separable solution gives the eigenvalue problem

Given boundary conditions and we can take With satisfying the boundary conditions and satisfying

Substituting this form into (1) gives

Or, on rearranging

Now consider the homogenous Sturm-Liouville problem for u

By Sturm-Liouville theory this has an infinite set of eigenvalues with corresponding eigenfunctions . Also since Each can be expanded as a fourier series in terms of sine functions.

Transforming (3) into the equivalent variational problem gives

Substituting the fourier expansion for into (4):

Since minimises J, we require

By defining a vector and matrices and we have the linear system which returns the eigenvalues and eigenvectors of equation (3), with eigenvectors representing coefficient vectors of the fourier expansions of eigenfunctions.

If we now construct and substitute this into equation (2) we get

And defining the RHS of equation (5) as , a known function, we can retrieve the coefficients by integrating against

The coefficients of the fourier expansion of u are just with being the th coefficient of the th eigenfunction of the Sturm-Liouville problem.

So

with and, given and explicitly differentiating gives and .

### Matching at

We choose a basis of the solution space for any particular to be , where is the solution to the BVP(a=1,b=0) and is the solution to the BVP(a=0,b=1). The functions and can be calculated for any from (6).

The aim here is to construct a matrix **S** such that, given and

Taking to give shows that the first column of **S** must be and likewise taking to give shows the second column must be . So **S** is given by

Now for the area of constant depth on the left hand side there is a potential of the form which, creates reflected and transmitted potentials from the variable depth area of the form and respectively where the magnitudes of and are unknown. We can calculate that the boundary conditions for must be

Knowing **S** these boundary conditions can be solved for and , which in turn gives actual numerical boundary conditions to the original problem( and ). Taking a linear combination of the solutions already calculated () will provide the solution for these new boundary conditions. This solution, along with the potentials outside this region gives a generalised eigenfunction potential for the whole real axis which we denote as .

Independent generalised eigenfunctons (which we denote as )can be found by considering the potential on the right hand region of constant depth. The corresponding reflected and transmitted potentials from the variable depth area are of the form and respectively. Again knowing **S** we can solve for R and T and hence find the numerical boundary conditions ( and ).

We come out with:

where R and T are found by solving:

and and

Note that the values of R and T for are different from those for
(although they are related through some identities). For we have:

where R and T are found by solving:

Note a_+, b_+, a_- and b_- are found frm their corresponding R and T values.

### Generalised Eigenfunction Expansion

Now we have the generalised eigenfunctions and , which have the orthogonality relationships:

For any particular the general solution to the differential equation can be written as:

The general solution to the PDE is therefore:

Giving the initial conditions:

Using identities (7),(8) and (9) we can show:

Which we can use in combination with (10) to solve the IVP.

### Matlab Code

Code to calculate the solution in a infinite basin can be found here infinite_basin_variable_h_and_rho.m