## The Heat Equation on the bounded interval $[0,L]$

The PDE is $u_t = D \, u_{xx}$

### First type of Dirichlet boundary conditions: $u(0,t)=u(L,t)=1$

The steady state solution is constant: $u_{ss}(x)=1$.

#### First example: eigenmodes

The initial data are the $k=1$, $k=2$, and $k=3$ modes: $u(x,0)= 1 + \sin(\pi x/L)$, $u(x,0) = 1 + \sin(2 \pi x/L)$, and $u(x,0)=1 + \sin(3 \pi x/L)$

The resultant solutions are \begin{align*} u(x,t) &= 1 + e^{-D \, (\pi/L)^2 t} \, \sin(\pi x/L)\\ u(x,t) &= 1 + e^{-D (2 \pi/L)^2 t} \, \sin(2 \pi x/L)\\ u(x,t) &= 1 + e^{-D (3 \pi/L)^2 t} \, \sin(3 \pi x/L) \end{align*}

The steady state is denoted with a dashed line.

Note that the $k=3$ mode decays faster than the $k=2$ mode which decays faster than the $k=1$ mode.

#### Second example: random initial data

The initial data is chosen by choosing random numbers and then multiplying them by $\sin(k \pi x/L)$ for $k=1$ to $20$.

The steady state is denoted with a dashed line.

Note that the $k=1$ mode decays the slowest and as the solution relaxes it looks more and more like a multiple of $\sin(\pi x/L)$.

#### Third example: top hat initial data

The initial data is a discontinuous function: $$u(x,0)= \begin{cases} 1 & \mbox{if L/4 < x < L/2} \\ 0 & \mbox{otherwise} \end{cases}$$

The steady state $u_{ss}(x)=1$ is denoted with a dashed line.

Note that the solution instantaneously smooths. The regions that were flat in the initial data appear to "take a while" to stop being flat if you look away from the two discontinuities. (In reality, there’s infinite speed of propagation and there’s no flatness anywhere, it’s just that our eye can’t see the deviation at first.) The boundary condition is driving the solution down to the steady state; note that the $x=0$ boundary is "felt" by the solution before the $x=L$ boundary. Again, this has to do with infinite speed of propagation and how the "width" of the fundamental solution depends on time.

#### Fourth example: witch’s hat initial data

The initial data is a “witch’s hat”. The solution is provided for your amusement; I have nothing to say that I didn’t say for the solution with top-hat initial data.

The steady state $u_{ss}(x)=1$ is denoted with a dashed line.

### Second type of Dirichlet boundary conditions: $u(0,t)=1$ and $u(L,t)=2$

The steady state solution is a line: $u_{ss}(x) =1 + x/L$

#### First example: eigenmodes

The initial data are the $k=1$, $k=2$, and $k=3$ modes: $u(x,0) = u_{ss}(x) + \sin(\pi x/L)$, $u(x,0) = u_{ss}(x) + \sin(2 \pi x/L)$, and $u(x,0) = u_{ss}(x) + \sin(3 \pi x/L)$.

The resultant solutions are \begin{align*} u(x,t) &= u_{ss}(x) + e^{-D (\pi/L)^2 t} \sin(\pi x/L)\\ u(x,t) &= u_{ss}(x) + e^{-D (2 \pi/L)^2 t} \sin(2 \pi x/L)\\ u(x,t) &= u_{ss}(x) + e^{-D (3 \pi/L)^2 t} \sin(3 \pi x/L). \end{align*}

The steady state is denoted with a dashed line.

Note that the $k=3$ mode decays faster than the $k=2$ mode which decays faster than the $k=1$ mode.

#### Second example: random initial data

The initial data is chosen by choosing random numbers and then multiplying them by $\sin(k \pi x/L)$ for $k=1$ to $20$.

The steady state is denoted with a dashed line.

Note that the $k=1$ mode decays the slowest and as the solution relaxes it looks more and more like a multiple of $\sin(\pi x/L)$ added to the steady state $u_{ss}(x)$.

#### Third example: top hat initial data

The initial data is $u_{ss}(x)$ with a discontinuous function added to it: $$u(x,0) = \begin{cases} u_{ss}(x) + 1 & \mbox{if L/4 < x < L/2}\\ u_{ss}(x) & \mbox{otherwise} \end{cases}$$

The steady state is denoted with a dashed line.

Note that the solution instantaneously smooths. The regions that were flat in the initial data appear to “take a while” to stop being flat if you look away from the two discontinuities. (In reality, there’s infinite speed of propagation and there’s no flatness anywhere, it’s just that our eye can’t see the deviation at first.) The boundary conditions are driving the solution down to the steady state; note that the x=0 boundary is “felt” by the solution before the x=L boundary. Again, this has to do with infinite speed of propagation and how the “width” of the fundamental solution depends on time.

### Neumann boundary conditions: $D \, u_x(0,t)=0$ and $D \, u_x(L,t)=0$

In the no-flux boundary condition case, there are infinitely many steady states: they're all constant. The long-time limit of an initial value problem is steady state that's determined by the initial data: $u_{ss}(x) =$ the average of $u(x,0)$.

