partial differential equations - school of mathematicsngray/math19662/notes/section 5... · 1m2...

21
1M2 Course Notes §5 Partial Differential Equations 5 Partial Differential Equations We know that a function of a single variable may satisfy a differential equation. For example, the function y = Ae 2t satisfies the differential equation dy dt =2y for all values of the constant A. Similarly the function y = Pe x + Qe 2x satisfies the differential equation d 2 y dx 2 + dy dx 2y =0 for all values of the constants P and Q. Differential equations involving terms like d n y dx n with n =1, 2, ..., N are called ordinary differential equations. In general solu- tions of ordinary differential equations contain arbitrary con- stants as in the two examples above. When the differential equation involves partial derivatives ∂/∂x, ∂/∂y , 2 /∂x 2 , 2 /∂y 2 etc, then the equation is called a par- tial differential equation. ODEs “Ordinary derivatives” PDEs “Partial derivatives” 5.1 February 2010

Upload: lyxuyen

Post on 06-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

1M2 Course Notes §5 Partial Differential Equations

5 Partial Differential Equations

We know that a function of a single variable may satisfy adifferential equation. For example, the functiony = Ae2t

satisfies the differential equation

dy

dt= 2y

for all values of the constantA. Similarly the functiony = Pex + Qe−2x satisfies the differential equation

d2y

dx2+

dy

dx− 2y = 0

for all values of the constantsP andQ.

Differential equations involving terms like

dny

dxnwith n = 1, 2, ..., N

are calledordinary differential equations. In general solu-tions of ordinary differential equations contain arbitrary con-stants as in the two examples above.

When the differential equation involves partial derivatives∂/∂x,∂/∂y, ∂2/∂x2, ∂2/∂y2 etc, then the equation is called apar-tial differential equation.

ODEs ⇒ “Ordinary derivatives”

PDEs ⇒ “Partial derivatives”

5.1 February 2010

1M2 Course Notes §5 Partial Differential Equations

A function of two (or more) variables may satisfy a partialdifferential equation. For example the functionf = x(x−2y)2

is a solution of the partial differential equation

2x∂f

∂x+ x

∂f

∂y= 2f.

Check:∂f

∂x= (x − 2y)2 + 2x(x − 2y),

∂f

∂y= −4x(x − 2y)

Substituting

2x(x−2y)2+4x2(x−2y)−4x2(x−2y) = 2x(x−2y)2 = 2fX

And the functionZ = 4x3 + 36xy2 − 24y3 is a solution of thepartial differential equation

−3∂2Z

∂x2+ 2

∂2Z

∂x∂y+

∂2Z

∂y2= 0.

Check:∂Z

∂x= 12x2 + 36y2,

∂Z

∂y= 72xy − 72y2

∂2Z

∂x2= 24x,

∂2Z

∂x∂y= 72y,

∂2Z

∂y2= 72x − 144y

Substituting

−3(24x) + 2(72y) + (72x − 144y) = 0X

5.2 February 2010

1M2 Course Notes §5 Partial Differential Equations

In the same way that solutions to a first order ordinary differ-ential equation contain anarbitrary constant, the solution toa first order partial differential equation contain anarbitraryfunction.

Example 7.1Show that the functionf(x, y) = xg(x − 2y), whereg is anarbitrary function, is a solution to the partial differential equa-tion

2x∂f

∂x+ x

∂f

∂y= 2f e.g.g(u) = u2

Find the particular solution that satisfiesf(x, y) = x3 alongthe x axis (that is wheny = 0).Solution

∂f

∂x= g(x − 2y) + xg′(x − 2y)

∂f

∂y= (−2)xg′(x − 2y)

Substituting

2x(

g(x−2y)+xg′(x−2y))

+x(

−2xg′(x−2y))

= 2xg(x−2y) = 2fX

On thex-axis (wheny = 0) the general solution reduces to

f(x, 0) = xg(x) = x3 ⇒ g(x) = x2

For an argumentx − 2y instead ofx the functiong is

g(x − 2y) = (x − 2y)2

and the particular solution is therefore

f(x, y) = x(x − 2y)2

5.3 February 2010

1M2 Course Notes §5 Partial Differential Equations

5.1 Fundamental Partial Differential Equations

