\magnification = \magstep1
\overfullrule=0pt
\centerline{Mathematics 173 -- Applied Mathematics 1}
\centerline{Lab/Problem Set 4}
\centerline{October 19, 1999}
\bigskip
\noindent
{\it Background and Review}
\bigskip
Before the midterm, we worked out some first examples of solutions
to boundary value problems for the 1D Heat Equation where the 
ends of the rod were held at zero temperature:
$$\cases{u_t = ku_{xx}&\cr
         u(x,0) = f(x)&\cr
         u(0,t) = 0&\cr
         u(L,t) = 0&\cr}\leqno(1)$$
Our method was the {\it separation of variables\/} technique:
\bigskip
\item{1)}  We looked first for ``product'' solutions of the heat equation,
that is:
$u(x,t) = G(t)\phi(x)$ satisfying $u_t = k u_{xx}$.  This led
to the two ordinary differential equations:
$${dG\over dt} = -k\lambda G\quad 
{\rm and}\quad  {d^2\phi\over dx^2} = -\lambda\phi,$$
from which we saw that
$$\eqalign{G(t) &= c e^{-k\lambda t}\cr
\phi(x) &= 
\cases{
c_1\cos(\sqrt{\lambda}x)+c_2\sin(\sqrt{\lambda}x)& if $\lambda > 0$\cr
c_1 x + c_2 & if $\lambda = 0$\cr
c_1\cosh(\sqrt{-\lambda}x)+c_2\sinh(\sqrt{-\lambda}x)& if $\lambda < 0$\cr}\cr}\leqno(2)$$
\item{2)}  Solutions satisfying the 
boundary conditions $u(0,t) = 0$ and $u(L,t) = 0$ are only possible in 
the case $\lambda > 0$, and we get the corresponding {\it eigenvalues}
$\lambda = \left({n\pi \over L}\right)^2$
and {\it eigenfunctions} $\sin(\sqrt{\lambda}x) = \sin\left({n\pi x\over L}\right)$.
\item{3)}  Then, to get a solution of (1) (including the initial condition
$u(x,0) = f(x)$, we proceed as follows.  If $f(x)$ is given by the 
{\it Fourier series expansion\/}
$$f(x) = \sum_{n=1}^\infty B_n \sin\left({n\pi x\over L}\right),$$
then our solution is
$$u(x,t) = \sum_{n=1}^\infty B_n 
e^{-k \left({n\pi x\over L}\right)^2 t} \sin\left({n\pi x\over L}\right).\leqno(3)$$
\item{4)} The Fourier coefficients $B_n$ are found by the following formula (consequence
of the orthogonality relation for the functions $\sin\left({n\pi x\over L}\right)$
$$B_n = {2\over L}\int_0^L f(x) \sin\left({n\pi x\over L}\right)\ dx.$$
\bigskip
Today, we want to work out another example like the one we saw in class
on 10/5 using Maple, then see how the method outlined above can {\it also}
be used to solve other types of boundary value problems.
\bigskip
\noindent
{\it Lab and Problem Set Questions}
\bigskip
\noindent
I.  In this question we will consider the BVP as in (1) with $k = 0.01$ (this 
means intuitively that heat energy diffuses relatively {\it slowly} through
the material making up this rod), and $L = 10$:
$$\cases{u_t = (.01)u_{xx}&\cr
         u(x,0) = 40 e^{-10(x-3)^2} + 20e^{-20(x-8)^2}&\cr
         u(0,t) = 0&\cr
         u(10,t) = 0&\cr}\leqno(1)$$
You will follow what we did in class on 10/5 (there is also a copy of that 
Maple worksheet on the course homepage -- 
{\tt http://math.holycross.edu/\~{}little/Applied9900/AM199.html} -- for you to consult
as needed).
\item{A)}  Compute the Fourier coefficient $B_n$ as a function of $n$
for this initial temperature function, using numerical integration.  First
define the initial temperature function $f(x)$, then use:
\medskip
\centerline{\tt B := n -> evalf((1/5)*Int(f(x)*sin(n*Pi*x/10),x=0..10));}
\medskip
\item{} (Technical Maple note:  The capital ``I'' on the integrate function is 
important here.  Maple has capitalized versions of a number of its basic functions.  
These are ``inert'' functions that are not evaluated immediately.  Here by placing
the ``inert'' integrate command {\it inside} the call to {\tt evalf}, you 
are saying: compute the definite integral using an approximate numerical
technique -- {\it don't try to evaluate the integral symbolically first\/}.)
\item{B)}  Plot the partial sums 
$$\sum_{n=1}^N B_n \sin\left({n\pi x\over 10}\right)$$
of the Fourier series of $f$ together with $f$ itself
for several increasing values of $N$, until you see good agreement in the plots.
(Note: As you increase $N$, these plots will take more time for Maple to compute, because
the evaluation of the $B_n$ is computationally intensive.  Be patient!)
\item{C)}  When you find a $k$ that gives good agreement with the initial
temperature function $f(x)$ in part B, make the corresponding partial sum
of the series expansion (3) for the solution $u(x,t)$, and plot that as a function
of $x,t$.  Describe how the temperature throughout the rod evolves over time.
What happens as $t \to \infty$, and why?
\bigskip
\noindent
II.  In this problem, we will consider a different type of BVP for the 1D heat
equation.  Instead of having the ends of the rod maintained at zero temperature,
suppose now that the ends of the rod are {\it insulated}.  As we have seen, 
this corresponds to the problem:
$$\cases{u_t = ku_{xx}&\cr
         u(x,0) = f(x)&\cr
         u_x(0,t) = 0&\cr
         u_x(L,t) = 0&\cr}\leqno(4)$$
Let $k = 0.01, L = 10$, and $f(x) = 40 e^{-10(x-3)^2} + 20e^{-20(x-8)^2}$
as in question I.
\item{A)}  The separation of variables works exactly the same way as above here
(because the boundary conditions have not been used yet), and 
we get the product solutions $u(x,t) = G(t)\phi(x)$ as in (2) above.  Now,
show using the boundary conditions $u_x(0,t) = 0, u_x(L,t) = 0$ that
the corresponding eigenvalues and eigenfunctions are $\lambda = 0$, $\phi(x) = 1$
and $\lambda = \left({n\pi\over L}\right)^2$, $\phi = \cos\left({n\pi x\over L}\right)$
for all integers $n \ge 1$.
(This is the same as 2.3.2 part c, from Problem Set 3.)
\item{B)}  To follow what we did before in the case where the ends of the
rod were maintained at zero temperature, now we have to try to expand the 
initial temperature function $f(x)$ in terms of the eigenfunctions 
$1, \cos\left({n\pi x\over L}\right)$:
$$f(x) = A_0 + \sum_{n=1}^\infty A_n \cos\left({n\pi x\over L}\right).$$
\itemitem{1)}  Do problem 2.3.6 from the text.
\itemitem{2)}  Show that the result from 1 (2.3.6) leads to the following formulas:
$$\cases{A_0 = {1\over L}\int_0^L f(x)\ dx&\cr
         A_n = {2\over L}\int_0^L f(x)\cos\left({n\pi x\over L}\right)\ dx&if $n \ge 1$\cr}$$
