Difference between revisions of "Variable Depth Shallow Water Wave Equation"
Sean Curry (talk | contribs) |
Sean Curry (talk | contribs) |
||
Line 182: | Line 182: | ||
Taking a separable solution gives the eigenvalue problem | Taking a separable solution gives the eigenvalue problem | ||
<center> | <center> | ||
− | <math>\partial_x \left( h(x) \partial_x\zeta \right) = -\ | + | <math>\partial_x \left( h(x) \partial_x\zeta \right) = -\omega^{2}\rho(x)\zeta \quad (1)</math> |
</center> | </center> | ||
Line 189: | Line 189: | ||
Substituting this form into (1) gives | Substituting this form into (1) gives | ||
<center> | <center> | ||
− | <math> \partial_x(h(x)\partial_x \zeta_p)+\partial_x(h(x)\partial_xu) = -\ | + | <math> \partial_x(h(x)\partial_x \zeta_p)+\partial_x(h(x)\partial_xu) = -\omega^{2}\left(\zeta_p+u\right)</math> |
</center> | </center> | ||
Or, on rearranging | Or, on rearranging | ||
<center> | <center> | ||
− | <math> \partial_x(h(x)\partial_xu)+\ | + | <math> \partial_x(h(x)\partial_xu)+\omega^{2}u = -\partial_x(h(x)\partial_x \zeta_p)-\omega^{2}\zeta_p = f(x)\quad (2)</math> |
</center> | </center> | ||
− | so <center><math> f(x) = -\frac{(b-a)}{2L}\partial_xh(x) - \ | + | so <center><math> f(x) = -\frac{(b-a)}{2L}\partial_xh(x) - \omega^2 \left(\frac{(b-a)}{2L}x + \frac{b+a}{2}\right) </math> |
</center> | </center> | ||
Now consider the homogenous Sturm-Liouville problem for u | Now consider the homogenous Sturm-Liouville problem for u | ||
Line 229: | Line 229: | ||
If we now construct <math> u = \sum_{k=1}^{\infty} b_k u_k </math> and substitute this into equation (2) we get | If we now construct <math> u = \sum_{k=1}^{\infty} b_k u_k </math> and substitute this into equation (2) we get | ||
− | <center><math> \sum_{k=1}^{\infty} (\partial_x(h(x)\partial_x u_k) + \ | + | <center><math> \sum_{k=1}^{\infty} (\partial_x(h(x)\partial_x u_k) + \omega^{2}\rho u_k)b_k = f(x) </math></center> |
− | <center><math> \implies \sum_{k=1}^{\infty} (-\lambda_k\rho u_k + \ | + | <center><math> \implies \sum_{k=1}^{\infty} (-\lambda_k\rho u_k + \omega^{2}\rho u_k)b_k = f(x) </math></center> |
− | <center><math> \implies \sum_{k=1}^{\infty} (\ | + | <center><math> \implies \sum_{k=1}^{\infty} (\omega^{2}-\lambda_k) b_k \rho u_k = f(x) \quad (5) </math></center> |
And defining the RHS of equation (5) as <math> f(x) </math>, a known function, we can retrieve the coefficients <math> b_k </math> by integrating against <math> u_k </math> | And defining the RHS of equation (5) as <math> f(x) </math>, a known function, we can retrieve the coefficients <math> b_k </math> by integrating against <math> u_k </math> | ||
<center> | <center> | ||
− | <math> b_k = \frac{\int_{0}^{1}\,f u_k\,dx}{(\ | + | <math> b_k = \frac{\int_{0}^{1}\,f u_k\,dx}{(\omega^{2}-\lambda_k) \int_{0}^{1}\, \rho u_{k}^{2}\,dx} </math> |
</center> | </center> | ||
Line 241: | Line 241: | ||
The coefficients <math> c_n </math> of the fourier expansion of u are just <math> \sum_{k=1}^{\infty}a_{n,k}b_{k} </math> with <math> a_{n.k} </math> being the <math>n</math>th coefficient of the <math>k</math>th eigenfunction of the Sturm-Liouville problem. | The coefficients <math> c_n </math> of the fourier expansion of u are just <math> \sum_{k=1}^{\infty}a_{n,k}b_{k} </math> with <math> a_{n.k} </math> being the <math>n</math>th coefficient of the <math>k</math>th eigenfunction of the Sturm-Liouville problem. | ||
− | So <math> \zeta=\frac{(b-a)}{2L}x + \frac{b+a}{2}+\sum_{n=1}^{\infty}c_{n} \sin\left(\frac{n\pi}{2}\left(\frac{x}{L} + 1\right)\right) </math> with <math> \zeta |_{-L}=a \quad \zeta |_{L}=b </math> and, given <math> a </math> and <math> b </math> explicitly differentiating <math> \zeta </math> gives <math> \partial_x \zeta |_{-L} </math> and <math> \partial_x | + | So <math> \zeta=\frac{(b-a)}{2L}x + \frac{b+a}{2}+\sum_{n=1}^{\infty}c_{n} \sin\left(\frac{n\pi}{2}\left(\frac{x}{L} + 1\right)\right) </math> with <math> \zeta |_{-L}=a \quad \zeta |_{L}=b </math> and, given <math> a </math> and <math> b </math> explicitly differentiating <math> \zeta </math> gives <math> \partial_x \zeta |_{-L} </math> and <math> \partial_x \zeta |_L </math>. |
The aim here is to construct a matrix <math> S </math> such that, given <math> a </math> and <math> b </math> | The aim here is to construct a matrix <math> S </math> such that, given <math> a </math> and <math> b </math> | ||
Line 253: | Line 253: | ||
</center> | </center> | ||
− | Now for the areas of constant depth there is a potential of the form <math> e^{ | + | Now for the areas of constant depth there is a potential of the form <math> e^{i\omega x} </math> which, creates reflected and transmitted potentials from the variable depth area of the form <math> Re^{i\omega x} </math> and <math> Te^{i\omega x} </math> respectively where the magnitudes of <math> R </math> and <math> T </math> are unknown. We can calculate that the boundary conditions for <math> \zeta </math> must be |
<center> | <center> | ||
− | <math> \zeta |_{-L} = e^{- | + | <math> \zeta |_{-L} = e^{-i\omega L}+Re^{i\omega L}, \quad \zeta |_L = Te^{i\omega L}, \quad \partial_x \zeta |_{-L} = i\omega e^{-i\omega L}-i\omega Re^{i\omega L}, \quad \partial_x \zeta |_L = i\omega Te^{i\omega L} </math> |
</center> | </center> | ||
Line 267: | Line 267: | ||
If a waveform <math> f(x) </math> is travelling in from <math> -\infty </math> Taking the fourier transform gives | If a waveform <math> f(x) </math> is travelling in from <math> -\infty </math> Taking the fourier transform gives | ||
<center> | <center> | ||
− | <math> \hat{f}( | + | <math> \hat{f}(\omega)=\int_{-\infty}^{\infty}\,f(x)e^{2\pi i \omega} \,dx </math> |
</center> | </center> | ||
− | and then inverting <math> \hat{f}( | + | and then inverting <math> \hat{f}(\omega) \zeta(x) </math> with respect to <math> t </math> gives |
<center> | <center> | ||
− | <math> f(x,t) = \int_{-\infty}^{\infty}\,\hat{f}( | + | <math> f(x,t) = \int_{-\infty}^{\infty}\,\hat{f}(\omega) \zeta(x) e^{-2\pi i \omega t} \,d\omega </math> |
</center> | </center> | ||
Revision as of 21:27, 17 February 2009
Introduction
We consider here the problem of waves reflected by a region of variable depth in an otherwise uniform depth region assuming the equations of Shallow Depth.
Equations
We begin with the shallow depth equation
subject to the initial conditions
where [math]\displaystyle{ \zeta }[/math] is the displacement, [math]\displaystyle{ \rho }[/math] is the string density and [math]\displaystyle{ h(x) }[/math] 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 [math]\displaystyle{ -L\lt x\lt L }[/math]. 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 [math]\displaystyle{ \lambda_0 = 0 }[/math].
Calculation of [math]\displaystyle{ \zeta_n }[/math]
We can calculate the eigenfunctions [math]\displaystyle{ \zeta_n }[/math] by an expansion in the modes for the case of uniform depth. We use the Rayleigh-Ritz method. The eigenfunctions are local minimums of
[math]\displaystyle{ J[\zeta] = \int_{-L}^L \frac{1}{2}\left\{ h(x)\left(\partial_x \zeta\right)^2 - \lambda \rho(x) \zeta^2 \right\} }[/math]
subject to the boundary conditions that the normal derivative vanishes (where [math]\displaystyle{ \lambda }[/math] is the eigenvalue).
We expand the displacement in the eigenfunctions for constant depth [math]\displaystyle{ h=1 }[/math]
[math]\displaystyle{ \zeta = \sum_{n=0}^{N} a_n \psi_n(x) }[/math]
where
[math]\displaystyle{ \psi_n = \frac{1}{\sqrt{L}} \cos( n \pi (\frac{1}{2L}x + \frac{1}{2})),\,\,n\ne 1 }[/math]
[math]\displaystyle{ \psi_0 = \frac{1}{\sqrt{2L}},\, }[/math]
and substitute this expansion into the variational equation we obtain
this equation can be rewritten using matrices as
[math]\displaystyle{ \mathbf{K} \vec{a} = \lambda\mathbf{M} \vec{a} }[/math]
where the elements of the matrices K and M are
[math]\displaystyle{ \mathbf{K}_{mn} = \int_{-L}^L \left\{ \left(\partial_x \psi_m h(x) \partial_x \psi_n\right) \right\} }[/math]
and
Matlab code
Example of the method of numerical integration; using a weighting matrix to implement Simpson's Rule:
x = linspace(-4,4,500).';
f = exp(-10*(x.^2));
g = sin(x);
h = x(2)-x(1);
simp = 2*h/3*ones(1,length(x));
simp(2:2:length(x)-1) = 4*h/3;
simp(1) = h/3;
simp(end) = h/3;
simp = diag(simp);
%The integral of f(x)^2 from (by Simpson's Rule) -4 to 4 is:
int1 = transpose(f)*simp*f;
%The integral of f(x)*g(x) from -4 to 4 is:
int2 = transpose(f)*simp*g;
Multiple integrals can be executed in one expression:
%NUMERICALLY CALCULATING FOURIER COEFICIENTS
%Make a row vector of x values
x = linspace(-pi,pi,200);
%Define a row vector of the values of the function to be fitted by a Fourier sine series
f = 5*x.^3 - 3*x;
%Simpson's Rule weighting matrix:
h = x(2)-x(1); simp = 2*h/3*ones(1,length(x)); simp(2:2:length(x)-1) = 4*h/3; simp(1) = h/3; simp(end) = h/3; simp = diag(simp);
%Create a matrix M with the fourier functions, x increasing along the rows, n increasing down the columns
M = zeros(round(length(x)/2),length(x));
for n = 1:length(M(:,1))
M(n,1:length(x)) = sin(n*x)/sqrt(pi);
end
%Calculate the column vector containing the coefficients of the sine series
fourier_coefficients = M*simp*transpose(f);
%Calculate a row vector of the fitting function evaluated at the values of x
fourier_sine_fit = transpose(fourier_coefficients)*M;
%Plot to check
plot(x,f,x,fourier_sine_fit)
Waves in an infinite basin
We assume that the density [math]\displaystyle{ \rho }[/math] and the depth [math]\displaystyle{ h }[/math] are constant and equal to one outside the region [math]\displaystyle{ -L\lt x\lt L }[/math]. We can therefore write the wave as
Solution using Separation of Variables
Taking a separable solution gives the eigenvalue problem
[math]\displaystyle{ \partial_x \left( h(x) \partial_x\zeta \right) = -\omega^{2}\rho(x)\zeta \quad (1) }[/math]
Given boundary conditions [math]\displaystyle{ \zeta \mid_{-L} = a }[/math] and [math]\displaystyle{ \zeta \mid_L = b }[/math] we can take [math]\displaystyle{ \zeta = \zeta_p + u }[/math] With [math]\displaystyle{ \zeta_p = \frac{(b-a)}{2L}x + \frac{b+a}{2} }[/math] satisfying the boundary conditions and [math]\displaystyle{ u }[/math] satisfying [math]\displaystyle{ u |_{-L} = u |_L = 0 }[/math]
Substituting this form into (1) gives
[math]\displaystyle{ \partial_x(h(x)\partial_x \zeta_p)+\partial_x(h(x)\partial_xu) = -\omega^{2}\left(\zeta_p+u\right) }[/math]
Or, on rearranging
[math]\displaystyle{ \partial_x(h(x)\partial_xu)+\omega^{2}u = -\partial_x(h(x)\partial_x \zeta_p)-\omega^{2}\zeta_p = f(x)\quad (2) }[/math]
so
Now consider the homogenous Sturm-Liouville problem for u
[math]\displaystyle{ \partial_x(h(x)\partial_xu)+\lambda u = 0\quad u|_0=u|_1=0 \quad (3) }[/math]
By Sturm-Liouville theory this has an infinite set of eigenvalues [math]\displaystyle{ \lambda_k }[/math] with corresponding eigenfunctions [math]\displaystyle{ u_k }[/math]. Also since [math]\displaystyle{ u_k|_0=u_k|_1=0\quad \forall k }[/math] Each [math]\displaystyle{ u_k }[/math] can be expanded as a fourier series in terms of sine functions.
[math]\displaystyle{ u_k = \sum_{n=1}^{\infty} a_{n,k} \psi_n }[/math]
where
[math]\displaystyle{ \psi_n = \sin\left(\frac{n\pi}{2}\left(\frac{x}{L} + 1\right)\right) }[/math]
Transforming (3) into the equivalent variational problem gives
[math]\displaystyle{ J[u] = \int_{-L}^{L}\,hu'^{2}-\lambda \rho u^{2} \, dx \quad (4) }[/math]
Substituting the fourier expansion for [math]\displaystyle{ u_k }[/math] into (4):
Since [math]\displaystyle{ u_k }[/math] minimises J, we require [math]\displaystyle{ \frac{\partial J}{\partial a_{n}}=0 \quad \forall n }[/math]
[math]\displaystyle{ \frac{\partial J}{\partial a_{m}}=\int_{-L}^{L}\left\{2h\psi_m'\sum_{n=1}^{\infty} a_{n}\psi_n'-2\lambda\rho \psi_m \sum_{n=1}^{\infty} a_{n} \psi_n\right\}dx=0 }[/math]
[math]\displaystyle{ \implies \int_{-L}^{L}2h\psi_m'\sum_{n=1}^{\infty} a_{n}\psi_n'dx= \int_{-L}^{L}2\lambda\rho \psi_m \sum_{n=1}^{\infty} a_{n} \psi_ndx }[/math]
By defining a vector [math]\displaystyle{ \textbf{a} = \left(a_{n}\right) }[/math] and matrices [math]\displaystyle{ K_{(n,m)} = \int_{-L}^{L}h(x)\psi_m'(x)\psi_n'(x)dx }[/math] and [math]\displaystyle{ M_{(n,m)} = \int_{-L}^{L}\rho(x)\psi_m(x)\psi_n(x)dx }[/math] we have the linear system [math]\displaystyle{ K\textbf{a} = \lambda M\textbf{a} }[/math] which returns the eigenvalues and eigenvectors of equation (3), with eigenvectors [math]\displaystyle{ \textbf{a} }[/math] representing coefficient vectors of the fourier expansions of eigenfunctions.
If we now construct [math]\displaystyle{ u = \sum_{k=1}^{\infty} b_k u_k }[/math] and substitute this into equation (2) we get
And defining the RHS of equation (5) as [math]\displaystyle{ f(x) }[/math], a known function, we can retrieve the coefficients [math]\displaystyle{ b_k }[/math] by integrating against [math]\displaystyle{ u_k }[/math]
[math]\displaystyle{ b_k = \frac{\int_{0}^{1}\,f u_k\,dx}{(\omega^{2}-\lambda_k) \int_{0}^{1}\, \rho u_{k}^{2}\,dx} }[/math]
The coefficients [math]\displaystyle{ c_n }[/math] of the fourier expansion of u are just [math]\displaystyle{ \sum_{k=1}^{\infty}a_{n,k}b_{k} }[/math] with [math]\displaystyle{ a_{n.k} }[/math] being the [math]\displaystyle{ n }[/math]th coefficient of the [math]\displaystyle{ k }[/math]th eigenfunction of the Sturm-Liouville problem.
So [math]\displaystyle{ \zeta=\frac{(b-a)}{2L}x + \frac{b+a}{2}+\sum_{n=1}^{\infty}c_{n} \sin\left(\frac{n\pi}{2}\left(\frac{x}{L} + 1\right)\right) }[/math] with [math]\displaystyle{ \zeta |_{-L}=a \quad \zeta |_{L}=b }[/math] and, given [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] explicitly differentiating [math]\displaystyle{ \zeta }[/math] gives [math]\displaystyle{ \partial_x \zeta |_{-L} }[/math] and [math]\displaystyle{ \partial_x \zeta |_L }[/math].
The aim here is to construct a matrix [math]\displaystyle{ S }[/math] such that, given [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math]
[math]\displaystyle{ S \begin{pmatrix} \zeta |_{-L} \\ \zeta |_L \end{pmatrix}=\begin{pmatrix} \partial_x \zeta |_{-L} \\ \partial_x \zeta |_L \end{pmatrix} }[/math]
Taking [math]\displaystyle{ a=1,\,b=0 }[/math] to give [math]\displaystyle{ \zeta_1 }[/math] shows that the first column of [math]\displaystyle{ S }[/math] must be [math]\displaystyle{ \begin{pmatrix} \partial_x \zeta_1 |_{-L} \\ \partial_x \zeta_1 |_L \end{pmatrix} }[/math] and likewise taking [math]\displaystyle{ a=0,\,b=1 }[/math] to give [math]\displaystyle{ \zeta_2 }[/math] shows the second column must be [math]\displaystyle{ \begin{pmatrix} \partial_x \zeta_2 |_{-L} \\ \partial_x \zeta_2 |_L \end{pmatrix} }[/math]. So [math]\displaystyle{ S }[/math] is given by
[math]\displaystyle{ \begin{pmatrix} \partial_x \zeta_1 |_{-L} \, \partial_x \zeta_2 |_{-L} \\ \partial_x \zeta_1 |_L \, \partial_x \zeta_2 |_L \end{pmatrix} }[/math]
Now for the areas of constant depth there is a potential of the form [math]\displaystyle{ e^{i\omega x} }[/math] which, creates reflected and transmitted potentials from the variable depth area of the form [math]\displaystyle{ Re^{i\omega x} }[/math] and [math]\displaystyle{ Te^{i\omega x} }[/math] respectively where the magnitudes of [math]\displaystyle{ R }[/math] and [math]\displaystyle{ T }[/math] are unknown. We can calculate that the boundary conditions for [math]\displaystyle{ \zeta }[/math] must be
[math]\displaystyle{ \zeta |_{-L} = e^{-i\omega L}+Re^{i\omega L}, \quad \zeta |_L = Te^{i\omega L}, \quad \partial_x \zeta |_{-L} = i\omega e^{-i\omega L}-i\omega Re^{i\omega L}, \quad \partial_x \zeta |_L = i\omega Te^{i\omega L} }[/math]
Knowing [math]\displaystyle{ S }[/math] these boundary conditions can be solved for [math]\displaystyle{ R }[/math] and [math]\displaystyle{ T }[/math], which in turn gives actual numerical boundary conditions to the original problem. Taking a linear combination of the solutions already calculated ([math]\displaystyle{ \zeta_1 }[/math] and [math]\displaystyle{ \zeta_2 }[/math]) will provide the solution for these new boundary conditions. This solution, along with the potentials outside this region gives a potential for the whole real axis.
If a waveform [math]\displaystyle{ f(x) }[/math] is travelling in from [math]\displaystyle{ -\infty }[/math] Taking the fourier transform gives
[math]\displaystyle{ \hat{f}(\omega)=\int_{-\infty}^{\infty}\,f(x)e^{2\pi i \omega} \,dx }[/math]
and then inverting [math]\displaystyle{ \hat{f}(\omega) \zeta(x) }[/math] with respect to [math]\displaystyle{ t }[/math] gives
[math]\displaystyle{ f(x,t) = \int_{-\infty}^{\infty}\,\hat{f}(\omega) \zeta(x) e^{-2\pi i \omega t} \,d\omega }[/math]
which is the time dependent solution for the wave form.