%%%%		-*- Mode: LaTeX -*-
%%%% Author:    J. Robert Buchanan
%%%% Address:   Department of Mathematics
%%%%		Millersville University
%%%%            P.O. Box 1002
%%%%            Millersville, PA 17551-0302
%%%% Phone:     717-871-7305
%%%% FAX:	717-871-7948
%%%% Email:     Robert.Buchanan@millersville.edu
%%%%
%%%% Date:      06/30/2022
%%%%
%%%% Purpose:   Laplace's Equation with Neumann Boundary Conditions
%%%%

\documentclass[10pt]{beamer}

\mode<presentation>
{
  %\usetheme{Warsaw}
  \usetheme{default}
  %\usetheme{CambridgeUS}
  % or ...

  %\setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}


\usepackage[english]{babel}
% or whatever

\usepackage[latin1]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}
% Or whatever. Note that the encoding and the font should match. If T1
% does not look nice, try deleting the line with the fontenc.


\title{Neumann Problems on Rectangles}
\subtitle{MATH 467 \textit{Partial Differential Equations}} % (optional)


\author % (optional, use only with lots of authors)
{J~Robert~Buchanan}
% - Use the \inst{?} command only if the authors have different
%   affiliation.

\institute[Millersville University of Pennsylvania]
% (optional, but mostly needed)
{
  Department of Mathematics
}
% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date{ % (optional)
Fall
%Spring
%Summer
\the\year}

\subject{Talks}
% This is only inserted into the PDF information catalog. Can be left
% out. 



% If you have a file called "university-logo-filename.xxx", where xxx
% is a graphic format that can be processed by latex or pdflatex,
% resp., then you can add a logo as follows:

% \pgfdeclareimage[height=0.5cm]{university-logo}{university-logo-filename}
% \logo{\pgfuseimage{university-logo}}



% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%\begin{frame}
%  \frametitle{Outline}
%  \tableofcontents
  % You might wish to add the option [pausesections]
%\end{frame}


% Since this a solution template for a generic talk, very little can
% be said about how it should be structured. However, the talk length
% of between 15min and 45min and the theme suggest that you stick to
% the following rules:  

% - Exactly two or three sections (other than the summary).
% - At *most* three subsections per section.
% - Talk about 30s to 2min per frame. So there should be between about
%   15 and 30 frames, all told.

%\section{Introduction}

\begin{frame}\frametitle{Objectives}

In this lesson we will learn:
\begin{itemize}
\item to solve Laplace's equation on two-dimensional domains with
  Neumann boundary conditions,
\item to compare the solutions on domains with Dirichlet boundary
  conditions to solution on domains with Neumann boundary conditions.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Boundary Value Problem}

Consider Laplace's equation on the rectangle $\Omega
= \{ (x, y) \, | \, 0 < x < a, \, 0 < y < b \}$ with Neumann boundary
conditions:
\begin{align*}
\triangle u	&= 0
\mbox{ for $(x, y) \in \Omega$}	\\
u_{y}(x, 0)	&= u_{y}(x, b) = 0
\mbox{ for $0 < x < a$}	\\
u_{x}(0,y) &= 0
\mbox{ for $0 < y < b$}	\\
u_{x}(a, y) &= f(y)
\mbox{ for $0 < y < b$.}
\end{align*}

\vspace*{0.10in}

\textbf{Physical Interpretation}:
the steady-state heat distribution in $\Omega$ when the rectangular
region is insulated along its bottom, top, and left edges and there is
a flow of heat on the right edge.

\end{frame}
%%

\begin{frame}\frametitle{Product Solutions}

