\section{Fredholm analysis of the integral representations}
\label{sec:analysis}
In this section, we establish how layer potential
representations of oscillatory Stokes velocity fields
can be used to compute Stokes eigenvalues.
%
The main results show that for certain representations
the resulting integral equation is not invertible precisely
when $k^2$ is an eigenvalue.
%
For the interior Dirichlet eigenvalue problem, this is
proved separately for a double layer representation on
simply connected domains in \cref{thm:dlmain} and
for a combined-field representation on multiply connected
domains in \cref{thm:cfmain}.
%

Before proving the main theorems, we require a number
of uniqueness results for oscillatory Stokes boundary
value problems.
%
To prove the uniqueness results, we follow the
structure presented in Colton and Kress~\cite[Ch. 3]{colton1983integral}
for the scalar Helmholtz equation.
%
While uniqueness results for interior Dirichlet,
Neumann, and impedance problems follow from energy
considerations and compactness arguments, the proofs
for the uniqueness of exterior problems are more
involved.
%
In particular, the exterior problems are only
well-posed after imposing an appropriate radiation
condition.
%
We formulate well-posed boundary value problems
for both interior and exterior domains with
Dirichlet, Neumann and impedance boundary
conditions and present uniqueness results for
each.

Along with the Fredholm alternative, these uniqueness
results are sufficient to prove
\cref{thm:dlmain,thm:cfmain}.
%
Once the main theorems are established,
the details of how to use the Fredholm determinant
as a numerical tool for computing the Stokes eigenvalues
follow in a straightforward manner from the results
in~\cite{zhao2015robust}.
%
We reproduce these results in the present
context for completeness.

\subsection{Boundary value problems --- interior}

Let $\Omega$ be a bounded domain with a $C^2$ boundary
denoted by $\Gamma$.
We summarize the interior Dirichlet, Neumann and impedance
boundary value problems in~\cref{def:int_dir,def:int_neu,def:int_imp} below.

