<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.wikiwaves.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tertius</id>
	<title>WikiWaves - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.wikiwaves.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tertius"/>
	<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php/Special:Contributions/Tertius"/>
	<updated>2026-04-17T18:43:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Template:Incident_potential_for_two_dimensions&amp;diff=13539</id>
		<title>Template:Incident potential for two dimensions</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Template:Incident_potential_for_two_dimensions&amp;diff=13539"/>
		<updated>2012-03-21T21:24:10Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Incident potential */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Incident potential===&lt;br /&gt;
&lt;br /&gt;
To create meaningful solutions of the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; in the specified domains we add an incident wave term to the expansion for the domain of &amp;lt;math&amp;gt;x &amp;lt; 0&amp;lt;/math&amp;gt; above. The incident potential is a wave of amplitude &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;&lt;br /&gt;
in displacement travelling in the positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;-direction. We would only see this in the time domain &amp;lt;math&amp;gt;\Phi(x,z,t)&amp;lt;/math&amp;gt; however, in the frequency domain the incident potential can be written as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{I}}(x,z)  =e^{-k_{0}x}\chi_{0}\left(&lt;br /&gt;
z\right). &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
The total velocity (scattered) potential now becomes &amp;lt;math&amp;gt;\phi = \phi_{\mathrm{I}} + \phi_{\mathrm{D}}&amp;lt;/math&amp;gt; for the domain of &amp;lt;math&amp;gt;x &amp;lt; 0&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first term in the expansion of the diffracted potential for the domain &amp;lt;math&amp;gt;x &amp;lt; 0&amp;lt;/math&amp;gt; is given by&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
a_{0}e^{k_{0}x}\chi_{0}\left(&lt;br /&gt;
z\right) &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
which represents the reflected wave. &lt;br /&gt;
&lt;br /&gt;
In any scattering problem &amp;lt;math&amp;gt;|R|^2 + |T|^2 = 1&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;R&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; are the reflection and transmission coefficients respectively. In our case of the semi-infinite dock &amp;lt;math&amp;gt;|a_{0}| = |R| = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;|T| = 0&amp;lt;/math&amp;gt; as there are no transmitted waves in the region under the dock.&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13538</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13538"/>
		<updated>2012-03-19T01:18:48Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
D_{n} = \int\nolimits_{-h}^{-d}\chi_{n}(z) \mathrm{d} z = \int\nolimits_{-h}^{-d} \frac{\cos k_{n}(z+h)}{\cos k_{n}h} \mathrm{d} z=\frac{\sin k_{n}(h-d)}&lt;br /&gt;
{k_{n}\cos k_{n}h}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13537</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13537"/>
		<updated>2012-03-16T06:37:03Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
D_{n} = \int\nolimits_{-h}^{-d}\chi_{n}(z) \mathrm{d} z = \int\nolimits_{-h}^{-d} \frac{\cos k_{n}(z+h)}{\cos k_{n}h} \mathrm{d} z=\frac{\sin k_{n}(h-d)}&lt;br /&gt;
{k_{n}\cos k_{n}h}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13536</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13536"/>
		<updated>2012-03-16T06:36:19Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
D_{n} = \int\nolimits_{-h}^{-d}\chi_{n}(z) \mathrm{d} z = \int\nolimits_{-h}^{-d} \frac{\cos k_{n}(z+h)}{\cos k_{n}h} \mathrm{d} z=\frac{\sin k_{n}(h-d)}&lt;br /&gt;
{k_{n}\cos k_{n}}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13535</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13535"/>
		<updated>2012-03-16T06:33:51Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
