next up previous
Next: About this document ... Up: Partial Differential Equations of Previous: Modelling: Derivation of the

Solution of the heat equation: separation of variables

To illustrate the method we consider the heat equation
\begin{displaymath}
{\partial u \over \partial t} = c^{2}{\partial^{2} u\over \partial
x^{2}},
\end{displaymath} (2.48)

with the boundary conditions
\begin{displaymath}
u(0,t) = 0, \qquad u(l,t) = 0,
\end{displaymath} (2.49)

for all time and the initial condition, at $t=0$, is
\begin{displaymath}
u(x,0) = f(x),
\end{displaymath} (2.50)

where $f(x)$ is a given function of $x$. The temperature, $u(x,t)$, is assumed seperable in $x$ and $t$ and we write
\begin{displaymath}
u(x,t) = X(x) T(t)
\end{displaymath} (2.51)

so that (2.48) becomes
\begin{displaymath}
X^{\prime\prime}T = c^{2}X \dot{T}
\end{displaymath} (2.52)

or, on dividing by $X(x)T(t)$,
\begin{displaymath}
{X^{\prime\prime}\over X} = c^{2}{\dot{T}\over T} = k,
\end{displaymath} (2.53)

where $k$ is the separation constant. In fact, we expect $k$ to be negative as can be seen from the time equation. Here we have

\begin{displaymath}
\dot{T} = c^{2}k T,
\end{displaymath}

with solution

\begin{displaymath}
T(t) = T_{0}e^{c^{2}kt}.
\end{displaymath}

Thus, $T(t)$ will increase in time if $k$ is positive and decrease in time only if $k$ is negative. It is obviously unphysical for the temperature to increase in time without any additional heating mechanism and so we must assume that $k$ is negative. To force this we set
\begin{displaymath}
k = - p^{2}.
\end{displaymath} (2.54)

The spatial equation is then
\begin{displaymath}
X^{\prime \prime} + p^{2}X = 0,
\end{displaymath} (2.55)

which is the simple harmonic motion equation with trigonometric solutions. Thus, the solution to (2.55) is
\begin{displaymath}
X(x) = A \cos px + B \sin px .
\end{displaymath} (2.56)

Now, applying the boundary conditions (2.49), we find that

\begin{displaymath}
X(0) = 0, \qquad X(l) = 0,
\end{displaymath}

so that, in (2.56), $A = 0$ and
\begin{displaymath}
\sin pl = 0, \qquad \Rightarrow \qquad pl = n \pi.
\end{displaymath} (2.57)

As for the wave equation, we take the most general solution by adding together all the possible solutions, satisfying the boundary conditions, to obtain
\begin{displaymath}
u(x,t) = \sum_{n=0}^{\infty} B_{n}\sin {n\pi\over l}x
e^{-n^{2}\pi^{2}c^{2}t/l^{2}}
\end{displaymath} (2.58)

The final step is to apply the initial conditions, namely
\begin{displaymath}
u(x,0) = \sum_{n=0}^{\infty} B_{n}\sin {n\pi\over l}x = f(x).
\end{displaymath} (2.59)

Again we must invert the Fourier series and we do this by multiplying the equation by $\sin m\pi x/l$ and integrating between $0$ and $l$. Thus, we obtain,
\begin{displaymath}
B_{n} = {2\over l}\int_{0}^{l}f(x)\sin {n\pi\over l}x dx,
\end{displaymath} (2.60)

for all positive integers, $n$.

Note that because every term in the solution for $u(x,t)$ has a negative exponential in it, the temperature must decrease in time and the final solution will tend to

\begin{displaymath}
u = 0.
\end{displaymath}

This is different from the wave equation where the oscillations simply continued for all time. This trivial solution, $u=0$, is a consequence of the particular boundary conditions chosen here.

Example 2. .28Solve

\begin{displaymath}
{\partial u \over \partial t} = {\partial^{2} u\over \partial x^{2}},
\end{displaymath}

subject to the boudary conditions

\begin{displaymath}
u(0,t) = u(1,t) = 0,
\end{displaymath}

and the initial condition