Assume $u(x, y) = X(x) Y(y)$ solves Laplace's equation.
Separation of variables induces the following ODEs for $X(x)$ and
$Y(y)$.
\begin{align*}
X''(x) - \sigma X(x) &= 0
\mbox{ with $X'(0) = 0$}	\\
Y''(y) + \sigma Y(y) &= 0
\mbox{ with $Y'(0) = 0 = Y'(b)$,}
\end{align*}
where $\sigma$ is a constant.

\vspace*{0.10in}

Taking the second BVP, the only nontrivial solutions are:
\begin{align*}
Y_{n}(y) &= \cos \frac{n \pi y}{b}	\\
\sigma_{n} &= \frac{n^{2} \pi^{2}}{b^{2}}
\end{align*}
for $n = 0, 1, 2, \ldots$.

\vspace*{0.10in}

This implies $\displaystyle X_{n}(x) = \cosh \frac{n \pi x}{b}$ for $n
= 0, 1, 2, \ldots$.

\end{frame}
%%

\begin{frame}\frametitle{Series Solution}

The product solutions:
\[
u_{n}(x, y) = \cosh \frac{n \pi x}{b} \cos \frac{n \pi y}{b}
\mbox{ for $n = 0, 1, 2, \ldots$}
\]
solve Laplace's equation and satisfy the three homogeneous boundary
conditions.

\vspace*{0.10in}

By the Principle of Superposition,
\[
u(x, y)
	=
b_{0} + \sum_{n=1}^{\infty}
b_{n} \cosh \frac{n \pi x}{b} \cos \frac{n \pi y}{b}	.
\]

\vspace*{0.10in}

The coefficients $b_{n}$ can be determined from the remaining
nonhomogeneous boundary condition.

\end{frame}
%%

\begin{frame}\frametitle{Determining the Coefficients}

Differentiate the formal series solution and let $x = a$.
\[
u_{x}(a, y)
	=
\sum_{n=1}^{\infty}
b_{n} \left( \frac{n \pi}{b} \right) \sinh \frac{n \pi a}{b}
\cos \frac{n \pi y}{b} = f(y)
\]

\vspace*{0.10in}

\textbf{Remarks}:
\begin{itemize}
\item The coefficient $b_{0}$ was lost during the differentiation.
\item The infinite series can be regarded as a cosine series for
$f(y)$ if the integral of $f$ over $[0, b]$ vanishes, \textit{i.e.},
if
\[
\int_{0}^{b} f(y) \, dy = 0	.
\]
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Further Remarks}

\begin{itemize}
\item If $\displaystyle \int_{0}^{b} f(y) \, dy \ne 0$ then a solution
  to the BVP does not exist.
\item Consider the physics:
\begin{itemize}
\item If the definite integral vanishes then there is no net flux of heat
across the boundary at $x = a$ and hence a steady-state (time
independent) heat distribution can evolve.
\item If the definite integral does not vanish, then there is a net flux of
heat in or out of $\Omega$ and no time independent temperature
distribution can exist.
\end{itemize}
\item Even if the definite integral vanishes, the solution can be
  determined only up to the addition of an arbitrary constant.
Thus Laplace's equation on a rectangle with Neumann boundary
conditions on all four edges has no unique solution.
\item This type of boundary value problem is ill-posed.
\end{itemize}

\end{frame}
%%

\begin{frame}\frametitle{Assuming $\displaystyle \int_{0}^{b} f(y) \, dy = 0$}

\[
b_{n}
	=
\frac{2}{n \pi \sinh \frac{n \pi a}{b}}
\int_{0}^{b} f(y) \cos \frac{n \pi y}{b} \, dy	,
\]
for $n \in \mathbb{N}$.

\vspace*{0.10in}

\[
u(x, y)
	=
b_{0} + \sum_{n=1}^{\infty}
b_{n} \cosh \frac{n \pi x}{b} \cos \frac{n \pi y}{b}
\]
where $b_{0}$ is an arbitrary constant.

\end{frame}
%%

\begin{frame}\frametitle{Example}

