Skip to the content of the web site.

Lecture 33

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 tex:$$t = 0$$, 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

  • tex:$$u(x,0) = 5$$
  • tex:$$u(0,t) = 80$$
  • tex:$$u(1,t) = 5$$

The solution when tex:$$\kappa = 1$$ running for 0.5 seconds is shown in Figure 3.


Figure 3. The temperature along a rod with tex:$$\kappa = 1$$ 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 tex:$$t = 0$$, 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

  • tex:$$u(x,0) = 100$$
  • tex:$$u(0,t) = 80$$
  • tex:$$u(1,t) = 5$$

The solution when tex:$$\kappa = 1$$ running for 0.5 seconds is shown in Figure 5.


Figure 5. The first 0.5 seconds of the temperature along a rod with tex:$$\kappa = 1$$ 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

tex:$$\frac{1}{\kappa} \frac{\partial u}{\partial t} = \nabla^2u$$.

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 tex:$$u(x, 0) = f(x)$$ (the initial temperature along the rod).

  • Boundary conditions tex:$$u(x_0 = 0, t) = u_0$$ and tex:$$u(x_1, t) = u_1$$ (the temperatures of the boundaries).

We already know that the stead-state solution will be tex:$$u(x, \infty) = u_0 + \frac{u_1 - u_0}{x_1} x$$ 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 tex:$$u(x, 0) = \tilde{f}(x)$$ (the initial temperature along the rod).

  • Boundary conditions tex:$$u(x_0 = 0, t) = u(x_1, t) = 0$$ (the temperatures of the boundaries).

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

tex:$$u(x, t) = v(x)w(t)$$

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

tex:$$\frac{1}{\kappa} v \frac{d w}{d t} = \frac{d^2 v}{d x^2} w$$

or, by dividing by tex:$$v(x)w(t)$$ we get

tex:$$\frac{1}{\kappa} \frac{\dot{w}}{w} = \frac{v''}{v}$$.

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

tex:$$\frac{1}{\kappa}\frac{\dot{w}}{w} = \frac{v''}{v} = \lambda$$.

This yields two ordinary differential equations:

tex:$$\dot{w} = \kappa \lambda w$$ and tex:$$v'' - \lambda v = 0$$.

We have two cases: that where tex:$$\lambda \ge 0$$ and where tex:$$\lambda < 0$$.

Case 1: λ ≥ 0

If this is true, the general solution to tex:$$v'' - \lambda v = 0$$ must be a sum of exponential functions and therefore the only way to satisfy the boundary conditions is to require that tex:$$v(x) \equiv 0$$. Thus, we cannot find any general solutions in this case.

Case 1: λ < 0

In this case, define tex:$$\lambda = -\mu^2$$ where tex:$$\mu$$ is now positive. We therefore have that the two ordinary differential equations are now

tex:$$\dot{w} = -\kappa \mu^2 w$$ and tex:$$v'' + \mu^2 v = 0$$.

The general solution to each of these are now

tex:$$w(t) = e^{-\kappa \mu^2 t}$$, and
tex:$$v(x) = c_1 \cos(\mu x) + c_2 \sin(\mu x)$$.

Because we will ultimate multiply these two functions together, by not placing an arbitrary constant in front of the first solution, we have tex:$$w(0) = 1$$ and therefore we may restrict our boundary condition tex:$$v(x) = f(x)$$.

Applying the other boundary conditions:

tex:$$v(0)w(t) = 0 \Rightarrow v(0) = 0$$, and
tex:$$v(x_1)w(t) = 0 \Rightarrow v(x_1) = 0$$.

It therefore follows that tex:$$c_1 = 0$$ and tex:$$c_2 \sin(\mu x_1) = 0$$ which implies tex:$$\mu x_1 = n \pi$$ or tex:$$\mu = \frac{n \pi}{x_1}$$.

We must therefore now find an approximation of the function tex:$$f(x)$$ using just sine functions, that is

tex:$$f(x) = \sum_{n = 1}^\infty s_n \sin\left( \frac{n \pi}{x_1} x \right )$$.

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, tex:$$f(x)$$, is not odd, but we can create a modified odd extension

tex:$$\tilde{f}(x) = \cases{ f(x) & $x \ge 0$ \cr -f(-x) & $x < 0$ }$$.

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

tex:$$f(x) = \cases{ x & $x \le 1$ \cr 2 - x & $x \le 1$ }$$

where the interval is tex:$$[0, 2]$$. 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 tex:$$t = 0$$, 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 tex:$$[-2, 2]$$ 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

tex:$$\tilde{f}(x) = \frac{8}{\pi^2} \sum_{n = 1}^\infty \frac{\sin\left(\frac{\pi}{2}n\right)}{n^2}\sin \left(n\frac{\pi}{2}t\right)$$.

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


Figure 8. The Fourier series converging to function tex:$$f(x)$$ on the interval tex:$$[0, 2]$$.

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

tex:$$u(x, t) = \frac{8}{\pi^2} \sum_{n = 1}^\infty \frac{\sin\left(\frac{\pi}{2}n\right)}{n^2}\sin \left(n\frac{\pi}{2}t\right)e^{-\kappa \left( \frac{\pi}{2} n \right)^2 t}$$.

Note that the higher the frequency, the faster that component decays to zero: the tex:$$\sin\left(\frac{\pi}{2} x\right)$$ term decays according to tex:$$u(x, t) = e^{- \left( \frac{\pi}{2} \right)^2 t}$$ and the next non-zero term is tex:$$\sin\left(3 \frac{\pi}{2} x\right)$$ which decays to tex:$$u(x, t) = e^{- 9\left( \frac{\pi}{2} \right)^2 t}$$. 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 tex:$$\kappa = 1$$.

To emphasize how significant the lowest order term is, Figure plots 10 shows the first Fourier series term tex:$$\frac{8}{\pi^2}\sin\left(-\frac{\pi}{2}x\right)e^{-\frac{\pi^2}{4}t}$$ and its decay as compared to the original function tex:$$f(x)$$.


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 tex:$$\dot{y} + cy = 0$$ where tex:$$c > 0$$ will decay to zero and the solution may at most once cross the origin as tex:$$t \rightarrow \infty$$. 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.