D_{n} = \int\nolimits_{-h}^{-d}\chi_{n}(z) \mathrm{d} z = \int\nolimits_{-h}^{-d} \frac{\cos k_{n}(z+h)}{\cos k_{n}h} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13534</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13534"/>
		<updated>2012-03-16T06:22:13Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d.&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13533</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13533"/>
		<updated>2012-03-16T06:21:19Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13532</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13532"/>
		<updated>2012-03-16T06:17:03Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\frac{1}{L}b^a_{0} -\sum_{m=1}^{\infty}b^{a}_{m}\kappa_{m}\coth(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13531</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13531"/>
		<updated>2012-03-16T06:09:03Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13530</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13530"/>
		<updated>2012-03-16T06:04:20Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\partial_x\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13529</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13529"/>
		<updated>2012-03-16T05:57:42Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; potentials &amp;lt;math&amp;gt;\phi^{s,a}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For these cases we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13528</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13528"/>
		<updated>2012-03-16T05:47:40Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the &#039;&#039;&#039;symmetric&#039;&#039;&#039; potential &amp;lt;math&amp;gt;\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
For this case we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13527</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13527"/>
		<updated>2012-03-16T05:41:49Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; &amp;lt;math&amp;gt;\phi^{s}(x,z) \,&amp;lt;/math&amp;gt; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13526</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13526"/>
		<updated>2012-03-16T05:39:29Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; &amp;lt;math&amp;gt;\phi_{s}(x,z) \,&amp;lt;/math&amp;gt; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad 0,\quad \quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13525</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13525"/>
		<updated>2012-03-16T05:37:20Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad 0,\quad \quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13524</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13524"/>
		<updated>2012-03-16T05:35:43Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad \quad 0,\quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b^{s}_{m}\kappa_{m}\tanh(\kappa_{m}L)\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13523</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13523"/>
		<updated>2012-03-16T05:21:34Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13522</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13522"/>
		<updated>2012-03-16T05:20:56Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrate from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13521</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13521"/>
		<updated>2012-03-16T05:18:42Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13520</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13520"/>
		<updated>2012-03-16T05:16:56Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13519</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13519"/>
		<updated>2012-03-16T05:15:14Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a^{s,a}_{m}B_{nm} = b^{s,a}_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13518</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13518"/>
		<updated>2012-03-16T05:01:35Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13517</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13517"/>
		<updated>2012-03-16T05:00:12Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13516</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13516"/>
		<updated>2012-03-16T04:35:33Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivatives of the potentials at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13515</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13515"/>
		<updated>2012-03-16T04:34:08Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivative of the potential at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13514</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13514"/>
		<updated>2012-03-16T04:31:54Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The derivative of the potential must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the derivative of the potential at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13513</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13513"/>
		<updated>2012-03-16T04:21:25Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) = &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13512</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13512"/>
		<updated>2012-03-16T04:20:25Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13511</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13511"/>
		<updated>2012-03-16T03:28:30Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; and &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; cases:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13510</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13510"/>
		<updated>2012-03-16T03:17:20Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a^{s,a}_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b^{s,a}_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13509</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13509"/>
		<updated>2012-03-16T03:16:37Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a^{s,a}_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b^{s,a}_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13508</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13508"/>
		<updated>2012-03-16T03:13:05Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* An infinite dimensional system of equations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=-L&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13507</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13507"/>
		<updated>2012-03-16T03:08:07Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13506</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13506"/>
		<updated>2012-03-16T03:01:56Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear systems of equations. If we had not taken advantage of the symmetry we would need to solve a &amp;lt;math&amp;gt;4(N+1) \mbox{ x } 4(N+1)&amp;lt;/math&amp;gt; linear system of equations for four coefficients &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;c_{m}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;d_{m}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13505</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13505"/>
		<updated>2012-03-16T02:00:19Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{ x } 2(N+1)&amp;lt;/math&amp;gt; linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13504</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13504"/>
		<updated>2012-03-16T01:58:48Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) \mbox{x} 2(N+1)&amp;lt;/math&amp;gt; linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13503</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13503"/>
		<updated>2012-03-16T01:50:33Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the two sets of &amp;lt;math&amp;gt;2(N+1) 2(N+1)&amp;lt;/math&amp;gt; linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13502</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13502"/>
		<updated>2012-03-16T01:41:13Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; \frac{1}{L}D_{0} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; \frac{1}{L}D_{1} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; \frac{1}{L}D_{N} &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13501</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13501"/>
		<updated>2012-03-16T01:32:21Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Matlab Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the single finite dock problem using symmetry can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13500</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13500"/>
		<updated>2012-03-16T01:30:47Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13499</id>
		<title>Eigenfunction Matching for a Semi-Infinite Rectangle</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13499"/>
		<updated>2012-03-16T01:28:57Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a region to the left with a free water surface and a region to the right with a rigid fixed semi infinite rectangular block with height &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. &lt;br /&gt;