\begin{definition}[Interior Dirichlet problem]
  \label{def:int_dir}
  Let $\ff \in C(\Omega)$ be given. Find $(\bu,p) \in A(\Omega)$
  such that
  \begin{equation}
  \begin{aligned} \label{eq:dir_interior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in \Omega \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in \Omega \, ,  \\
    \bu &= \ff \quad \bx \in \Gamma \, .
  \end{aligned}
  \end{equation}
\end{definition}
Note that the divergence-free constraint for the oscillatory
Stokes equations implies a compatibility condition on the
Dirichlet data $\ff$, namely that
\begin{equation} \label{eq:dir_compat}
  \int_\Gamma \ff \cdot \bnu \, dS = 0 \; .
\end{equation}

\begin{definition}[Interior Neumann problem]
  \label{def:int_neu}
  Let $\bg \in C(\Omega)$ be given. Find $(\bu,p) \in A(\Omega)$
  such that
  \begin{equation}
  \begin{aligned} \label{eq:neu_interior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in \Omega \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in \Omega \, ,  \\
    \bt &= \bg \quad \bx \in \Gamma \, .
  \end{aligned}
  \end{equation}
\end{definition}

\begin{definition}[Interior impedance problem]
\label{def:int_imp}
  Let $\bh \in C(\Omega)$ be given and suppose
  $\eta \in \mathbb{C}$ with $\Re{(\eta)} >0$ and $\Im{(\eta)}\ge 0$.
  Find $(\bu,p) \in A(\Omega)$  such that
  \begin{equation}
  \begin{aligned} \label{eq:imp_interior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in \Omega \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in \Omega \, ,  \\
    \bt - i \eta \bu &= \bh \quad \bx \in \Gamma \, .
  \end{aligned}
  \end{equation}
\end{definition}

\subsection{A radiation condition for the oscillatory Stokes
  equation}

\begin{figure}
  \begin{center}
  \includegraphics[width=0.4\textwidth]{fig/ext_dom}
  \caption{Example of an exterior domain with four obstacles.}
  \label{fig:ext_dom}
  \end{center}
\end{figure}

Let $\Omega$ be the union of a finite collection of
simply connected domains, i.e. $\Omega = \bigcup_{i=1}^m \Omega_i$
for some $m \in \N$,
and let $E = \R^{2} \setminus \bar{\Omega}$ denote its
exterior; see \cref{fig:ext_dom} for an example with $m=4$.
%
Let $\Gamma = \partial E$ denote the boundary of $E$ and
$\bnu(\yy)$ denote the exterior normal to the point $\yy$ on
$\Gamma$, i.e. the normal vector pointing out of $E$ into $\Omega$.
%
For a given function $\ff$ defined on $\Gamma$,
the exterior Dirichlet boundary value problem is to
find a pair $(\bu,p)$ which satisfies:
\begin{equation}
\begin{aligned}
\Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in E \, ,\\
\nabla \cdot \bu &= 0 \quad \bx \in E \, ,  \\
\bu &= \ff \quad \bx \in \Gamma \, . \nonumber
\end{aligned}
\end{equation}
In addition to the boundary condition on
$\Gamma$, we must impose radiation conditions
at $\infty$, analogous to the Helmholtz equation.
%

Let $B_r(0)$ denote the disc of radius $r$ centered
at the origin and $\partial B_r(0)$ its boundary.
%
We propose the following radiation condition.

\begin{definition} \label{def:radcond}
Let $(\bu,p)$ satisfy the oscillatory Stokes equations in
the exterior of a bounded domain. We say that
the pair $(\bu,p)$ is {\em radiating} if
\begin{equation}
\lim_{r\to \infty} \sqrt{r} \left| \bt - i k \bu \right| \to 0 \, ,
\label{eq:radcond}
\end{equation}
uniformly in direction where $\bt = \bsigma \cdot \bnu$
with $\bnu = \xx/|\xx|$, i.e. $\bt$ is the surface
traction on $\partial B_r(0)$.
\end{definition}

In the following lemma, we show that the oscillatory
Stokeslet satisfies the radiation condition.
\begin{lem}
The oscillatory Stokeslet, as defined in \eqref{eq:ostokeslet},
satisfies the radiation condition in Definition \ref{def:radcond}.
\end{lem}
\begin{proof}
Consider the Stokeslet induced by an arbitrary charge
$k^2 \bpsi$ at the origin where $\bpsi \in \mathbb{C}^2$
is a constant. Let $r = |\xx|$,
$\bnu(\xx) = \xx/|\xx|$, and $\btau(\xx) = \bnu(\xx)^\perp$. We have

\begin{align*}
\bu (\xx) &= k^2 \GG(\xx,0) \bpsi \\
&= k^2 \left (-\II \Delta \Gbh(\xx,0)
+ \nabla \otimes \nabla \Gbh(\xx,0)\right ) \bpsi \\
&= -k^2 \left (\nabla^\perp \otimes \nabla^\perp \Gbh(\xx,0) \right) \bpsi \\
&= \left(\nabla^\perp \otimes \nabla^\perp \left ( \frac{1}{2\pi}
\log r + \frac{i}{4} H_0^{(1)} (kr) \right ) \right)\bpsi \; .
\end{align*}
Note that derivatives of $\log r$ are $\littleo (1/\sqrt{r})$
and that the pressure associated with the Stokeslet is
$p = \nabla \Glap(\xx) \cdot \bpsi$. We then have

\begin{align*}
\left | \sigma \cdot \bnu(\xx) - i k \bu \right | &=
\left | p \bnu(\xx) + \partial_{{\nu_x}} \bu + \nabla (\bu \cdot \bnu(\xx))
- ik \bu \right | \\
&\leq \left | \partial_{{\nu_x}} \bu - ik\bu \right | + \left | \nabla(\bu \cdot \bnu(\xx)) \right |
+ \littleo (1/\sqrt{r}) \\
&\leq \frac{1}{4} \left | \partial_{{\nu_x}} \left(\nabla^\perp \otimes
\nabla^\perp \left (H_0^{(1)} (kr) \right ) \right)\bpsi
- i k \left(\nabla^\perp \otimes \nabla^\perp
\left (H_0^{(1)} (kr) \right ) \right)\bpsi \right | \\
& \quad + \left | \nabla \left( \partial_{\tau_x} \left (
\nabla^\perp \left (H_0^{(1)} (kr) \right ) \cdot \bpsi  \right )
\right) \right | + \littleo (1/\sqrt{r}) \; .
\end{align*}
Because $H_0^{(1)}(kr)$ has the asymptotic expansion

\begin{equation}
H_0^{(1)}(kr) = \sqrt{\frac{2}{\pi k r}} e^{i(rk-\pi/4)} \left ( 1 + O\left (
\frac{1}{r} \right ) \right ) \; \nonumber
\end{equation}
as $r\to \infty$, we have

\begin{equation}
\left | \partial_{{\nu_x}} \left(\nabla^\perp \otimes
\nabla^\perp \left (H_0^{(1)} (kr) \right ) \right)\bpsi
- ik \left(\nabla^\perp \otimes \nabla^\perp
\left (H_0^{(1)} (kr) \right ) \right)\bpsi \right | =
o ( 1/\sqrt{r} ) \; . \nonumber
\end{equation}
Finally, since $H_0^{(1)}(kr)$ is radially symmetric,
we have

\begin{equation}
\left | \nabla \left( \partial_{\tau_x} \left (
\nabla^\perp \left (H_0^{(1)} (kr) \right ) \cdot \bpsi  \right )
\right) \right | = 0 \; , \nonumber
\end{equation}
so that the Stokeslet satisfies the radiation condition.
\end{proof}
A consequence of the above lemma is that the oscillatory Stokes
single layer potential satisfies the radiation condition.
\begin{cor}
Suppose that $\Gamma$ is the boundary of a region $\Omega$
and is $C^{2}$.
Suppose that $\bmu \in C(\Gamma)\times C(\Gamma)$, then
the oscillatory Stokes single layer potential $\bS[\bmu]$,
as defined in~\cref{eq:singlelayer}, satisfies the radiation condition.
\end{cor}
Unfortunately, the stresslet, as defined in~\cref{eq:ostress},
does not necessarily satisfy the radiation condition.
The reason for failure is the logarithmic growth of
the pressure at $\infty$.
However, this turns out to be a rank-one issue and
the oscillatory Stokes double layer potential
does satisfy the radiation condition
if the density satisfies an integral constraint.
The following lemma proves this result.

\begin{lem}
Suppose that $\Gamma$ is the boundary of a region $\Omega$
and is $C^{2}$.
Suppose that $\bmu \in C(\Gamma) \times C(\Gamma)$ and satisfies
$\int_{\Gamma} \bmu \cdot \bnu dS = 0$, where
$\bnu$ denotes the outward normal to the curve $\Gamma$.
Then, the oscillatory Stokes
double layer potential $\bD[\bmu]$, as defined in \eqref{eq:doublelayer},
also satisfies the radiation condition.
\end{lem}

\begin{proof}
We only establish the
decay of the pressure, which we will denote by $p^\bD$;
the rest of the terms in \eqref{eq:radcond} can be bounded
using an argument like that for the Stokeslet above.
Because $p^\bD$ is harmonic in the exterior of any disc
containing $\Gamma$, it is sufficient to show that
$|\nabla p^\bD| = \bigo (1/r^2)$. Let $\btau$ denote the
positively oriented tangent to the curve $\Gamma$ and
$\mu_\nu(\yy)$ and $\mu_\tau(\yy)$ denote $\bmu(\yy) \cdot \bnu(\yy)$ and
$\bmu(\yy) \cdot \btau(\yy)$, respectively. Substituting
$\bD \bmu$ into \eqref{eq:ostokes}, we obtain

\begin{align*}
\nabla p^\bD(\xx) &= (\Delta + k^2) \bD \bmu(\xx) \\
&= \int_\Gamma \left (-k^2 \nabla \Glap (\xx,\yy) +
2 \nabla^\perp \partial_{\nu\tau} \Glap (\xx,\yy) \right ) \mu_\nu(\yy)
\, dS(\yy) \\
& \qquad + \int_\Gamma \nabla^\perp (\partial_{\tau\tau}-\partial_{\nu\nu})\Glap \mu_\tau(\yy)
\, dS(\yy) \; .
\end{align*}
The other terms are higher-order derivatives
of $\Glap$, so it is sufficient to show that the term

\begin{align*}
|\nabla p_1(\xx)| &:= \left |-k^2 \nabla \int_\Gamma \Glap(\xx,\yy)
\mu_\nu(\yy) \, dS(\yy) \right |
\end{align*}
is $\bigo (1/r^2)$. In the following, let $z = x_1 + i x_2$ be the
point corresponding to $\xx$ in the complex plane and let $R$
be the radius of some disc containing $\Gamma$. If $|\xx| > 2R$,
we can use the standard multipole expansion of $\log(z-(y_1+iy_2))$
and the assumption that $\int_\Gamma \bmu \cdot \bnu = 0$
to obtain
\begin{align*}
|\nabla p_1(\xx)| &= \frac{k^2}{2\pi} \left |  \partial_z \int_\Gamma \log(z-(y_1+iy_2))
\mu_\nu(\yy) dS(\yy) \right | \\
&= \frac{k^2}{2\pi} \left |  \partial_z  \left ( \log(z) \int_\Gamma \mu_\nu(\yy) \, dS(\yy)
+ \sum_{l=1}^\infty \frac{1}{z^l} \int_\Gamma \left( y_1+iy_2 \right)^l \mu_\nu(\yy) \, dS(\yy)
\right ) \right | \\
&= \frac{k^2}{2\pi} \left | \sum_{l=1}^\infty \frac{-l}{z^{l+1}}
\int_\Gamma \left( y_1+iy_2 \right)^l \mu_\nu(\yy) \, dS(\yy) \right | \\
&= \bigo (1/r^2) \; .
\end{align*}
\end{proof}

\subsection{Boundary value problems --- exterior}

Let $E$ and $\Gamma$ be as in the previous subsection.
The radiation condition allows for a well-posed formulation
of the exterior boundary value problems, which we
summarize in
\cref{def:dir_exterior,def:neu_exterior,def:imp_exterior} below.

\begin{definition}[Exterior Dirichlet problem]
  \label{def:dir_exterior}
  Let $\ff \in C(\Gamma)$ be given. Find $(\bu,p) \in A(E)$
  such that
  \begin{equation}
  \begin{aligned} \label{eq:dir_exterior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in E \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in E \, ,  \\
    \bu &= \ff \quad \bx \in \Gamma \, ,
  \end{aligned}
  \end{equation}
  and $(\bu,p)$ satisfies the radiation condition in
  \cref{def:radcond}.
\end{definition}
\begin{definition}[Exterior Neumann problem]
  \label{def:neu_exterior}
  Let $\bg \in C(\Gamma)$ be given. Find $(\bu,p) \in A(E)$
  such that
  \begin{equation}
  \begin{aligned} \label{eq:neu_exterior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in E \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in E \, ,  \\
    \bt &= \bg \quad \bx \in \Gamma \, ,
  \end{aligned}
  \end{equation}
  and $(\bu,p)$ satisfies the radiation condition in
  \cref{def:radcond}.
\end{definition}

\begin{definition}[Exterior impedance problem]
  \label{def:imp_exterior}
  Let $\bh \in C(\Gamma)$ be given and suppose that
  $\eta \in \mathbb{C}$ with $\Re{(\eta)} > 0$ and $\Im{(\eta)} \ge 0$.
  Find $(\bu,p) \in A(E)$
  such that
  \begin{equation}
  \begin{aligned} \label{eq:imp_exterior}
    \Delta \bu + k^{2} \bu &= \nabla p \quad \bx \in E \, ,\\
    \nabla \cdot \bu &= 0 \quad \bx \in E \, ,  \\
    \bt + i\eta \bu &= \bh \quad \bx \in \Gamma \, ,
  \end{aligned}
  \end{equation}
  and $(\bu,p)$ satisfies the radiation condition in
  \cref{def:radcond}.
\end{definition}

\subsection{Uniqueness results}

Before moving on to the exterior uniqueness theorems,
we establish the well-known result that
the $k$ corresponding to interior eigenvalues, $k^2$,
are real-valued.

\begin{thrm}
  Let $\Omega$ be a bounded domain and suppose that
  $\Im (k) \neq 0$. Then both the interior
  Dirichlet and Neumann boundary value problems have
  unique solutions.
\end{thrm}
\begin{proof}
  A couple applications of the divergence theorem establish
  that
  \begin{equation} \label{eq:greenlike}
    \int_\Omega |2\be(\bu)|^2 - \overline{k}^2 |\bu|^2 \, dV
    = \int_\Gamma \bu \cdot \overline{\bt} \, dS \; .
  \end{equation}
  Suppose that either $\bu = 0$ or $\bt = 0$ on $\Gamma$.
  Then, the right hand side of \cref{eq:greenlike} is
  zero.
  Taking the real and imaginary parts of \cref{eq:greenlike},
  it is clear that $\bu \equiv 0$, if $\text{Im}(k) \neq 0$.
\end{proof}

In the following lemma, we prove uniqueness for the
interior impedance problem.

\begin{thrm}
  Let $\Omega$ be a bounded domain and suppose that
  $\Re(k),\Im (k) > 0$. Then the interior
  impedance problem has a unique solution.
\end{thrm}
\begin{proof}
  Plugging $\bt = i\eta \bu$ in~\cref{eq:greenlike}
  and taking the imaginary part, we get
  \begin{equation}
   2 \Re{(k)} \Im{(k)} \int_{\Omega} |\bu|^2\, dV + 2\Re{(\eta)} \int_{\Gamma}
   |\bu|^2 \, dS = 0 \, ,
  \end{equation}
  from which it is is clear that $\bu \equiv 0$, since
  $\Re{(\eta)}, \Re{(k)}, \Im{(k)} > 0$.
\end{proof}

We now turn our attention to the proofs of the exterior boundary value problems
for the oscillatory Stokes equation. The following lemmas are useful for
proving these results.

\begin{lem}
  \label{lem:rep}
  Let the unbounded region $E$ be given as the exterior
  of a finite collection of bounded domains.
  Suppose that $(\bu,p)$ satisfies the oscillatory Stokes equation in
  $E$ as well as the radiation condition~\cref{eq:radcond}.
  Then
  \begin{multline}
    \label{eq:repinfest}
    \lim_{r\to\infty}
    \int_{|\by|=r} \left( |\bt|^2 + |k|^2 |\bu|^2 \right) dS +
    2 \Im(k) \int_{E \cap B_{r}(0)} \left(|k|^2 |\bu|^2 + |2\be(\bu)|^2 \right)
    dV \\
    + 2 \Im \left( k \int_{\Gamma} \bu \cdot
\overline{\bt} dS  \right) = 0
  \end{multline}

\end{lem}

\begin{proof}
Since $(\bu,p)$ satisfies the radiation condition, we have that
\begin{equation}
\lim_{r\to\infty} \int_{|\by|=r} | \bt - i k \bu|^2 dS =
\lim_{r\to\infty} \int_{|\by| =r} \left( |\bt|^2 + |k|^2|\bu|^2 + 2 \Im
\left( k \bu\cdot \overline{\bt} \right) dS \label{eq:raddecayproof1}
\right) = 0 \, .
\end{equation}
Since $\bu$ satisfies the oscillatory Stokes equation $E \cap B_{r}(0)$,
using a couple of applications of the divergence theorem, we have that
\begin{equation}
\int_{E\cap B_{r}(0)} |2 \be(\bu)|^2 dV =
-\int_{\Gamma} \bu \cdot \overline{\bt} dS
+ \int_{|\by|=r} \bu \cdot \overline{\bt} dS + \overline{k}^2
\int_{E \cap B_{r}(0)} |\bu|^2 dV \,. \label{eq:raddecayproof2}
\end{equation}
Combining~\cref{eq:raddecayproof1,eq:raddecayproof2}, we get
\begin{multline*}
\lim_{r\to\infty} \int_{|\by|=r}\left(|\bt|^2 + |k|^2 |\bu|^2 \right) dS
+ 2 \Im(k)\int_{E \cap B_{r}(0)} \left(|2\be(\bu)|^2 + |k|^2 |\bu|^2
\right) dV \\
+ 2\Im \left ( k \int_{\Gamma} \bu \cdot \overline{\bt} dS \right) = 0 \, .
\end{multline*}
\end{proof}

In the next lemma, we prove the analogue of Rellich's lemma for the
oscillatory Stokes equation.
\begin{lem}
  \label{lem:rellich}
  Let the unbounded region $E$ be given as the exterior
  of a finite collection of bounded domains.
  Suppose $k$ is real, $\bu$ satisfies the oscillatory
  Stokes equation in $E$, and that
\begin{equation}
\lim_{r \to \infty} \int_{|\by|=r} |\bu|^2 dS = 0
\, . \label{eq:decayatinf}
\end{equation}
Then each component of $\bu$ is harmonic in $E$.
\end{lem}
\begin{proof}
We first note that each component of $\bu= (u_{1},u_{2})$ satisfies the
oscillatory biharmonic equation in $E$, i.e.
\begin{equation}
\Delta (\Delta + k^2) u_{j} = 0 \quad j=1,2 \,. \nonumber
\end{equation}
For $r$ sufficiently large, we can express $u_{j}$ in the Fourier basis as
\begin{equation}
u_{j}(r,\theta) = \sum_{n=-\infty}^{\infty} a_{j,n}(r) e^{i n \theta}  \quad
j=1,2 \, . \nonumber
\end{equation}
Using Parseval's identity then
\begin{equation}
\int_{|\by|=r} |\bu|^2 dS = r\sum_{n=-\infty}^{\infty} |a_{1,n}(r)|^2  +
|a_{2,n}(r)|^2 \, . \nonumber
\end{equation}
Since $\bu$ satisfies~\cref{eq:decayatinf}, we conclude that
\begin{equation}
\lim_{r\to\infty} r|a_{j,n}(r)|^2 = 0 \quad j=1,2 \, , \label{eq:adecay}
\end{equation}
Since $u_{j}$, $j=1,2$ satisfies the oscillatory biharmonic equation,
the functions $a_{j,n}$ are linear combinations of
\begin{equation}
r^{|n|}, r^{-|n|}, H^{(1)}_{n}(k r), H^{(2)}_{n}(k r) \, , \quad
n\neq 0 \, , \nonumber
\end{equation}
and
\begin{equation}
1, \log{(r)}, H^{(1)}_{0}(k r), H^{(2)}_{0}(k r) \quad n=0 \, ,  \nonumber
\end{equation}
where $H_{n}^{(1),(2)}(\cdot)$ are the Hankel functions of the first and
second kind of order $n$.
Since $a_{j,n}(r)$ satisfy~\cref{eq:adecay}, and using the asymptotic
expansion of $H_{n}^{(1),(2)}(kr)$ when $k$ and $r$ are real-valued, we note
that the projection of $a_{j,n}$ on $r^{|n|}$, and $H_{n}^{1,2}(k r)$
must be zero. Thus, for sufficiently large $r$,
\begin{equation}
u_{j}(r,\theta) = \sum_{n=-\infty}^{\infty} \frac{a_{j,n} e^{i n \theta}}{r^{|n|}}
\, , \nonumber
\end{equation}
i.e. $u_{j}$ is harmonic
in $B_{r}(0)^{c}$.
Finally, by \cref{cor:analytic}, $\bu$ is
analytic in $E$. Therefore, each $u_j$ is harmonic
throughout $E$.
\end{proof}

\begin{remark} \label{rmk:harmu}
  Note that if $\bu$ satisfies the assumptions
  of~\cref{lem:rellich}, then each component is harmonic
  and thus $\bu$ satisfies
\begin{align}
k^2 \bu &= \nabla p \label{eq:massconsred} \; .
\end{align}
\end{remark}

\begin{remark}
  It should be noted that in~\cref{lem:rellich}, $\bu$ need
  not be a radiating solution. All that is assumed of $\bu$
  is that it satisfies the oscillatory Stokes equations in $E$.
\end{remark}

We now have the results needed to establish the
uniqueness of exterior boundary value problems.

\begin{thrm}[Uniqueness of the Exterior Dirichlet Problem]
  \label{thrm:unique_dir_ext}
  Let the unbounded region $E$ be given as the exterior
  of a finite collection of bounded domains.
  Suppose that $\Im(k)\geq 0$ and
  that $(\bu,p)$ is a radiating solution to the oscillatory Stokes
  equation in $E$ with $\bu =0$ on the boundary $\Gamma$, then
  $\bu \equiv 0$ in $E$.
\end{thrm}

\begin{proof}
Since $\bu = 0$ on $\Gamma$, it follows from~\cref{lem:rep} that
\begin{equation}
\lim_{r\to\infty}
\int_{|\by|=r} \left( |\bt|^2 + |k|^2 |\bu|^2 \right) dS +
2 \Im(k) \int_{E \cap B_{r}(0)} \left(|k|^2 |\bu|^2 + |\be(\bu)|^2 \right)
dV = 0 \nonumber
\end{equation}

Suppose that $\Im(k) > 0$. Then, it is immediate that
$\bu \equiv 0$ in $E$.

Suppose that $k$ is real valued. It is clear that
\begin{equation}
\lim_{r\to\infty} \int_{|\by|=r} |\bu|^2 dS = 0 \, . \nonumber
\end{equation}
Thus, the conditions on $\bu$ and $k$ in~\cref{lem:rellich}
are satisfied, and each component of $\bu$ is a harmonic function
with $\bu \to 0$ as $r \to \infty$. Furthermore, since $\bu=0$ on
$\Gamma$, by the uniqueness of solutions to the
Dirichlet problem for Laplace's equation
on exterior domains, we conclude that $\bu \equiv 0$
in $E$.
\end{proof}

\begin{thrm}[Uniqueness of the Exterior Neumann Problem]
  Suppose that $\Omega$ is the union of a finite collection
  of simply connected domains, i.e. $\Omega = \bigcup_{i=1}^m \Omega_{i}$
  for some $m \in \N$, with $C^{2}$ boundaries,
  and let $E = \R^{2} \setminus \bar{\Omega}$ denote its exterior;
  see~\cref{fig:ext_dom} for an example with $m=4$.
  Let $\Gamma_{i}$ denote the boundary of $\Omega_{i}$,
  and $\Gamma = \bigcup_{i=1}^{m} \Gamma_{i}$ denote the boundary
  of $\Omega$.
  Suppose that $\Im(k)\geq 0$ and
  that $(\bu,p)$ is a radiating solution to the oscillatory Stokes
  equation in $E$ with $\bt = 0$ on the boundary $\Gamma$, then
  $\bu \equiv 0$ in $E$.
\end{thrm}

\begin{proof}
Since $\bt = 0$ on $\Gamma$, it follows
from~\cref{eq:repinfest} that
\begin{equation}
\lim_{r\to\infty}
\int_{|\by|=r} \left( |\bt|^2 + |k|^2 |\bu|^2 \right) dS +
2 \Im(k) \int_{E \cap B_{r}(0)} \left(|k|^2 |\bu|^2 + |\be(\bu)|^2 \right)
dV = 0 \; . \nonumber
\end{equation}

Suppose that $\Im(k) > 0$. It is then immediate
that $\bu \equiv 0$ in $E$.

Suppose that $k$ is real. It is clear that
\begin{equation}
\lim_{r\to\infty} \int_{|\by|=r} |\bu|^2 dS = 0 \, . \nonumber
\end{equation}
Thus, the conditions on $\bu$ and $k$ in \cref{lem:rellich}
are satisfied, and each component of $\bu$ is a harmonic function
with $\bu \to 0$ as $r \to \infty$. Furthermore, as observed
in \cref{rmk:harmu}, $k^2 \bu = \nabla p$. Then, the boundary
condition becomes $0 = \bt = -p \bnu + 2 \nabla \partial_\nu p/k^2$.
Because $0 = \btau \cdot \bt = 2\partial_{\tau\nu} p/k^2$,
$\partial_\nu p  = c_{i}$ on $\Gamma_{i}$ for each $\Gamma_{i}$,
where $c_{i}$ is a constant.
Observe that $|\bu|$ and $|\be(\bu)|$ must be $O(1/r)$ as
$r\to\infty$. Thus,
for a radiating pair $(\bu,p)$ with $p$ harmonic,
we have that $|p| = O(1/r)$ and $|\nabla p| = O(1/r^2)$
as $r\to\infty$.
Since the boundary is $C^{2}$ and the boundary data for $p$
is analytic, we conclude that $p$ is $C^{2}$ in
$\overline{E}$.
Furthermore, $\bt=0$ implies $p \bnu = 2\nabla \partial_{\nu} p/k^2$,
and taking the dot
product with $\bnu$, we get
$p = 2\partial_{\nu \nu}p/k^2$.
It then follows that
$p = -2\partial_{\tau \tau}p/k^2$ on $\Gamma$ since
$p$ is harmonic in $E$ and $C^{2}$ in $\overline{E}$.
Since $p$ satisfies the radiation condition at $\infty$,
we have
\begin{equation}
\begin{aligned}
\int_{E} |\nabla p|^2 dV &=
\sum_{i=1}^{m} \int_{\Gamma_{i}} p \partial_{\nu}p \,dS \\
&= \sum_{i=1}^{m} c_{i} \int_{\Gamma_{i}} p \,dS \quad \text{(Since $\partial_{\nu} p = c_{i}$ on
$\Gamma_{i}$)} \\
&= -\sum_{i=1}^{m} \frac{2c_{i}}{k^2} \int_{\Gamma_{i}} \partial_{\tau \tau} p \,dS
\quad \text{(Since $p = -\partial_{\tau \tau}p/k^2$ on $\Gamma$)} \\
&= 0
\end{aligned}
\end{equation}
Thus, $p$ is a constant in $E$. Furthermore, since $p\to 0$ at $\infty$,
we conclude that $p\equiv 0$ in $E$.
Finally, since $k^2 \bu = \nabla p$, we conclude that $\bu\equiv 0$ in
$E$.
\end{proof}

\begin{thrm}[Uniqueness of the Exterior Impedance Problem]
  Let the unbounded region $E$ be given as the exterior
  of a finite collection of bounded domains.
  Suppose that the complex numbers $\eta$ and $k$ satisfy that
  $\Re(\eta), \Re(k) > 0$ and $\Im(\eta),\Im(k) \geq 0$.
  Suppose further that
  $(\bu,p)$ is a radiating solution of the
  oscillatory Stokes equation in $E$ which satisfies
  the homogeneous impedance boundary condition
  \begin{equation}
\bt + i \eta \bu = 0 \quad \xx \in \Gamma \, . \nonumber
\end{equation}
Then $\bu \equiv 0$ for $\xx \in E$.
\end{thrm}

\begin{proof}
Since $\bu$ satisfies the radiation condition at $\infty$ and $\bt = -i\eta \bu$
on $\Gamma$, it follows from~\cref{eq:repinfest} that
\begin{align*}
0 &=
\int_{|\by|=r} \left( |\bt|^2 + |k|^2 |\bu|^2 \right) dS +
2 \text{Im}(k) \int_{E \cap B_{r}(0)} \left(|k|^2 |\bu|^2 + |2\be(\bu)|^2 \right)
dV \nonumber \\
& \qquad + 2 \text{Im} \left( k \int_{\Gamma} \bu \cdot \overline{\bt} dS  \right) \\
&=
\int_{|\by|=r} \left( |\bt|^2 + |k|^2 |\bu|^2 \right) dS +
2 \text{Im}(k) \int_{E \cap B_{r}(0)} \left(|k|^2 |\bu|^2 + |2\be(\bu)|^2 \right)
dV \nonumber \\
& \qquad + 2 \left( \left (\Re(k)\Re(\eta) + \Im(k)\Im(\eta)
\right ) \int_{\Gamma} |\bu|^{2} dS  \right)
\, .
\end{align*}
Because all of the quantities in the last expression above are
nonnegative, we have that
\begin{equation}
  \int_{\Gamma} |\bu|^{2} = 0 \implies \bu = 0  \quad \xx \in \Gamma \, .
  \nonumber
\end{equation}
The result then follows from the uniqueness of solutions to the exterior
Dirichlet problem.
\end{proof}

\subsection{The integral equations and their null-spaces}

\begin{figure}
\begin{center}
\includegraphics[width=0.4\textwidth]{fig/mc_dom}
\end{center}
\caption{Example of a multiply connected domain with four obstacles.}
\label{fig:mc_dom}
\end{figure}

In this section, we establish the correspondence between
Stokes eigenvalues and the invertibility of certain integral
equations arising from layer potential representations
of solutions to the oscillatory Stokes equation.

Let $\Omega$ be a bounded domain given as
the intersection of a simply connected domain $\Omega_0$ and
the exteriors of a finite collection of bounded,
simply connected domains $\{ \Omega_i \}_{i=1}^m$
whose closures are contained in $\Omega_0$;
see \cref{fig:mc_dom} for an example with four inclusions.
Note that the
exterior of $\Omega$, which we denote by $E$, is the
disjoint union of the exterior of $\Omega_0$, which we
denote $E_0$, with the sets $\{ \Omega_i \}_{i=1}^m$.
Let $\Gamma$ denote the boundary of $\Omega$ with the normal
$\bnu$ pointing out of $\Omega$.
We will use superscript $+$ and $-$ signs
to indicate the limit values of a function on $\Gamma$
as approached from the exterior and interior, respectively.

For the sake of brevity, we consider only the
Dirichlet eigenvalue problem but a similar analysis
could be applied to the Neumann eigenvalue problem.
We analyze two different representations for the
Dirichlet problem: a double layer potential,
i.e. setting $\bu=\bD_{k} \bmu$, and a combined-field
layer potential, i.e. setting
$\bu=(i\eta \bS_{k} + \bD_{k})\bmu$.
While both representations result in a second kind
integral equation for the oscillatory Stokes Dirichlet
problem, the double layer potential has spurious non-trivial
nullspaces on domains with positive genus, as
explained below.

\begin{remark}
  The application of the Fredholm alternative here
  again follows the structure used for the Laplace
  eigenvalue problem in~\cite[Ch. 3]{colton1983integral}.
\end{remark}

\subsubsection{Dirichlet eigenvalues --- double layer
  representation}
\label{subsec:dlanalysis}
Suppose that the solution to the oscillatory
Stokes Dirichlet problem, \cref{eq:dir_interior},
is represented using a double layer potential defined
on $\Gamma$, i.e. setting $\bu = \bD_{k} \bmu$ where
$\bmu$ is an unknown density.
Substituting this expression
into the boundary condition and applying
\cref{lem:jump-conds}, we obtain

\begin{equation}
  (\cI - 2\cD_{k}) \bmu = -2\ff \; . \label{eq:inteq_dir_int}
\end{equation}

The rank deficiency of $\cI-2\cDk$ is
well-known~\cite{biros2002embedded} and we summarize it
in the lemma below.

\begin{lem}
  \label{lem:nunull} In the notation above,
  $\bnu \in \cN(\cI - 2\cDkt)$.
\end{lem}
\begin{proof}
From~\cref{lem:propnullspacecorr}, we note that
$W[(\cI - 2\cD_{k})\bmu] =0$ implies that
$\left<(\cI -2\cD_{k})\bmu ,\bnu \right> = 0$ for
all $\bmu$, i.e. $\bnu \in R(\cI - 2\cD_{k})^{\perp}$, where
$R(A)$ denotes the range of the operator $A$.
By the Fredholm alternative, the result then follows.
\end{proof}
Thus, we instead analyze the equation
\begin{equation}
(\cI - 2\cD_{k}  -2\cW) \bmu = -2\ff \; \, . \label{eq:inteq_dir_int_mod}
\end{equation}
Note that if $\ff$ satisfies the compatibility
condition $\int_\Gamma \ff \cdot \bnu \, dS =0$, then
\cref{eq:inteq_dir_int_mod} implies \cref{eq:inteq_dir_int}.

On simply connected domains, there is a one-to-one correspondence between
the eigenvalues of the Dirichlet problem for
the Stokes equation
and the values of $k$ for which the operator $(\cI - 2\cD_{k} - 2\cW)$
is not invertible. To prove this, we also need the
following lemma:
\begin{lem}
  \label{lem:nutracli}
  If $\bt^{-}$ is the surface traction associated
  with an interior Dirichlet Stokes eigenfunction $\bu$,
  then $\bt^{-}$ and $\bnu$ are linearly independent.
\end{lem}
\begin{proof}
We first note that $\bS_{k}[\bnu](\bx) = 0$ for all $\bx \in \Omega$.
This follows from an application of the divergence
theorem and the fact that
oscillatory Stokeslet is divergence free in $\Omega$.
If $\bt^{-}$ is a surface traction associated with
a Stokes eigenvalue, then
using Green's theorem, it follows that
$\bS_{k}[\bt^{-}](\bx) = \bu(\bx) \neq 0$ for $\bx \in \Omega$ and
thus $\bt^{-}$ and $\bnu$ are linearly independent.
\end{proof}

\begin{thrm}
\label{thm:dlmain}
Suppose that $\Omega$ is a bounded, simply connected domain. Then, the operator
$(\cI - 2\cD_{k} - 2 \cW)$ is not invertible if and only if $k^2$ is a
Dirichlet eigenvalue for the Stokes equation on $\Omega$.
\end{thrm}
\begin{proof}
  Suppose that $k^2$ is not a Dirichlet eigenvalue for
  the Stokes equation on
$\Omega$.
Suppose further that $\bmu$ satisfies
\begin{equation}
(\cI - 2\cD_{k} - 2\cW) \bmu = 0 \, , \label{eq:dlproofrep}
\end{equation}
i.e. $\bmu$ is in the null-space
of $(\cI - 2 \cD_{k} - 2 \cW)$.
Applying the operator $\cW$ to~\cref{eq:dlproofrep} and
using~\cref{lem:propnullspacecorr}, we get
\begin{equation}
0 = \cW [(\cI - 2\cD_{k} - 2\cW)\bmu] = -2\cW [\bmu] \, .
\end{equation}
Thus~\cref{eq:dlproofrep} reduces to
\begin{equation}
(\cI - 2 \cD_{k})\bmu = 0\, .
\end{equation}
Suppose now $\bu = -2\bD_{k}[\bmu]$ in $\Omega$.
Then $\bu$ is a solution to the oscillatory Stokes equation in $\Omega$,
and applying~\cref{lem:jump-conds}, we get that the interior
limit of the velocity $\bu^{-}=(\cI - 2\cD_{k}) \bmu = 0$
on $\Gamma$. Since $k^2$ is not a Dirichlet eigenvalue for the Stokes
equation on $\Omega$, we conclude that $\bu \equiv 0$ in $\Omega$.
In particular, this implies that the interior limit of the surface traction
denoted by $\bt^{-} = 0$ on $\Gamma$.
Using~\cref{lem:jump-conds} again, we conclude that the exterior limit
of the surface traction, $\bt^{+}$, is $0$ on $\Gamma$.
Note that $\bu$ is a radiating solution of the oscillatory
Stokes equation in the exterior $E$, as $\cW[\bmu] = 0$ implies
$\int_{\Gamma} \bmu \cdot \bnu = 0$.
From the uniqueness of solutions to the exterior Neumann problem,
we conclude that $\bu \equiv 0$ in $E$ as well,
which in particular implies that
the exterior limit of the velocity, $\bu^{+}$, is $0$ on $\Gamma$.
Using the jump conditions in~\cref{lem:jump-conds} again, we
get that $2\bmu = \bu^{-} - \bu^{+} = 0$.
Thus $(\cI - 2\cD_{k} - 2\cW)$ is invertible if $k^2$
is not a Dirichlet eigenvalue for the Stokes equation on $\Omega$.

To prove the converse, note that from \cref{thrm:rep-theorem} we have
  \begin{equation}
    \bS_{k} [\bt](\xx) - \bD_{k}[\bu](\xx) = \begin{cases}
    \bu(\xx) &\quad \xx \in \Omega \, , \\
    0 &\quad \xx \in E \; .
    \end{cases}
  \end{equation}
  Suppose that $k^2$ is a Dirichlet eigenvalue for the Stokes equation
  on $\Omega$ and let $\bu$ denote the corresponding eigenfunction
  with $\bt^{-}$ the corresponding surface traction on the
  boundary $\Gamma$.
  Since $\bu$ is a Dirichlet eigenfunction, the velocity restricted
  to the boundary, $\bu^{-}$, is $0$.
  Using the Green's theorem representation for the pair
  $(\bu,\bt^{-})$ and evaluating the surface traction
  using~\cref{lem:jump-conds}, we get
  \begin{equation}
    \bt^{-} = \left(\cDt_{k} + \frac{1}{2} \cI\right) \bt^{-} \,
    \implies \left(\cI - 2\cDt_{k} \right)
    \bt^{-} = 0 \, .
  \end{equation}
  From the above and \cref{lem:nunull,lem:nutracli},
  we know that $\bt^{-}, \bnu \in \cN(\cI - 2\cDt_{k})$
  are two linearly independent vectors in the null space.
  Let $c = \left< \bt^{-},\bnu \right>$. Then, it
  follows that $\left<\bt^{-} -c \bnu, \bnu \right> = 0$
  and thus $\cW[\bt^{-} - c\bnu] = 0$.
  Since $\bt^{-}$ and $\bnu$ are linearly independent, we note that
  $\bt^{-} -c\bnu \neq 0$. Combining these results, we get that
  $(\cI - 2\cDt_{k} - 2\cW) (\bt^{-} - c\bnu) = 0$.
  Since $\bt^{-}-c\bnu$ is non-trivial, and $\cW$ is
  self-adjoint, it follows from the Fredholm alternative
  that the operator $\cI - 2\cD_{k} - 2\cW$ is also not
  invertible.
\end{proof}

The correspondence result above does not hold on multiply
connected domains.
In particular, while the operator $\cI -2\cD_{k} -2\cW$
is indeed not invertible when $k^2$ is a Dirichlet eigenvalue,
it turns out that the operator is also not
invertible when $k^2$ is a Neumann eigenvalue
corresponding to the interior of one of the obstacle regions,
i.e. one of the $\Omega_{i}$ with $i > 0$. The following theorem
proves this result for a region with one obstacle;
the extension to the general case is straightforward.

\begin{thrm}
  Suppose that $\Omega$ is a multiply connected domain
  given by the intersection of a domain $\Omega_{0}$
  and the exterior of a single domain $\Omega_{1}$ with
  $ \bar\Omega_1 \subset \Omega_0$.
  Then, the operator $\cI - 2\cD_{k} - 2\cW$ is not invertible
  if $k^2$ is a Neumann eigenvalue of $\Omega_{1}$.
\end{thrm}

%\begin{figure}
%\begin{center}
%\includegraphics[width=0.3\linewidth]{fig/multiply_final}
%\end{center}
%\caption{Example of a multiply connected domain with one obstacle.}
%\label{fig:1ply}
%\end{figure}

\begin{proof}
  Suppose that $k^2$ is a Neumann eigenvalue of $\Omega_{1}$, and
  let $\tilde{\bu}$ denote the corresponding eigenfunction.
  Note that $\tilde{\bu}$ is not identically $0$ on the boundary
  of $\Omega_{1}$, which we denote by $\Gamma_1$.
  Since $\tilde{\bu}$ is an interior Neumann eigenfunction, we note that
  the surface traction corresponding to the solution, $\bt^{-}$, is $0$
  on the boundary.
  Applying \cref{thrm:rep-theorem} to the
  solution $\tilde{\bu}$ in the interior
  and taking the interior limit we get
\begin{equation}
\tilde{\bu} = \frac{1}{2}\tilde{\bu} + \cD^{\Gamma_{1}}_{k}[\tilde{\bu}] +
\cS^{\Gamma_{1}} [\bt^{-}] \implies \frac{1}{2} \tilde{\bu} - \cD^{\Gamma_{1}}_{k}[\tilde{\bu}]
= 0\, .
\end{equation}
Note that the sign of the $\bD$ operator in the
representation theorem is switched since the normal
is pointing inwards for the boundary $\Omega_{1}$.
Thus, $\tilde{\bu}$ is a non-trivial null vector of the operator
$\frac{1}{2}\cI - \cD^{\Gamma_{1}}_{k}$.
Furthermore since $\tilde{\bu}$ is the boundary data of
the solution of the oscillatory Stokes equation
in $\Omega_{1}$, we get that $\cW^{\Gamma_{1}}[\tilde{\bu}] = 0$.
Setting $\bmu = \tilde{\bu}$ on $\Gamma_{1}$, and
$\bmu = 0$ on $\Gamma_{0}$, we obtain a non-trivial null
vector for the operator $\cI - 2\cD^{\Gamma}_{k} -2\cW^{\Gamma}$
on the boundary $\Gamma = \Gamma_{0} \cup \Gamma_{1}$.
\end{proof}

The spurious eigenvalues of the operator $\cI-2\cDk-2\cW$
are demonstrated in \cref{subsec:spurannulus} on an annulus,
where both the true and spurious eigenvalues can be
determined analytically.
Analogous with the observation in~\cite{zhao2015robust},
this lack of one-to-one correspondence between
the invertibility of the integral operator $\cI - 2\cD_{k} - 2\cW$
and the Dirichlet eigenvalues of the Stokes operator on multiply
connected domains also causes non-robustness and introduces
near-resonances for simply-connected domains which are almost
multiply-connected.
%We demonstrate this issue numerically
%in~\cref{subsec:crescent}.

\subsubsection{Dirichlet eigenvalues --- combined-field representation}
\label{subsec:mixedanalysis}

The non-robustness in using the double layer
potential representation can be
remedied by using a combined-field, or mixed layer potential,
representation, i.e. setting $\bu = (\bD_{k} + i\eta \bS_{k})
\bmu$, with $\eta$ real and positive.
Imposing the Dirichlet boundary condition
and using~\cref{lem:jump-conds}, we obtain
\begin{equation}
  (\cI - 2\cD_{k} - 2i\eta \cS_{k}) \bmu = -2 \ff \,
  \textrm{ on } \Gamma.
\end{equation}
As with the double layer representation, this
integral equation is rank deficient for any $k$.
Instead, we consider
\begin{equation}
(\cI - 2\cD_{k} -2i\eta \cS_{k}  -2\cW)\bmu = -2 \ff \, .
\end{equation}

We now prove that for any bounded region $\Omega$
(simply or multiply connected) with $C^{2}$ boundaries,
there exists a one-to-one correspondence between the
invertibility of the operator $\cI - 2\cD_{k}
- 2i\eta \cS_{k} - 2\cW$ and the Dirichlet eigenvalues.

\begin{thrm}
  \label{thm:cfmain}
  Suppose $\Omega$ is a bounded region defined
  by the intersection of a simply connected domain $\Omega_{0}$
  and the exteriors of a finite collection bounded simply
  connected domains $\{ \Omega_{i} \}_{i=1}^{m}$. As above,
  let $\Gamma_{i}$ denote the boundary of $\Omega_{i}$ and let
  $\Gamma = \cup_{i=0}^{m} \Gamma_{i}$ denote the boundary of
  $\Omega$. Then, the operator $\cI - 2\cD_{k} - 2i\eta \cS_{k}
  - 2\cW$ is invertible if and only if $k^2$ is not a Dirichlet
  eigenvalue for the Stokes operator on $\Omega$.
\end{thrm}

\begin{proof}
  Suppose that $k^2$ is not a Dirichlet eigenvalue for the
  Stokes equation on $\Omega$. Suppose further that $\bmu$ satisfies
  \begin{equation}
    (\cI - 2\cD_{k} -2i\eta\cS_{k} - 2\cW) \bmu = 0 \, ,
    \label{eq:mlproofrep}
  \end{equation}
i.e. $\bmu$ is in the null-space
of $(\cI - 2 \cD_{k} - 2i\eta \cS_{k} - 2 \cW)$.
Applying the operator $\cW$ to~\cref{eq:mlproofrep} and
using~\cref{lem:propnullspacecorr}, we get
\begin{equation}
0 = \cW [(\cI - 2\cD_{k} - 2i\eta\cS_{k} - 2\cW)\bmu] = -2\cW [\bmu] \, .
\end{equation}
Thus~\cref{eq:mlproofrep} reduces to
\begin{equation}
(\cI - 2 \cD_{k} - 2i\eta \cS_{k})\bmu = 0\, .
\end{equation}
Suppose now $\bu = -2\bD_{k}[\bmu] -2i\eta\bS_{k}[\bmu]$
in $\Omega$. Then $\bu$ is a solution to the oscillatory
Stokes equation in $\Omega$, and applying~\cref{lem:jump-conds},
we get that the interior limit of the velocity
$\bu^{-} = (\cI - 2\cD_{k} -2i\eta\cS_{k}) \bmu = 0$ on $\Gamma$.
Since $k^2$ is not a Dirichlet eigenvalue for the Stokes equation
on $\Omega$, we conclude that $\bu \equiv 0$ in $\Omega$.
This in particular implies that the interior limit of the
surface traction, denoted by $\bt^{-}$, is $0$ on $\Gamma$.

Using~\cref{lem:jump-conds} we observe that $\bt^{+}
= 2i\eta \bmu(\xx)$ and $\bu^{+} = -2\bmu(\xx)$ on $\Gamma$, i.e.
$\bt^{+}+i\eta \bu^{+}=0$ and $\bu^{+}$ satisfies the homogeneous
exterior impedance problem.
We first show that $\bmu=0$ on $\Gamma_{0}$.
To this end, note that $\bu$ is a radiating solution
of the oscillatory Stokes equation in the exterior $E$,
since $\cW[\bmu] = 0$ implies that $\int_{\Gamma} \bmu
\cdot \bnu = 0$. From the uniqueness of the impedance problem
in the exterior $E_0$ of $\Omega_0$, we conclude that
$\bu \equiv 0$ in $E_0$ as well, which in particular
implies that $\bu^{+}=0$ on $\Gamma_{0}$.
Using the jump conditions in~\cref{lem:jump-conds}
again, we get that
$2\bmu = \bu^{-} - \bu^{+} = 0$ on
$\Gamma_{0}$.

\begin{remark}
  Note that there is potential for confusion here
  in that the exterior limit with respect to $\Omega$
  for the boundary $\Gamma_{j}$ is the traditional interior
  limit with respect to the obstacle region $\Omega_{j}$.
\end{remark}

To show that $\bmu=0$ on
$\Gamma_{j}$, we observe that $\bu$ is also a
solution to the oscillatory Stokes equation in each
of the obstacles $\Omega_{j}$.
Using the jump conditions in~\cref{lem:jump-conds},
we get that $\bt^{+} = 2i\eta \bmu$ and $\bu^{+} = -2\bmu$.
However, the normal is inward pointing inside $\Omega_{j}$
on the boundary $\Gamma_{j}$.
If we revert back to the normal being defined as
an outward normal to $\Omega_{j}$, then
the boundary conditions on $\Gamma_{j}$
is $\bt - i \eta \bu = 0$.
From the uniqueness of solutions to the interior
impedance problem, we conclude that $\bu \equiv 0$
in $\Omega_{j}$, which in particular implies
that $2\bmu = \bu^{-}-\bu^{+} = 0$ for $\xx \in \Gamma_{j}$,
$j=1,2,\ldots m$.
Thus, $\cI - 2\cD_{k} -2i\eta\cS_{k} -2\cW$ is
invertible when $k^2$ is not a Dirichlet eigenvalue
for the Stokes equation on $\Omega$.

From \cref{thrm:rep-theorem}, we have
\begin{equation}
  \bS [\bt](\xx) - \bD[\bu](\xx) = \begin{cases}
    \bu(\xx) &\quad \xx \in \Omega \, , \\
    0 &\quad \xx \in \R^2 \setminus \bar{\Omega} \; .
    \end{cases}
  \end{equation}
Suppose that $k^2$ is Dirichlet eigenvalue for
the Stokes equation on $\Omega$ and let $\bu$
denote the corresponding eigenfunction and $\bt$ denote
its surface traction. Note that \cref{thrm:rep-theorem}
implies that $\cS_{k}[\bt^{-}] = 0$, since
$\bu^{-}=0$ on $\Gamma$. Applying \cref{thrm:rep-theorem}
to the pair $\bt^{-}, \bu^{-}$ and evaluating the
traction on $\Gamma$ using~\cref{lem:jump-conds},
we get
\begin{equation}
\bt^{-} = (\cDt_{k} + \frac{1}{2} \cI) \bt^{-} \, .
\end{equation}
Combining these two identities, we get
that
\begin{equation}
(\cI - 2\cDkt -2i\eta \cS_{k}) \bt^{-} = 0 \, .
\end{equation}
As in the proof of~\cref{thm:dlmain}, letting
$c = \left< \bt^{-} ,\bnu \right>$, it follows that
\begin{equation}
  (\cI - 2\cDkt - 2i \eta \cS_{k} - 2\cW)
  (\bt^{-} - c\bnu) = 0 \, ,
\end{equation}
where $\bt^{-} - c\bnu \neq 0$.
Since $\bt^{-} - c\bnu$ is non-trivial and both
$i\eta \cS_{k}$ and $\cW$ are self-adjoint with respect
to the bilinear form \cref{eq:bi_form},
it follows from the Fredholm alternative
that the operator $\cI - 2\cDk -2i\eta \cSk - 2\cW$
is also not invertible.
\end{proof}

\subsection{Fredholm determinants}
\label{sec:dets}
In this section, we show
how the Fredholm determinant can be used
as a computational tool for detecting the
non-invertibility of $\cI - 2\cD_{k} - 2\cW$.
The arguments here follow the structure of the
analogous arguments in~\cite{zhao2015robust}
for Laplace eigenvalues.

Let $\cJ_{1}(X)$ denote the space of trace class operators
on $X$, where $X$ is a Hilbert space, which is a
subspace of the space of compact operators on $X$.
A compact operator $\cA$ with eigenvalues
$\lambda_{i}, i\in \mathbb{N}$ is in $\cJ_{1}(X)$ if
$\sum_{i} |\lambda_{i}| < \infty$.
If $\cA$, is a trace class operator, then
the Fredholm determinant of the operator $\cI + \cA$
is defined by
\begin{equation}
\text{det}(\cI +\cA) = \prod_{i=1}^{\infty} (1+\lambda_{i}) \, .
\end{equation}

So far, we have discussed the Fredholm theory in the space
$C(\Gamma)\times C(\Gamma)$ equipped with the bilinear form~\cref{eq:bi_form}.
However, it is more convenient to discuss the theory of Fredholm
determinants on Hilbert spaces.
We note that both the operators $\cD_{k}$ and $\cS_{k}$
are also compact operators mapping $Y \to Y$
where $Y = \mathbb{L}^{2}(\Gamma) \times \mathbb{L}^{2}(\Gamma)$.
Furthermore, it is well-known that the spectrum of compact
operators with weakly singular kernels coincide on
$C(\Gamma)\times C(\Gamma)$ and $Y$ (see~\cite{kress1989linear},
for example).
So for the rest of the section, we present the discussion of
the relevant operators on $Y$ instead of $C(\Gamma)\times C(\Gamma)$.

%It follows from standard results in complex
%analysis, that the Fredholm determinant is finite and well-defined if
%$\text{det}(\cI+A) < \infty$ if $\sum_{i} |\lambda_{i}| < \infty$,
%i.e. if $A$ is in trace class.

The operator $-2\cD_{k} - 2\cW$ is trace class:
\begin{lem}
  Suppose that $\Gamma$ is a $C^2$ curve.
  Then $-2\cD_{k} - 2\cW \in \cJ_1(Y)$
  for all $k \in \mathbb{C} \setminus \{0\}$
\end{lem}
\begin{proof}
Using Bessel function asymptotics, we note that the
kernel of $\cD_{k}$ given by $\TT_{\cdot,\cdot,\ell}\nu_{\ell}(\bx,\by)$
has a leading order singularity of
$|\bx-\by|^2 \log{|\bx-\by|^2}$ as $\bx\to \by$
for all $k \in \mathbb{C} \setminus \{ 0\}$.
It follows from the criteria listed
in~\cite[Sec. 2]{bornemann2010numerical} that $\cD_{k}$
is a trace-class operator.
Since $\cW$ is a rank-one perturbation independent of $k$,
and trace-class operators are a vector space, we conclude
that $-2\cD_{k} - 2\cW$ is also a trace-class operator.
\end{proof}

Let $f(k) = \text{det}(\cI - 2\cD_{k} - 2\cW)$.
First, note that $f(k)$ is an analytic function of $k$
for $k \in \mathbb{C} \setminus \{0 \}$, since the kernel
of $\cD_{k}$ is an analytic function of $k$ on that domain,
and the Fredholm determinant of an analytic operator
is analytic on the domain of analyticity
of the operator (see~\cite{zhao2015robust}, for example).

The zeros of the Fredholm determinant indicate when the
operator is not invertible.
The following lemma summarizes this result.
\begin{lem} \label{lem:detzeros}
  With $f(k)$ defined as above, $f(k) = 0$ if and only if
  $\cI - 2\cD_{k} -2\cW$ is not invertible.
\end{lem}
\begin{proof}
  The proof is standard; see, for example,
  \cite[p. 34]{simon2005trace}.
\end{proof}

When $\Omega$ is simply connected, \cref{lem:detzeros} and
\cref{thm:dlmain} together imply that $f(k) = 0$
if and only if $k^2$
is a Dirichlet eigenvalue of the Stokes equation.
This reduces the problem of finding eigenvalues to
finding the roots of an analytic function.

We now show how this fact can be used to numerically
estimate the Dirichlet eigenvalues.
Suppose that $D_{k}^{N}$ is a Nystr\"{o}m discretization
of the operator $-2\cD_{k} - 2\cW$ when the boundary
$\Gamma$ is discretized with $N$ points.
Let $f^{N}(k) = \text{det}(I + D_{k}^{N})$
where here $\text{det}$ is the standard matrix determinant.
Note that the discretized matrix also depends on the choice
of quadrature rule used in the Nystr\"{o}m discretization
of the operator.

In~\cite{zhao2015robust}, the authors prove that
for computing the Laplace eigenvalues on regions with
analytic boundaries, when the integral operators are
discretized using Kress quadrature --- a spectrally accurate
quadrature rule for such kernels, see~\cite{kress1991boundary} ---
the determinant of the Nystr\"{o}m discretized operators
at the true eigenvalues converge to $0$ exponentially
in $N$.
Thus, if the eigenvalues have multiplicity $1$,
i.e. the derivative of the determinant is non-zero
at the true-eigenvalues, then the analyticity of the
discretized determinant implies that the zeros
of the determinant of the Nystr\"{o}m discretization
of the linear operator converge exponentially to
the true Dirichlet eigenvalues for Laplace's equation.

The proof presented in~\cite{zhao2015robust} applies
to the BIE approach for computing the Dirichlet eigenvalues
of the Stokes operator as well.
The result is summarized below.
\begin{thrm}
\label{thm:mainconvfreddet}
Suppose that $\Omega$ is a simply connected
domain with an analytic boundary. Let $k_{j}^2$, $j=1,2,\ldots M$
denote all the Dirichlet eigenvalues of Stokes equation
on $\Omega$ contained in the interval $[a,b]$.
Suppose further that all the eigenvalues have multiplicity $1$.
Let $f^{N}(k) = \text{det}(I+D^{N}_{k})$, where $D^{N}_{k}$
is the Nystr\"{o}m discretization of $-2\cD_{k} - 2\cW$ with Kress
quadrature.
Then there exists $N_{0} \in \mathbb{N}$ such
that for all $N>N_{0}$,
$f^{N}(k)$ has exactly $M$ zeros on the interval $[a,b]$.
Let $\omega_{j}$, $j=1,2\ldots M$ denote the zeros of $f^{N}$.
Furthermore, there exist constants $a>0$ and $C$,
such that $\sup_{j=1}^{M} |\omega_{j} - k_{j}| < C e^{-aN}$.
\end{thrm}

\begin{proof}
  The proof follows from small modifications of the
  proofs contained in~\cite{zhao2015robust}.
\end{proof}

\begin{remark}
In practice, using Kress quadrature for large
problems is problematic owing to the global
nature of the quadrature rule.
%
First, the use of a global rule does not allow
for adaptive refinement at a complicated, local
feature of the boundary.
%
Second, the integration weight in each entry
of the matrix depends on both the column and the row
in a non-separable way.
%
As a result, the fast multipole method is not
directly applicable to the resulting matrix
and many fast-direct methods for computing
the determinant lose efficiency (for
instance, the reasoning behind the use of a
{\em proxy surface} \cite{cheng2005compression}
no longer holds).
Over the last two decades, many high-order quadrature
methods which are compatible with
the fast multipole method and fast-direct methods
have been developed.
%
Our numerical experiments, see \cref{subsec:convannulus},
suggest that the zeros of the
determinants of linear systems discretized using
these quadrature methods are also high order approximations
of Dirichlet eigenvalues for the Stokes operator ---
the error is observed to be proportional to the quadrature error
for the eigenfunction $\bt^{-}$ associated with the eigenvalue.
We leave a proof of this to future work.
\end{remark}

\begin{remark}
The same analysis does not carry through for the operator
$\cI - 2 \cD_{k} - 2i\eta \cS_{k} - 2\cW$,
since $\cS_{k}$ is not a trace class operator.
For brevity, let $\cC_{k} = -2\cD_{k} - 2i\eta \cS_{k} - 2\cW$.
The operator $\cC_{k}$ is
in $\cJ_{2}(Y)$ where
$\cJ_{2}(Y)$ is the space of Hilbert-Schmidt operators
on $Y$ (the singular values of the operator are square
summable, as opposed to being summable).
Thus the Fredholm determinant of $\cI + \cC_{k}$
is not necessarily finite.
However, as noted in~\cite{zhao2015robust}, the convergence
result~\cref{thm:mainconvfreddet}
should be true up to a logarithmic factor in the rate
of convergence, since the singular values of the operator
$\cC_{k}$ decay like $\frac{1}{n}$, and the
Fredholm determinant diverges logarithmically.
In~\cref{subsec:convannulus}, we demonstrate this fact
numerically on the annulus, where the eigenvalues are
analytically known.
\end{remark}


\section{Compactness}


\section{Prob 2. a)}

\lstinputlisting{integration.py}

Randomly generated $a$, $b$, $c$ in the given range and correspondingly calculated $A$.

\lstinputlisting{integrated_result.txt}


\section{Edit Menu}
The only option is Calibrate Spectrum. This will launch a new window, seen in Figure \ref{fig:calibrate_window}. The main widget features two indepenedent graphs. The upper represents the raw, uncalibrated spectrum and is plotted on a channel basis. The lower graph shows a linearly calibrated spectrum, this initializes to a 3MeV maximum, with a single peak added it adjusts to a 0 intercept with a single point slope, two or more calibration points results in a linear least squares regression fit being shown. The dotted black line that appears is used to track the cursor to help in the identification of peak centroids. Double-right clicking with initiate a input dialog that will take the energy of the peak in MeV. This will be added to the widget on the left-hand side. Double-left clicking will remove the peak-channel pair. There is no limit to the numer of peaks that can be selected, but a minimum of two are required. This window has one drop down in the menu bar:
\begin{figure}[h!]
	\centering
	\includegraphics[width=\linewidth]{Calibrate.png}
	\caption{Calibration interface.}
	\label{fig:calibrate_window}
\end{figure}

	\subsection{Load New Spectrum}
		This will load the per channel counts in the spectrum. This will accept plain text, comma-seperated, and IAEA file types. It expects a single column of data for the plain text and comma-seperated variants.

	\subsection{Rebin Data}
		This will take the loaded data and compress it into a limited number of bins. The predetermined values for this are factors of 2. Use of this will enable saving of the rebinned data, this must be used to save the compressed data in order to save plot the spectrum in the main window.

	\subsection{Calibrate}
		This loads a drop down menu with the following options:
				\subsubsection{Linear}
				Performs a linear least squares regression, ultimately resulting in the calibration being in the form of:
				\begin{equation}
				 	y=mx+b
				\label{eq:linear}
				\end{equation}
				\subsubsection{Deviation Pairs}
				Conducts a linear least squares fit, the determines the devaition from this at the known points to create and scale each data point. This can be used to generate a non-linear calibration.
				\subsubsection{External Calibration}
				Used if a known slope and intercept are to be input. It will fit the calibration to equation \ref{eq:linear}.
				\subsubsection{Segmented Linear}
				Fits a line between each successive point of the inputs.
	\subsection{Save Calibration}
	Will save a single column of that relate the channel to calibrated energy as a plain text file(.txt) to the specified location.


\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\usepackage{enumerate}
\usepackage{natbib}
\usepackage{float}%稳定图片位置
\usepackage{graphicx,subfig}%画图
\usepackage{caption}
\usepackage[english]{babel}
\usepackage{indentfirst}%缩进
\usepackage{enumerate}%加序号
\usepackage{multirow}%合并行
\usepackage{hyperref}
\newcommand{\reals}{{\mathbb{R}}}
\hypersetup{hypertex=true, colorlinks=true, linkcolor=black, anchorcolor=black, citecolor=black}
\title{\Large \textbf{VG441 Problem Set 1}\\
\author{\textbf{Pan, Chongdan ID:516370910121}\\
}
}
\begin{document}
\maketitle
\section{Problem 1}
\quad
\\$\theta^TX^TX\theta=(X\theta)^T(X\theta)=(X\theta)^2$
\\Assume $X\in\reals^{m\times n},\theta\in\reals^{n\times1}$ then $=(X\theta)^2=\sum_{i=1}^m(\sum_{j=1}^nx_{ij}\theta_j)^2$
\\$\frac{\mathrm{d}\theta^TX^TX\theta^2}{\mathrm{d}\theta}=\frac{\mathrm{d}(X\theta)^2}{\mathrm{d}\theta}=\left[\begin{array}{c}
    \frac{\partial (X\theta)^2}{\partial \theta_j}\\
    \vdots\\
    \frac{\partial (X\theta)^2}{\partial \theta_n}\\
  \end{array}\right]
  =\left[\begin{array}{c}
    2\sum_{i=1}^m(\sum_{j=1}^nx_{ij}x_{i1}\theta_j)\\
    \vdots\\
    2\sum_{i=1}^m(\sum_{j=1}^nx_{ij}x_{in}\theta_j)\\
  \end{array}\right]$
\\$2X^TX\theta=2\left[\begin{array}{ccc}
    \sum_{i=1}^mx_{i1}x_{i1} &\cdots & \sum_{i=1}^mx_{i1}x_{in}\\
    \vdots&\vdots &\vdots\\
    \sum_{i=1}^mx_{in}x_{i1} &\cdots & \sum_{i=1}^mx_{in}x_{in}\\
  \end{array}\right]\left[\begin{array}{c}
    \theta_1\\
    \vdots\\
    \theta_n\\
  \end{array}\right]=\left[\begin{array}{c}
    2\sum_{i=1}^m(\sum_{j=1}^nx_{ij}x_{i1}\theta_j)\\
    \vdots\\
    2\sum_{i=1}^m(\sum_{j=1}^nx_{ij}x_{in}\theta_j)\\
  \end{array}\right]$
\\\\\\Therefore, the derivative of $\theta^TX^TX\theta$ with respect to $\theta$ is $2X^TX\theta$
\section{Problem 2}
\begin{itemize}
    \item The average value for salary is 5875.So before the first iteration:
    \begin{table}[htbp]
        \begin{tabular}{|c|c|c|c|c|c|c|}
        \hline
        Age & Home Owner & Car Owner & Having kids & Salary & F0 & PR0 \\ \hline
        40 & YES & YES & YES & 10000 & 5875 & 4125 \\ \hline
        20 & NO & NO & NO & 500 & 5875 & -5375 \\ \hline
        50 & YES & NO & YES & 8000 & 5875 & 2125 \\ \hline
        30 & YES & NO & NO & 5000 & 5875 & -875 \\ \hline
        \end{tabular}
        \end{table}
    \\The deviance is 5118750.
    \\For \textbf{Home Owner} node: deviance is 12666666.67
    \\For \textbf{CAR Owner} node: deviance is 28500000
    \\For \textbf{Having Kids} node:deviance is 12125000
    \\For \textbf{Age $\leq$ 25} node: deviance is 12666666.67
    \\For \textbf{Age $\leq$ 35} node: deviance is 12125000
    \\For \textbf{Age $\leq$ 45} node: deviance is 45166666
    \\\\So we set \textbf{Having Kids} as the highest node, \textbf{Home Owner} as the left lower node,\textbf{CAR Owner} as the right lower node
    \begin{figure}[H]
        \centering
        \includegraphics[scale=0.25]{P1.png}
        \caption{First decision tree for GBM}
        \label{P1}
    \end{figure}
    \begin{table}[htbp]
    \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
        \hline
        Age & Home Owner & Car Owner & Having kids & Salary & F0 & PR0 & F1 & PR1 & F2 & PR2\\ \hline
        40 & YES & YES & YES & 10000 & 5875 & 4125 & 6287.5 & 3712.5 & 6658.75 & 3341.25\\ \hline
        20 & NO & NO & NO & 500 & 5875 & -5375 & 5337.5 & -4837.5 & 4853.75 & -4353.75\\ \hline
        50 & YES & NO & YES & 8000 & 5875 & 2125 & 6087.5 & 1912.5 & 6278.5 & 1721.25\\ \hline
        30 & YES & NO & NO & 5000 & 5875 & -875 & 5787.5 & -787.5 & 5708.75 & -708.75\\ \hline
        \end{tabular}
    \end{table}
    \item The average value for salary is 5875.So before the first iteration:
    \begin{table}[htbp]
        \begin{tabular}{|c|c|c|c|c|c|c|}
        \hline
        Age & Home Owner & Car Owner & Having kids & Salary & F0 & PR0 \\ \hline
        40 & YES & YES & YES & 10000 & 5875 & 4125 \\ \hline
        20 & NO & NO & NO & 500 & 5875 & -5375 \\ \hline
        50 & YES & NO & YES & 8000 & 5875 & 2125 \\ \hline
        30 & YES & NO & NO & 5000 & 5875 & -875 \\ \hline
        \end{tabular}
        \end{table}
        \\SS with $\lambda=1$ is 994050000
        \\For \textbf{Home Owner} node: Gain is 21667968.75
        \\For \textbf{CAR Owner} node: Gain is 12761718.75
        \\For \textbf{Having Kids} node:Gain is 26041666.67
        \\For \textbf{Age $\leq$ 25} node: Gain is 21667968.75
        \\For \textbf{Age $\leq$ 35} node: Gain is 26041666.67
        \\For \textbf{Age $\leq$ 45} node: Gain is 3386718.75
        \\\\So we set \textbf{Having Kids} as the highest node, \textbf{Home Owner} as the left lower node,\textbf{CAR Owner} as the right lower node
        \\The \textbf{Home Owner} node has Gain with $1807292>\gamma$, so it'll remain.
        \\The \textbf{CAR Owner} node has Gain with $-2255208<\gamma$, so it'll be deleted.
        \\After pruning, the XGBoost tree becomes:
        \begin{figure}[H]
            \centering
            \includegraphics[scale=0.25]{P2.png}
            \caption{First XGBoost Tree}
            \label{P2}
        \end{figure}
        \begin{table}[htbp]
            \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|}
                \hline
                Age & Home Owner & Car Owner & Having kids & Salary & F0 & PR0 & F1 & PR1 & F2 & PR2\\ \hline
                40 & YES & YES & YES & 10000 & 5875 & 4125 & 6083.3 & 3916.7 & 6277.75 & 3722.25\\ \hline
                20 & NO & NO & NO & 500 & 5875 & -5375 & 5606.3 & -5106.3 & 5351 & -4851\\ \hline
                50 & YES & NO & YES & 8000 & 5875 & 2125 & 6083.3 & 1916.7 & 6277.75 & 1722.25\\ \hline
                30 & YES & NO & NO & 5000 & 5875 & -875 & 5831.3 & -831.3 & 5790 & -790\\ \hline
                \end{tabular}
            \end{table}
\end{itemize}
\section{Problem 3}
\begin{itemize}
    \item The Linear Regression model leads to $MSE=3.74\times10^9, R^2=0.66$
    \begin{figure}[H]
        \centering
        \includegraphics[scale=0.5]{LR.png}
        \caption{Actual Value vs Linear Regression Predicted Value}
        \label{LR}
    \end{figure}
    \item The GBM model leads to $MSE=2.01\times10^9, R^2=0.81$
    \begin{figure}[H]
        \centering
        \includegraphics[scale=0.5]{GBM.png}
        \caption{Actual Value vs Gradient Boosting Predicted Value}
        \label{GBM}
    \end{figure}
    \item The XGBoost model leads to $MSE=1.85\times10^9, R^2=0.83$
    \begin{figure}[H]
        \centering
        \includegraphics[scale=0.5]{XGBoost.png}
        \caption{Actual Value vs XGBoost Predicted Value}
        \label{XGBoost}
    \end{figure}
\end{itemize}
From the figure, $MSE,R^2$ we get that the XGBoost Model can achieve the best prediction result, and Linear Regression Model's result is worst.
\section*{Python Code}
\begin{verbatim}
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import linear_model
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.model_selection import cross_val_predict

df=pd.DataFrame(pd.read_csv(r"D:\PANDA\Study\VG441\Homework\Problem Set 1\Cal_Housing.csv"))

class_mapping={'NEAR BAY':0, 'INLAND':1}
df['ocean_proximity']=df['ocean_proximity'].map(class_mapping) # 字符串转数字
df=df.dropna(axis=0,how='any',inplace=False) # 删除数据中所有含有nan的行

X=df[['longitude','latitude','housing_median_age','total_rooms','total_bedrooms','population','households','median_income','ocean_proximity']]
Y=df[['median_house_value']]
X_train,X_test,Y_train,Y_test=train_test_split(X, Y, test_size=0.8)
\end{verbatim}
\subsection*{Linear Regression Model}
\begin{verbatim}
model=linear_model.LinearRegression()
\end{verbatim}
\subsection*{GBM Model}
\begin{verbatim}
params = {'n_estimators': 500, 'max_depth': 4, 'min_samples_split': 2, 'learning_rate': 0.05, 'loss': 'ls'}
model = ensemble.GradientBoostingRegressor(**params)
\end{verbatim}
\subsection*{XGBoost Model}
\begin{verbatim}
params = {'n_estimators': 500, "objective":"reg:linear",'colsample_bytree': 0.5,'learning_rate': 0.05,
                'max_depth': 5, 'alpha': 1}
model = xgb.XGBRegressor(**params)
\end{verbatim}
\subsection*{Model Fit}
\begin{verbatim}
model.fit(X_train, Y_train)
model_score = model.score(X_train,Y_train)
Y_predicted = model.predict(X_test)
\end{verbatim}
\subsection*{Result and Visualization}
\begin{verbatim}
print("Mean squared error: %.2f"% mean_squared_error(Y_test, Y_predicted))
print('R2 sq: ',r2_score(Y_test, Y_predicted))
fig, ax = plt.subplots()
ax.scatter(Y_test, Y_predicted, edgecolors=(0, 0, 0))
ax.plot([Y_test.min(), Y_test.max()], [Y_test.min(), Y_test.max()], 'k--', lw=4)
ax.set_xlabel('Actual')
ax.set_ylabel('Predicted')
ax.set_title("Ground Truth vs Predicted")
plt.show()
\end{verbatim}
\end{document}


% This is part of the TFTB Reference Manual.
% Copyright (C) 1996 CNRS (France) and Rice University (US).
% See the file refguide.tex for copying conditions.

\markright{integ}
\section*{\hspace*{-1.6cm} integ}

\vspace*{-.4cm}
\hspace*{-1.6cm}\rule[0in]{16.5cm}{.02cm}
\vspace*{.2cm}

{\bf \large \sf Purpose}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
Approximate integral.
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Synopsis}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
som = integ(y)
som = integ(y,x)
\end{verbatim}
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Description}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
        {\ty integ} approximates the integral of vector {\ty y} according
        to {\ty x}.\\

\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8.5cm} c}
Name & Description & Default value\\
\hline
         {\ty y}   & {\ty N}-row-vector (or {\ty (M,N)}-matrix) to be integrated
              (along each row). \\
         {\ty x}   & {\ty N}-row-vector containing the integration path of {\ty y}
                                & {\ty (1:N)}\\
