% Vim: two=50
% 31/10/2022 10AM

\noindent
General solution:
\[ \hat{\theta}(x, t) = \sum_{n = 1}^\infty b_n
\sin \frac{n\pi x}{L} e^{-\frac{Dn^2\pi^2}{L^2}t}
\tag{4.13} \]
Now impose initial conditions (4.11) at $t = 0$
\begin{align*}
    b_n
    &= \frac{1}{L} \int_{-L}^L \ub{\hat{\phi}(x,
    0)}_{H(x) - \frac{x + L}{2L}}
    \sin \frac{n\pi x}{L} \dd x \\
    &= \frac{2}{L} \int_0^L (H(x) - \half) \sin
    \frac{n\pi x}{L} \dd x - \frac{2}{L} \int_0^L
    \frac{x}{2L} \sin \frac{n\pi x}{L} \dd x \\
    &= \frac{2}{n\pi}(\text{n odd})
    - \frac{(-1)^{n + 1}}{n\pi} \\
    &= \frac{1}{n\pi}
\end{align*}
Solution
\[ \hat{\theta}(x, t) = \sum_{n = 1}^\infty
\frac{1}{n\pi} \sin \frac{n\pi x}{L} e^{-D
\frac{n^2\pi^2}{L^2}t} \]
or with original boundary conditions (4.9)
\[ \theta(x, t) = \frac{x + L}{2L} +
\hat{\theta}(x, t) \tag{4.14} \]
Plot with $L = 1$ and $D = 1$.
\begin{center}
    \includegraphics[width=0.6\linewidth]
    {images/d15ab0da590511ed.png}
\end{center}
(the dotted lines are the fundamental solutions).
Approximate solution (4.7) ($\half \erf \left(
\frac{x}{2\sqrt{Dt}} \right) $) are excellent
for $t \le 0.1$.

\newpage
\section{The Laplace Equation}

Laplace's equation
\[ \boxed{ \nabla^2 \phi = 0} \tag{5.1} \]
has wide application in math physics \&
applications:
\begin{itemize}
    \item Steady state heat flow
    \item Potential theory $\bf{F}= -\nabla \phi$
        (also $\nabla^2 \phi = \rho(\bf{x})$)
    \item Incompressible fluid flow $\bf{v} =
        \nabla \phi$ etc.
\end{itemize}
We solve (5.1) in a domain $D$ subject to boundary
conditions either:
\begin{itemize}
    \item Dirichlet: $\phi$ given on boundary surface
        $\partial D$
    \item Neumann: $\bf{n} \cdot \nabla \phi$
        given on boundary surface $\partial D$.
\end{itemize}

\subsection{3D Cartesian coordinates}

Equation (5.1) becomes
\[ \pfrac[2]{\phi}{x} + \pfrac[2]{\phi}{y}
+ \pfrac[2]{\phi}{z} = 0 \tag{5.2} \]
Seek separable solution $\phi(x, y, z) =
X(x)Y(y)Z(z)$
\[ X''YZ + XY''Z + XYZ'' = 0 \]
\[ \frac{X''}{X} = -\frac{Y''}{Y} - \frac{Z''}{Z}
= -\lambda_l \text{(constant)} \]
and
\[ \frac{Y''}{Y} = -\lambda_m \text{(constant)} \]
so
\[ \frac{Z''}{Z} = -\lambda_n = \lambda_l +
\lambda_m \]
General solution from eigenmodes
\[ \phi(x, y, z) = \sum_{l, m, n} a_{lmn} X_l(x)
Y_m(y) Z_n(z) \tag{5.4} \]