Find a solution to the Neumann boundary value problem on the unit
square:
\begin{align*}
\triangle u	&= 0
\mbox{ for $0 < x < 1$ and $0 < y < 1$}	\\
u_{y}(x, 0)	&= u_{y}(x, 1) = 0
\mbox{ for $0 < x < 1$}	\\
u_{x}(0, y)	&= 0
\mbox{ for $0 < y < 1$}	\\
u_{x}(1, y)	&= y - 1/2
\mbox{ for $0 < y < 1$.}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Solution (1 of 2)}

Check: $\displaystyle \int_{0}^{1} \left( y - \frac{1}{2} \right) \,
dy = \left[ \frac{y^{2}}{2} - \frac{y}{2} \right]_{y=0}^{y=1} = 0$.

\vspace*{0.10in}

Using the Euler-Fourier coefficient formula:
\begin{align*}
b_{n}
	&=
\frac{2}{n \pi \sinh (n \pi)}
\int_{0}^{1} \left( y - \frac{1}{2} \right) \cos (n \pi y) \, dy	\\
	&=
\frac{-2}{n^{2} \pi^{2} \sinh (n \pi)}
\int_{0}^{1} \sin (n \pi y) \, dy	\\
	&=
\frac{2 ((-1)^{n} - 1)}{n^{3} \pi^{3} \sinh (n \pi)}	.
\end{align*}

\[
u(x, y) = b_{0} - \frac{4}{\pi^{3}} \sum_{n=1}^{\infty}
\frac{\cosh ((2n-1) \pi x) \cos ((2n-1) \pi y)}{(2n-1)^{3} \sinh ((2n-1) \pi)}
\]
where $b_{0}$ is an arbitrary constant.

\end{frame}
%%

\begin{frame}\frametitle{Solution (2 of 2)}

\begin{center}
\resizebox{0.90\textwidth}{!}{\includegraphics{example01}}
\end{center}

\end{frame}
%%

\begin{frame}\frametitle{General Case}

Consider Laplace's equation on a rectangle with Neumann BCs on all
four edges.
\begin{align*}
u_{xx} + u_{yy} &= 0
\mbox{ for $(x, y) \in R$}	\\
u_{x}(0, y) &= g_{1}(y)
\mbox{ for $0 < y < b$}	\\
u_{x}(a, y) &= g_{2}(y)
\mbox{ for $0 < y < b$}	\\
u_{y}(x, 0) &= f_{1}(x)
\mbox{ for $0 < x < a$}	\\
u_{y}(x, b) &= f_{2}(x)
\mbox{ for $0 < x < a$}
\end{align*}
This BVP can be decomposed into four sub-problems with homogeneous
boundary conditions on three edges.

\end{frame}
%%

\begin{frame}\frametitle{Sub-Problems}
\fontsize{9pt}{10.8}\selectfont

\begin{align*}
\begin{array}{rcl}
\triangle u_{1} & = & 0
\mbox{ for $(x, y) \in R$}	\\
(u_{1})_{x}(0, y) & = & g_{1}(y)
\mbox{ for $y \in (0,b)$}	\\
(u_{1})_{x}(a, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{1})_{y}(x, 0) & = & 0
\mbox{ for $x \in (0,a)$}	\\
(u_{1})_{y}(x, b) & = & 0
\mbox{ for $x \in (0,a)$}
\end{array}
	&\quad
\begin{array}{rcl}
\triangle u_{2} & = & 0
\mbox{ for $(x, y) \in R$}	\\
(u_{2})_{x}(0, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{2})_{x}(a, y) & = & g_{2}(y)
\mbox{ for $y \in (0,b)$}	\\
(u_{2})_{y}(x, 0) & = & 0
\mbox{ for $x \in (0,a)$}	\\
(u_{2})_{y}(x, b) & = & 0
\mbox{ for $x \in (0,a)$}
\end{array}	\\
%
\mathstrut &\quad \mathstrut	\\
%
\begin{array}{rcl}
\triangle u_{3} & = & 0
\mbox{ for $(x, y) \in R$}	\\
(u_{3})_{x}(0, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{3})_{x}(a, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{3})_{y}(x, 0) & = & f_{1}(y)
\mbox{ for $x \in (0,a)$}	\\
(u_{3})_{y}(x, b) & = & 0
\mbox{ for $x \in (0,a)$}
\end{array}
	&\quad
