You are on page 1of 9

Partial Differential Partial Differential

Equations PDEs Equations

Stephen Cameron Stephen Cameron

Continuous Mathematics
Partial Differential Equations
• Ordinary differential equations are differential equations
Continuous Mathematics HT16 that only depend on total derivatives, e.g. dy d2 y
dx , dx 2
• Partial differential equations are differential equations that
depend on partial derivatives, for example

@u @u
+u = x +u
✓ ◆ ✓ @t @x

@ u @u @ 3u @u
+ = eu
@x 1 + u @x @y 1 + u @y

Stephen Cameron
University of Oxford Department of Computer Science

Cont. Maths HT16–8.1 Cont. Maths HT16–8.2

Partial Differential Partial Differential


Leibniz integral rule Equations Leibniz integral rule, continued Equations

Stephen Cameron Stephen Cameron

• We need this for the next example:


X ✓ ◆
Z b Z b
f (xi , t + h1 ) f (xi , t)
d = lim h2 lim
f (x, t) dx = ft (x, t) dx h2 !0 h1 !0 h1
dt axi b
a a
Z b
provided that f and ft are continuous = ft (x, t) dx
a
• Outline proof; we have the general limits
Z b X
dg(t) g(t + h1 ) g(t)
= lim k (x) dx = lim h2 k (xi )
dt h1 !0 h1 a h2 !0
axi b
• There is a generalisation of this rule that we can use if a
and so and b are functions of t which we quote without further
Z b proof:
d 1 X
f (x, t) dx = lim lim h2 (f (xi , t + h1 ) f (xi , t)) Z b(t) Z b(t)
dt a h1 !0 h1 h2 !0 d
axi b f (x, t) dx = ft (x, t) dx
X ✓ ◆ dt a(t) a(t)
f (xi , t + h1 ) f (xi , t)
= lim lim h2 + f (x, b(t)) ⇥ b0 (t)
h2 !0 h1 !0 h1
axi b
f (x, a(t)) ⇥ a0 (t)
Cont. Maths HT16–8.3 Cont. Maths HT16–8.4
Partial Differential Partial Differential
Example Equations The heat equation Equations

Stephen Cameron Stephen Cameron

• We have Z • Suppose a metal bar occupies the region 0 < x < L.


1
1
e tx
dx = Assuming the temperature ⇥(x, t) is uniform across the
0 t bar’s cross section, the temperature in the bar is given by
• Differentiate both sides a few times wrt t:
Z @⇥ @2⇥
1
1 = D 2 + f (x, t)
tx @t @x
xe dx =
0 t2
Z 1 where D > 0 is the thermal diffusivity and f (x, t) is an
2
x 2e tx
dx = internal heat source (if one exists)
0 t3
... • We assume that we know the initial temperature
Z 1
n!
( 1)n x ne tx
dx = ( 1)n n ⇥(x, 0) = ⇥0 (x)
0 t

Z 1
for some given function ⇥0 (x)
) x ne x
dx = n! • We also require boundary conditions for ⇥ or @⇥
@x at x = 0
0 and x = L for all times t > 0

Cont. Maths HT16–8.5 Cont. Maths HT16–8.6

Partial Differential Partial Differential


Separable solutions to the heat equation Equations Example, continued Equations

• Example: Find ⇥(x, t) that satisfies Stephen Cameron


• We define E(t) by
Stephen Cameron

