example of solving the heat equation

example of solving the heat equation

Let a .  Determine the temperature function

(

x

,

y

)

↦

u

⁢

(

x

,

y

)

on the plate, when the faces of the plate are .

The equation of the heat flow (

http://planetmath.org/HeatEquation

) in this case is

∇

2

⁡

u

≡

u

x

⁢

x

′′

+

u

y

⁢

y

′′

=

0

(1)

under the

boundary conditions

u

⁢

(

0

,

y

)

=

0

,

u

⁢

(

π

,

y

)

=

0

,

u

⁢

(

x

,

π

)

=

C

,

u

y

′

⁢

(

x

,

0

)

=

0

.

We first try to separate the variables, i.e. seek the solution of (1) of the form

u

⁢

(

x

,

y

)

:=

X

⁢

(

x

)

⁢

Y

⁢

(

y

)

.

Then we get

u

x

′

=

X

′

⁢

Y

,

u

x

⁢

x

′′

=

X

′′

⁢

Y

,

u

y

′

=

X

⁢

Y

′

,

u

y

⁢

y

′′

=

X

⁢

Y

′′

,

and thus (1) gets the form

X

′′

⁢

Y

+

X

⁢

Y

′′

=

0

(2)

and the boundary conditions

X

⁢

(

0

)

=

X

⁢

(

π

)

=

0

,

X

⁢

(

x

)

=

C

Y

⁢

(

π

)

,

Y

′

⁢

(

0

)

=

0

.

We separate the variables in (2):

X

′′

X

=

-

Y

′′

Y

This equation is not possible unless both sides are equal to a same negative

-

k

2

, which implies for

X

′′

=

-

k

2

⁢

X

the solution

X

:=

C

1

⁢

cos

⁡

k

⁢

x

+

C

2

⁢

sin

⁡

k

⁢

x

and for

Y

′′

=

k

2

⁢

Y

the solution

Y

:=

D

1

⁢

cosh

⁡

k

⁢

y

+

D

2

⁢

sinh

⁡

k

⁢

y

.

The two first boundary conditions give

0

=

X

⁢

(

0

)

=

C

1

,

0

=

X

⁢

(

π

)

=

0

+

C

2

⁢

sin

⁡

k

⁢

π

,  and since

C

2

≠

0

,  we must have

sin

⁡

k

⁢

π

=

0

,  i.e.

0

<

k

:=

n

=

1

,

2

,

3

,

…

Therefore

X

⁢

(

x

)

:=

C

2

⁢

sin

⁡

n

⁢

x

,

Y

′

⁢

(

y

)

≡

n

⁢

D

1

⁢

sinh

⁡

n

⁢

y

+

n

⁢

D

2

⁢

cosh

⁡

n

⁢

y

.

The fourth boundary condition now yields that

0

=

Y

′

⁢

(

0

)

=

n

⁢

D

2

;
thus

D

2

=

0

and

Y

⁢

(

y

)

:=

D

1

⁢

cosh

⁡

n

⁢

y

.

So (1) has infinitely many solutions

u

n

:=

C

2

⁢

D

1

⁢

sin

⁡

n

⁢

x

⁢

cosh

⁡

n

⁢

y

=

A

n

⁢

sin

⁡

n

⁢

x

⁢

cosh

⁡

n

⁢

y

(3)

with

n

∈

ℤ

+

and they all satisfy the boundary conditions except the third.  Because of the linearity of (1), also the sum

u

:=

∑

n

=

1

∞

A

n

⁢

sin

⁡

n

⁢

x

⁢

cosh

⁡

n

⁢

y

of the functions (3) satisfy (1) and those boundary conditions, provided that this series

converges

.  The third boundary condition requires that

C

=

u

⁢

(

x

,

π

)

=

∑

n

=

1

∞

A

n

⁢

sin

⁡

n

⁢

x

⁢

cosh

⁡

n

⁢

π

=

∑

n

=

1

∞

(

A

n

⁢

cosh

⁡

n

⁢

π

)

⁢

sinh

⁡

n

⁢

x

on the

interval

0

≦

x

≦

π

.  But this is the

Fourier sine series

of the constant function

x

↦

C

on the half-interval

[

0

,

π

]

,  whence

A

n

⁢

cosh

⁡

n

⁢

π

=

2

π

⁢

∫

0

π

C

⁢

sin

⁡

n

⁢

x

⁢

d

⁢

x

=

2

⁢

C

n

⁢

π

⁢

(

1

-

(

-

1

)

n

)

∀

n

∈

ℤ

+

.

The even (

http://planetmath.org/EvenNumber

)

n

’s here give 0 and the odd (

http://planetmath.org/EvenNumber

) give

A

2

⁢

m

+

1

:=

4

⁢

C

(

2

⁢

m

+

1

)

⁢

π

⁢

cosh

⁡

(

2

⁢

m

+

1

)

⁢

π

(

m

=

0

,

1

,

2

,

…

)

Thus we obtain the solution

u

⁢

(

x

,

y

)

:=

4

⁢

C

π

⁢

∑

m

=

0

∞

sin

⁡

(

2

⁢

m

+

1

)

⁢

x

⁢

cosh

⁡

(

2

⁢

m

+

1

)

⁢

y

(

2

⁢

m

+

1

)

⁢

cosh

⁡

(

2

⁢

m

+

1

)

⁢

π

.

It can be shown that this series converges in the whole of the plate.

Visualization of the solution

Figure 1:

Surface plot of the solution

u

⁢

(

x

,

y

)

, for

C

=

1

Figure 2:

Color-coded plot of the temperature

u

⁢

(

x

,

y

)

Remark.

The function

u

has been approximated in the plot by computing a partial sum of the true infinite-series solution.  However,
there is substantial numerical error in the approximate solution near

y

=

π

,  evident in the small oscillations observed in the surface plot, that should not be there in .  This phenomenon is actually inevitable given that the boundary conditions are actually

discontinuous

at the corners

(

0

,

π

)

and

(

π

,

π

)

.

More precisely, observe that when

y

=

π

,  the for

u

⁢

(

x

,

y

)

reduces to the

Fourier series

4

⁢

C

π

⁢

(

sin

⁡

x

+

sin

⁡

3

⁢

x

3

+

sin

⁡

5

⁢

x

5

+

⋯

)

for the

discontinuous function

on

[

-

π

,

π

]

:

x

↦

{

C

,

0

<

x

<

π

-

C

,

-

π

<

x

<

0

That means the Fourier will necessarily be subject to the

Gibbs phenomenon

.  Of course, the series also cannot

converge absolutely

; in other of the series decay too slowly in magnitude, adversely affecting the numerical solution.

•

http://gold-saucer.afraid.org/math/planetmath/ExampleOfSolvingTheHeatEquation/heat.py

Python program to compute

u

⁢

(

x

,

y

)

and produce the two figures

Title

example of solving the

heat equation

Canonical name

ExampleOfSolvingTheHeatEquation

Date of creation

2014-09-28 17:02:21

Last modified on

2014-09-28 17:02:21

Owner

pahio (2872)

Last modified by

pahio (2872)

Numerical id

25

Author

pahio (2872)

Entry type

Example

Classification

msc 35Q99

Synonym

stationary example of heat equation

Related topic

LaplacesEquation

Related topic

BlackScholesPDE

Related topic

AnalyticSolutionOfBlackScholesPDE

Related topic

SolvingTheWaveEquationByDBernoulli

Related topic

TimeDependentExampleOfHeatEquation

Related topic

ExampleOfSummationByParts

Generated on Fri Feb 9 20:44:41 2018 by

LaTeXML