Professional Documents
Culture Documents
1D Diffusion PDE
Introduction to Partial Differential Equations
part of EM, Scalar and Vector Fields module (PHY2064)
Richard Sear
This lecture
Diffusion PDE in 1D
Method of Separation of Variables to solve diffusion PDE
Particular solution with just one wavevector k
Particular solutions using Fourier series
Particular solution that is a Gaussian function
The main technique we will use for solving the wave, diffusion and
Laplace’s PDEs is the method of Separation of Variables. For the
diffusion equation in 1D this works as follows.
This is where Fourier series come in. We will find that X can be a
sine and a cosine, and from the mathematics of Fourier series we
know we can write essentially any function as a sum of sines and
cosines. Because we can write any function as a Fourier series, we
can use a Fourier series to satisfy any set of BCs.
∂ 2 P(x, t) 1 ∂P(x, t)
2
=
∂x D ∂t
If we substitute P(x, t) = X (x)T (t) into the one-dimensional wave
equation we get
d2 X (x) 1 dT (t)
T (t) = X (x)
dx 2 D dt
If we divide both sides by XT , we get
1 d2 X (x) 1 1 dT (t)
2
=
X (x) dx D T (t) dt
So we have
1 d2 X (x) 1 1 dT (t)
2
= = −k 2
X (x) dx D T (t) dt
which gives us the two ODEs
d2 X (x) dT (t)
= −k 2 X (x) and = −k 2 DT (t)
dx 2 dt
Richard Sear 1D Diffusion PDE
The diffusion PDE
P(x, t = 0) = 10 cos(0.75x)
this is different from the wave PDE, because the wave PDE is
second order in time.
or
10 cos(0.75x) = F cos(kx) + E sin(kx)
so we must have that k = 0.75, F = 10 and E = 0. The solution
then becomes
10
P (x, t = constant)
−10
0 5 10 15
x
Richard Sear 1D Diffusion PDE
The diffusion PDE
We can write any periodic solution with any BCs, of the diffusion
PDE as
∞
1 X
P(x, t) = a0 + [an cos(kn x) + bn sin(kn x)] exp(−kn2 Dt)
2
n=1
As we saw in the Fourier series revision part of this course, this can
be written as the sum of sine waves
X 4
P(x, t = 0) = sin (nx)
nπ
n=1,3,5,7,...
Note that for this square wave, a0 = an = 0 and only the bn for
odd values of n are non-zero (and equal to 4/nπ). Also, here
kn = n as the period is 2π.
1.5
P (x, t = constant)
1.0
0.5
0.0
−0.5
−1.0
−1.5
0 5 10 15
Richard Sear 1D Diffusion PDE
The diffusion PDE
x2
A
P(x, t) = 1/2 exp −
t 4Dt
for A a constant.
3.0
P (x, t = constant)
2.5
2.0
1.5
1.0
0.5
0.0
−4 −2 0 2 4
x
Richard Sear 1D Diffusion PDE
The diffusion PDE
This lecture
Diffusion PDE in 1D
Method of Separation of Variables to solve diffusion PDE
Particular solution with just one wavevector k
Particular solutions using Fourier series
Particular solution that is a Gaussian function