We begin with the simple problem when the waves are normally incident (so that the problem is truly two-dimensional). We can extend this solution to a finite dock using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged dock which occupies&lt;br /&gt;
the region &amp;lt;math&amp;gt;x&amp;gt;0&amp;lt;/math&amp;gt; (we assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence).&lt;br /&gt;
The depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; 0, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, x &amp;gt; 0. \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= \alpha\phi, \,\,\, z=0, \,\, x&amp;lt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x=0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-d, \,\, x&amp;gt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-h.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
Before we can write down the expansion of the potentials we need to solve for the horizontal eigenfunctions. We start with the equation&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X^{\prime\prime} - k^2 X = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
which has the general solution&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X(x) = a e^{kx} + b e^{-kx},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; are constants to be determined from the boundary conditions. The general solution, or eigenfunction expansion, for the potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is obtained by superimposing all the possible modes; for the region of the &#039;&#039;&#039;free surface&#039;&#039;&#039; we have&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{k_{m}x} + b_{m}e^{-k_{m}x}\right)\chi_{m}(z), \quad x&amp;lt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In this expression the term involving &amp;lt;math&amp;gt;e^{ikx}&amp;lt;/math&amp;gt; (recall that &amp;lt;math&amp;gt;k_{0} = -ik&amp;lt;/math&amp;gt;) corresponds to a wave propagating towards large positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; while the term involving &amp;lt;math&amp;gt;e^{-ikx}&amp;lt;/math&amp;gt; corresponds to a wave propagating towards large negative &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;. Terms which decay as &amp;lt;math&amp;gt;x \rightarrow -\infty&amp;lt;/math&amp;gt; or as &amp;lt;math&amp;gt;x \rightarrow \infty&amp;lt;/math&amp;gt; are referred to as evanescent modes.&lt;br /&gt;
&lt;br /&gt;
The expansion of the potential for the region under the &#039;&#039;&#039;dock&#039;&#039;&#039; is&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{\kappa_{m}x} + b_{m}e^{-\kappa_{m}x}\right)\psi_{m}(z), \quad x&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
To obtain a unique solution, the diffracted field &amp;lt;math&amp;gt;\phi_{\mathrm{D}}&amp;lt;/math&amp;gt; must satisfy the Sommerfeld radiation condition (see further above) specifying that the waves of this potential propagate away from the structure and the solution be bounded.&lt;br /&gt;
&lt;br /&gt;
Application of the radiation condition to both the general solutions immediately above give diffracted potentials of&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \quad x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \quad x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the &#039;&#039;&#039;open water&#039;&#039;&#039; and&lt;br /&gt;
the &#039;&#039;&#039;dock&#039;&#039;&#039; covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m}\delta_{mn} = -\sum^{\infty}_{m=1}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember &amp;lt;math&amp;gt;\kappa_{0} = 0 \,&amp;lt;/math&amp;gt;. Solving the equations above will yield the coefficients of the water velocity potential in the free surface and dock covered regions.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a_{0} \\ a_{1} \\ \vdots \\ a_{N} \\ b_{0} \\ b_{1} \\ \vdots \\ b_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problem can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13498</id>
		<title>Eigenfunction Matching for a Semi-Infinite Rectangle</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13498"/>
		<updated>2012-03-16T01:28:34Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a region to the left with a free water surface and a region to the right with a rigid fixed semi infinite rectangular block with height &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. &lt;br /&gt;