\begin{array}{rcl}
\triangle u_{4} & = & 0
\mbox{ for $(x, y) \in R$}	\\
(u_{4})_{x}(0, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{4})_{x}(a, y) & = & 0
\mbox{ for $y \in (0,b)$}	\\
(u_{4})_{y}(x, 0) & = & 0
\mbox{ for $x \in (0,a)$}	\\
(u_{4})_{y}(x, b) & = & f_{2}(y)
\mbox{ for $x \in (0,a)$}
\end{array}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Solutions to the Sub-Problems}

\begin{align*}
u_{1}(x, y)
	&=
a_{0} + \sum_{n=1}^{\infty}
a_{n} \cosh \frac{n \pi (a - x)}{b} \cos \frac{n \pi y}{b}	\\
u_{2}(x, y)
	&=
b_{0} + \sum_{n=1}^{\infty}
b_{n} \cosh \frac{n \pi x}{b} \cos \frac{n \pi y}{b}	\\
u_{3}(x, y)
	&=
c_{0} + \sum_{n=1}^{\infty}
c_{n} \cos \frac{n \pi x}{a} \cosh \frac{n \pi (b - y)}{a}	\\
u_{4}(x, y)
	&=
d_{0} + \sum_{n=1}^{\infty}
d_{n} \cos \frac{n \pi x}{a} \cosh \frac{n \pi y}{a}
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Series Coefficients}

Provided $\int_{0}^{b} g_{1}(y) \, dy = \int_{0}^{b} g_{2}(y) \, dy =
0$ and $\int_{0}^{a} f_{1}(x) \, dx = \int_{0}^{a} f_{2}(x) \, dx =
0$, then
\begin{align*}
a_{n}	&= \frac{-2}{n \pi \sinh \frac{n \pi a}{b}}
\int_{0}^{b} g_{1}(y) \cos \frac{n \pi y}{b} \, dy	\\
b_{n}	&= \frac{2}{n \pi \sinh \frac{n \pi a}{b}}
\int_{0}^{b} g_{2}(y) \cos \frac{n \pi y}{b} \, dy	\\
c_{n}	&= \frac{-2}{n \pi \sinh \frac{n \pi b}{a}}
\int_{0}^{a} f_{1}(x) \cos \frac{n \pi x}{a} \, dx	\\
d_{n}	&= \frac{2}{n \pi \sinh \frac{n \pi b}{a}}
\int_{0}^{a} f_{2}(x) \cos \frac{n \pi x}{a} \, dx	.
\end{align*}

The solution to the original BVP is then
\[
u(x, y) = u_{1}(x, y) + u_{2}(x, y) + u_{3}(x, y) + u_{4}(x, y)	.
\]

\end{frame}
%%

\begin{frame}\frametitle{Neumann Problems on Disks}

Consider Laplace's equation on the disk of radius $a > 0$:
\begin{align*}
\triangle u	&= 0
\mbox{ for $x^{2} + y^{2} < a^{2}$}	\\
\frac{\partial u}{\partial \mathbf{n}}(x, y)	&= \phi(x,y)
\mbox{ for $x^{2} + y^{2} = a^{2}$.}
\end{align*}
$\partial u/\partial \mathbf{n}$ denotes the derivative
in the direction of the
unit outward normal vector to the boundary.

\vspace*{0.10in}

\uncover<2->{%
Convert to polar coordinates.
\begin{align*}
v_{rr} + \frac{1}{r} v_{r} + \frac{1}{r^{2}} v_{\theta\theta} &= 0
\mbox{ for $0 < r < a$ and $-\infty < \theta < \infty$}	\\
\frac{\partial v}{\partial r}(a, \theta)
	&=\phi(a \cos \theta, a \sin \theta) = f(\theta)
\mbox{ for $-\infty < \theta < \infty$.}
\end{align*}
}

