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≡ux⁢x′′+uy⁢y′′= 0 (1)

under the boundary conditionsMathworldPlanetmath

u⁢(0,y)=0,u⁢(π,y)=0,u⁢(x,π)=C,uy′⁢(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

ux′=X′⁢Y,ux⁢x′′=X′′⁢Y,uy′=X⁢Y′,uy⁢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)=CY⁢(π),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 -k2, which implies for  X′′=-k2⁢X  the solution

X:=C1⁢cos⁡k⁢x+C2⁢sin⁡k⁢x

and for  Y′′=k2⁢Y  the solution

Y:=D1⁢cosh⁡k⁢y+D2⁢sinh⁡k⁢y.

The two first boundary conditions give  0=X⁢(0)=C1,  0=X⁢(π)=0+C2⁢sin⁡k⁢π,  and since  C2≠0,  we must have  sin⁡k⁢π=0,  i.e.

0<k:=n= 1, 2, 3,…

Therefore

X⁢(x):=C2⁢sin⁡n⁢x,Y′⁢(y)≡n⁢D1⁢sinh⁡n⁢y+n⁢D2⁢cosh⁡n⁢y.

The fourth boundary condition now yields that  0=Y′⁢(0)=n⁢D2;  thus  D2=0  and  Y⁢(y):=D1⁢cosh⁡n⁢y.  So (1) has infinitely many solutions

un:=C2⁢D1⁢sin⁡n⁢x⁢cosh⁡n⁢y=An⁢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∞An⁢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∞An⁢sin⁡n⁢x⁢cosh⁡n⁢π=∑n=1∞(An⁢cosh⁡n⁢π)⁢sinh⁡n⁢x

on the interval  0≦x≦π.  But this is the Fourier sine seriesMathworldPlanetmath of the constant function  x↦C  on the half-interval  [0,π],  whence

An⁢cosh⁡n⁢π=2π⁢∫0πC⁢sin⁡n⁢x⁢d⁢x=2⁢Cn⁢π⁢(1-(-1)n) ∀n∈ℤ+.

The even (http://planetmath.org/EvenNumber) n’s here give 0 and the odd (http://planetmath.org/EvenNumber) give

A2⁢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 discontinuousMathworldPlanetmath 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⁢x3+sin⁡5⁢x5+⋯)

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.pyPython 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