We begin with the simple problem when the waves are normally incident (so that the problem is truly two-dimensional). We can extend this solution to a finite dock using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged dock which occupies&lt;br /&gt;
the region &amp;lt;math&amp;gt;x&amp;gt;0&amp;lt;/math&amp;gt; (we assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence).&lt;br /&gt;
The depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; 0, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, x &amp;gt; 0. \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= \alpha\phi, \,\,\, z=0, \,\, x&amp;lt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x=0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-d, \,\, x&amp;gt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-h.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
Before we can write down the expansion of the potentials we need to solve for the horizontal eigenfunctions. We start with the equation&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X^{\prime\prime} - k^2 X = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
which has the general solution&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X(x) = a e^{kx} + b e^{-kx},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; are constants to be determined from the boundary conditions. The general solution, or eigenfunction expansion, for the potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is obtained by superimposing all the possible modes; for the region of the &#039;&#039;&#039;free surface&#039;&#039;&#039; we have&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{k_{m}x} + b_{m}e^{-k_{m}x}\right)\chi_{m}(z), \quad x&amp;lt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In this expression the term involving &amp;lt;math&amp;gt;e^{ikx}&amp;lt;/math&amp;gt; (recall that &amp;lt;math&amp;gt;k_{0} = -ik&amp;lt;/math&amp;gt;) corresponds to a wave propagating towards large positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; while the term involving &amp;lt;math&amp;gt;e^{-ikx}&amp;lt;/math&amp;gt; corresponds to a wave propagating towards large negative &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;. Terms which decay as &amp;lt;math&amp;gt;x \rightarrow -\infty&amp;lt;/math&amp;gt; or as &amp;lt;math&amp;gt;x \rightarrow \infty&amp;lt;/math&amp;gt; are referred to as evanescent modes.&lt;br /&gt;
&lt;br /&gt;
The expansion of the potential for the region under the &#039;&#039;&#039;dock&#039;&#039;&#039; is&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{\kappa_{m}x} + b_{m}e^{-\kappa_{m}x}\right)\psi_{m}(z), \quad x&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
To obtain a unique solution, the diffracted field &amp;lt;math&amp;gt;\phi_{\mathrm{D}}&amp;lt;/math&amp;gt; must satisfy the Sommerfeld radiation condition (see further above) specifying that the waves of this potential propagate away from the structure and the solution be bounded.&lt;br /&gt;
&lt;br /&gt;
Application of the radiation condition to both the general solutions immediately above give diffracted potentials of&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \quad x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \quad x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the &#039;&#039;&#039;open water&#039;&#039;&#039; and&lt;br /&gt;
the &#039;&#039;&#039;dock&#039;&#039;&#039; covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m}\delta_{mn} = -\sum^{\infty}_{m=1}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember &amp;lt;math&amp;gt;\kappa_{0} = 0 \,&amp;lt;/math&amp;gt;. Solving the equations above will yield the coefficients of the water velocity potential in the free surface and dock covered regions.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a_{0} \\ a_{1} \\ \vdots \\ a_{N} \\ b_{0} \\ b_{1} \\ \vdots \\ b_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problem can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13497</id>
		<title>Eigenfunction Matching for a Semi-Infinite Rectangle</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Semi-Infinite_Rectangle&amp;diff=13497"/>
		<updated>2012-03-16T01:28:16Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a region to the left with a free water surface and a region to the right with a rigid fixed semi infinite rectangular block with height &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. &lt;br /&gt;