@⇥ @2⇥ Z L
=D 2 0<x <L 2
@t @x E(t) = [ (x, t)] dx ) E(0) = 0, E(t) 0
0
with initial conditions
⇡x
⇥(x, 0) = 3 sin Z Z L
L dE d L 2 @ 2
= [ (x, t)] dx = [ (x, t)] dx
with boundary conditions ⇥ = 0 at x = 0, L dt dt 0 0 @t
• We will assume throughout these examples that D > 0 Z L Z L
@ @2
• We will first show that if we can find a solution then it is = 2 dx = 2 D 2 dx
0 @t 0 @x
unique  L Z L ✓ ◆2
• Suppose there are two solutions, ⇥1 and ⇥2 ; Let @ @
= 2 D 2D dx
= ⇥1 ⇥2 @x 0 0 @x
• It then follows by substituting into the equation and Z L ✓ ◆2
@
boundary conditions that = 2D dx  0
0 @x
@ @2
=D 2 0<x <L • Hence E(t) is a decreasing function; the only way all the
@t @x
conditions on E(t) can be met is if E(t) = 0 at all times t
with initial conditions and boundary conditions
(x, 0) = 0 = 0 at x = 0, L ) ⇥1 = ⇥2
Cont. Maths HT16–8.7 Cont. Maths HT16–8.8
Partial Differential Partial Differential
Example, continued Equations Example, continued Equations

• We look for a separable solution ⇥(x, t) = X (x)S(t). If we Stephen Cameron Stephen Cameron

find a solution then we know by uniqueness that it will be


the only solution
• We have
• We now think about boundary conditions
@⇥ @2⇥
= X (x)S 0 (t) = X 00 (x)S(t) • We have ⇥(0, t) = 0 and ⇥(L, t) = 0
@t @x 2
• We may write the governing equation as • As ⇥(x, t) = X (x)S(t) we must have

X (x)S 0 (t) = DX 00 (x)S(t) X (0)S(t) = 0, X (L)S(t) = 0


S 0 (t) X 00 (x)
equivalently = • We don’t want S(t) = 0 for all times t — this would give
D S(t) X (x)
⇥(x, t) = 0
• The right-hand side of the last equation is a function only • We therefore have boundary conditions on X given by
of x and not of t X (0) = 0 and X (L) = 0
• The left–hand–side is a function only of t and not of x
• The only way this can simultaneously be true is if both
sides are equal to a constant, i.e.
S 0 (t) X 00 (x)
= =
D S(t) X (x)
Cont. Maths HT16–8.9 Cont. Maths HT16–8.10

Partial Differential Partial Differential


Example, contined Equations Example, continued Equations

Stephen Cameron Stephen Cameron

• Suppose 2
> 0. Then we can write = k , and so
• We therefore write
d2 X 2
k X =0
dx 2 X 00 (x)
= k2
X (x)
• This has general solution X = Aekx + Be kx

• The boundary conditions then give A = B = 0, and so • This equation has general solution
X (x) = 0, and then ⇥(x, t) = 0. This isn’t what we want —
the assumption > 0 must be false X (x) = A sin kx + B cos kx
• Suppose now that =0 • We now fit the boundary conditions
• We then have
X (0) ) B = 0 X (L) = 0 ) A sin kL = 0
X 00 (x)
=0
X (x) • If A = 0 we would have the trivial solution X (x) = 0, and
so ⇥(x, t) = 0 which violates the initial conditions
together with boundary conditions X (0) = 0 and X (L) = 0
• Instead, sin kL = 0 and so kL = n⇡ where n = 1, 2, 3, . . .
• Again, this only has solution X (x) = 0
• We must have <0
Cont. Maths HT16–8.11 Cont. Maths HT16–8.12
Partial Differential Partial Differential
Example, continued Equations Example, continued Equations

• When kL = n⇡ the equation for S(t) is Stephen Cameron Stephen Cameron

Dn2 ⇡ 2 • Note that the only Fourier solution to f (x) = 0 8x is


