+ All Categories
Home > Documents > Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF...

Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF...

Date post: 21-Dec-2015
Category:
Upload: osborne-lambert
View: 213 times
Download: 0 times
Share this document with a friend
Popular Tags:
31
Macquarie University 2004 1 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS
Transcript
Page 1: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 1

The Heat Equation and Diffusion

PHYS220 2004by Lesa Moore

DEPARTMENT OF PHYSICS

Page 2: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 2

Diffusion of Heat

The diffusion of heat through a material such as solid metal is governed by the heat equation.

We will not try to derive this equation.

We will compare results from the heat equation with our studies of the random walk.

Page 3: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 3

Initial Temperature Distribution

-3 -2 -1 0 1 2 3 x

Consider diffusion in 1D (let a thin copper wire represent a one-dimensional lattice).

Let u(t,x) be the heat at point x at time t, with x and t integers, u(t=0,x=0)=1 and u(t=0,x)=0 if x is not zero.

Page 4: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 4

The Partial Differential Equation The heat equation is a partial

differential equation (PDE):

k is the diffusion coefficient. Assume the initial distribution is a spike

at x=0 and is zero elsewhere.

2

2

x

uk

t

u

Page 5: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 5

Partial Derivatives For functions of more than one

variable, the partial derivative is the rate of change with respect to one variable with the other variable(s) fixed.

:

:

:

t

xtuxttuxt

t