We begin with the simple problem when the waves are normally incident (so that the problem is truly two-dimensional). We can extend this solution to a finite dock using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged dock which occupies&lt;br /&gt;
the region &amp;lt;math&amp;gt;x&amp;gt;0&amp;lt;/math&amp;gt; (we assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence).&lt;br /&gt;
The depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; 0, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, x &amp;gt; 0. \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= \alpha\phi, \,\,\, z=0, \,\, x&amp;lt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x=0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-d, \,\, x&amp;gt;0, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi &amp;amp;= 0, \,\,\, z=-h.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
Before we can write down the expansion of the potentials we need to solve for the horizontal eigenfunctions. We start with the equation&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X^{\prime\prime} - k^2 X = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
which has the general solution&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
X(x) = a e^{kx} + b e^{-kx},&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt; are constants to be determined from the boundary conditions. The general solution, or eigenfunction expansion, for the potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is obtained by superimposing all the possible modes; for the region of the &#039;&#039;&#039;free surface&#039;&#039;&#039; we have&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{k_{m}x} + b_{m}e^{-k_{m}x}\right)\chi_{m}(z), \quad x&amp;lt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In this expression the term involving &amp;lt;math&amp;gt;e^{ikx}&amp;lt;/math&amp;gt; (recall that &amp;lt;math&amp;gt;k_{0} = -ik&amp;lt;/math&amp;gt;) corresponds to a wave propagating towards large positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; while the term involving &amp;lt;math&amp;gt;e^{-ikx}&amp;lt;/math&amp;gt; corresponds to a wave propagating towards large negative &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;. Terms which decay as &amp;lt;math&amp;gt;x \rightarrow -\infty&amp;lt;/math&amp;gt; or as &amp;lt;math&amp;gt;x \rightarrow \infty&amp;lt;/math&amp;gt; are referred to as evanescent modes.&lt;br /&gt;
&lt;br /&gt;
The expansion of the potential for the region under the &#039;&#039;&#039;dock&#039;&#039;&#039; is&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}\left(a_{m}e^{\kappa_{m}x} + b_{m}e^{-\kappa_{m}x}\right)\psi_{m}(z), \quad x&amp;gt;0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
To obtain a unique solution, the diffracted field &amp;lt;math&amp;gt;\phi_{\mathrm{D}}&amp;lt;/math&amp;gt; must satisfy the Sommerfeld radiation condition (see further above) specifying that the waves of this potential propagate away from the structure and the solution be bounded.&lt;br /&gt;
&lt;br /&gt;
Application of the radiation condition to both the general solutions immediately above give diffracted potentials of&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \quad x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi_{\mathrm{D}}(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \quad x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the &#039;&#039;&#039;open water&#039;&#039;&#039; and&lt;br /&gt;
the &#039;&#039;&#039;dock&#039;&#039;&#039; covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=1}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m}\delta_{mn} = -\sum^{\infty}_{m=1}\kappa_{m}b_{m}B_{mn}, \quad n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember &amp;lt;math&amp;gt;\kappa_{0} = 0 \,&amp;lt;/math&amp;gt;. Solving the equations above will yield the coefficients of the water velocity potential in the free surface and dock covered regions.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a_{0} \\ a_{1} \\ \vdots \\ a_{N} \\ b_{0} \\ b_{1} \\ \vdots \\ b_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problem can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13496</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13496"/>
		<updated>2012-03-16T01:23:34Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\coth(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\coth(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^a_{0} \\ a^a_{1} \\ \vdots \\ a^a_{N} \\ b^a_{0} \\ b^a_{1} \\ \vdots \\ b^a_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13495</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13495"/>
		<updated>2012-03-16T01:20:12Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;symmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the &#039;&#039;&#039;antisymmetric&#039;&#039;&#039; case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13494</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13494"/>
		<updated>2012-03-16T01:18:03Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the symmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the antisymmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13493</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13493"/>
		<updated>2012-03-16T01:17:27Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the symmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the antisymmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13492</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13492"/>
		<updated>2012-03-16T01:16:37Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the symmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the antisymmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13491</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13491"/>
		<updated>2012-03-16T01:12:07Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the symmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0            &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots       &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N}  &amp;amp; 0               &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
	<entry>
		<id>https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13490</id>
		<title>Eigenfunction Matching for a Finite Rectangle using Symmetry</title>
		<link rel="alternate" type="text/html" href="https://www.wikiwaves.org/index.php?title=Eigenfunction_Matching_for_a_Finite_Rectangle_using_Symmetry&amp;diff=13490"/>
		<updated>2012-03-16T01:07:24Z</updated>

		<summary type="html">&lt;p&gt;Tertius: /* Numerical Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{incomplete pages}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The problem consists of a finite rigid fixed rectangle of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; centered at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; and having a height of &amp;lt;math&amp;gt;d + ...&amp;lt;/math&amp;gt; freeboard with depth of submergence being &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; through which no flow is possible. The regions to the left and right of the rectangle are the free water surface. Since the geometry of the rectangle is symmetric about &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; we can decompose the velocity potential &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; into a symmetric &amp;lt;math&amp;gt;\phi^s&amp;lt;/math&amp;gt; and antisymmetric &amp;lt;math&amp;gt;\phi^a&amp;lt;/math&amp;gt; potential. We then solve for these two potentials in the left domain only &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt; and subsequently recompose the solution &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; for the entire domain. We begin with the simple problem when the waves are normally incident on the rectangle (dock) (so that the problem is truly two-dimensional). We can extend this solution to a pair of partially submerged finite rigid fixed rectangles using symmetry&lt;br /&gt;
[[Eigenfunction Matching for a Finite Rectangle using Symmetry]]&lt;br /&gt;
&lt;br /&gt;
== Governing Equations ==&lt;br /&gt;
&lt;br /&gt;
We begin with the [[Frequency Domain Problem]] for a partially submerged finite dock. Although the dock is of length &amp;lt;math&amp;gt;2L&amp;lt;/math&amp;gt; we are only interested in the dock of &amp;lt;math&amp;gt;-L \leq x \leq 0&amp;lt;/math&amp;gt; together with the fluid domain &amp;lt;math&amp;gt;x \leq 0&amp;lt;/math&amp;gt;. We assume &amp;lt;math&amp;gt;e^{i\omega t}&amp;lt;/math&amp;gt; time dependence and&lt;br /&gt;
the depth of submergence is &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt;.&lt;br /&gt;
The water is assumed to have constant finite depth &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; and the &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;-direction points vertically&lt;br /&gt;
upward with the water surface at &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt; and the sea floor at &amp;lt;math&amp;gt;z=-h&amp;lt;/math&amp;gt;. &lt;br /&gt;
The boundary value problem can therefore be expressed as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq 0, \,\, x &amp;lt; -L, \\&lt;br /&gt;
&lt;br /&gt;
\Delta\phi^{s,a} &amp;amp;= 0, \,\,\,  -h\leq z\leq -d, \,\, -L &amp;lt; x &amp;lt; 0. \\ &lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= \alpha\phi^{s,a}, \,\,\, z=0, \,\, x &amp;lt; -L, \\ &lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^{s,a} &amp;amp;= 0, \,\,\, -d\leq z\leq 0, \,\, x = -L, \\&lt;br /&gt;
&lt;br /&gt;
\partial_z\phi^{s,a} &amp;amp;= 0, \,\,\,&lt;br /&gt;
\begin{cases}&lt;br /&gt;
z = -d, \,\, -L &amp;lt; x &amp;lt; 0, \\&lt;br /&gt;
z = -h, \,\, x &amp;lt; 0. &lt;br /&gt;
\end{cases} \\&lt;br /&gt;
&lt;br /&gt;
\partial_x\phi^s &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d, \\&lt;br /&gt;
&lt;br /&gt;
\phi^a &amp;amp;= 0, \,\,\, x = 0, \,\, -h \leq z \leq -d. &lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;\alpha = \omega^2/g&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi^s(x,z)&amp;lt;/math&amp;gt; is an even function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; the derivative of this function is equal to zero. &amp;lt;math&amp;gt;\phi^a(x,z)&amp;lt;/math&amp;gt; is an odd function and at &amp;lt;math&amp;gt;x = 0&amp;lt;/math&amp;gt; this function is equal to zero. These boundary conditions are important and enable the recomposed solution &amp;lt;math&amp;gt;\phi(x,z)&amp;lt;/math&amp;gt; to be reflected into the domain of &amp;lt;math&amp;gt;x \geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We must also apply the [[Sommerfeld Radiation Condition]]&lt;br /&gt;
as &amp;lt;math&amp;gt;|x|\rightarrow\infty&amp;lt;/math&amp;gt;. This essentially implies&lt;br /&gt;
that the only wave at infinity is propagating away and at negative infinity there is a unit incident wave&lt;br /&gt;
and a wave propagating away.&lt;br /&gt;
&lt;br /&gt;
== Solution Method ==&lt;br /&gt;
&lt;br /&gt;
We use [http://en.wikipedia.org/wiki/Separation_of_Variables separation of variables] in the two regions, &amp;lt;math&amp;gt;x\leq 0&amp;lt;/math&amp;gt;&lt;br /&gt;
and &amp;lt;math&amp;gt;x\geq 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{separation of variables in two dimensions}}&lt;br /&gt;
&lt;br /&gt;
{{separation of variables for a free surface}}&lt;br /&gt;
&lt;br /&gt;
=== Separation of Variables for a Dock ===&lt;br /&gt;
&lt;br /&gt;
The separation of variables equation for a partially submerged dock is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime\prime} + k^2 Z =0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
subject to the boundary conditions&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-h) = 0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z^{\prime} (-d) = 0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The solution is &lt;br /&gt;
&amp;lt;math&amp;gt;k=\kappa_{m}= \frac{m\pi}{h-d} \,&amp;lt;/math&amp;gt; , &amp;lt;math&amp;gt;m\in\mathbb{N}\cup\left\{0\right\}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
Z = \psi_{m}\left(  z\right)  = \cos\kappa_{m}(z+h),\quad&lt;br /&gt;
m\in\mathbb{N}\cup\left\{0\right\}.&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
We note that&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int\nolimits_{-h}^{-d}\psi_{m}(z)\psi_{n}(z) \mathrm{d} z=C_{m}\delta_{mn},&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{m} = \frac{1}{2} \left( \frac{\cos\kappa_{m}(h-d)\sin\kappa_{m}(h-d)+\kappa_{m}(h-d)}{\kappa_{m}} \right).&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
In addition there is the special case of when &amp;lt;math&amp;gt;m=n=0&amp;lt;/math&amp;gt; ,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C_{0} = h-d,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta_{00}=1&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== Inner product between free surface and dock modes ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn} = \int\nolimits_{-h}^{-d}\psi_{m}(z)\chi_{n}(z) \mathrm{d} z , \quad m\geq1, \quad n\geq0,&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
where&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{mn}= \int\nolimits_{-h}^{-d} \frac{\cos\kappa_{m}(z+h)\cos k_{n}(z+h)}{\cos(k_{n}h)} \mathrm{d} z=\frac{-(-1)^m k_{n}\sin k_{n}(h-d)}&lt;br /&gt;
{\cos(k_{n}h)(\kappa_{m}^{2}-k_{n}^{2})}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
The evaluation of this inner product works on the assumption that the two roots &amp;lt;math&amp;gt;\kappa_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_{n}&amp;lt;/math&amp;gt; do not coincide. The Matlab code given below has a routine to check for this case and make necessary adjustments.&lt;br /&gt;
&lt;br /&gt;
We also have the case where the functions of the inner product are switched.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{nm} = \int\nolimits_{-h}^{-d}\chi_{m}(z)\psi_{n}(z) \mathrm{d} z , \quad m\geq0, \quad n\geq0.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n \geq 1&amp;lt;/math&amp;gt; the evaluation is above with the exception that the indices of the expression are switched.&lt;br /&gt;
&lt;br /&gt;
Finally there is the special case of when &amp;lt;math&amp;gt;m \geq 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;n = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{0m} = \frac{\sin k_{m}(h-d)}{k_{m}\cos(k_{m}h)}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expansion of the potential === &lt;br /&gt;
&lt;br /&gt;
We need to apply some boundary conditions at plus and minus infinity, &lt;br /&gt;
where essentially the solution cannot grow. This means that we&lt;br /&gt;
only have the positive (or negative) roots of the dispersion equation.&lt;br /&gt;
However, it does not help us with the purely imaginary roots. Here we&lt;br /&gt;
must use a different condition, essentially identifying one solution&lt;br /&gt;
as the incoming wave and the other as the outgoing wave. &lt;br /&gt;
&lt;br /&gt;
Therefore the diffracted potentials can&lt;br /&gt;
be expanded as&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}a_{m}e^{k_{m}x}\chi_{m}(z), \;\;x&amp;lt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(x,z)=\sum_{m=0}^{\infty}b_{m}&lt;br /&gt;
e^{-\kappa_{m}x}\psi_{m}(z), \;\;x&amp;gt;0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;a_{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;b_{m}&amp;lt;/math&amp;gt;&lt;br /&gt;
are the coefficients of the potential in the open water and&lt;br /&gt;
the dock covered region respectively.&lt;br /&gt;
&lt;br /&gt;
{{incident potential for two dimensions}}&lt;br /&gt;
&lt;br /&gt;
=== An infinite dimensional system of equations ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The potential and its derivative must be continuous across the&lt;br /&gt;
transition from open water to the dock covered region. Therefore, the&lt;br /&gt;
potentials and their derivatives at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; have to be equal.&lt;br /&gt;
We obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\chi_{0}\left(  z\right) + \sum_{m=0}^{\infty}a_{m} \chi_{m}\left(  z\right) &lt;br /&gt;
&amp;amp;=\sum_{m=0}^{\infty}b_{m}\psi_{m}(z), \quad -h \leq z\leq -d \\&lt;br /&gt;
&lt;br /&gt;
-k_{0}\chi_{0}\left(  z\right) +\sum_{m=0}^{\infty} a_{m}k_{m}\chi_{m}\left(  z\right) &amp;amp;= &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\quad \quad \quad 0,\quad \quad \quad -d\leq z\leq 0 \\&lt;br /&gt;
-\sum_{m=0}^{\infty}b_{m}\kappa_{m}\psi_{m}(z),\quad -h\leq z\leq -d&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first equation we multiply both sides by &amp;lt;math&amp;gt;\psi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;-d&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
B_{n0} + \sum^{\infty}_{m=0}a_{m}B_{nm} = b_{m}C_{m}\delta_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and for the second equation we multiply both sides by &amp;lt;math&amp;gt;\chi_{n}(z) \,&amp;lt;/math&amp;gt; and integrating from &amp;lt;math&amp;gt;-h&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to obtain:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
 -k_{0}A_{0}\delta_{0n} + k_{m}a_{m}A_{m} = -\sum^{\infty}_{m=0}\kappa_{m}b_{m}B_{mn}, n\in\mathbb{N}\cup\left\{0\right\}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solving the equations above will yield the coefficients of the water velocity potential in the dock covered region.&lt;br /&gt;
&lt;br /&gt;
== Numerical Solution ==&lt;br /&gt;
&lt;br /&gt;
To solve the system of equations for the symmetric case, we set the upper limit of &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; to be &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;. This resulting system can be expressed in the block matrix form below,&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
B_{00}           &amp;amp; B_{01}      &amp;amp; \cdots &amp;amp; B_{0N}      &amp;amp; -C_{0}          &amp;amp; 0                &amp;amp; \cdots    &amp;amp; 0        \\&lt;br /&gt;
B_{10}           &amp;amp; B_{11}      &amp;amp; \cdots &amp;amp; B_{1N}      &amp;amp; 0                &amp;amp; -C_{1}          &amp;amp; \cdots    &amp;amp; \vdots   \\&lt;br /&gt;
\vdots           &amp;amp; \vdots      &amp;amp; \ddots &amp;amp; \vdots      &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; 0        \\&lt;br /&gt;
B_{N0}           &amp;amp; B_{N1}      &amp;amp; \cdots &amp;amp; B_{NN}      &amp;amp; 0                &amp;amp; \cdots           &amp;amp; 0         &amp;amp; -C_{N}  \\&lt;br /&gt;
     k_{0}A_{0} &amp;amp; 0           &amp;amp; \cdots &amp;amp; 0           &amp;amp; \kappa_{0}B_{00} &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{10} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N0} \\&lt;br /&gt;
        0        &amp;amp; k_{1}A_{1} &amp;amp; \cdots &amp;amp; \vdots      &amp;amp; \kappa_{0}B_{01} &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{11} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{N1} \\&lt;br /&gt;
      \vdots     &amp;amp;   \vdots    &amp;amp; \ddots &amp;amp; 0           &amp;amp; \vdots           &amp;amp; \vdots           &amp;amp; \ddots    &amp;amp; \vdots           \\&lt;br /&gt;
         0       &amp;amp;   \cdots    &amp;amp; 0      &amp;amp; k_{N}A_{N} &amp;amp; \kappa_{0}B_{0N} &amp;amp; \kappa_{1}\tanh(\kappa_{1}L)B_{1N} &amp;amp; \cdots    &amp;amp; \kappa_{N}\tanh(\kappa_{N}L)B_{NN} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
a^s_{0} \\ a^s_{1} \\ \vdots \\ a^s_{N} \\ b^s_{0} \\ b^s_{1} \\ \vdots \\ b^s_{N} \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
=\begin{bmatrix}&lt;br /&gt;
-B_{00} \\ -B_{10} \\ \vdots \\ -B_{N0} \\ k_{0}A_{0} \\ 0 \\ \vdots \\ 0 \\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
We then simply need to solve the linear system of equations.&lt;br /&gt;
&lt;br /&gt;
== Matlab Code ==&lt;br /&gt;
&lt;br /&gt;
A program to calculate the coefficients for the semi-infinite dock problems can be found here&lt;br /&gt;
{{semiinfinite_dock code}}&lt;br /&gt;
&lt;br /&gt;
=== Additional code ===&lt;br /&gt;
&lt;br /&gt;
This program requires&lt;br /&gt;
* {{free surface dispersion equation code}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Eigenfunction Matching Method]]&lt;/div&gt;</summary>
		<author><name>Tertius</name></author>
	</entry>
</feed>