Dn2 ⇡ 2 t/L2
S 0 (t) = S(t) ) S(t) = Ce am = bn = 0
L2
• Combining the solutions for X (x) and S(t), we see that
• We see that initially the bar has a positive temperature
n⇡x Dn2 ⇡ 2 t/L2 inside the bar
En sin e where En = AC
L • The ends of the bar are maintained at a temperature
is a solution that satisfies the boundary conditions for any ⇥ = 0, and so we would expect that this would cool the
n = 1, 2, 3 bar down
• The general solution is the sum of these solutions: • This is evident from the solution; as t ! 1 we see that
N ⇥(x, t) ! 0 for all values of x
X n⇡x Dn2 ⇡ 2 t/L2
⇥(x, t) = En sin e
L • This use of ‘common sense’ is standard in solving
i=1
equations that deal with physical systems
where En , n = 1, 2, 3, . . . are constants that are fitted from
the initial conditions • The equations are in fact reversible wrt time; but we know
• In this case, E1 = 3 and En = 0 for n = 2, 3, 4, . . . and so that ‘hot things get cooler’ (in the absence of a heat
source)
n⇡x Dn2 ⇡ 2 t/L2
⇥(x, t) = 3 sin e
L
Cont. Maths HT16–8.13 Cont. Maths HT16–8.14

Partial Differential Partial Differential


Another Example Equations Another Example, continued Equations

Stephen Cameron Stephen Cameron


• Consider the PDE

@⇥ @2⇥ • The boundary condition X 0 (0) = 0 implies A = 0


=D 2, 0<x <L • The boundary condition X (L) = 0 gives B cos kL = 0
@t @x
• For a non–trivial solution we require kL = (n + 12 )⇡,
with boundary conditions @⇥ @x = 0 at x = 0, and ⇥ = 0 at n = 0, 1, 2, . . .
x = L, and initial conditions
• We therefore have, for n = 0, 1, 2, . . .
⇥(x, 0) = L2 x2
(2n + 1)⇡x (2n + 1)⇡
X (x) = B cos , k=
• We again proceed by seeking a separable solution 2L 2L
⇥(x, t) = X (x)S(t)
• Associated with this X (x) is the equation for S(t):
• Boundary conditions give X 0 (0) = 0 and X (L) = 0
• As with the previous example we may write (2n + 1)2 ⇡ 2 D
S 0 (t) = S(t)
4L2
X 00 (x) S 0 (t)
= = k2 with solution
X (x) D S(t)
(2n+1)2 ⇡ 2 Dt/(4L2 )
from which we may deduce that S(t) = Ce

X (x) = A sin kx + B cos kx


Cont. Maths HT16–8.15 Cont. Maths HT16–8.16
Partial Differential Partial Differential
Another Example, continued Equations Another Example, continued Equations

Stephen Cameron Stephen Cameron