\begin{displaymath}
u(x,0) = f(x) = \left \{
\begin{array}{lll}
x & \hbox{if}...
... 1/2, \\
1-x & \hbox{if} & 1/2 < x < 1.
\end{array}\right .
\end{displaymath}

The solution is given by (2.58) with, from (2.60),
\begin{displaymath}
B_{n} = 2\left (\int_{0}^{1/2}x\sin {n\pi\over l}x dx +
\int_{1/2}^{1}(1-x)\sin {n\pi\over l}x dx \right ).
\end{displaymath} (2.61)

Integration by parts yields, for even $n = 2m$,

\begin{displaymath}
B_{2m}= (-1)^{m}{1\over m^{2}\pi^{2}},
\end{displaymath}

and

\begin{displaymath}
B_{2m+1} = 0,
\end{displaymath}

for odd $n= 2m +1$.

For problems involving heat flow there is no reason why the temperature should have the same value at each end of the rod. The next few examples will show the effect of different boundary conditions.

Example 2. .29Solve

\begin{displaymath}
{\partial u \over \partial t} = {\partial^{2} u\over \partial x^{2}},
\end{displaymath}

subject to the boudary conditions

\begin{displaymath}
u(0,t) = u_{0}, \qquad u(1,t) = u_{1},
\end{displaymath}

and the initial condition

\begin{displaymath}
u(x,0) = f(x).
\end{displaymath}

In this example $u_{0}$ and $u_{1}$ are not equal. To proceed we consider the final steady state after a long period of time. Eventually we expect all temperature variations to be smoothed out in time to leave a solution that is independent of time. This solution satisfies the equation

\begin{displaymath}
{\partial ^{2} u_{pi} \over \partial x^{2}} = 0,
\end{displaymath}

and has solution

\begin{displaymath}
u_{pi}(x) = A + B x,
\end{displaymath}

where the constants $A$ and $B$ are chosen to satisfy the boundary conditions in $x$. Thus,

\begin{displaymath}
A = u_{0} \qquad \hbox{and} \qquad B = \left ( u_{1} - u_{0}\right ).
\end{displaymath}

However, this does not satisfy the initial condition. Thus, we add on a solution, $u_{cf}(x,t)$, that satisfies the heat equation and the boundary conditions

\begin{displaymath}
u_{cf}(0,t) = 0, \qquad u_{cf}(1,t) = 0.
\end{displaymath}

Thus, the solution

\begin{displaymath}
u(x,t) = u_{cf}(x,t) + u_{pi}(x),
\end{displaymath}

satisfies the heat equation and the boundary conditions for the full problem. From (2.58) we have

\begin{displaymath}
u_{cf}(x,t) = \sum_{n=0}^{\infty} B_{n}\sin {n\pi\over l}x
e^{-n^{2}\pi^{2}c^{2}t/l^{2}},
\end{displaymath}

The initial condition on $u(x,t)$ can be written as

\begin{displaymath}
u(x,0) = u_{cf}(0,t) + u_{pi}(x) = f(x).
\end{displaymath}

Thus, we have

\begin{displaymath}
u_{cf}(x,0) = f(x) - u_{pi}(x) = f(x) - u_{0} - \left (u_{1} -
u_{0} \right )x = g(x).
\end{displaymath}

Hence, from (2.60) we have

\begin{displaymath}
B_{n} = 2\int_{0}^{1}g(x)\sin {n\pi\over l}x dx.
\end{displaymath}

Thus,

\begin{displaymath}
u(x,t) = u_{0} + \left (u_{1} - u_{0} \right ) x +
\sum_{...
...fty} B_{n}\sin {n\pi\over l}x
e^{-n^{2}\pi^{2}c^{2}t/l^{2}}.
\end{displaymath}

Example 2. .30Solve

\begin{displaymath}
{\partial u \over \partial t} = {\partial^{2} u\over \partial x^{2}},
\end{displaymath}

subject to

\begin{displaymath}
u(0,t) = 1, \qquad u(l,t) = 0, \qquad u(x,0) = 0.
\end{displaymath}

Thus,

\begin{displaymath}
u_{pi}(x) = 1 - x/l
\end{displaymath}

and

\begin{displaymath}
B_{n} = {2\over l}\int_{0}^{l}\left ( {x\over l} - 1 \right
)\sin {n\pi\over l}x dx.
\end{displaymath}

Integration by parts gives

\begin{displaymath}
B_{n} = {2\over l} \left [ - {l\over n \pi}\left ( {x\over ...
... {2\over
n\pi}\int_{0}^{l}{1\over l} \cos {n\pi\over l}x dx.
\end{displaymath}

Hence,

\begin{displaymath}
B_{n} = -{2\over n \pi}.
\end{displaymath}

Hence, the solution is

\begin{displaymath}
u(x,t) = 1 - x/l - \sum_{n=0}^{\infty} {2\over n \pi}\sin {n\pi\over l}x
e^{-n^{2}\pi^{2}c^{2}t/l^{2}}.
\end{displaymath}

Instead of specifying the value of the temperature at the ends of the rod we could fix $\partial u/\partial x$ instead. This corresponds to fixing the heat flux that enters or leaves the system. For example, if $\partial u/\partial x = 0$, then no heat enters the system and the ends are said to be insulated. The following example illustrates the case when one end is insulated and the other has a fixed temperature.

Example 2. .31Solve the heat equation subject to the boundary conditions

\begin{displaymath}
u(0,t) = 0, \qquad {\partial u \over \partial x}(1,t) = 0,
\end{displaymath}

and the initial condition

\begin{displaymath}
u(x,0) = 1.
\end{displaymath}

In this case the steady state solution must satisfy the boundary conditions and is simply

\begin{displaymath}
u_{pi}(x) = 0.
\end{displaymath}

Again we look for a seperable solution of the form

\begin{displaymath}
u(x,t) = X(x) T(t),
\end{displaymath}

and the solution reduces to

\begin{displaymath}
u(x,t) = \left (A \cos px + B \sin px \right ) e^{-p^{2}c^{2}t}.
\end{displaymath}

Applying the boundary condition at $x=0$ gives

\begin{displaymath}
A = 0,
\end{displaymath}

and the condition at $x=1$ gives

\begin{displaymath}
B p \cos p = 0,
\end{displaymath}

so that, in this case $p$ must be an odd integer times $\pi /2$. Thus,

\begin{displaymath}
p = (2n + 1){\pi \over 2}.
\end{displaymath}

Hence, the solution is

\begin{displaymath}
u(x,t) = \sum_{n=0}^{\infty} B_{n}\sin (2n + 1){\pi \over 2}x
e^{-(2n+1)^{2}\pi^{2}t/4}.
\end{displaymath}

Finally, the initial condition is given by inverting the Fourier series at $t=0$. Thus,

\begin{displaymath}
u(x,0) = \sum_{n=0}^{\infty} B_{n}\sin (2n + 1){\pi \over 2}x = 1.
\end{displaymath}

Again multiply by $\sin (2m + 1){\pi \over 2}x$ and integrate between $x=0$ and $1$ to get

\begin{displaymath}
B_{m} = 2 \int_{0}^{1} \sin (2m+1){\pi\over 2}x dx = {4\over (2m +
1)\pi }.
\end{displaymath}


next up previous
Next: About this document ... Up: Partial Differential Equations of Previous: Modelling: Derivation of the
Prof. Alan Hood
2000-10-30