ut

),(),(lim),(

0

x

xtuxxtuxt

x

ux

),(),(lim),(

0

x

xtxuxxtxuxt

x

ux

),)(/(),)(/(lim),(

02

2

Page 6: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 6

The PDE in full

:

:

:

x

xxxtuxtu

xxtuxxtu

kt

xtuxttuxt

),(),(),(),(

lim),(),(

lim00

x

xtxuxxtxuk

t

xtuxttuxt

),)(/(),)(/(lim

),(),(lim

00

2

2

x

uk

t

u

Page 7: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 7

Converting to a Difference Equation Don’t take the limits as intervals

approach zero. Take finite time steps (t=1) and finite

positions steps (x=1).

x

xxxtuxtu

xxtuxxtu

kt

xtuxttuxt

),(),(),(),(

lim),(),(

lim00

Page 8: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 8

Simplifying …

x

xxxtuxtu

xxtuxxtu

kt

xtuxttuxt

),(),(),(),(

lim),(),(

lim00

11

1

Page 9: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 9

Rearranging …

)1,(),(),()1,(),(),1( xtuxtuxtuxtukxtuxtu

),()1,(),(2)1,(),1( xtuxtuxtuxtukxtu

Want all t+1 terms on l.h.s. and everything else on r.h.s.

Page 10: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 10

Modelling in Excel Columns are x-values. Rows are t-values.

The difference equation relates each cell to three cells in the row above.

),()1,(),(2)1,(),1( xtuxtuxtuxtukxtu

1234

Y Z AA AB AC-2 -1 0 1 2

u(t,x-1) u(t,x) u(t,x+1)u(t+1,x)

Page 11: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 11

The Excel Spreadsheet The first row (t=0) is all zeros except

for the initial spike: u(t=0,x=0) = 1. The same formula is entered in every

cell from row 2 down: A1 holds the value of k (k = 0.1) AA3=$A$1*(Z2-2*AA2+AB2)+AA2

12345

X Y Z AA AB AC AD-3 -2 -1 0 1 2 3

0 0 0 1 0 0 00 0 0.1 0.8 0.1 0 00 0.01 0.16 0.66 0.16 0.01 0

0.001 0.024 0.195 0.56 0.195 0.024 0.001

Page 12: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 12

Filling the Spreadsheet

In Excel, it is easiest to insert the formula in the top left cell of the range, select the range and use Ctrl+R, Ctrl+D to fill the range: -20 ≤ x ≤ 20; 0 ≤ t ≤ 60.

Page 13: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 13

Boundary Conditions What happens at the boundaries? Setting columns at x=±21 equal to

zero stops the spatial evolution of the model – is this a problem? Provided that values in neighbouring

columns (x=±20) are still small at the end of the simulation, the choice of boundary conditions is not so important.

u=0 is equivalent to an absorbing boundary.

Page 14: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 14

SnapshotsSpread of Heat in 1D: t = 0

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-20 -15 -10 -5 0 5 10 15 20

Space (x) units

Mea

sure

of

hea

t

Spread of Heat in 1D: t = 11

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-20 -15 -10 -5 0 5 10 15 20

Space (x) units

Mea

sure

of

hea

t

Spread of Heat in 1D: t = 51

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-20 -15 -10 -5 0 5 10 15 20

Space (x) units

Mea

sure

of

hea

t

Spread of Heat in 1D: t = 3

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-20 -15 -10 -5 0 5 10 15 20

Space (x) units

Mea

sure

of

hea

t

Page 15: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 15

Plotting the Heat SpreadSpread of Heat in 1D

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-20 -15 -10 -5 0 5 10 15 20

Space (x) units

Mea

sure

of

hea

t

t=1

t=11

t=21

t=31

t=51

t=81

Page 16: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 16

Spreadsheet Results Conservation of heat can be

demonstrated by adding the values in a row (a row is a time step). Values in a row should add to 1.

Checking the sum in a row is good test of numerical accuracy.

Heat diffusion looks like a Gaussian distribution.

Page 17: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 17

The Distribution

The simulation satisfies conservation of energy (total heat along a row = 1).

Does the Gaussian distribution satisfy this condition too (area under curve = 1)? The initial spike can be thought of as a

very sharp, very narrow Gaussian. For t>0, need to integrate the Gaussian. “Normalised” if integral yields unity.

Page 18: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 18

Normalisation of the Gaussian Formula for Gaussian with = 0.

Use a trick for the integral:

2)(

22 2/xexf

dxdyyfxfdxxf )()()(

Page 19: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 19

The integral becomes

dxdyeedx

e yxx

2222

22

2/2/2/

2

1

2

dxdye yx 222 2/)(

2

1

Page 20: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 20

But using and

222 ryx

0

2

0

rdrddxdy

2

0 0

2/ 22

2

1)( drreddxxf r

0

2/ 22

22

1drre r

Page 21: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 21

Cancelling

0

2/ 22

22

1)( drredxxf r

0

2/ 221drre r

Page 22: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 22

Then use the substitution:

dvrdr

drrdv

rv

)/(

)/(

2/

2

2

22

Page 23: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 23

And finally:

1

1

0

0

0

2

v

v

v

e

dve

dvr

re

dx

e x

2

22 2/

Page 24: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 24

The integral proves that the Gaussian is normalised to unity – the area under the curve is one.

But the heat equation is a function of x and t, and uses a constant k.

k and t must be included in the term of the Gaussian if we are to say our model satisfies this distribution.

2)(

22 2/xexf

2

2

x

uk

t

u

Page 25: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 25

What is ? From the Random Walk, we learned

that √t. Try a guess: The Gaussian becomes:

kt2

kt

etxf

ktx

4),(

4/2

Page 26: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 26

Derivatives of the Gaussian Space derivatives:

The time derivative is left as an exercise …

fkt

x

ktx

f

fkt

x

x

f

122

1

22

2

2

Page 27: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 27

The Gaussian satisfies the Heat Equation It can be shown

that the heat equation is satisfied by our guess.

2

2

x

uk

t

u

The distribution integrates to unity (conservation of energy).

The spread of heat is given by of the Gaussian (normal) distribution.

Page 28: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 28

Diffusion and the Random Walk

The initial temperature spike grows into a Gaussian distribution according to the 1D heat equation.

The width grows in proportion to the square root of elapsed time.

Heat and diffusion can be understood in terms of the “random walk”.

Page 29: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 29

Other Conditions

The initial condition may not be a spike, but could be some initial distribution: u(x,0)=g(x).

The boundary conditions may not be absorbing, but could be continuous.

The thermal diffusivity constant k may not be constant, but may vary with x or t.

Page 30: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 30

Summary The heat equation is a PDE. By separating space and time variables,

we see that a Gaussian that spreads as √t is a solution.

We can model the differential equation as a difference equation in Excel and see the same effect.

The spread of heat is a physical example of a random walk.

Page 31: Macquarie University 20041 The Heat Equation and Diffusion PHYS220 2004 by Lesa Moore DEPARTMENT OF PHYSICS.

Macquarie University 2004 31

Acknowledgements

This presentation was based on lecture material for PHYS220 presented by Prof. Barry Sanders, 2000-2003.

Additional Reference: Folland, Fourier Analysis and its

Applications, 1992.


Recommended