Difference between revisions of "Variable Depth Shallow Water Wave Equation"
Line 1: | Line 1: | ||
The wave equation can be written as | The wave equation can be written as | ||
<center> | <center> | ||
− | <math>\partial_t^2 w- \partial_x \left( c(x)^2 \partial_x w \right)</math> | + | <math>\partial_t^2 w- \partial_x \left( c(x)^2 \partial_x w \right) \quad (1)</math> |
</center> | </center> | ||
+ | |||
+ | Taking a seperable solution <math>\ w (x,t) = \Tau (t) \hat{w} (x)</math> gives the eigenvalue problem | ||
+ | <center> | ||
+ | <math>\partial_x \left( c(x)^2 \partial_x\hat{w} \right) = \lambda\hat{w} \quad (2)</math> | ||
+ | </center> | ||
+ | |||
+ | Given boundary conditions <math>\hat{w} (0) = a</math> and <math>\hat{w} (1) = b</math> we can take | ||
+ | <center> | ||
+ | <math>\hat{w} = (b-a)x + a + u \quad (3)</math> | ||
+ | </center> | ||
+ | |||
+ | With <math> u = \sum_{n=1}^{N} a_n \sin (n \pi x)</math> a series solution satisfying <math> u (0) = u (1) = 0</math> | ||
+ | |||
+ | We wish to solve for <math> a_n </math> given <math> a </math> and <math> b </math>. Equation (2) can be transformed into the Sturm-Liouville problem of minimizing the functional | ||
+ | <center> | ||
+ | <math> J [u] = \int_{0}^{1} c^2 \left(\frac{d \hat{w}}{d x}\right)^2 + \lambda \hat{w}^2 \,dx</math> | ||
+ | </center> | ||
+ | which is minimal exactly when <math>\partial_{a_n} J = 0 \quad \forall a_n </math> | ||
+ | |||
+ | Substituting in <math>\hat{w} = (b-a)x + a + \sum_{n=1}^{N} a_n \sin (n \pi x)</math> and <math>\frac {d \hat{w}}{d x} = (b-a) + \sum_{n=1}^{N} a_n n \pi \cos (n \pi x)</math> | ||
+ | |||
+ | gives | ||
+ | |||
+ | <center> | ||
+ | <math> \partial_{a_n} J = \int_{0}^{1} c^2 \left( n \pi \cos (n \pi x) \left((b-a) + \sum_{m=1}^{N} a_m m \pi \cos (m \pi x) \right) \right) \, dx + \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx = 0 \quad (4) </math> | ||
+ | </center> | ||
+ | |||
+ | Since <math> \sin(n \pi x) </math> and <math> \sin(m \pi x) </math> are orthogonal the second integral in (4) can be calculated. | ||
+ | |||
+ | <math> \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx =\lambda \int_{0}^{1} \left( (b-a)x+a \right) \sin (n \pi x) \, dx + \frac{\lambda a_n}{2}</math> | ||
+ | |||
+ | and | ||
+ | |||
+ | <math> \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx </math> | ||
+ | <math>= \lambda \left((b-a) \int_{0}^{1} x \sin(n \pi x) \, dx + a \int_{0}^{1} \sin(n \pi x) \, dx \right) </math> | ||
+ | <math>= \frac{\lambda (b-a)}{(n \pi)^2} \Big[ \sin(n \pi x) -n \pi x \cos( n \pi x) \Big]_{0}^{1} - \frac{a \lambda}{n \pi} \Big[\cos(n \pi x) \Big]_{0}^{1} </math> | ||
+ | <math> = \frac{\lambda (b-a)}{(n \pi)^2} \left(n \pi (-1)^{n+1} \right) + \frac{a \lambda}{n \pi} \left(1 - (-1)^n \right) </math> | ||
+ | <math> = \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) </math> | ||
+ | |||
+ | So equation (4) can be written as | ||
+ | <math>\int_{0}^{1} c^2 \left( n \pi \cos (n \pi x) \left((b-a) + \sum_{m=1}^{N} a_m m \pi \cos (m \pi x) \right) \right) \, dx + \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) + \frac{\lambda a_n}{2}= 0 </math> | ||
+ | |||
+ | The remaining integral can be split into two parts and with the sum taken outside the integral we obtain | ||
+ | <math>\int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) + \sum_{m=1}^{N} \left( \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx \right) a_m + \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) + \frac{\lambda a_n}{2}= 0 </math> | ||
+ | |||
+ | or, on rearranging | ||
+ | <math> \sum_{m=1}^{N} \left( \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx \right) a_m+ \frac{\lambda a_n}{2}= -\int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) - \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) </math> | ||
+ | |||
+ | Now if we form the vector <math> \mathbf{a} = \begin{pmatrix} a_1 \\ \vdots \\ a_N \end{pmatrix} </math> and recalling that we have the above expression for all n, we can write the above as a matrix multiplication of <math> \mathbf{a} </math> | ||
+ | <center> | ||
+ | <math> \mathrm{M} \mathbf{a} = \mathbf{f} </math> | ||
+ | </center> | ||
+ | |||
+ | with | ||
+ | <math> \mathrm{M}_{(n,m)} = \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx + \delta_{nm} \frac{\lambda}{2} \quad \delta_{nm} = \left\{ \begin{matrix} 1 & \mathrm{if} \quad n = m \\ 0 & \mathrm{if} \quad n \neq m \end{matrix} \right. </math> | ||
+ | |||
+ | and | ||
+ | <math> \mathbf{f} = \begin{pmatrix} f_1 \\ \vdots \\ f_N \end{pmatrix} </math> with <math> f_n = -\int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) - \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) </math> | ||
+ | |||
+ | So, given a suitable <math> c(x) </math> and boundary conditions <math>\hat{w} (0) = a</math> and <math>\hat{w} (1) = b</math> we have a system of linear equations that can be solved to give the coefficients <math> a_n </math> which in turn define the function <math>\hat{w} </math>. |
Revision as of 01:42, 16 December 2008
The wave equation can be written as
[math]\displaystyle{ \partial_t^2 w- \partial_x \left( c(x)^2 \partial_x w \right) \quad (1) }[/math]
Taking a seperable solution [math]\displaystyle{ \ w (x,t) = \Tau (t) \hat{w} (x) }[/math] gives the eigenvalue problem
[math]\displaystyle{ \partial_x \left( c(x)^2 \partial_x\hat{w} \right) = \lambda\hat{w} \quad (2) }[/math]
Given boundary conditions [math]\displaystyle{ \hat{w} (0) = a }[/math] and [math]\displaystyle{ \hat{w} (1) = b }[/math] we can take
[math]\displaystyle{ \hat{w} = (b-a)x + a + u \quad (3) }[/math]
With [math]\displaystyle{ u = \sum_{n=1}^{N} a_n \sin (n \pi x) }[/math] a series solution satisfying [math]\displaystyle{ u (0) = u (1) = 0 }[/math]
We wish to solve for [math]\displaystyle{ a_n }[/math] given [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math]. Equation (2) can be transformed into the Sturm-Liouville problem of minimizing the functional
[math]\displaystyle{ J [u] = \int_{0}^{1} c^2 \left(\frac{d \hat{w}}{d x}\right)^2 + \lambda \hat{w}^2 \,dx }[/math]
which is minimal exactly when [math]\displaystyle{ \partial_{a_n} J = 0 \quad \forall a_n }[/math]
Substituting in [math]\displaystyle{ \hat{w} = (b-a)x + a + \sum_{n=1}^{N} a_n \sin (n \pi x) }[/math] and [math]\displaystyle{ \frac {d \hat{w}}{d x} = (b-a) + \sum_{n=1}^{N} a_n n \pi \cos (n \pi x) }[/math]
gives
[math]\displaystyle{ \partial_{a_n} J = \int_{0}^{1} c^2 \left( n \pi \cos (n \pi x) \left((b-a) + \sum_{m=1}^{N} a_m m \pi \cos (m \pi x) \right) \right) \, dx + \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx = 0 \quad (4) }[/math]
Since [math]\displaystyle{ \sin(n \pi x) }[/math] and [math]\displaystyle{ \sin(m \pi x) }[/math] are orthogonal the second integral in (4) can be calculated.
[math]\displaystyle{ \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx =\lambda \int_{0}^{1} \left( (b-a)x+a \right) \sin (n \pi x) \, dx + \frac{\lambda a_n}{2} }[/math]
and
[math]\displaystyle{ \int_{0}^{1} \lambda \left( \sin (n \pi x) \left((b-a)x + a + \sum_{m=1}^{N} a_m \sin (m \pi x) \right) \right) \, dx }[/math] [math]\displaystyle{ = \lambda \left((b-a) \int_{0}^{1} x \sin(n \pi x) \, dx + a \int_{0}^{1} \sin(n \pi x) \, dx \right) }[/math] [math]\displaystyle{ = \frac{\lambda (b-a)}{(n \pi)^2} \Big[ \sin(n \pi x) -n \pi x \cos( n \pi x) \Big]_{0}^{1} - \frac{a \lambda}{n \pi} \Big[\cos(n \pi x) \Big]_{0}^{1} }[/math] [math]\displaystyle{ = \frac{\lambda (b-a)}{(n \pi)^2} \left(n \pi (-1)^{n+1} \right) + \frac{a \lambda}{n \pi} \left(1 - (-1)^n \right) }[/math] [math]\displaystyle{ = \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) }[/math]
So equation (4) can be written as [math]\displaystyle{ \int_{0}^{1} c^2 \left( n \pi \cos (n \pi x) \left((b-a) + \sum_{m=1}^{N} a_m m \pi \cos (m \pi x) \right) \right) \, dx + \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) + \frac{\lambda a_n}{2}= 0 }[/math]
The remaining integral can be split into two parts and with the sum taken outside the integral we obtain [math]\displaystyle{ \int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) + \sum_{m=1}^{N} \left( \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx \right) a_m + \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) + \frac{\lambda a_n}{2}= 0 }[/math]
or, on rearranging [math]\displaystyle{ \sum_{m=1}^{N} \left( \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx \right) a_m+ \frac{\lambda a_n}{2}= -\int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) - \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) }[/math]
Now if we form the vector [math]\displaystyle{ \mathbf{a} = \begin{pmatrix} a_1 \\ \vdots \\ a_N \end{pmatrix} }[/math] and recalling that we have the above expression for all n, we can write the above as a matrix multiplication of [math]\displaystyle{ \mathbf{a} }[/math]
[math]\displaystyle{ \mathrm{M} \mathbf{a} = \mathbf{f} }[/math]
with [math]\displaystyle{ \mathrm{M}_{(n,m)} = \int_{0}^{1} c^2 n m \pi^2 \cos(n \pi x) \cos (m \pi x) \, dx + \delta_{nm} \frac{\lambda}{2} \quad \delta_{nm} = \left\{ \begin{matrix} 1 & \mathrm{if} \quad n = m \\ 0 & \mathrm{if} \quad n \neq m \end{matrix} \right. }[/math]
and [math]\displaystyle{ \mathbf{f} = \begin{pmatrix} f_1 \\ \vdots \\ f_N \end{pmatrix} }[/math] with [math]\displaystyle{ f_n = -\int_{0}^{1} c^2 (b-a) n \pi \cos (n \pi x) - \frac{\lambda}{n \pi} \left( b (-1)^{n+1}+a \right) }[/math]
So, given a suitable [math]\displaystyle{ c(x) }[/math] and boundary conditions [math]\displaystyle{ \hat{w} (0) = a }[/math] and [math]\displaystyle{ \hat{w} (1) = b }[/math] we have a system of linear equations that can be solved to give the coefficients [math]\displaystyle{ a_n }[/math] which in turn define the function [math]\displaystyle{ \hat{w} }[/math].