You are on page 1of 29

Heat (or Diffusion) equation in 1D*

• Derivation of the 1D heat equation


• Separation of variables (refresher)
• Worked examples

*Kreysig, 8th Edn, Sections 11.4b


Physical assumptions
• We consider temperature in a long thin
wire of constant cross section and
homogeneous material
• The wire is perfectly insulated laterally, so
heat flows only along the wire
insulation

heat flow
Derivation of the heat equation in 1D

x x + δx
Suppose that the thermal conductivi ty in the wire is K
The specific heat is σ
The density of the material is ρ
Cross sectional area is A
Denote the temperatur e at point x at time t by u ( x, t )
∂u
Heat flow into bar across face at x : − KA
∂x x Conservati on of heat gives :
∂u ∂ 2u ∂u
At the face x + δx : KA KA 2 δx = σρA δx
∂x x +δx ∂x ∂t
∂ 2u
So the net flow out is : : KA 2 δx
∂x
∂u 2 ∂ u
2
K
=c , where c 2
=
∂t ∂x 2 σρ
Boundary and Initial Conditions
As a first example, we will assume that the perfectly insulated rod is of finite
length L and has its ends maintained at zero temperature.

u (0, t ) = u ( L, t ) = 0
If the initial temperatur e distribution in the rod is given by f ( x),
we have the initial condition : u ( x,0) = f ( x)
Evidently, from the boundary conditions : f (0) = f ( L) = 0
Solution by Separation of Variables
1. Convert the PDE into two separate
ODEs
2. Solve the two (well known) ODEs
3. Compose the solutions to the two ODEs
into a solution of the original PDE
– This again uses Fourier series
Step 1: PDE Î 2 ODEs
The first step is to assume that the function of two variables has a very
special form: the product of two separate functions, each of one variable,
that is: Assume that : u ( x, t ) = F ( x)G (t )
Differentiating, we find :
∂u
= FG&
∂t So that FG& = c 2 F ' ' G
∂ 2u
= F ''G
∂x 2
G& F''
dG d 2
F
equivalently
2
= =k
&
where G = and F ' ' = 2 cG F
dt dx

The two (homogeneous) ODEs are:


F ' '− kF = 0
&
G − kc G = 0
2
Step 2a: solving for F*
We have to solve: F ' '−kF = 0
case k = µ 2 > 0 the general solution is : case k = 0 :
F ( x) = Ae µx + Be − µx F ( x) = ax + b
Applying the boundary conditions Applying the boundary conditions : a = b = 0
A+ B = 0
Ae µL + Be − µL = 0
and so A = B = 0
It follows that the only case of interest is k = − p 2

case k = − p 2 < 0 : the solution is pL = nπ that is :


F ( x) = A cos px + B sin px π
p=n
Applying the boundary conditions , we find L
F (0) = A = 0 so that
F ( L) = B sin pL = 0, and so sin pL = 0 π
Fn ( x) = sin n x
L
* This analysis is identical to the Wave Equation case we studied earlier
Step 2b: solving for G
π cπ
p=n , and, as for the wave equation, we denote λn = n
L L

We have G& + λ2nG = 0


− λ2n t
whose general solution is : Gn (t ) = Bn e
Step 2c: combining F&G
The solution to the 1D diffusion equation is :

∞ ∞
π
u ( x, t ) = ∑ un ( x, t ) =∑ Bn e − λ2n t
sin n x
n =1 n =1 L

π
Initial condition : u ( x,0) = ∑ Bn sin n x = f ( x)
n =1 L

2 π L
As for the wave equation, we find : Bn = ∫ f ( x) sin n xdx
L0 L
Analysing the solution
The solution to the 1D diffusion equation can be written as :


u ( x, t ) = ∑ Bnun ( x, t )
n =1

where
π
u n ( x, t ) = e −λnt sin n
2
x
L
This emphasises that the solution is a weighted sum of functions un ( x, t )
where
(1) The functions un are completely determined by the generic problem
(that is, the constants L, c ) and the boundary conditions
u (0, t ) = u ( L, t ) = 0 in this case; and
(2) The weights Bn are determined by the initial conditions, since
2
L
π
Bn = ∫ f ( x) sin n xdx
L0 L

We now take a closer look at the functions un


Sine term
π
Consider first the sine term : sin n x
L

Evidently, the higher the


value of n the higher the
frequency component of
f(x) that is analysed
Exponential term
⎛ ncπ ⎞
2
−⎜ ⎟ t
⎝ L ⎠
Consider next the exponential term : e
Suppose that L = 100 and (see 2 slides later) c 2 = 1.158
⎛ cπ ⎞
2

Then λ = ⎜ ⎟ = 0.0011
2
1
⎝ L ⎠
Gabor functions
⎛ ncπ ⎞
2
−⎜ ⎟ t
⎝ L ⎠
The exponential term is e
⎛ L ⎞
denote t = s and σ n = ⎜ ⎟, then the term is
⎝ ncπ ⎠
s2