• We now use an approach similar to that used for Fourier
• For n = 1, 2, 3, . . . the following is a solution of the PDE:
series to determine the constants Pn
(2n + 1)⇡x (2n+1) ⇡ Dt/(4L )2 2 2 • Assuming we may interchange the order of the infinite
Pn cos e
2L summation and integration gives
where Pn is a constant Z L 1
X Z L
• A general solution is a linear sum of these solutions: (L2 x 2 ) cos (2m+1)⇡x
2L dx = Pn cos (2m+1)⇡x
2L cos (2n+1)⇡x
2L dx
0 n=1 0
1
X (2n + 1)⇡x (2n+1)2 ⇡ 2 Dt/(4L2 )
⇥(x, t) = Pn cos e • Remembering that
2L
n=1 cos A cos B = 12 (cos(A + B) + cos(A B)) we have, for
integers m 6= n:
• The constants Pn are determined by the initial conditions
⇥(x, 0) = L2 x2 Z L
• Setting t = 0 in the infinite sum and equating to the initial cos (2m+1)⇡x
2L cos (2n+1)⇡x
2L dx
0
conditions gives Z L
1 m)⇡x
1
X = 2 cos (n+m+1)⇡x
L + cos (n L dx
2 2 (2n + 1)⇡x 0
L x = Pn cos h iL
2L 1 L L m)⇡x
n=1 = 2 (n+m+1)⇡ sin (n+m+1)⇡x
L + (n m)⇡ sin (n L =0
0
Cont. Maths HT16–8.17 Cont. Maths HT16–8.18

Partial Differential Partial Differential


Another Example, continued Equations Yet Another Example Equations

Stephen Cameron Stephen Cameron


• Solve

• We also have @⇥ @2⇥


= , 0 < x < 1, t >0
Z L Z L
@t @x 2
(2n + 1)⇡x 1 (2n + 1)⇡x
cos2 dx = 1 + cos dx with boundary conditions
0 2L 2 0 L
L ⇥ = 2 at x = 0, and ⇥ = 4 at x = 1
=
2
and initial conditions
• The constants Pn are therefore given by
Z L
⇥(x, 0) = 2 + 2x + 3 sin ⇡x
2 (2n + 1)⇡x
Pn = (L2 x 2 ) cos dx
L 0 2L • All the boundary conditions we have considered before are
of the form ⇥ = 0 or @⇥ @x = 0, which are known as
which can be evaluated by integration by parts; I get homogeneous boundary conditions
32L2 • This allows us to find non–trivial sine and cosine solutions
Pn = ( 1)n in the x variable
(2n + 1)3 ⇡ 3
• At first sight, we can’t do this for the non homogeneous
boundary conditions for this problem.
• But there is a way around it — write U = ⇥ (2 + 2x)
Cont. Maths HT16–8.19 Cont. Maths HT16–8.20
Partial Differential Partial Differential
Yet Another Example, continued Equations Similarity solutions to the heat equation Equations

• Noting that Stephen Cameron Stephen Cameron

@U @⇥ @2U @2⇥
= , 2
= • Suppose we want to solve
@t @t @t @t 2
we see that U satisfies the PDE @⇥ @2⇥
=D 2, x, t > 0
@U @2U @t @x
= , 0 < x < 1, t >0
@t @x 2 with initial and boundary conditions
• The boundary conditions become
⇥(x, 0) = 0 (x > 0) ⇥(0, t) = U, ⇥(1, t) = 0 (t > 0)
U = 0 at x = 0, and U = 0 at x = 1
• Physically this corresponds to a semi-infinite bar
and the initial conditions become occupying the region 0 < x < 1, that is initially at zero
U(x, 0) = 3 sin ⇡x temperature. At time t = 0 the end at x = 0 is raised to
temperature U
• The equation for U has homogeneous boundary p
• Let ⌘ = x/ Dt, and let ⇥ = f (⌘)
conditions, so can be solved in the same way as we have
solved earlier equations • ⌘ is known as a similarity variable
• The solution for ⇥ can then be recovered by writing

⇥(x, t) = U(x, t) + 2 + 2x
Cont. Maths HT16–8.21 Cont. Maths HT16–8.22

Partial Differential Partial Differential


Yet Another Example, continued Equations Yet Another Example, continued Equations

Stephen Cameron Stephen Cameron

• On Worksheet 1 you showed that for the heat equation on


the previous slide this implies that

f 00 (⌘) + 12 ⌘f 0 (⌘) = 0
• x = 1, t > 0 corresponds to ⌘ = 1 — the second
• Integrating once gives, for arbitrary constant B, boundary condition corresponds to f (1) = 0. Note this is
consistent with other conditions on f
⌘ 2 /4 • Using these conditions on f (0) and f (1) we may
f 0 (⌘) = Be
determine A and B to give
• Integrating once more gives, for arbitrary constant A, !
R⌘ s2 /4
Z e ds

s2 /4 u(x, t) = f (⌘) = U 1 Rs=0
1
f (⌘) = A + B e ds s=0
e s2 /4 ds
s=0
p
• Noting that x > 0, t = 0 corresponds to ⌘ = x/ Dt = 1,
the initial condition corresponds to f (1) = 0
• Similarly, x = 0, t > 0 corresponds to ⌘ = 0 and so the first
boundary condition corresponds to f (0) = U.

Cont. Maths HT16–8.23 Cont. Maths HT16–8.24


Partial Differential Partial Differential
Vibrating String Equations Model Justification Equations

Stephen Cameron Stephen Cameron

• Can model the string as many discrete masses connected


• Another standard example. Consider a tensioned string of
by short springs
length L attached its ends. The equation connecting its
• The longitudual tension in the string T is assumed large
(small) displacement u as a function of distance along the
compared with the transversal forces, so if F (x, t) is the
string x and time t is
force to the right in the string and Tr (x, t) the transversal
@2u @2u component the string
2
= c2 2 u(0, t) = u(L, t) = 0 @u
@t @x T = F (x, t) cos ✓ Tr (x, t) = F (x, t) sin ✓ = T tan ✓ = T (x, t)
@x
• We justify this later. We also want initial conditions
• The overall transversal force on a small piece of string is
( 2xd L proportional to the rate of change of Tr (x, t):
L 0<x  2
ut (x, 0) = 0, and given u(x, 0) = @2u @ @u @2u
2(L x)d L
L 2 <x L 2
(x, t) / (x, t) = (x, t)
@t @x @x @x 2
which is equivalent to the string being plucked in its centre
u
Tr F
d
x
x=0 x=L θ T

Cont. Maths HT16–8.25 Cont. Maths HT16–8.26

Partial Differential Partial Differential


Solution Equations Solution, continued Equations

Stephen Cameron Stephen Cameron


• Try for a separated solution
• Only at this point do we need to match the initial shape of
u(x, t) = X (x)T (t) ) XT 00 = c 2 X 00 T the string. We have the Fourier series for this shape from
an example on Worksheet 3;
• Re-organising, and avoiding exponential solutions
1 ✓ ◆
8d X ( 1)k (2k + 1)⇡x
T 00 X 00 sin
= c2 = 2
) X (x) = A sin c x + B cos c x ⇡2 (2k + 1)2 L
T X k =0