There are three very important equations that occur in engineering:-

1. thewave equation

∂2Z

∂t2= c2∂

2Z

∂x2, c is the wave speed

occurs in problems concerning vibration, for example thevibration of violin string, or waves travelling through somemedium.

It is time-dependent and requires two initial conditions

Z(x, 0) = a(x),∂Z

∂t(x, 0) = b(x),

and two boundary conditions, e.g.

Z(xleft, t) = c(t), Z(xright, t) = d(t).

2. theheat or diffusion equation

∂Z

∂t= k

∂2Z

∂x2, k is the thermal diffusivity

is used to model the diffusion of heat, and the diffusion ofa wide variety of other quantities, for example pollutantsin water.

It is time-dependent and requires one initial condition

Z(x, 0) = a(x),

and two boundary conditions, e.g.

Z(xleft, t) = c(t), Z(xright, t) = d(t).

5.4 February 2010

1M2 Course Notes §5 Partial Differential Equations

3. Laplace’s equation

∂2Z

∂x2+

∂2Z

∂y2= 0.

is independent of time, and is used to model a wide variety ofstationary problems occurring in solid mechanics (e.g. tor-sion), fluid mechanics (e.g. pressure and stream functions)and in electrostatics (e.g. electric and magnetic fields).

Requires boundary conditionsalong the entire domain bound-ary, e.g. for a rectangular plate

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

����������������������������������������������������������������

Z(x, y)

y

xO α

β

Z(x, 0) = a(x) when y = 0

Z(x, β) = b(x) when y = β

Z(0, y) = c(y) when x = 0

Z(α, y) = d(y) when x = α

5.5 February 2010

1M2 Course Notes §5 Partial Differential Equations

Arbitrary constants and/or arbitrary functions occur in solu-tions to partial differential equations and specification of suit-able boundary conditions that ensures that both a solution ex-ists and that it is unique is a far from trivial task.

For example, it is fairly easy to see that bothf(x + ct) andg(x − ct) satisfy the wave equation by simple differentiationand the general solution of the wave equation is written as

Z = f(x + ct) + g(x − ct) (1)

but extra conditions are needed to determinef andg.

Example 7.2

The displacement of a string of lengthπ, clamped at eitherend is governed by the differential equation

∂2Z

∂t2= 100

∂2Z

∂x2. (c = 10)

Show that if the string is initially displaced to a profile2 sin(x)

and releasedits displacement is given by

Z = sin(x + 10t) + sin(x − 10t) Note form of (1)

Solution:

The displacementz satisfies the initial conditions

Z(x, 0) = 2 sin x, 0 ≤ x ≤ π

∂Z

∂t(x, 0) = 0, 0 ≤ x ≤ π released from rest

and the boundary conditions

Z(0, t) = 0, t ≥ 0, string clamped atx = 0

Z(π, t) = 0, t ≥ 0, string clamped atx = π

5.6 February 2010

1M2 Course Notes §5 Partial Differential Equations

Differentiating the solution

Zx = cos(x + 10t) + cos(x − 10t)

Zxx = − sin(x + 10t) − sin(x − 10t)

Zt = 10 cos(x + 10t) −10 cos(x − 10t)

Ztt = −100 sin(x + 10t) −100 sin(x − 10t)

⇒ Ztt = 100Zxx, so PDE satisfied

Are the initial/boundary conditions satisfied?

Z(x, 0) = sin(x + 0) + sin(x − 0) = 2 sin(x)X

Zt(x, 0) = 10 cos(x) − 10 cos(x) = 0X

Z(0, t) = sin(10t) + sin(−10t) = 0X

Z(π, t) = sin(π + 10t) + sin(π − 10t) = − sin(10t) − sin(−10t) = 0X

⇒ Z(x, t) satisfies the problem

5.7 February 2010

1M2 Course Notes §5 Partial Differential Equations

−2

0

2 t=0.000

z

−2

0

2 t=0.105

z

−2

0

2 t=0.209

z

−2

0

2 t=0.314

z

−2

0

2 t=0.419

z

−2

0

2 t=0.524

z

0 0.5 1 1.5 2 2.5 3−2

0

2

x

t=0.628

z

