+ All Categories
Home > Documents > Lecture 17 Solving the Diffusion equation Remember Phils Problems and your notes = everything Only...

Lecture 17 Solving the Diffusion equation Remember Phils Problems and your notes = everything Only...

Date post: 05-Jan-2016
Category:
Upload: clifton-burns
View: 213 times
Download: 1 times
Share this document with a friend
25
Lecture 17 Lecture 17 Solving the Diffusion equation Solving the Diffusion equation http://www.hep.shef.ac.uk/Phil/PHY226.htm Remember Phils Problems and your notes = everything ly 5 lectures left ome to see me before the end of term ’ve put more sample questions and answers in Phils Problems ast exam papers omplete solution from last lecture ave a look at homework 2 (due in on 12/12/08) t u h u 2 2 1
Transcript
Page 1: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Lecture 17Lecture 17

Solving the Diffusion equationSolving the Diffusion equation

http://www.hep.shef.ac.uk/Phil/PHY226.htmRemember Phils Problems and your notes = everything

Only 5 lectures left

• Come to see me before the end of term• I’ve put more sample questions and answers in Phils Problems• Past exam papers• Complete solution from last lecture• Have a look at homework 2 (due in on 12/12/08)

t

u

hu

2

2 1

Page 2: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Poisson’s equation

t

uiVuu

m

22

2

2

2

22 1

t

u

cu

Introduction to PDEsIntroduction to PDEs

In many physical situations we encounter quantities which depend on two or more variables, for example the displacement of a string varies with space and time: y(x, t). Handing such functions mathematically involves partial differentiation and partial differential equations (PDEs).

t

u

hu

22 1

02 u

0

2

uAs (4) in regions

containing mass, charge, sources of heat, etc.

Electromagnetism, gravitation,

hydrodynamics, heat flow.

Laplace’s equation

Heat flow, chemical diffusion, etc.

Diffusion equation

Quantum mechanicsSchrödinger’s

equation

Elastic waves, sound waves, electromagnetic

waves, etc.Wave equation

Page 3: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

The Diffusion equationThe Diffusion equation

f(x, t) is the quantity that diffuses. It usually describes a chemical or heat diffusing through a region where h2 is the diffusion constant typically 1×10-4 m 2s -1 for metals.

In classical physics, almost all time dependent phenomena may be described by the wave equation or the diffusion equation. Smaller than the micrometer scale, diffusion is often the dominant phenomenon.

The 1D diffusion equation has the form t

txf

hdx

