Application Center - Maplesoft

App Preview:

Heat Equation

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application



Section 11.5. The Heat Equation

by Alain Goriely,,

Abstract: This section illustrates Section 11.5 in Kreyszig 's book (8th ed.)

Application Areas/Subjects: Engineering, Applied Mathematics

Keywords: Heat equation, Finite domain, Fourier series
See Also:
 Other Worksheets in the same package.

Prerequisites:  plots

Note:  Send me an e-mail (comments-criticisms) if you use this worksheet.

> restart;assume(n,integer):with(plots):
setoptions(thickness=2): #set the tickness of the lines in the plots

Warning, the name changecoords has been redefined


In this worksheet, I use Maple to illustrate Section 11.5 of Kreyszig 's book: Advanced Engineering Mathematics.

Let u = u(x, t) be the temperature in a one dimensional media.
The heat profile obeys the following PDEs (the so-called
1D heat equation):

diff(u, t) = c^2*(diff(u, `$`(x, 2)))

where c  is the speed of the wave (c^2 = K/(sigma*rho) : themal conductivity/ (specific heat *density) )

Here we explore different solutions of the heat equation, starting with initial heat profile on a finite bar.

Look at the animations!

Section 1: The fundamental solutions

The following functions are the solutions for boundary conditions (free heat transfer at the end).

u(0, t) = 0  and   u(L, t) = 0

> Su:=u=(A[n]*sin(n*Pi*x/L))*exp(-lambda[n]^2*t);

Su := u = A[n]*sin(n*Pi*x/L)*exp(-lambda[n]^2*t)

> Slambda:=lambda[n]=c*n*Pi/L;

Slambda := lambda[n] = c*n*Pi/L

Let us verify that this is indeed a solution of the equation:

> Diff(u,t) - c^2*Diff(u,`$`(x,2))=eval(subs(Su,diff(u,`$`(t,2)) - c^2*diff(u,`$`(x,2))));

(Diff(u, t))-c^2*(Diff(u, `$`(x, 2))) = 0

We want to see what these modes look like: Start with n=1, the FUNDAMENTAL solution:

Sinus profile: animation

> M1:=subs(n=1,L=2*Pi,c=2,subs(Su,Slambda,A[n]=1,u));

> animate( M1,x=0..2*Pi,t=0..3,frames=30,color=red,thickness=3);

M1 := sin(1/2*x)*exp(-t)


The other decaying solutions

> M1:=subs(n=1,L=2*Pi,c=2,subs(Su,Slambda,A[n]=1,u));

M1 := sin(1/2*x)*exp(-t)

M2 := sin(x)*exp(-4*t)

> for i from 0 to 30  do p1[i]:=plot(subs(t=2*i/31,[M1,M2]),x=0..2*Pi,color=[green,blue],thickness=3): od:

> display ([seq(p1[i],i=0..30)],insequence=true,title="The first and second fundamental solutions (green and blue)");


Observe also that the mode N=2 decays  twice as fast as the mode N=1.

Section 2: An example of a symmetric profile: Animation

We now take a simple profile for f(x) and see how it evolves as a function of time.

> f(x)=(1-cos(2*Pi*x));plot((1-cos(2*Pi*x)),x=0..1,thickness=3);

f(x) = 1-cos(2*Pi*x)


> A:=int(2*(1-cos(2*Pi*x))*sin(m*Pi*x),x=0..1);

A := 8*(-1+cos(m*Pi))/(m*Pi*(m^2-4))

> S:=(N,x)->subs(m=1,A)*sin(Pi*x)*exp(-t)+sum(subs(m=k,A)*sin(Pi*k*x)*exp(-k^2*t),k=3..N):

> animate(St,x=0..1,t=0..3,frames=30,color=red,thickness=3);


Sectioon 3: An asymmetric profile: Animation

> f:=(sin(Pi*x)-1/2*sin(2*Pi*x));plot(f,x=0..1,thickness=3);

f := sin(Pi*x)-1/2*sin(2*Pi*x)


> A1:=1;A2:=-1/2;S:=A1*sin(Pi*x)*exp(-t)+A2*sin(2*Pi*x)*exp(-2*t);


A1 := 1

A2 := (-1)/2

S := sin(Pi*x)*exp(-t)-1/2*sin(2*Pi*x)*exp(-2*t)


> animate(S,x=0..1,t=0..3,frames=30,color=blue,thickness=3);


Section 4: The ubiquitous triangular profile: Animation

> A:=2*(int(x*sin(m*Pi*x),x=0..1/2)+int((1-x)*sin(m*Pi*x),x=1/2..1));

A := -(-2*sin(1/2*m*Pi)+cos(1/2*m*Pi)*m*Pi)/(m^2*Pi^2)+(cos(1/2*m*Pi)*m*Pi+2*sin(1/2*m*Pi)-2*sin(m*Pi))/(m^2*Pi^2)

> S:=(N,x)->sum(subs(m=k,A)*sin(Pi*k*x)*exp(-k^2*t),k=1..N):


> animate(St,x=0..1,t=0..3,frames=30,color=red,thickness=3);



Can you explain why the discontinuous point disappear in the process and the profile is rapidly smoothed?
Compare this with the evolution of the triangular profile for the string.



E. Kreyszig : Advanced Engineering Mathematics (8th Edition) John Wiley  New York (1999)

Disclaimer: While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.