Application Center - Maplesoft

# Heat Equation

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

heat_equation.mws

Section 11.5. The Heat Equation

by Alain Goriely, goriely@math.arizona.edu,
(http://www.math.arizona.edu/~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
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

Introduction

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

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

where  is the speed of the wave ( : 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).

and

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

 > 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))));

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);

The other decaying solutions

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

 > 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 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);

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

 > 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): St:=S(10,x):

 > 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);

 > A1:=1;A2:=-1/2;S:=A1*sin(Pi*x)*exp(-t)+A2*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));

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

 >

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

Explain!

References

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.