%%%%		-*- 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:      02/14/2025
%%%%
%%%% Purpose:   Laplace's equation on rectangle with Mixed BCs
%%%%

\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{Mixed Boundary Conditions on Rectangles}
\subtitle{\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 to:
\begin{itemize}
\item solve Laplace's equation on a rectangle with mixed Dirichlet and
  Neumann boundary conditions,
\item periodically extend boundary conditions to obtain Fourier series
  solution containing just even-indexed or just odd-indexed terms.
\end{itemize}

\end{frame}
%%

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

Consider the following mixed boundary value problem on a
rectangle in the $xy$-plane:
\begin{align*}
\Delta u
	&= 0
\mbox{ for $0 < x < a$ and $0 < y < b$}	\\
u(x, 0)
	&= 0
\mbox{ for $0 < x < a$}	\\
u_{y}(x, b)
	&= 0
\mbox{ for $0 < x < a$}	\\
u(0, y)
	&= 0
\mbox{ for $0 < y < b$}	\\
u(a, y)
	&= f(y)
\mbox{ for $0 < y < b$.}
\end{align*}

\textbf{Physical Interpretation}:
the left and
bottom edges of the rectangle are kept at temperature 0, the top edge
is insulated, and along the right edge the distribution of temperature
has been specified as $f(y)$.

\end{frame}
%%

\begin{frame}\frametitle{Separation of Variables (1 of 2)}

Assume a product solution $u(x, y) = X(x) Y(y)$, then the following
ODEs and BCs are induced:
\begin{align*}
X''(x) - \sigma X(x)
	&= 0
\mbox{ for $0 < x < a$}	\\
X(0)
	&= 0	,
\end{align*}
and
\begin{align*}
Y''(y) + \sigma Y(y)
	&= 0
\mbox{ for $0 < y < b$}	\\
Y(0)
	&= Y'(b)
	= 0	,
\end{align*}
where $\sigma$ is a constant.

The only non-trivial solutions for $Y(y)$ occur when
$\sigma = \sigma_{n} = ((2n-1) \pi/(2 b))^{2}$ and
\[
Y_{n}(y)
	= \sin \frac{(2n-1) \pi y}{2 b}
\mbox{ for $n \in \mathbb{N}$.}
\]

\end{frame}
%%

\begin{frame}\frametitle{Separation of Variables (2 of 2)}

Substituting $\sigma_{n}$ into the ODE for $X(x)$ produces
\[
X_{n}(x)
	= \sinh \frac{(2n-1) \pi x}{2 b}	.
\]

\vspace*{0.10in}

The product solutions have the form:
\[
u_{n}(x, y)
	= \sinh \frac{(2n-1) \pi x}{2 b} \sin \frac{(2n-1) \pi y}{2 b}
\]

\vspace*{0.10in}

Using the Principle of Superposition, the formal solution to the BVP
can be expressed as,
\[
u(x, y)
	= \sum_{n=1}^{\infty}
c_{n} \sinh \frac{(2n-1) \pi x}{2 b} \sin \frac{(2n-1) \pi y}{2 b}	.
\]

The nonhomogeneous BC can be used to determine
coefficients $c_{n}$.

\end{frame}
%%

\begin{frame}\frametitle{Boundary Condition at $x = a$}

\[
u(a, y)
	= \sum_{n=1}^{\infty}
c_{n} \sinh \frac{(2n-1) \pi a}{2 b} \sin \frac{(2n-1) \pi y}{2 b} =
f(y)
\]

\textbf{Remark}:
In order to determine the coefficients $c_{n}$,
$f(y)$ must be extended in such
a way that the even-indexed Fourier sine coefficients vanish.

\vspace*{0.10in}

\uncover<2->{%
Extend $f(y)$ to the interval $[-2b, 2b]$ as $f_{o}(y)$ where
\[
f_{o}(y)
	= \left\{ \begin{array}{ll}
-f(2b+y)	& \mbox{if $-2b \le y \le -b$,}	\\
-f(-y)	& \mbox{if $-b \le y \le 0$,}	\\
f(y)	& \mbox{if $0 \le y \le b$}	\\
f(2b-y)	& \mbox{if $b \le y \le 2b$.}
\end{array} \right. 
\]
}

\end{frame}
%%

\begin{frame}\frametitle{Fourier Coefficients}

The Fourier sine series representation of $f_{o}(y)$ is calculated as
\[
f_{o}(y)
	\sim \sum_{m=1}^{\infty} \beta_{m} \sin \frac{(2m-1) \pi y}{2 b}	.
\]
Multiply both sides by $\displaystyle \sin \frac{(2n-1) \pi y}{2 b}$
and integrate over $[0, b]$.
\begin{align*}
\int_{0}^{b} f_{o}(y) \sin \frac{(2n-1) \pi y}{2 b} \, dy
	&= \sum_{m=1}^{\infty} \beta_{m} \int_{0}^{b} \sin
   \frac{(2m-1) \pi y}{2 b} \sin \frac{(2n-1) \pi y}{2 b} \, dy	\\
	&= \beta_{n} \left( \frac{b}{2} \right)
\mbox{ (orthogonality)}	\\
\beta_{n}
	&= \frac{2}{b} \int_{0}^{b} f(y) \sin \frac{(2n-1) \pi y}{2 b} \, dy
\end{align*}

The coefficients $c_{n}$ of the series representation of $f(y)$
should be chosen as
\[
c_{n}
	= \frac{2}{b \sinh \frac{(2n-1) \pi a}{2 b}}
\int_{0}^{b} f(y) \sin \frac{(2n-1) \pi y}{2 b} \, dy	.
\]

\end{frame}
%%

\begin{frame}\frametitle{Example}

Find the solution to Laplace's equation with mixed boundary conditions
below.
Interpret this boundary value
problem in the context of a steady-state solution to the heat equation
on a rectangular plate.
\begin{align*}
\Delta u
	&= 0
\mbox{ for $0 < x < 2$ and $0 < y < 1$}	\\
u(0, y)
	&= 0
\mbox{ for $0 < y < 1$}	\\
u(2, y)
	&= y (1-y)
\mbox{ for $0 < y < 1$}	\\
u(x, 0)
	&= u_{y}(x, 1) = 0
\mbox{ for $0 < x < 2$}
\end{align*}

\end{frame}
%%

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

\textbf{Physical Interpretation}:
the domain $\Omega = \{ (x, y) \, | \, 0 < x < 2, \, 0 < y < 1 \}$ is
a rectangle whose left and bottom edges are kept at constant
temperature $0$ (perhaps by being in perfect thermal contact with
ice).
The top edge is insulated so that no heat flows out the top of the
rectangle.
The right edge of the rectangle is in perfect thermal contact with a
heat source with temperature distribution given by $f(y) = y (1- y)$.

\end{frame}
%%

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

As derived previously, the formal solution has the form,
\[
u(x, y)
	= \sum_{n=1}^{\infty}
c_{n} \sinh \frac{(2n-1) \pi x}{2} \sin \frac{(2n-1) \pi y}{2}	,
\]
since $b = 1$.

\vspace*{0.10in}

At the boundary where $a = 2$,
\[
u(2, y)
	= \sum_{n=1}^{\infty}
c_{n} \sinh ((2n-1) \pi) \sin \frac{(2n-1) \pi y}{2} = y (1-y)	.
\]

\vspace*{0.10in}

The coefficients $c_{n}$ are calculated as
\begin{align*}
c_{n} \sinh ((2n-1) \pi)
	&= 2 \int_{0}^{1} f(y) \sin \frac{(2n-1) \pi y}{2} \, dy	\\
	&= 2 \int_{0}^{1} y (1-y) \sin \frac{(2n-1) \pi y}{2} \, dy	\\
	&= \frac{8 (4 + (-1)^{n} (2n-1) \pi)}{(2n-1)^{3} \pi^{3}}	.
\end{align*}

\end{frame}
%%

\begin{frame}\frametitle{Solution (3 of 4)}

The solution to the boundary value problem can be
expressed as
\[
u(x, y)
	= \frac{8}{\pi^{3}} \sum_{n=1}^{\infty}
\frac{4 + (-1)^{n} (2n-1) \pi}{(2n-1)^{3} \sinh ((2n-1) \pi)} \sinh
\frac{(2n-1) \pi x}{2} \sin \frac{(2n-1) \pi y}{2}	.
\]

\end{frame}
%%

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

\begin{center}
\resizebox{1.00\textwidth}{!}{\includegraphics{example13}}
\end{center}

\end{frame}
%%

\begin{frame}\frametitle{Example}

Consider the boundary value problem:
\begin{align*}
\Delta u
	&= 0
\mbox{ for $0 < x < 1$ and $0 < y < 1$}	\\
u(x, 0)
	&= u_{y}(x, 1) = 0
\mbox{ for $0 < x < 1$}	\\
u(0, y)
	&= 0
\mbox{ for $0 < y < 1$}	\\
u_{x}(1, y)
	&= y
\mbox{ for $0 < y < 1$.}
\end{align*}
Find a solution to Laplace's equation with these mixed boundary
conditions.

\end{frame}
%%

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

Assuming a product solution $u(x, y) = X(x) Y(y)$, differentiating, and
separating the variables implies the following ODEs and
BCs (with $\sigma$ constant).
\begin{align*}
X''(x) - \sigma X(x)
	&= 0
\mbox{ with $X(0) = 0$}	\\
Y''(y) + \sigma Y(y)
	&= 0
\mbox{ with $Y(0) = 0$ and $Y'(1) = 0$.}
\end{align*}

\vspace*{0.10in}

The non-trivial solutions to the latter equation occur when
\begin{align*}
\sigma_{n}
	&= \left( \frac{(2n-1) \pi}{2} \right)^{2}	\\
Y_{n}(y)
	&= \sin \left( \frac{(2n-1) \pi y}{2} \right)
\end{align*}
for $n \in \mathbb{N}$.

\end{frame}
%%

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

Solving the first BVP 
yields
\[
X_{n}(x)
	= \sinh ((2n-1) \pi x/2)	.
\]

Hence the product solutions take the form
\[
u_{n}(x, y)
	= \sinh \frac{(2n-1) \pi x}{2} \sin \frac{(2n-1) \pi y}{2}
\mbox{ for $n \in \mathbb{N}$.}
\]

\vspace*{0.10in}

Using the Principle of Superposition, the formal solution to
Laplace's equation can be written as
\[
u(x, y)
	= \sum_{n=1}^{\infty}
c_{n} \sinh \frac{(2n-1) \pi x}{2} \sin \frac{(2n-1) \pi y}{2}	.
\]

The coefficients $c_{n}$ must be determined from the nonhomogeneous
BC.

\end{frame}
%%

\begin{frame}\frametitle{Solution (3 of 5)}

At the boundary where $x = 1$,
\[
u_{x}(1, y)
	= \sum_{n=1}^{\infty}
\frac{(2n-1) \pi}{2} c_{n} \cosh \frac{(2n-1) \pi}{2}
\sin \frac{(2n-1) \pi y}{2} = y	.
\]

Therefore, $c_{n}$ must be chosen so that
\begin{align*}
\frac{(2n-1) \pi}{2} c_{n} \cosh \frac{(2n-1) \pi}{2}
	&= 2 \int_{0}^{1} y \sin \frac{(2n-1) \pi y}{2} \, dy	\\
	&= \frac{8 (-1)^{n+1}}{(2n-1)^{2} \pi^{2}}	\\
c_{n}
	&= \frac{16 (-1)^{n+1}}{(2n-1)^{3} \pi^{3} \cosh \frac{(2n-1) \pi}{2}}
\end{align*}
for $n \in \mathbb{N}$.

\end{frame}
%%

\begin{frame}\frametitle{Solution (4 of 5)}

The formal solution to the boundary value problem can be expressed as
\[
u(x, y)
	= \frac{16}{\pi^{3}} \sum_{n=1}^{\infty}
\frac{(-1)^{n+1}}{(2n-1)^{3} \cosh \frac{(2n-1) \pi}{2}}
\sinh \frac{(2n-1) \pi x}{2} \sin \frac{(2n-1) \pi y}{2}	.
\]

\end{frame}
%%

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

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

\end{frame}
%%

%\begin{frame}\frametitle{Homework}

%\begin{itemize}
%\item Read Section $6.7$
%\item Exercises: 24, 25
%\end{itemize}

%\end{frame}
%%

%%%
\end{document}

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