\hline   {\ty som} & value (or {\ty (M,1)} vector) of the integral\\

\hline
\end{tabular*}

\end{minipage}
\vspace*{1cm}

{\bf \large \sf Example}
\begin{verbatim}
         y = altes(256,0.1,0.45,10000)';
         x = (0:255); som = integ(y,x)
         som =
               2.0086e-05
\end{verbatim}
\vspace*{.5cm}

{\bf \large \sf See Also}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
integ2d.
\end{verbatim}
\end{minipage}


\documentclass[xcolor=dvipsnames, professionalfont]{beamer}

\usepackage{xcolor}
%\usepackage{tikz}

\usefonttheme{serif}

\usetheme{Berlin}
\usecolortheme[named=purple]{structure}

\author{Ali Abolhassanzadeh Mahani}
\title{Growing Critical: Self-Organized Criticality in a Developing Neural System}
\date{}
\institute{Sharif University of Technology}

\begin{document}
	\frame{\maketitle}
	\section*{Introduction}
	\begin{frame}
		{\centering
		An article by:\\
		Felipe Yaroslav Kalle Kossio, Sven Goedeke, Benjamin van
		den Akker, Borja Ibarz, and Raoul-Martin Memmesheimer
	}

		\begin{itemize}
			\item Intro to criticality
			\pause
			\item Genetic development of neural networks:\\
			active neurons shrink while inactive ones grow
		\end{itemize}
	\end{frame}

	\subsection*{A bit of history}
	\begin{frame}

	\end{frame}

	\section*{Stationary State Dynamics}
	\begin{frame}
		The dynamics is an inhomogeneous Poisson point process (?)\\
		Notation:
		\begin{itemize}
			\item $f_i(t)$: instantaneous firing rate of neuron $i$
			\item $gA_{ij}$: time-dependent connection strength
			\item $g$: proportionality constant
			\item $A_{ij}$: overlap areas of the neurons
			\item $\tau$: the decay time constant due to leak currents
			\item $\hat{t}_j$: spike times of neuron $j$
		\end{itemize}
	\pause
	The Stationary State Dynamics is a follows:
	\begin{equation}
		\tau \dot{f}_i(t) = f_0 - f_i(t) + \tau g \sum_j A_{ij}(t^-) \sum_{\hat{t}_j} \delta(t - \hat{t}_j)
	\end{equation}
	\end{frame}

	\section*{Network Growth}
	\begin{frame}
		Notation:
		\begin{itemize}
			\item $R_i(t)$: radius of disk representing a single neuron
			\item $K$: linear growth rate of neurons
			\item $\frac{K}{f_{sat}}$: neuron radii shrinkage at spike sending
			\item Growth takes much longer than decay of