\item{C)}  Compute the Fourier coefficients $A_0$ and $A_n$ as a function of $n$
for this initial temperature function, using numerical integration.  (Follow what
you did in I, part A.)
\item{D)}  Plot the partial sums 
$$A_0 + \sum_{n=1}^N A_n \cos\left({n\pi x\over L}\right)$$
of the Fourier series of $f$ together with $f$ itself
for several increasing values of $N$, until you see good agreement in the plots.
\item{E)}  When you find a $N$ that gives good agreement with the initial
temperature function $f(x)$ in part D, make the corresponding partial sum
of the series expansion for the solution $u(x,t)$ (you'll need to figure
out what that should look like), and plot that as a function
of $x,t$.  Describe how the temperature throughout the rod evolves over time.
What happens as $t \to \infty$, and why?
\bigskip
\noindent
III.  {\it (Note: Most of this problem will require ``pencil and paper''
work rather than Maple calculations.  You will use Maple only for the final
part E.)}
The 2D Laplace Equation is
$u_{xx} + u_{yy} = 0$.  The solutions of this equation represent 
{\it equilibrium temperature distributions} in 2D heat conduction problems.
Suppose we have a rectangular $L \times H$ thin metal plate in the shape of
$\{(x,y) : 0 \le x \le L, 0 \le y \le H\}$.  Suppose the two edges
of the rectangle with $x = 0$ and $x = L$ are {\it insulated\/}, while
the temperature along the edge $y = 0$ is maintained at $0$, 
and the temperature at the point $(x,H)$ on the edge $y = H$ is given by 
a given function $f(x)$.  
\item{A)} Explain why the conditions above are equivalent to the BVP
$$\cases{u_{xx} + u_{yy} = 0&\cr
         u_x(0,y) = 0&for all $y$, $0 \le y \le H$\cr
         u_x(L,y) = 0&for all $y$\cr
         u(x,0) = 0&\cr
         u(x,H) = f(x)&\cr}$$