txfd

),(1),(

22

2

Page 4: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Step 4: Boundary conditions could then be applied to find A and B

Step 2: The auxiliary is then and so roots are

Step 1: Let the trial solution be So andmtx e mxmedt

dx mt xmemdt

xd mt 222

2

Unstable equilibrium

xxm 22 m

Step 3: General solution for real roots is m

)()( 2

2

2

txdt

txd

tt BeAetx )(

Introduction to PDEsIntroduction to PDEs

Thing to notice is that x(t) only tends towards x=0 in one direction of t, increasing exponentially in the other

tAetx )(

t

Page 5: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Step 1: Let the trial solution be So and

Introduction to PDEsIntroduction to PDEs

Harmonic oscillator

mtx e mxmedt

dx mt xmemdt

xd mt 222

2

Step 2: The auxiliary is then and so roots are xxm 22 im

Step 3: General solution for complex is

where = 0 and = so

)cossin( tDtCex t

tDtCx cossin

im

Thing to notice is that x(t) passes through the equilibrium position (x=0) more than once !!!!

Step 4: Boundary conditions could then be applied to find C and D

)()( 2

02

2

txdt

txd

tCx sin

Page 6: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

2 2

2 2 2

( , ) 1 ( , )y x t y x t

x c t

)()(),( tTxXtxy

Ndt

tTd

tTcdx

xXd

xX

2

2

22

2 )(

)(

1)(

)(

1

SUMMARY of the procedure used to solve PDEs

9. The Fourier series can be used to find the particular solution at all times.

1. We have an equation with supplied boundary conditions

2. We look for a solution of the form

3. We find that the variables ‘separate’

4. We use the boundary conditions to deduce the polarity of N. e.g.

5. We use the boundary conditions further to find allowed values of k and hence X(x).

6. We find the corresponding solution of the equation for T(t).

7. We hence write down the special solutions.

8. By the principle of superposition, the general solution is the sum of all special solutions..

2kN

L

xnBxX nn

sin)( kxBkxAxX sincos)( so

kctDkctCtT sincos)(

nn L

ctnEtT cos)(

nnn L

ctn

L

xnBtxY

cossin),(

1

cossin),(n

nn L

ctn

L

xnBtxy

L

ct

L

x

L

ct

L

x

L

ct

L

x

L

ct

L

xdtxy

7cos

7sin

49

15cos

5sin

25

13cos

3sin9

1cossin

8),(

2

www.falstad.com/mathphysics.html

Page 7: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Before we do anything let’s think about hot stuffBefore we do anything let’s think about hot stuffConsider a metal bar heated along it’s length. The ends are placed in ice water and so are held at 0ºC and the middle section is heated by a gas burner.

After a while we reach an equilibrium or steady state temperature distribution along the rod which, let’s say is given by f(x), the temperature distribution plot below.

x = 0 x = Lforxxf )( 20 Lx

Lxxf )( LxL 2forIs there a way of describing the shape of the temperature distribution in terms of an infinite series of sine terms ???????

Yes, it’s called the Half range sine series !!!!

Page 8: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Before we do anything let’s think about hot stuffBefore we do anything let’s think about hot stuff

forxxf )( 20 Lx

Lxxf )( LxL 2for

1

sin)(n

n d

xnbxf

d

n dxd

xnxf

db

0sin)(

2 Half-range sine series: where

. L

L

LL

n dxL

xnxL

Ldx

L

xnx

Ldx

L

xnxf

Lb

2

2

00

sin)(2

sin2

sin)(2

So

Full solution is given in the notes, but we don’t want to waste time doing number crunching so let’s go straight to the answer….

2sin

422

n

n

Lbn

1

sin)(n

n d

xnbxf

L

xnn

n

Lxf

n

sin2

sin4

)(1

22

Find So since then

This describes the temperature distribution f(x) along the bar in equilibrium

Page 9: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxationConsider a metal bar heated along it’s length. The ends are placed in ice water and so are held at 0ºC and the middle section is heated by a gas burner.

After a while we reach an equilibrium or steady state temperature distribution along the rod which, let’s say is given by f(x), the temperature distribution plot below.

At t = 0 we switch off the burner and allow the rod to cool.

What is the function f(x,t) that describes the temperature of the rod at any point along its length at any time as it cools?

t

txf

hdx

txfd

),(1),(

22

2Heat flow is governed by the diffusion equation,

(f is the temperature and x is position and t is time)

Page 10: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

t

txf

hdx

txfd

),(1),(

22

2Heat flow is governed by the diffusion equation,

(f is the temperature and x is position and t is time)

Step 1: Rewrite using new variables

Substitute f(x,t) back into the Diffusion equation:

Separating variables:

Step 2: Rearrange the equation

We are looking for solutions of the form )()(),( tTxXtxf

Where X(x) is temperature purely as a function of x

and T(t) is temperature purely as a function of time

dt

tdTxX

htT

dx

xXd )()(

1)(

)(22

2

dt

tdT

tThdx

xXd

xX

)(

)(

11)(

)(

122

2

Page 11: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

Step 3: Equate to a constant

Now we have separated the variables. The above equation can only be true for all x, t if both sides are equal to a constant.

So which rearranges to (i)

which rearranges to (ii)

dt

tdT

tThdx

xXd

xX

)(

)(

11)(

)(

122

2

constant)(

)(

12

2

dx

xXd

xX )(constant

)(

)(

12

2

xXdx

xXd

xX

constant)(

)(

112

dt

tdT

tTh )(constant

)( 2 tThdt

tdT

Page 12: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

Step 4: Decide based on the boundary conditions whether constant is +ve or -ve

(i) )(constant)(

2

2

xXdx

xXd

We are told in the boundary conditions that both ends of the rod are held at 0°C at all times.

We therefore choose a negative constant, –k2, to give LHO type solutions that will allow X(x) to be zero at more than one value of x, and rearrange to get two ODEs:

Xkdx

xXd 22

2 )( kxBkxAxX sincos)(

)()( 22 tThk

dt

tdT thkCetT

22

)(

which has general solution

which has general solution

(ii) )(constant)( 2 tTh

dt

tdT

(iii)

(iv)

Page 13: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

kxBkxAxX sincos)( thkCetT22

)(

Also since then

Solution to (iii) is kxBkxAxX sincos)(

Step 5: Solve for the boundary conditions for X(x)

We know that X(0) = X(L) = 0 meaning that the temperature is zero at the ends

nkL L

xnBxX

sin)( so we can say kLBLX sin0)(

We know that X(0) = 0 so A = 0.

(iii) (iv)

X(x)

x

Page 14: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

where

Step 6: Write down the special solution for fn (x, t) i.e.

where Pn = BnCn

n

t

nnn eL

xnCBtTxXtxf

sin)()(),(2

22

1

hn

L

khn

xkBxX nnn sin)( thknn

neCtT22

)(

)()(),( tTxXtxf nnn

n

t

nn eL

xnPtTxXtxf

sin)()(),(So

is a special solution of the diffusion equation at one value of n

Page 15: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

1

)()(),(n

nn tTxXtxf

n

t

nn eL

xnPtTxXtxf

sin)()(),(So

is a special solution of the diffusion equation at one value of n

The general solution therefore is

n

t

nn

nne

L

xnPtxftxf sin),(),(

.

Step 7: Constructing the general solution for

The general solution of our equation is the sum of all special solutions:

Page 16: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

The general solution is

n

t

nne

L

xnPtxf sin),(

All that remains is calculate the required values of Pn and the harmonics required.

Step 8: Use Fourier series to find values of Pn

We can do this by relating the Fourier series found at t = 0 to the general solution.

The general solution is the solution to the diffusion equation for all values of n summed from 1 to infinity. For our specific example we only want our solution to contain those harmonics required to fulfil the boundary conditions.

Remember earlier we showed that in equilibrium the temperature profile along the rod is given by:

L

xnn

n

Lxf

n

sin2

sin4

)0,(1

22

By comparing this with the general solution at the top of the page when t = 0 we can assign values to Pn .

Page 17: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

The general solution is

n

t

nne

L

xnPtxf sin),(

Step 8 continued: Use Fourier series to find values of Pn

L

xnn

n

Lxf

n

sin2

sin4

)0,(1

22

By comparing we can see that

n

n L

xnPxf

sin)0,(The general solution at t = 0 is

Fourier series at t = 0 is

2sin

422

n

n

LPn

Step 9: Write down full solution of problem

n

t

neL

xnn

n

Ltxf

sin

2sin

4),(

22where

2

22

1

hn

L

khn

Page 18: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Let’s check that this fulfils all boundary conditions

This is just the Fourier series at start

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxationA metal bar is heated along it’s length. The ends are placed in ice water and so are held at 0ºC and the middle section is heated by a gas burner. At t=0 heating stops.

)0()()0,( TxXxf

)()0(),0( tTXtf

)()(),( tTLXtLf

n

t

neL

xnn

n

Ltxf

sin

2sin

4),(

22

n L

xnn

n

Ltxf

sin2

sin4

),(22

00),(

n

t

etxf

0sin2

sin4

),(22

n

t

nenn

n

Ltxf

Page 19: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Now we can stick in appropriate values of h and find how the temperature profile changes over time. It can be shown that f(x, t) with increasing time looks like this:

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxationA metal bar is heated along it’s length. The ends are placed in ice water and so are held at 0ºC and the middle section is heated by a gas burner. At t=0 heating stops.

n

t

neL

xnn

n

Ltxf

sin

2sin

4),(

22where

2

22

1

hn

L

khn

.....

5sin

25

13sin9

1sin1

14),(

2

22

2

22

2

22 259

2L

th

L

th

L

th

eL

xe

L

xe

L

xLtxf

Page 20: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Solving the diffusion equation for relaxationSolving the diffusion equation for relaxation

Points of interest

The temperature distribution decays exponentially with time.

2

22

1

hn

L

khn

The time constant of the decay is proportional to k -2, and therefore also L2. So the longest wavelengths (such as the fundamental) last longest.

.....

5sin

25

13sin9

1sin1

14),(

2

22

2

22

2

22 259

2L

th

L

th

L

th

eL

xe

L

xe

L

xLtxf

To know exactly how the temperature profile changes with time then we need all the terms. But usually a very good approximation can be obtained by considering just the first term.

n

t

n etT

)(

Remember how we said earlier that temperature as a function of time was written:

22

1

khn

The time constant of temperature decay is defined as , the time for temperature to drop to of its initial value.

n37.01 e

where

Page 21: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Our experimentOur experiment

2

22

sin4

),(2

L

th

eL

xLtxf

A good approximation can be obtained by considering just the first term.

At a fixed x, the temperature drop from t = 0 is:

2

22

)( L

th

etf

We know , L = 0.5m , and h2 = 3×10-5m2s-1 for stainless steel.

32

22

1

102.11

L

sh

L844

22

2

1

So and therefore So 844)(t

etf

We must record temperature at a fixed location on the rod at regular intervals, then plotting it as a function of time and fitting an exponential to find the decay time constant

n

t

neL

xnn

n

Ltxf

sin

2sin

4),(

22

Remember that now in the full equation x is fixed constant

Page 22: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Our experimentOur experiment

Theory tells us that at a fixed x, the temperature drop from t = 0 should be:

32

22

1

102.11

L

844)(t

etf

We recorded temperature at a fixed location on the rod at regular intervals, then plotted it as a function of time and fitted an exponential to find the decay time constant

since

y = 333.75e-0.0012x

0

50

100

150

200

250

300

350

400

0 200 400 600 800 1000 1200 1400Time (seconds)

Tem

per

atu

re (

deg

C)

Data collected during the lecture has a decay constant of 1.2x10-3 as expected!!!!

Page 23: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Revision for the examRevision for the exam

http://www.shef.ac.uk/physics/exampapers/2007-08/phy226-07-08.pdf

Above is a sample exam paper for this course

There are 5 questions. You have to answer Q1 but then choose any 2 others

Previous years maths question papers are up on Phils Problems very soon

Q1: Basic questions to test elementary concepts. Looking at previous years you can expect complex number manipulation, integration, solving ODEs, applying boundary conditions, plotting functions, showing ‘x’ is solution of PDE. Easy stuff.

Q2-5: More detailed questions usually centred about specific topics: InhomoODE, damped SHM equation, Fourier series, Half range Fourier series, Fourier transforms, convolution, partial differential equation solving (including applying an initial condition to general solution for a specific case), Cartesian 3D systems, Spherical polar 3D systems, Spherical harmonics

The notes are the source of examinable material – NOT the lecture presentations

I wont be asking specific questions about Quantum mechanics outside of the notes

Page 24: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Revision for the examRevision for the examThe notes are the source of examinable material – NOT the lecture presentations

Things to do now

Read through the notes using the lecture presentations to help where required.

At the end of each section in the notes try Phils problem questions, then try the tutorial questions, then look at your problem and homework questions.

If you can do these questions (they’re fun) then you’re in excellent shape for getting over 80% in the exam.

Any problems – see me in my office or email me

Same applies over holidays. I’ll be in the department most days but email a question or tell me you want to meet up and I’ll make sure I’m in.

Look at the past exam papers for the style of questions and the depth to which you need to know stuff.

You’ll have the standard maths formulae and physical constants sheets (I’ll put a copy of it up on Phils Problems so you are sure what’s on it). You don’t need to know any equations e.g. Fourier series or transforms, wave equation, polars.

Page 25: Lecture 17 Solving the Diffusion equation  Remember Phils Problems and your notes = everything Only 5 lectures.

Concerned about what you need to know? Look through previous exam questions. 2008/2009 exam will be of very similar style.

You don’t need to remember any proofs or solutions (e.g. Parseval, Fourier series, Complex Fourier series) apart from damped SHM which you should be able to do.

You don’t need to remember any equations or trial solutions, eg. Fourier and InhomoODE particular solutions.

You don’t need to remember solutions to any PDE or for example the Fourier transform of a Gaussian and its key widths, etc. However you should understand how to solve any PDE from start to finish and how to generate a Fourier transform.

Things you need to be able to do:

Everything with complex numbers; solve ODEs and InhomoODEs, apply boundary conditions; integrate and differentiate general stuff; know even and odd functions; understand damped SHM, how to derive its solutions depending on damping coefficient and how to draw them; how to represent an infinitely repeating pattern as a Fourier series, how to represent a pulse as a sine or cosine half range Fourier series; how to calculate a Fourier transform; how to (de)convolve two functions; the steps needed to solve any PDE and apply boundary conditions and initial conditions (usually using Fourier series); how to integrate and manipulate equations in 3D cartesian coordinates; how to do the same in spherical polar coordinates; how to prove an expression is a solution of a spherical polar equation; explain in general terms what spherical harmonics are.


Recommended