activity $\frac{1}{K} \gg \tau$,
			\item experiments $\Rightarrow f_{sat} \gg f_0$
		\end{itemize}
	\pause
	The network growth dynamics is as follows:
	\begin{equation}
		\dot{R}_i(t) = K \left( 1 - \frac{1}{f_{sat}} \sum_{\hat{t}_i} \delta(t - \hat{t}_i) \right)
	\end{equation}
	\end{frame}

	\begin{frame}
		\includegraphics[width=\linewidth]{img/example.png}
		Example of the network dynamics.
	\end{frame}

	\section{Results}
	\begin{frame}
		Averaged over the randomness of spike generation, each spike generates in total
		\begin{equation}
			\sigma = \tau g \sum_j \bar{A_{ij}} = 1 - \frac{f_{0}}{f_{sat}}
		\end{equation}
	spikes.

	Thus we have a age-dependent branching process with branching parameter $\sigma$.  (Individuals --spikes-- generate offspring at an age-dependent rate)

	\textbf{Ref:} Crump-Mode-Jagers branching process

	\end{frame}

	\begin{frame}
	\centering
	\includegraphics[width=.8\linewidth]{img/simulation.png}

\end{frame}

	\begin{frame}
			The avalanche sizes $s$ follow the Borel distribution
		\begin{equation}
			P(s) = \frac{(s\sigma)^{s-1} e^{-s\sigma}}{s!}
		\end{equation}
	where using the Stirling's approximation we get
	\begin{equation}
		P_{appr}(s) = \frac{1}{\sqrt{2\pi}\sigma} s^{-\frac{3}{2}} e^{-(\sigma - \ln \sigma - 1)s}
	\end{equation}
	\pause

	\textbf{Notice} the power-law tail with exponent $\frac{3}{2}$ of a critical branching process for $\sigma = 1$
	\end{frame}

	\begin{frame}
		\centering
		\includegraphics[width=\linewidth]{img/avalanches.png}
	\end{frame}

	\begin{frame}
		\centering
		\Large
		Thank you for your time :)
	\end{frame}