σ2
e ... a Gaussian
so if we consider ( x, s) instead of ( x, t ) we have to work with
a Gaussian multiplied by a sine term.
These are called Gabor functions and are fundamental to signal processingand optics

This appears to be a short burst of sine wave in a


Gaussian shaped envelope. This is fundamental to
AM/FM communications and to wavelets

Denis Gabor (born Budapest 1900, died London 1979).


Left Berlin for London during the 1930s. Eventually
professor of electronics at Imperial College. Credited
with invention of the hologram in 1947. Awarded the
Nobel prize for physics in 1971
Recall the solution …
The solution to the 1D diffusion equation is :

∞ ∞
π
u ( x, t ) = ∑ un ( x, t ) =∑ Bn e − λ2n t
sin n x
n =1 n =1 L

π
Initial condition : u ( x,0) = ∑ Bn sin n x = f ( x)
n =1 L

2 π L
As for the wave equation, we find : Bn = ∫ f ( x) sin n xdx
L0 L
Example 1*

π π
Length of the bar :80 cms u ( x,0) = ∑ Bn sin n x = f ( x) = 100 sin x
π n =1 80 80
Sinusoidal initial conditions : f ( x) = 100 sin x
80 B1 = 100, B2 = B3 = ... = 0
Copper : K = 0.95 cal/(cm sec o C)
ρ = 8.92 gm/cm 3
σ = 0.092 cal/(gm o C)
so
K 0.95
c2 = = = 1.158 cm2 / sec
ρσ 0.092 ⋅ 8.92
9.870
λ12 = 1.158 = 0.001758
6400
π
u ( x, t ) = 100e −0.001785t sin x
80

time required for the maximum temperatur e to reduce to 50 o :


100e -0.001785t = 50 ⇒ t = 388s = 6.5 min
*Kreysig, 8th Edn, page 603
Example 2
Somewhat more realistically, we assume that the bar is initially entirely at a
constant temperature, then at time t=0, it is insulated and quenched, that is,
the temperatures at its two ends instantly reduce to zero.

Initial condition : u ( x,0) = T0

Boundary conditions :
u (0, t ) = u ( L, t ) = 0, for all t > 0
u ( x, t ) → 0, as t → ∞
Solution
Recall that the solution to the 1D diffusion equation is :

∞ ∞
π
u ( x, t ) = ∑ un ( x, t ) =∑ Bn e − λ2n t
sin n x
n =1 n =1 L

π
Initial condition : u ( x,0) = ∑ Bn sin n x = f ( x) = T0
n =1 L
2 π L
As for the wave equation, we find : Bn = ∫ f ( x) sin n xdx
L0 L
2T0 π L
Bn =
L 0∫ sin n xdx
L
π
2T0
=
π ∫ sin nθdθ
0
Solving for Bn
π
π ⎡ cos nθ ⎤
Evidently, ∫0 sin n θdθ = ⎢⎣− n ⎥⎦
0

if n = 2m is even, then this is 0


2
if n = (2m − 1) is odd, it equals
(2m − 1)

⎛ ( 2 m −1) cπ ⎞
2

2 2T −⎜ ⎟ t π
and so, we find u ( x, t ) = ∑ ⋅ 0e ⎝ L ⎠
sin( 2m − 1) x
m =1 ( 2m − 1) π L
Changing the initial condition
T

To

⎧ 2T0 L
L
⎪ x if 0 ≤ x ≤
Suppose that initially f ( x) = ⎨ L 2
2T L
⎪ 0 ( L − x) if ≤ x ≤ L
⎩ L 2

All the other boundary conditions remain the same:


u(0,t) = 0 for all t > 0

u(L,t) = 0 for all t > 0 (quenched at both ends)

t → ∞ ⇒ u( x, t ) → 0 (must eventually cool down to zero)


Solution
Recall that the solution to the 1D diffusion equation is :

∞ ∞
π
u ( x, t ) = ∑ un ( x, t ) =∑ Bn e − λ2n t
sin n x
n =1 n =1 L

π
Initial condition : u ( x,0) = ∑ Bn sin n x = f ( x)
n =1 L

We have to solve for the coefficients using Fourier series.

Instead of orthogonality, we consult HLT


which is
f(φ)
8A 1
A f (φ ) = (cos φ + cos 3φ + .....)
π2 9
π/2 π φ
-A

Let’s shift this by π/2 in the φ direction: θ = φ-π/2 to give:

g(θ) This is now what we need between


A
0 < θ < π with Α = Το

π
π/2 θ
-A

8A 1
g( θ ) = f ( θ + π 2 ) = (cos( θ + π 2 ) + cos 3( θ + π 2 ) + .....)
π 2
9