\item{B)}  To solve a problem of this form, we will apply the same
separation of variables idea.  Consider a function $u(x,y) = h(x)\phi(y)$.
Show that a function of this form satisfies Laplace's equation 
if and only if 
$${d^2h\over dx^2} = -\lambda h\quad {\rm and}\quad {d^2\phi\over dy^2} = \lambda\phi$$
(This the same as 2.3.1, part c from Problem Set 3.)
\item{C)}  Because of the form of these separated equations, we can use (2) 
in each variable.
\itemitem{1)}  Use the boundary conditions $u_x(0,y) = 0$ and $u_x(L,y)$
to show that $\lambda \ge 0$ is the only possibility, and that
the $x$ eigenfunctions are $h(x) = 1, \cos\left({n\pi x\over L}\right)$
with corresponding eigenvalues $\lambda = 0, \left({n\pi\over L}\right)^2$.
\itemitem{2)}  Now we will use the boundary condition $u(x,0) = 0$.
If $\lambda = 0$, show that the corresponding function $\phi(y)$
must be $\phi(y) = C_0 y$ for some constant $C_0$.  
If $\lambda = \left({n\pi\over L}\right)^2$, $n \ge 1$, 
show that the only corresponding eigenfunctions $\phi(y)$ are
$C_n \sinh\left({n\pi y\over L}\right)$  for some constant $C_n$.
This gives product solutions
$1\cdot y$, and $\cos\left({n\pi x\over L}\right)\sinh\left({n\pi x\over L}\right)$
satisfying the first three boundary conditions.
\item{D)}  Taking a linear superposition of the functions found in part
C gives an expansion of the form:
$$u(x,y) = C_0y + 
\sum_{n=1}^\infty C_n \cos\left({n\pi x\over L}\right)\sinh\left({n\pi y\over L}\right)\leqno(5)$$
Note that we have not used the last boundary condition $u(x,H) = f(x)$
yet!  If we substitute $y = H$ into the expansion above, we get
$$u(x,H) = C_0 H + \sum_{n=1}^\infty C_n \cos\left({n\pi x\over L}\right)\sinh\left({n\pi H\over L}\right)$$
By comparing this with the Fourier cosine expansion of 
$f(x)$ as in question II:
$$f(x) = A_0 + \sum_{n=1}^\infty A_n \cos\left({n\pi x\over L}\right),$$
explain how to determine the $C_n$ in (5).
\item{E)}  Suppose $L = 10$, $H = 5$, and $f(x) = x(10-x)$. Determine the corresponding
solution of Laplace's Equation, find a partial sum of the series
that approximates the function $f$ reasonably well, and plot using Maple.
\bigskip
\noindent
{\it Assignment}
\bigskip
Individual write-ups due Tuesday, October 26.

\bye