• u(0, t) = 0 ) B = 0 and so
• u(L, t) = 0 ) = cn⇡ ( ⇣ ⌘
L 8d ⇥ ( 1)(n 1)/2
n odd
• Now include T (t); we must have An = ⇡ 2 n2
0 n even
X (x) = An sin n⇡
L x T (t) = Cn cos n⇡ n⇡
L ct + Dn sin L ct
• So there is a fundamental frequency, followed by odd
1
• ut (x, 0) = 0 ) Dn = 0 harmonics, with harmonic n of magnitude n2
compared to
• WLOG, Cn = 1 and the fundamental.
X • The spectrum of the relative size of the harmonics is what
u(x, t) = An sin( n⇡ n⇡
L x) cos( L ct)
makes up the tone of a musical note
n
Cont. Maths HT16–8.27 Cont. Maths HT16–8.28
Partial Differential Partial Differential
Standing Waves Equations Poisson’s equation Equations

Stephen Cameron Stephen Cameron


• Poisson’s equations in two dimensions is the partial
differential equation
• We had the general solution (before imposing initial
shape): ✓ 2 ◆
@ u @2u
X D + + f (x, y ) = 0
@x 2 @y 2
u(x, t) = An sin( n⇡ n⇡
L x) cos( L ct)
n where D is constant
• Using the identity 2 sin X cos Y = sin(X + Y ) + sin(X Y) • This models many time independent diffusion processes
we get — e.g. chemical, heat — where f (x, y ) is a source term
• An exercise on Worksheet 1 was to show that, for
u(x, t) = W (x + ct) + W (x ct) cylindrical polar coordinates x = r cos ✓, y = r sin ✓,
X
1
where W (✓) = 2 An sin( n⇡
L ✓) ✓ ◆
@2u @2u 1 @ @u 1 @2u
n
2
+ 2
= r + 2 2
@x @y r @r @r r @✓
• This provides another interpretation of the solution,
namely as two standing waves travelling in opposite • We may therefore write Poisson’s equation as
directions with velocity c, and reflecting at the end-points. ✓ ◆
1 @ @u 1 @2u
r + + f (r , ✓) = 0
r @r @r r 2 @✓2
Cont. Maths HT16–8.29 Cont. Maths HT16–8.30