#### First example: random initial data

The initial data is chosen by choosing random numbers and then multiplying them by $\cos(k \pi x/L)$ for $k=1$ to $20$.

The steady state is found by computing the average vaule of the inital data and is denoted with a dashed line.

Note that the $k=1$ mode decays the slowest and as the solution relaxes it looks more and more like a multiple of $\cos(\pi x/L)$ added to the steady state.

#### Second example: top hat initial data

The initial data is a discontinuous function: $$u(x,0)= \begin{cases} 1 & \mbox{if L/4 < x < L/2} \\ 0 & \mbox{otherwise} \end{cases}$$

The steady state is found by computing the average vaule of the inital data and is denoted with a dashed line.

Note that the solution instantaneously smooths. The regions that were flat in the initial data appear to “take a while” to stop being flat if you look away from the two discontinuities. (In reality, there’s infinite speed of propagation and there’s no flatness anywhere, it’s just that our eye can’t see the deviation at first.) The boundary conditions are driving the solution down to the steady state; note that the x=0 boundary is “felt” by the solution before the x=L boundary. Again, this has to do with infinite speed of propagation and how the “width” of the fundamental solution depends on time.

## The Heat Equation on the interval $[0,L]$ with non-constant diffusivity.

Here the heat equation is $u_t = ( D(x) \, u_x )_x$ where the diffusivity $D(x)$ depends on $x$. It’s one constant on $(0,L/2)$, and a larger constant on $(L/2,L)$. As a result, in the material to the right the diffusion is “faster”.

The boundary conditions are Dirichlet boundary conditions $u(0,t) = 0$ and $u(L,t) = 0$. And so the steady state is: $u_{ss}(x) = 0$.

The initial data is $\sin(\pi x/L)$: a single bump with its peak initially at the interface between the two materials.

Note: If the boundary conditions had been $u(0,t) = 1$ and $u(L,t) = 2$ then the steady state would be piecewise linear. To find it, you would need to use the fact that both $u_{ss}(x)$ and the flux $D(x) \, {u_{ss}}_x(x)$ are continuous at $x=L/2$.

## The Wave Equation on the line.

The PDE is $u_t = c^2 \, u_{xx}$ on the line. No boundary conditions are needed. For initial data, both the initial displacement $u(x,0)$ and the initial velocity $u_t(x,0)$ are given.

#### First example: top hat initial data

The initial displacement is $u(x,0)$ is the discontinuous function $$u(x,0)= \begin{cases} 1 & \mbox{if 0 < x < 2} \\ 0 & \mbox{otherwise} \end{cases}$$ The initial velocity is zero.

Note that there is no instantaneous smoothing. In fact the initial data has only two jump discontinuities in it while the solution at t>0 has more than two. Note that if you wait long enough you get two copies of the initial data running away from each other off to infinity and -infinity; their height is half the original height. This is exactly what DAlembert’s formula told you to expect.

#### Second example: cap initial data

The initial displacement is continuous but with jumps in the derivative (corners): $$u(x,0)= \begin{cases} (2-x)(x-0) & \mbox{if 0 < x < 2} \\ 0 & \mbox{otherwise} \end{cases}$$ The initial velocity is zero.

Note that there is no instantaneous smoothing. In fact the initial data has only two “corners” in it while the solution at $t>0$ has more than two corners. Note that if you wait long enough you get two copies of the initial data running away from each other off to $\infty$ and $-\infty$; their height is half the original height. This is exactly what D'Alembert’s formula told you to expect.

## The Wave Equation on the bounded inteval $[0,L]$.

The PDE is $u_t = c^2 \, u_{xx}$.

The boundary conditions are Dirichlet: $u(0,t) = u(L,t) = 0$.

#### First example: standing waves

The first three standing wave solutions are $u(x,t) = \cos( c \pi/L t) \sin(\pi x/L)$, $u(x,t) = \cos( c 2 \pi/L t) \sin(2 \pi x/L)$, and $u(x,t) = \cos( c 3 \pi/L t) \sin(3 \pi x/L)$.

As expected, they don’t decay in amplitude (in contrast with the heat equation) and the larger $k$ is the faster the temporal oscillation.

#### Second example: random initial data

The initial displacement is chosen by choosing random numbers and then multiplying them by $\sin(k \pi x/4)$ for $k=1$ to $20$. The initial velocity is zero.

Note there’s no “infinity” for solutions to run off to (in contrast to the wave equation on the line). Things that hit the boundary get sent right back in.

I chose the speed $c$ and the run time so that the final snap-shot is the same as the initial data. Can you figure out how I did this?

#### Third example: top hat initial data

The initial displacement, $u(x,0)$, is a discontinuous function: $$u(x,0)= \begin{cases} 1 & \mbox{if L/4 < x < L/2} \\ 0 & \mbox{otherwise} \end{cases}$$ The initial velocity is zero.

Note there’s no “infinity” for solutions to run off to (in contrast to the wave equation on the line). Things that hit the boundary get sent right back in.

I chose the speed $c$ and the run time so that the final snap-shot is the same as the initial data. Can you figure out how I did this?