\begin{example*}[Steady heat conduction]
    ((4.3) with $\pfrac{\phi}{t} = 0 \implies$
    (5.1)) Consider a semi-infinite rectangular
    bar
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/38f1f964590711ed.png}
    \end{center}
    with boundary conditions $\phi = 0$ at $x = 0,
    a$ and $y = 0, b$. $\phi = 1$ at $z = 0$,
    $\phi \to 0$ as $z \to \infty$.
     Solve for eigenmodes successively:
     \begin{itemize}
         \item $X'' = -\lambda_l X$ with $X(0) =
             X(a) = 0$
             \[ \lambda_l = \frac{l^2\pi^2}{a^2},
             \quad X_l = \sin \frac{l\pi x}{a}
             \quad l = 1, 2, \dots \]
         \item $Y'' = -\lambda_m Y$
             \[ \lambda_m = \frac{m^2\pi^2}{b^2}
             \quad Y_m = \sin \frac{m\pi y}{b}
             \quad m > 0 \]
         \item $Z'' = -\lambda_n Z = (\lambda_l +
             \lambda_m) z = \pi^2 \left(
             \frac{l^2}{a^2} + \frac{m^2}{b^2}
             \right) Z$ with boundary conditions
             $Z \to 0$ as $z \to \infty$
             \[ Z_{lm} = \exp \left[ -\left(
             \frac{l^2}{a^2} + \frac{m^2}{b^2}
             \right)^\half \pi z \right] \]
             So our \emph{general solution} (5.4)
             becomes
             \[ \phi(x, y, z) = \sum_{l, m} a_{lm}
             \sin \frac{l\pi x}{a} \sin \frac{m\pi
             y}{b} \exp \left[ -\left( \frac{l^2}{a^2}
             + \frac{m^2}{b^2}\right)^\half \pi z
            \right] \]
            Now fix $a_{km}$ using $\phi(x, y, z)
            = 1$ using Fourier sine $b_n$ (1.12)
            \begin{align*}
                a_{lm}
                &= \frac{2}{b} \int_0^b \dd
                y \frac{2}{a} \int_0^a \dd x \ub{1
                \sin \frac{l\pi x}{a} \sin
                \frac{m\pi y}{b}}_{\text{square wave
                FS (1.7)}} \\
                &= \frac{4a}{al\pi}
                \frac{4b}{bm\pi} \text{($l, m$,
                odd)} \\
                &= \frac{16}{\pi^2 lm} \text{($l,
                m$ odd)}
            \end{align*}
            so the heat flow solution is
            \[ \phi(x, y, z) = \sum_{l, m
            \text{ odd}} \frac{16}{\pi^2 lm} \sin
            \frac{l\pi x}{a} \sin \frac{m\pi y}{b}
            \exp \left[ -\left( \frac{l^2}{a^2} +
            \frac{m^2}{b^2} \right)^\half \pi z
            \right] \]
     \end{itemize}
\end{example*}

\subsection{2D Plane Polar coordinates}

Recall
\[ \nabla^2 = \frac{1}{r} \pfrac{}{r} \left( r
\pfrac{\phi}{r} \right) + \frac{1}{r^2}
\pfrac[2]{\phi}{\theta} = 0 \tag{5.6} \]
and try $\phi(r, \theta) = R(r) H(\theta)$ to find
\[ H'' + \mu H = 0 \quad \text{ and } \quad
r(rR')' - \mu R = 0 \]
\begin{itemize}
    \item Polar equation periodic boundary
        conditions $\implies \mu = m^2$. (as
        before (3.25), $H_m(\theta) = \cos
        m\theta$ and $\sin m\theta$)
    \item Radial equation $r(rR')' - m^2 R = 0$
        (5.7). Try $R = \alpha r^\beta \implies
        \beta^2 - m^2 = 0$, $\beta = \pm m$
        \[ R_m = r^m \text{ and } r^{-m} \]
        If $m = 0$, $(rR')' = 0 \implies rR' =
        \text{const} \implies R = \log r$.
        \[ R_0 =
        \text{const} \text{ and }\log r .\]
\end{itemize}
\begin{flashcard}[2d-polar-solution-of-laplacian]
General solution\prompt{ of the Laplacian in 2D polar
coordinates}:
\begin{align*}
    \theta(r, 0)
    &= \cloze{\frac{a_0}{2} + c_0 \log r + \sum_{m =
    1}^\infty (a_m \cos m\theta + b_m \sin
    m\theta) r^m} \\
    &~~~~~~\cloze{+ \sum_{m = 1}^\infty (c_m \cos
    m\theta + d_m \sin m\theta) r^{-m} \tag{5.8}}
\end{align*}
\end{flashcard}

\begin{example*}
    Soap film on unit disk. Solve (5.6) with a
    distorted circular disk (wire) radius $r = 1$
    with given boundary conditions:
    \[ \phi(1, \theta) = f(\theta) \]
    to find $\phi(r, \theta)$ on $r < 1$.
    Regularity at $r = 0$ implies $c_m = d_m = 0$
    for all $n$, so (5.8) becomes
    \[ \theta (r, \theta) = \half a_0 + \sum_{m =
    1}^\infty (a_M \cos m\theta + b_m \sin
    m\theta) r^m \]
    At $r = 1$, $\phi(1, 0) = f(\theta) = \half
    a_0 + \sum_m (a_m \cos m\theta + b_m \sin
    m\theta)$ so the Fourier series coefficients
    (1.5) are
    \[ a_m = \frac{1}{\pi} \int_0^{2\pi} f(\theta)
    \cos m\theta \dd \theta, \quad b_m =
    \frac{1}{\pi} \int_0^{2\pi} f(\theta) \sin
    m\theta \dd \theta \]
    Note high harmonics are confined near $r = 0$
    edge becomes $r^m$ term
    \begin{center}
        \includegraphics[width=0.6\linewidth]
        {images/b85a8984590a11ed.png}
    \end{center}
\end{example*}