Partial Differential Partial Differential


Example Equations Example, continued Equations

• Solve Stephen Cameron Stephen Cameron

@2u @2u
+ x2 y2 = 0
@x 2 @y 2 • This has general solution

for x 2 + y 2 < 4, with boundary condition u = 5 on 1 4


x2 + y2 = 4 u= r + A log r + B
16
• Noting that x 2 + y 2 = r 2 we may write this as
✓ ◆ • We first note that u must be finite at r = 0 — as
1 @ @u 1 @2u
r + 2 2 = r2 limr !0 log r = 1 this requires A = 0
r @r @r r @✓
• The other boundary condition is u = 5 on r = 2 — this
for r < 2, with boundary condition u = 5 on r = 2 yields B = 4
• As there is no dependence on ✓ in the boundary
• The solution is therefore
conditions or source term we seek a solution u = u(r ), i.e.
we neglect the dependence on ✓ 1 4
• The partial derivatives with respect to r are now total
u = r +4
16
derivatives, and the partial derivatives with respect to ✓ are 1 2
zero = x2 + y2 +4
16
• The equation therefore becomes
✓ ◆
1 d du
r = r2
r dr dr
Cont. Maths HT16–8.31 Cont. Maths HT16–8.32
Partial Differential Partial Differential
Separable solutions to Poisson’s equation Equations Separable solutions, continued Equations

Stephen Cameron Stephen Cameron


• Suppose we want to solve • We have two boundary conditions on X , so start with this
equation first:
@2u @2u
+ = 0, 0 < x, y < 1
@x 2 @y 2 X 00 + k 2 X = 0

with boundary conditions • Boundary conditions give, for arbitrary constant B

u = 0, x = 0, x = 1, y = 1 X (x) = B sin n⇡x, n = 1, 2, 3, . . .


u = x(1 x), y =0
and k = n⇡.
• We seek a separable solution u(x, y ) = X (x)Y (y ), with • ODE for Y (y ) becomes
boundary conditions
Y 00 n2 ⇡ 2 Y = 0
X (0) = 0, X (1) = 0
, Y (1) = 0 • This has general solution

• Substitution into the given PDE gives X 00 Y + XY 00 = 0 Y (y ) = Cen⇡y + De n⇡y

which may be written


• Applying the boundary condition Y (1) = 0 gives
X 00 Y 00 2 D = Ce2n⇡
= = k
X Y • General solution becomes Y (y ) = C en⇡y en⇡(2 y)
Cont. Maths HT16–8.33 Cont. Maths HT16–8.34

Partial Differential Partial Differential


Separable solutions, continued Equations Summary Equations

• Solution may be written Stephen Cameron Stephen Cameron

1
X ⇣ ⌘
u(x, y , t) = Pn en⇡y en⇡(2 y)
sin n⇡x
• We can normally assume that PDEs have a unique
n=1
solution
• To set u = x(1 x) on y = 0 we note that • Separation of variable used to construct separate (but
x(1 x) = u(x, 0) linked) ODEs for each variable
X1 • Boundary conditions on one variables can be used to
= Pn 1 e2n⇡ sin n⇡x constrain the common constant
n=1
• Common sense is also useful. For physical systems
• We will now follow the Fourier type approach to determine quantities can’t be infinite, entropy tends to increase with
the constants Pn . Noting that for integers m, n we have time, etc.
Z 1 ⇢ • Tricks are also useful in solving the equations
0 m 6= n
sin m⇡x sin n⇡x dx = 1 • Fourier techniques can be used to combine solutions, with
0 2 m=n
the constants established from the boundary conditions
we may write
Z 1 ⇢ 8
2 n3 ⇡ 3 (e2n⇡ 1)
n even
Pn = x(1 x) sin n⇡x dx =
1 e2n⇡ 0 0 n odd
Cont. Maths HT16–8.35 Cont. Maths HT16–8.36

You might also like