A sequence of spatial plots showing the displacement of the string z(x, t)at different instants of timet.

Good lecture break

5.8 February 2010

1M2 Course Notes §5 Partial Differential Equations

5.2 Solution of PDEs by Separation of Variables

The most common method for solving the PDEs that occurin engineering design is numerical and for those who are in-terested you will see examples of this in other course mod-ules. There is an analytic method that can be used to solvesimple equations in simple situations, namelyseparation ofvariables and we shall look at an example of this approachhere for theHeat Equation.

The method assumes that we can write the solutionZ to aPDE in the formZ(x, t) = X(x)T (t) [or as a sum of suchterms

X1(x)T1(t) + X2(x)T2(t) + X3(x)T3(t) · · ·

This form can be substituted into the equation and the func-tions X of x only andT of t only can be separated out andevaluated.

TheMethod of Separation of Variables can be summarizedas follows:-

1. substitute the formZ = X(x)T (t) into the equation

2. write the terms involvingx only on one side of the equationand the terms involvingt only on the other side. Equateboth sides to a constantK

3. solve the ODE’s that result for each possible value ofK,K = 0, K > 0, K < 0

4. apply the boundary conditions to evaluateX andT

5.9 February 2010

1M2 Course Notes §5 Partial Differential Equations

For example, consider a bar of thermal diffusivityk = 1 andof length 1 heated to a temperature 1. Both ends are thencooled to 0 by immersion in ice. Find how the temperatureZ(x, t) in the bar behaves as a function of position and time?

MathematicallyZ(x, t) satisfies the Heat Equation

∂Z

∂t=

∂2Z

∂x2;

The initial and boundary conditions are

1. Z(x, 0) = 1

2. Z(0, t) = 0

3. Z(1, t) = 0

For those that are astute there is a bit of a problem with theboundary conditions. What is the value at(0, 0) and at(1, 0)?

zero or one?

In practice this does not cause a problem for this equation.Nevertheless, this PDE with boundary conditions is a bit trickyto solve, although we shall do that later. First we shall solvethe simpler problem, assuming that the bar is heated to an ini-tial temperature distributionZ(x, 0) = sin(πx).

5.10 February 2010

1M2 Course Notes §5 Partial Differential Equations

Example 7.3Solve the heat equation

∂Z

∂t=

∂2Z

∂x2

subject to the initial condition and boundary conditions

Z(x, 0) = sin(πx), 0 < x < 1

Z(0, t) = 0, t > 0

Z(1, t) = 0, t > 0

Note asx −→ 0 andx −→ 1, so the initial and boundaryconditions are compatible this time!

SolutionLet Z(x, t) = X(x)T (t) then

∂Z

∂t= X(x)T ′(t)

∂Z

∂x= X ′(x)T (t)

∂2Z

∂x2= X ′′(x)T (t)

The equation becomes

X(x)T ′(t) = X ′′(x)T (t)

which can be rearranged into

T ′(t)

T (t)=

X ′′(x)

X(x)

5.11 February 2010

1M2 Course Notes §5 Partial Differential Equations

Since the RHS of this equation is a function ofx only and theLHS is a function oft only, the only way this is possible isif both sides are equal to a constantK. Thus

T ′(t)

T (t)= K =

X ′′(x)

X(x)

and this separates into two ordinary differential equations

T ′(t) = KT (t)

X ′′(x) = KX(x)

We shall now consider the 3 casesK = 0, K > 0, K < 0.

Case 1: K = 0

Here we haveT ′(t) = 0 andX ′′(x) = 0 and therefore

T (t) = A and X(x) = B + Cx

ThusZ = A(Bx + C) = Px + Q

The only way this can satisfy the boundary conditions

Z(0, t) = 0 and Z(1, t) = 0

is for bothP andQ to be zero, that isZ = 0.

This cannot satisfyZ(x, 0) = sin(πx).

# Contradiction!

ThusK 6= 0

5.12 February 2010

1M2 Course Notes §5 Partial Differential Equations

Case 2: K > 0

We setK = λ2 > 0 and the equations become

T ′(t) = λ2T and X ′′(x) = λ2X

The first equation implies

dT

T= λ2dt ⇒ ln(T ) = λ2t + A ⇒ T (t) = Aeλ2t

While the second equation implies

X ′′(x) − λ2X(x) = 0 ⇒ X(x) = Beλx + Ce−λx

Putting the two solutions togetherZ = T (t)X(x)

Z = Aeλ2t[Beλx + Ce−λx] = eλ2t[Peλx + Qe−λx]

The leftboundary conditionZ(0, t) = 0 implies that

P = −Q,

The rightboundary conditionZ(1, t) = 0 implies that

Peλ + Qe−λ = 0 or P [eλ − e−λ] = 0 ⇒ P = 0

This implies thatP andQ are both zero in which case theinitial conditionZ(x, 0) = sin(πx) cannot be satisfied.

# Contradiction!

5.13 February 2010

1M2 Course Notes §5 Partial Differential Equations

Case 3: K < 0

We setK = −λ2 < 0 and the equations become

T ′(t) = −λ2T, and X ′′(x) = −λ2X

The first equation implies

dT

T= −λ2dt ⇒ ln(T ) = −λ2t+A ⇒ T (t) = Ae−λ2t

While the second equation implies(p2 +λ2 = 0,⇒ p = ±λi)

X ′′(x)+λ2X(x) = 0 ⇒ X(x) = B cos(λx)+C sin(−λx).

Putting the two solutions togetherZ = T (t)X(x)

Z = Ae−λ2t[B cos(λx) + C sin(−λx)]

⇒ Z = e−λ2t[P cos(λx) + Q sin(−λx)]

The leftboundary conditionZ(0, t) = 0 implies that

0 = e−λ2t[P + 0] ⇒ P = 0

The rightboundary conditionZ(1, t) = 0 implies that

0 = e−λ2t[0 + Q sin(λ)] ⇒ λ = nπ, n = 1, 2, 3 · · ·

We have then

Z(x, t) = Qe−(nπ)2t sin(nπx). (2)

The initial conditionZ(x, 0) = sin(πx) is satisfied by choos-ing n = 1 andQ = 1. Therefore the solution is

Z(x, t) = e−π2t sin(πx)

5.14 February 2010

1M2 Course Notes §5 Partial Differential Equations

0

0.5

1t=0.000

z

0

0.5

1t=0.050

z

0

0.5

1t=0.100

z

0

0.5

1t=0.150

z

0

0.5

1t=0.200

z

0

0.5

1t=0.250

z

0 0.2 0.4 0.6 0.8 10

0.5

1

x

t=0.300

z

A series of spatial plots showing how the heatZ(x, t) is diffused awaywith increasing timet.

Good lecture break

5.15 February 2010

1M2 Course Notes §5 Partial Differential Equations

5.3 Separation of variables and superposition

Having solved the simplified heat flow problem, example 7.3,we will now go back to the original problem, namely the Heatequation withZ(0, t) = 0 andZ(1, t) = 0 for all t, but with

Z(x, 0) = 1 instead of Z(x, 0) = sin(πx).

The above argument still holds as far as equation (2), wherewe have shown that

Z(x, t) = Qe−(nπ)2t sin(nπx)

satisfies the differential equation and boundary conditions forall values ofn.

Since the heat equation is a linear PDE we can superpose so-lutions. It is a simple calculation to see that

Z(x, t) = Qne−(nπ)2t sin(nπx)+Qme−(mπ)2t sin(mπx), n 6= m

also satisfies the PDE and boundary conditions as does

Z(x, t) =

∞∑

n=1

Qne−(nπ)2t sin(nπx).

To satisfy the initial conditionZ(x, 0) = 1 we need

1 =

∞∑

n=1

Qn sin(nπx).

We can indeed choose the{Qn} so that this equation is solvedbut this is the topic ofFourier Analysis which is beyond thescope of this course.

5.16 February 2010

1M2 Course Notes §5 Partial Differential Equations

Example 7.4

Solve Laplace’s Equation∂2u

dx2+

∂2u

dy2= 0 subject to the

boundary conditions that

u = 0 when x = 0 (3)

u = 0 when x = 1 (4)

u = sin 2πx when y = 0 (5)∂u

∂y= −2π sin 2πx when y = 0 (6)

Solution

Assuming a solution of separable formu = X (x) Y (y), thederivatives are

⇒∂2u

dx2= X ′′ (x) Y (y) ,

∂2u

dy2= X (x) Y ′′ (y) .

The equation becomes

X ′′ (x) Y (y) + X (x) Y ′′ (y) = 0.

which can be rearranged into

X ′′ (x)

X (x)= −

Y ′′ (y)

Y (y)= k

wherek is a constant.

5.17 February 2010

1M2 Course Notes §5 Partial Differential Equations

Case I: k = 0

The separated equations become

X ′′ (x) = 0 and Y ′′ (y) = 0

which have solutions

X = ax + b and Y = cy + d

The composite solution is therefore

u = (ax + b) (cy + d) .

Condition (3) implies that

0 = b (cy + d) for all y

so eitherb = 0 OR c = d = 0.

Condition (4) gives

0 = (a + b) (cy + d)

so eithera + b = 0 or c = d = 0.

Thusa = b = 0 OR c = d = 0 and in either case,

u = 0 everywhere.

It follows that condition (5) can not be satisfied.# Contradiction!

5.18 February 2010

1M2 Course Notes §5 Partial Differential Equations

Case II: k = λ2 > 0

X ′′ (x)

X (x)= −

Y ′′ (y)

Y (y)= λ2

implies that

X ′′ (x) − λ2X (x) = 0 and Y ′′ (y) + λ2Y (y) = 0

which have solutions

X = Aeλx + Be−λx and Y = C cos λx + D sinλx

giving

u =(

Aeλx + Be−λx)

(C cos λy + D sin λy) .

Condition (3) gives0 = (A + B) (C cos λy + D sinλy) andthis must apply for ally so eitherA + B = 0 ORC = D = 0.

Condition (4) gives0 =(

Aeλ + Be−λ)

(C cos λy + D sin λy)

so eitherAeλ + Be−λ = 0 ORC = D = 0.

The two conditions involvingA andB giveA = B = 0. ThuseitherA = B = 0 ORC = D = 0.

In either caseu = 0 so condition (5) cannot be satisfied.# Contradiction!

5.19 February 2010

1M2 Course Notes §5 Partial Differential Equations

Case III: k = −λ2 < 0

X ′′ (x)

X (x)= −

Y ′′ (y)

Y (y)= −λ2

becomes

X ′′ (x) + λ2X (x) = 0 and Y ′′ (y) − λ2Y (y) = 0

which have solutions

X = A sin λx + B cos λx and Y = Ceλy + De−λy

giving

u = (A sinλx + B cos λx)(

Ceλy + De−λy)

.

Condition (3) gives0 = B(

Ceλy + De−λy)

so eitherB = 0

or C = D = 0. If C = D = 0, u = 0 everywhere so condition(5) cannot be satisfied. HenceB = 0.

Condition (4) gives0 = A sin λ(

Ceλy + De−λy)

so A = 0

OR sin λ = 0 (As C = D = 0 is not allowed).

If A = 0, u = 0 everywhere and condition (5) cannot besatisfied. Therefore,sinλ = 0 giving λ = nπ.

We now have

u = A sin nπx(

Cenπy + De−nπy)

= sinnπx(

Eenπy + Fe−nπy)

whereE = AC andF = AD.

Condition (5) givessin 2πx = sin nπx (E + F ) and these areconsistent ifn = 2 andE + F = 1.

5.20 February 2010

1M2 Course Notes §5 Partial Differential Equations

If follows that

u = sin 2πx(

Ee2πy + (1 − E) e−2πy)

∂u

∂y= sin 2πx

(

2πEe2πy − 2π (1 − E) e−2πy)

.

Condition (6) gives

−2π sin 2πx = sin 2πx (2πE − 2π (1 − E))

⇒ −2π = 2πE − 2π + 2πE,

⇒ E = 0 ⇒ F = 1.

The solution is therefore

u = e−2πy sin 2πx

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.05

0.1

0.15

0.2

0.25

0.3

X

Y

−0.8

−0.6−0.6 −0.4

−0.4

−0.4

−0.2

−0.2−0.2

−0.2

00

0

0.2

0.2

0.2

0.2

0.4

0.4

0.6

0.6

0.8

Contours of u(x,y) for the separable variable solution.

5.21 February 2010