\end{document}


\subsection{Syntactic Sugar}
\begin{frame}[fragile]{Parallel Operators}
\begin{lstlisting}[frame=htrbl]
(|***|) :: arr a b -> arr c d -> arr (a, c) (b, d)
(|***|) = parEval2 ()
\end{lstlisting}
\begin{center}
\includegraphics[scale=0.5]{images/starstarstar}
\hspace{2em}
\includegraphics[scale=0.5]{images/parEval2}
\end{center}
\begin{lstlisting}[frame=htrbl]
(|&&&|) :: arr a b -> arr a c -> arr a (b, c)
(|&&&|) f g = (arr $ \a -> (a, a)) >>> f |***| g
\end{lstlisting}
\begin{center}
	\includegraphics[scale=0.5]{images/dollardollardollar}
	\hspace{2em}
	\includegraphics[scale=0.5]{images/pardollardollardollar}
\end{center}
\end{frame}

\begin{frame}[fragile]{Parallelism made easy}
Parallel Evaluation made easy:
\begin{lstlisting}[frame=htrbl]
add :: Arrow arr => arr a Int -> arr a Int -> arr a Int
add f g = (f |&&&| g) >>> arr (\(u, v) -> u + v)
\end{lstlisting}
\begin{center}
	\includegraphics[scale=0.6]{images/addA-comb}
	\hspace{2em}
	\includegraphics[scale=0.5]{images/parAddA}
\end{center}
\end{frame}