← Lecture 32 | Lecture 34 →

# The Heat-Conduction/Diffusion Equation

Motivation

Consider a length of rod which is clamped between two large blocks, one kept at 80°C and the
other at 5°C. According to Laplace's equation, the steady state would be a uniform change
in temperature along the rod from 80°C down to 5°C, as is shown in Figure 1.

Figure 1. The expected steady-state linear temperature distribution along a rod the ends of which
are kept at two different temperatures.

Suppose now that we have a different scenario: the entire rod has been in contact with the
cooler mass and is therefore uniformly 5°C. Suppose then at time
, the rod is placed in contact with a large body kept at
80°C, as shown in Figure 2.

Figure 2. A rod cooled to 5°C placed in contact with a body kept at 80°C.

Over time, we would expect that the rod will have the temperature distribution shown
in Figure 1, but we would not expect the rod to heat up linearly. Instead, it would
make sense that the end closest to the heated body would rapidly heat up while the balance
of the rod would heat up more slowly. If the rod was made out of a more insulating material,
one would expect that the time it takes to heat up would also be increased.

We would write these boundary conditions as

The solution when running for 0.5 seconds is shown in Figure 3.

Figure 3. The temperature along a rod with initially at 5°C placed in
contact with a body at 80°C showing the first 0.5 seconds.

Yet another scenario: we have the two bodies, but we place between them
a rod which is heated uniformly at 100°C. Suppose then at time
, this rod is placed between the two masses, as is shown in Figure 4.

Figure 4. A rod at 100°C placed between two bodies, one at 80°C and the other at 5°C.

Again, we expect that the rod will ultimately have the temperature distribution shown
in Figure 1.

We would write these boundary conditions as

The solution when running for 0.5 seconds is shown in Figure 5.

Figure 5. The first 0.5 seconds of the temperature along a rod with initially at 100°C placed between
two bodies, one at 80°C and the other at 5°C.

# Separated Solutions

The heat-conduction/diffusion equation is

.

From the previous section, we have seen that it is difficult enough to solve Laplace's equation in two
or more dimensions, and therefore we will restrict ourselves to a single space variable.

Recall that previously with ordinary differential equations, if we found a particular solution, we
could add to that a linear combination of the independent solutions of the homogeneous equation. We will
use a similar argument here:

Suppose we have a system similar to that discussed above with the following conditions:

- An initial condition that (the initial temperature along the rod).
- Boundary conditions and
(the temperatures of the boundaries).

We already know that the stead-state solution will be
and therefore, we could simply
subtract this solution from both the initial condition and the boundaries; that is, without loss
of generality, we will assume the initial conditions are

- An initial condition that (the initial temperature along the rod).
- Boundary conditions
(the temperatures of the boundaries).

As we did with Laplace's equation, we will assume that the solution is of the form

and by substituting this into the differential equation, we get that

or, by dividing by we get

.

As with Laplace's equation, this must equal some constant:

.

This yields two ordinary differential equations:

and
.

We have two cases: that where and where
.

## Case 1: λ ≥ 0

If this is true, the general solution to must be a sum
of exponential functions and therefore the only way to satisfy the boundary conditions is to require
that . Thus, we cannot find any general solutions in this case.

## Case 1: λ < 0

In this case, define where
is now positive. We therefore have that the two ordinary differential equations
are now

and
.

The general solution to each of these are now

, and

.

Because we will ultimate multiply these two functions together, by not placing an
arbitrary constant in front of the first solution, we have
and therefore we may restrict our boundary condition
.

Applying the other boundary conditions:

, and

.

It therefore follows that
and
which implies
or
.

We must therefore now find an approximation of the function
using just sine functions, that is

.

How can we do this?

## Fourier Series

Recall that a Fourier series contains both sines and cosines and it contains only sine functions if the
function is *odd*. The function we have here, , is not odd, but we can
create a modified odd extension

.

For example, suppose that our the initial condition were given by a function such as

where the interval is . Such a situation could easily be set up as is demonstrated in Figure 6
where a bar connecting two sinks of 0°C and a 1°C source is applied to the mid-point. After the system stabilizes,
the temperature will be 1°C in the middle and fall of linearly towards either end. Suppose then at time
, the central heat source is removed.

Figure 6. A source heating a rod in the centre and then being removed.

We must extend this function to the interval by reflecting the image through
the origin thereby creating an odd function and therefore the Fourier series on that interval will contain only
the sine terms. The function and its odd extension are shown in Figure 7.

Figure 7. The odd extension of a tent function.

The Fourier series of the function in Figure 7 is

.

An animation of the converging Fourier series on the original interval is shown in Figure 8.

Figure 8. The Fourier series converging to function on the interval
.

It therefore follows that the solution to the heat-conduction/diffusion equation is therefore

.

Note that the higher the frequency, the faster that component decays to zero: the
term decays according to
and the next non-zero term is
which decays to
. This is very clear in the animation shown in Figure
9 where within a few seconds all higher-order sine terms have decayed essentially to zero and the only remaining significant
term is the first.

Figure 9. The solution to the partial differential equation with
.

To emphasize how significant the lowest order term is, Figure plots 10 shows the first Fourier series
term
and its decay as compared to the original function
.

Figure 10. The solution together with just the first term to emphasize how soon the solution essentially
depends on the first term.

# Note

Recall that a differential equation of the form
where
will decay to zero and the solution may at most once cross the origin as
. If the distance to the solution
is halved, the rate at which the solution approaches zero is also approximately
halved. This strongly suggests that solutions to the heat-conduction/diffusion equation
do not oscillate significantly but rather converge initially quickly and then more slowly
to the solution in a more-or-less monotonic manner. I say more-or-less as because
under certain initial conditions, it may cause a more passes as is shown in Figure 11,
but if you look closely, you will see that it is, in the end, a decaying sine function.

Figure 11. Another initial function and its convergence.