Skip to main content

Section 7.4 Boundary Conditions for the Heat Equation

I want to show how the solutions to the heat equation can vary when the boundary conditions are altered.
Figure 7.4.1. Diffusion to a Linear Steady State
A small increase in complexity of the solution to the heat equation comes from constant but non-equal boundary conditions: \(u(0,t) = A\) and \(u(\pi,t) = B\) for some constants \(A\) and \(B\text{.}\) This is a situation where I will keep the ends of the rod at constant temperature, but those temperatures need not be the same.
In this case, seperation of variables when \(\alpha = 0\) implies that \(X(x)\) must be a linear function. Matching the boundary contions (with a rod of length \(\pi\)) means that \(X(x) = \frac{B-A}{\pi}x + A\text{.}\) This is called the steady-state solution and it is the base case of the situation. (For the previous case with zero boundary conditions, the steady state solution was just \(X(x) = 0\text{.}\)) The steady-state solution is the solution to which we want the situaiton to diffuse; it is the resting case. With non-equal boundary conditions, the steady state involves a heat flow along the rod, from the warmer end to the cooler. A complicated initial heat-situation will diffuse and reduce to a straight-line distribution between the tempeartures at each end as show in Figure 7.4.1.
Now I need to understand how to combine this linear steady state with the previous solutions. The linearity of the system means that the solution with both boundary conditions set to \(0\) can simply be added to this steady state to give the general solution.
\begin{equation*} u(x,t) = \frac{2}{\pi} \sum_{n=1}^\infty T_n e^{-kn^2t} \sin (nx) \end{equation*}
The calculation of the Fourier coefficients \(T_n\text{,}\) however, needs an adjustment. I need to shift the function back to a 0-equilibrium situation to repeat the result of the previous section. With that shift, the integral that calculates the coefficient changes to the following definition.
\begin{equation*} T_n = \frac{2}{\pi} \int_0^\pi \left( f(x) - \frac{B-A}{\pi} x - A \right) \sin nx dx \end{equation*}
Figure 7.4.2. Heat Equation Examples with Initial Conditions \(f(x) = x^2 + (1-\pi)x + 1\)

Example 7.4.3.

I can use an example to see what this looks like with explicit numbers. Set the boundary contidions to be \(u(0,t) = 1\) and \(u(\pi, t) = 1 + \pi\) and the initial condition \(u(x,0) = x^2 + (1-\pi)x + 1\text{.}\) The steady state solution is the line \(u = x+1\text{.}\) I calculate the Fourier coefficients.
\begin{align*} T_n \amp = \frac{2}{\pi} \int_0^\pi (x^2 - \pi x) \sin nx = \frac{2}{\pi} \int_0^\pi x^2 \sin nx - 2 \int_0^\pi x\sin nx\\ \amp = \frac{2}{\pi} \left( \left. \frac{-x^2 \cos nx}{n} \right|_0^\pi + \frac{2}{n} \int_0^\pi x \cos nx \right) - 2 \left( \left. \frac{-x \cos nx}{n} \right|_0^{\pi} + \int_0^{\pi} \cos nx dx \right)\\ \amp = \frac{2}{\pi} \left( \frac{-\pi^2 \cos n\pi}{n} + \left. \frac{2}{n} \frac{x \sin nx}{n} \right|_0^\pi - \frac{2}{n^2} \int_0^\pi \sin nx \right) - 2 \left( \frac{2\pi}{n} + \left. \frac{\sin nx}{n} \right|_0^{\pi} \right)\\ \amp = \frac{2}{\pi} \left( \frac{\pi^2 (-1)^{n+1}}{n} + 0 + \left. \frac{2\cos nx}{n^3} \right|_0^\pi \right) - \frac{4\pi}{n} - 0\\ \amp = \frac{2}{\pi} \left( \frac{\pi^2 (-1)^{n+1}}{n} + \frac{2(-1)^n}{n^3} - \frac{2}{n^3} - \frac{2\pi^2}{n}\right)\\ \amp = \frac{2n^2 \pi^2 (-1)^{n+1} + 2\pi (-1)^n - 2\pi - 4\pi n^2 }{\pi n^3} \end{align*}
The general solution uses the Fourier coefficients.
\begin{equation*} u(x,t) = 1 + x + \sum_{n=1}^\infty \left[ \frac{2n^2 \pi^2 (-1)^{n+1} + 2\pi (-1)^n - 2\pi - 4\pi n^2}{\pi n^3} \right] e^{-kn^2t} \sin (nx) \end{equation*}
Figure 7.4.2 shows this situation.