8A 1
= 2 (sin θ + sin 3θ + .....) ≡ ∑ Bn sin nθ
π 9 n =1
8T0
So, Bn = 2
π ( 2 n − 1 )2

and the final solution for this problem is


8T0 (2n − 1)πx ⎛ k (2n − 1) 2 π 2t ⎞
T ( x, t ) = ∑ sin exp − ⎜⎜ ⎟⎟
n =1 (2n − 1) π
2 2
L ⎝ L 2

Compare this with our previous example of constant


initial temperature distribution:


4T0 (2n − 1)πx ⎛ k (2n − 1) 2 π 2t ⎞
T ( x, t ) = ∑ sin exp − ⎜⎜ ⎟⎟
n =1 (2n − 1)π L ⎝ L 2

Derivation from electrostatics: the ‘Telegraph Equation’
I(x) Rδx R: Resistance per unit length
I(x+δx)
C: Capacitance per unit length

∂I
Cδx I ( x + δx ) = I ( x ) + δx
V(x) V(x+δx) ∂x
∂V
V ( x + δx ) = V ( x ) + δx
δx ∂x
∂V
From I = C , we find :
Ohm’s law: ∂t
∂V
V ( x + δx ) − V ( x ) = − IRδx I ( x + δ x ) − I ( x ) = − Cδ x
∂t
∂I ∂V
− =C
∂x ∂t ∂ 2V ∂V The diffusion
We find = RC
∂V ∂x 2
∂t equation
− = RI
∂x
Example from electrostatics
Initially, a uniform conductor has zero potential throughout. One end (x=0) is
then subjected to constant potential V0 while the other end (x=L) is held at zero
potential. What is the transient potential distribution?

Initial conditions :
u ( x,0) = 0, for 0 ≤ x ≤ L
Boundary conditions :
u (0, t ) = V0 , all t > 0
u ( L, t ) = 0, all t > 0

We again use separation of variables; but we need to start from scratch


because so far we have assumed that the boundary conditions were
u (0, t ) = u ( L, t ) = 0 but this is not the case here.

We now retrace the steps for the original solution to the heat equation,
noting the differences
Step 1: PDE Î 2 ODEs
The first step is to assume that the function of two variables has a very
special form: the product of two separate functions, each of one variable,
that is: Assume that : u ( x, t ) = F ( x)G (t )
Differentiating, we find :
∂u
= FG&
∂t So that FG& = c 2 F ' ' G
∂ 2u
= F ''G
∂x 2
G& F''
dG d 2
F
equivalently
2
= =k
&
where G = and F ' ' = 2 cG F
dt dx

The two (homogeneous) ODEs are:


F ' '− kF = 0
No change here!!
&
G − kc G = 0
2
Step 2a: solving for F&G .. k≥0
We have to solve: F ' '−kF = 0
case k = µ 2 > 0 the general solution is : F ( x) = Ae µx + Be − µx
so that u ( x,0) = F ( x)G (0) = 0 from which A = B = 0 as before
case k = 0 :
F ( x) = ax + b
Applying the boundary conditions :
F (0) = V0 = b
V0
F ( L) = 0 = aL + b, so a = −
L
⎛ x⎞
so that F ( x) = V0 ⎜1 − ⎟
⎝ L⎠
Since k = 0, we have G& = 0, so that G is constant (ignore)
Step 2b: Solving for F&G …k<0
case k = − p 2 < 0 : the solution is
F ( x) = A cos px + B sin px
Applying the boundary conditions , we find
F (0) = A = 0
F ( L) = B sin pL = 0, and so sin pL = 0
pL = nπ that is :
π
p=n
L
so that This case is as before
π
Fn ( x) = sin n x
L
π cπ
p=n , and, as before, we denote λn = n
L L

We have G& + λ2n G = 0


− λ2n t
whose general solution is : Gn (t ) = Bn e
Step 2c: combining F&G
In this case, the solution to the 1D diffusion equation is :

⎛ x⎞ ∞ π
u ( x, t ) = V0 ⎜1 − ⎟ + ∑ Bn e −λnt sin n x
2

⎝ L ⎠ n =1 L

⎛ x⎞ ∞ π
Initial condition : u ( x,0) = V0 ⎜1 − ⎟ + ∑ Bn sin n x = 0
⎝ L ⎠ n =1 L
so that
2 L ⎛ x⎞ π
L ∫0
Bn = − V0 ⎜ 1 − ⎟ sin n xdx
⎝ L⎠ L
π
− 2V0 ⎛ θ ⎞
π ∫0 ⎝ π ⎠
= ⎜1 − ⎟ sin nθdθ

− 2V0 1
which (by parts) = . (or use HLT next to last on earlier list)
π n
⎛ x ⎞ 2V0 ∞ 1 −λ2nt π
Solution is : u ( x, t ) = V0 ⎜1 − ⎟ −
⎝ L ⎠ π n =1 n
∑ e sin n x
L

You might also like