\end{frame}
%%

\begin{frame}\frametitle{Series Solution}

The formal series solution can be written as
\[
v(r, \theta)
	=
d_{0} + \sum_{n=1}^{\infty}
r^{n} [ c_{n} \cos (n \theta) + d_{n} \sin (n \theta) ]	,
\]
with coefficients $d_{0}$, $c_{n}$, and $d_{n}$ chosen such that
\[
v_{r}(a, \theta) =
\sum_{n=1}^{\infty} n a^{n-1}
[ c_{n} \cos (n \theta) + d_{n} \sin (n \theta) ] =
f(\theta)	.
\]
A necessary condition for the solution to
exist is
\[
\int_{-\pi}^{\pi} f(\theta) \, d\theta =
\int_{-\pi}^{\pi} \phi(a \cos \theta, a \sin \theta) \, d\theta = 0	.
\]

\end{frame}
%%

\begin{frame}\frametitle{Series Coefficients}

\begin{align*}
c_{n}
	&=
\frac{a^{1-n}}{n \pi} \int_{-\pi}^{\pi} f(\theta) \cos (n \theta) \, d\theta	\\
d_{n}
	&=
\frac{a^{1-n}}{n \pi} \int_{-\pi}^{\pi} f(\theta) \sin (n \theta) \, d\theta	.
\end{align*}

\vspace*{0.10in}

\textbf{Remark}:
Coefficient $d_{0}$ can be chosen arbitrarily and thus the solution to
Laplace's equation on a disk with Neumann boundary conditions is not
unique.

\end{frame}
%%

\begin{frame}\frametitle{Example}

Find a bounded solution to Laplace's equation on $\Omega = \left\{
  (r, \theta) \, | \, 0 \le r < 1 \right\}$ that satisfies the Neumann
boundary condition,
\[
u_{r}(1, \theta) = f(\theta) = \theta	,
\]

\end{frame}
%%

\begin{frame}\frametitle{Solution (1 of )}

The solution can be written as
\[
u(r, \theta) = d_{0} + \sum_{n=1}^{\infty}
r^{n} [ c_{n} \cos (n \theta) + d_{n} \sin (n \theta) ]	.
\]

The boundary condition implies
\[
u_{r}(1, \theta)
	=
\sum_{n=1}^{\infty}
n \,  c_{n} \cos (n \theta) + n \, d_{n} \sin (n \theta) ]
	=
\theta	.
\]

Applying the Euler-Fourier formula:
\begin{align*}
n \, c_{n}
	&=
\frac{1}{\pi} \int_{-\pi}^{\pi} \theta \, \cos (n \theta) \,  d\theta
	= 0	\\
n \, d_{n}
	&=
\frac{1}{\pi} \int_{-\pi}^{\pi} \theta \, \sin (n \theta) \,  d\theta	\\
	&=
\left[ \frac{-\theta}{n \pi} \cos (n \theta)
              \right]_{\theta=-\pi}^{\theta=\pi} +
\frac{1}{n \pi} \int_{-\pi}^{\pi} \cos (n \theta) \, d\theta	\\
d_{n}	&=
\frac{-2 (-1)^{n}}{n^{2}}	.
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Solution (2 of )}

\[
u(r, \theta)
	=
d_{0} - 2 \sum_{n=1}^{\infty}
\frac{(-1)^{n} r^{n}}{n^{2}} \sin (n \theta)	.
\]

\begin{center}
\resizebox{0.80\textwidth}{!}{\includegraphics{example02}}
\end{center}

\end{frame}
%%

\begin{frame}\frametitle{Homework}

\begin{itemize}
\item Read Sections $6.5$ and $6.6$
\item Exercises: 20--23
\end{itemize}

\end{frame}
%%

%%%
\end{document}

%%%%
%%%% EOF
%%%%
