Вы находитесь на странице: 1из 9

HEAT EQUATION EXAMPLES

1. Find the solution to the heat conduction problem:


4ut

uxx , 0 x 2, t > 0

u(0, t)

u(2, t)

u(x, 0)

2 sin

 x 
2

sin(x) + 4 sin(2x) = f (x)

Solution:
We use separation of variables. Let u(x, t) = X(x)T (t). Then 4ut = uxx becomes 4X(x)T 0 (t) =
00
X (x)T (t). We divide both sides by X(x)T (t) to obtain:
4

T0
X 00
=
= ,
T
X

(1)

where is a constant.
What happens to the boundary conditions under the separation of variables?
0 = u(0, t) = X(0)T (t) X(0) = 0 (since T (t) won0 t be 0 for allt)
0 = u(2, t) = X(2)T (t) X(2) = 0 (since T (t) won0 t be 0 for allt)
So we have X(0) = X(2) = 0. Can the initial condition tell us anything at this stage?
f (x) = u(x, 0) = X(x)T (t) T (t) = f (x)/X(x)???
No, it cant. The trick worked on the boundary conditions b/c they were homogeneous (= 0). Well actually
use the initial condition at the end to solve for constants.
Lets start with the T -equation from (3):

T (t).
4

T 0 (t) =
Solving, we notice that this is a separable equation

dT

dT

= T
= dt.
dt
4
T
4
Integrating both sides,

dT
=
T

dt ln(T ) = t + C T (t) = Cet/4 ,


4
4

taking the exponential of both sides.


Next we deal with the X-equation in (3) with conditions X(0) = X(2) = 0 derived from the boundary
conditions
X 00
X(0)

= X(2) = 0.

This is an eigenvalue problem. There are 3 cases to consider: > 0, = 0, and < 0.
We begin with the > 0 case - note that we expect this to only yield the trivial solution (aka X = 0), since
T (t) = Cet/4 so u(x, t) = X(x)T (t) = X(x)et/4 and > 0 would suggest that the temperature u ,
which doesnt make sense. Set = 2 > 0. Then X 00 (x) 2 X(x) = 0. Use the substitution X(x) = erx to
get the characteristic equation r2 2 = 0, which has roots r = .Thus X(x) = C1 ex + C2 ex . We now
use the boundary conditions to find constants such that the conditions are satisfied:
X(0)

0 C1 + C2 = 0

X(2)

0 C1 e2 + C2 e2 = 0.
1

30
20
10
0
10
20

sinh()
cosh()

30
5

Figure 1: Hyperbolic functions sinh() and cosh().


Solving simultaneously we find C1 = C2 = 0. (The first equation gives C2 = C1 , plugging into the first
equation gives C1 e2 C1 e2 = 0 C1 (e2 e2 ) = 0, and this means that C1 = 0 because e2 e2 is
only zero at = 0, which it isnt here - 2 = > 0). Thus we have recovered the trivial solution (aka zero
solution). Therefore for > 0 we have no eigenvalues or eigenfunctions. As we had expected.
ASIDE
It is actually more convenient to use hyperbolic functions, and write down X(x) = C1 sinh(x) +

C2 cosh(x),because they have some nice properties. Recall


sinh() =

e + e
e e
, cosh() =
.
2
2

See Fig.1 for an illustration. The convenient properties include that sinh() = 0 ONLY at = 0, cosh() = 0
NEVER, and cosh(0) = 1. So when applying the boundary conditions X(0) = X(2) = 0:
X(0) = 0 C1 sinh(0) + C2 cosh(0) = 0 C2 = 0,
since sinh(0) = 0, cosh(0) = 1. Then X(x) = C1 sinh(x);
X(2) = 0 X(2) = C1 sinh(2) C1 = 0.
This is the case because sinh(2) is only zero at = 0, but is non-zero by definition.
END OF ASIDE
All right, next we consider the = 0 case (we could consider it jointly with the < 0 or > 0 cases, if
were very careful, but for the purposes of a systematic approach we wont here). Then X 00 = 0 X(x) =
Ax + B. Applying boundary conditions, 0 = X(0) = B B = 0; 0 = X(2) = 2A A = 0. Thus
we have recovered the trivial solution (aka zero solution). Therefore for = 0 we have no eigenvalues or
eigenfunctions.
Finally we look at the < 0 case. Set = 2 < 0. Then X 00 (x) + 2 X(x) = 0. Use the substitution
X(x) = erx to get the characteristic equation r2 + 2 = 0, which has roots r = i.Thus X(x) = C1 eix +
C2 eix or X(x) = C1 sin(x) + C2 cos(x) (for more details on solving this ode, see your textbook, section
3.3). We now use the boundary conditions to find constants such that the conditions are satisfied:
X(0)

0 C1 sin(0) + C2 cos(0) = 0 C2 = 0

X(2)

0 C1 sin(2) = 0.

Since sin() has roots at = n, n = 1, 2, 3, . . . , the second condition tells us that 2 = n or = n/2,
n = 1, 2, 3, . . . Thus we have our eigenfunctions an eigenvalues for < 0:
 n 2
n =
2
Xn (x) = sin(nx/2).
2

Now we re-assemble. Recall u(x, t) = X(x)T (t). Therefore


 2 2 
 nx 
n
exp
t
un (x, t) = Xn (x)Tn (t) = sin
2
16
for n = 1, 2, 3, . . . are each solutions to the pde. The pde is linear so we can use the principle of superposition,
and sum them to make up a general solution:
 2 2 

 nx 
X
n
exp
u(x, t) =
bn sin
t ,
2
16
n=1
where the bn are constants.
We solve for the bn using the initial condition. That is, u(x, 0) = f (x) so

f (x) =

bn sin

 nx 
2

n=1

which is a Fourier sine series. We exploit orthogonality of the sines, that is,
(
L
 nx 
 mx 
0,
m 6= n
sin
sin
dx =
L
L
L/2, m = n
0
where L = 2 to solve for the individual bn :

2
 nx 
 nx 
2 L
bn =
dx =
dx
f (x) sin
f (x) sin
L 0
L
2
0

since L = 2. Now here f (x) = 2 sin x
sin(x) + 4 sin(2x), so
2
2
2

 nx 
 nx 
 x 
bn =
dx =
sin(x) + 4 sin(2x) sin
dx
f (x) sin
2 sin
2
2
2
0
0
2
2
2
 nx 
 nx 
 nx 
 x 
sin
dx
dx + 4
dx.
bn = 2
sin(x) sin
sin(2x) sin
sin
2
2
2
2
0
0
0
This is less scary than it looks! We can use orthogonality of the sines:
(
2
 nx 
 x 
1, n = 1
sin
dx =
sin
2
2
0, otherwise
0
(
2
 nx 
1, n = 2
sin (x) sin
dx =
2
0, otherwise
0
(
2
 nx 
1, n = 4
sin (2x) sin
dx =
2
0, otherwise
0
So then

b1 = 2

sin
0

b2 = 0

 x 
2

sin

 nx 

sin (x) sin


0

b4 = 0 0 + 4

dx 0 + 0 = 2

 nx 
2

sin (2x) sin

dx + 0 = 1

 nx 

dx = 4

bn = 0 if n 6= 1, 2, 4.
Thus b1 = 2,b2 = 1, b4 = 4, and bn = 0 for all other values of n. We can now re-write our solution:




 x 

2
2
u(x, t) = 2 sin
exp t sin (x) exp t sin (2x) exp 2 t .
2
16
4
3


2. Find the solution to the heat conduction problem:
= 2 uxx , 0 x , t > 0

ut
u(0, t)

ux (, t)

0


u(x, 0)

3 sin

5x
2


= f (x)

The mechanics of this problem are very VERY similar to the previous problem. In fact, thats the case with
most of the heat equation problems. The main difference is in the eigenvalue/eigenfunction part!
Solution:
We use separation of variables. Let u(x, t) = X(x)T (t). Then ut = 2 uxx becomes X(x)T 0 (t) =
2 X 00 (x)T (t). We divide both sides by 2 X(x)T (t) to obtain:
X 00
T0
=
= ,
2
T
X

(2)

where is a constant.
What happens to the boundary conditions under the separation of variables?
0 = u(0, t) = X(0)T (t) X(0) = 0 (since T (t) won0 t be 0 for allt)
0 = ux (, t) = X 0 ()T (t) X 0 () = 0 (since T (t) won0 t be 0 for allt)
So we have X(0) = X 0 () = 0.
Lets start with the T -equation from (3):
T 0 (t) = 2 T (t),
2

which means T (t) = Ce t (see above for details on solving this ODE).
Next we deal with the X-equation in (3) with conditions X(0) = X 0 () = 0 derived from the boundary
conditions
X 00
X(0)

= X 0 () = 0.

This is an eigenvalue problem. There are 3 cases to consider: > 0, = 0, and < 0.
We begin with the > 0 case - recall from above that we expect this to only yield the trivial solution
(aka X = 0). Set = 2 > 0. Then X 00 (x) 2 X(x) = 0. Use the substitution X(x) = erx to get the
characteristic equation r2 2 = 0, which has roots r = .Thus X(x) = C1 ex + C2 ex . We now use the
boundary conditions to find constants such that the conditions are satisfied:
X(0)
0

X ()

0 C1 + C2 = 0

0 C1 e C2 e = 0.

Solving simultaneously we find C1 = C2 = 0. (The first equation gives C2 = C1 , plugging into the
first equation gives C1 e + C1 e = 0 C1 (e + e ) = 0, and this means that C1 = 0 because
e + e is never zero. You could also use X(x) = C1 sinh(x) + C2 cosh(x), and would find C1 = C2 = 0.
All right, next we consider the = 0 case (we could consider it jointly with the < 0 or > 0 cases, if
were very careful, but for the purposes of a systematic approach we wont here). Then X 00 = 0 X(x) =
Ax + B. Applying boundary conditions, 0 = X(0) = B B = 0; 0 = X 0 () = A A = 0. Thus
we have recovered the trivial solution (aka zero solution). Therefore for = 0 we have no eigenvalues or
eigenfunctions.

Finally we look at the < 0 case. Set = 2 < 0. Then X 00 (x) + 2 X(x) = 0 and X(x) =
C1 sin(x) + C2 cos(x) (key steps to solving that ode above; for more details see your textbook, section
3.3). We now use the boundary conditions to find constants such that the conditions are satisfied:
X(0)
0

X ()

0 C1 sin(0) + C2 cos(0) = 0 C2 = 0

0 C1 cos() = 0.

Since cos() has roots at = (2n 1)/2, n = 1, 2, 3, . . . (or, equivalently, that = (2n + 1)/2, n =
0, 1, 2, 3, . . . ), the second condition tells us that = (2n1)/2 or = (2n1)/2 = (n1/2), n = 1, 2, 3, . . .
Thus we have our eigenfunctions an eigenvalues for < 0:
2
1
= n
2
= sin ((n 1/2)x) .


n
Xn (x)

Now we re-assemble. Recall u(x, t) = X(x)T (t). Therefore



un (x, t) = Xn (x)Tn (t) = sin

1
n
2

 

2 !
1
2
x exp n
t
2

for n = 1, 2, 3, . . . are each solutions to the pde. The pde is linear so we can use the principle of superposition,
and sum them to make up a general solution:
 

2 !


X
1
1
2
x exp n
t ,
u(x, t) =
sin
n
2
2
n=1
where the bn are constants.
We solve for the bn using the initial condition. That is, u(x, 0) = f (x) so
f (x) =


bn sin

n=1

1
2

 
x ,

which is a Fourier sine series. As discussed above,


 
 




2 L
1
1
bn =
x dx =
x dx
f (x) sin
n
f (x) sin
n
L 0
2
2
0
which we find by exploiting the orthogonality of sines:


sin

1
n
2

(
 

 
0,
1
x sin
m
x dx =
2
/2,

m 6= n
.
m=n

Now here f (x) = 3 sin (5x/2), so



 
 

 

2
1
6
5x
1
bn =
f (x) sin
n
x dx =
sin
sin
n
x dx.
0
2
0
2
2
This is less scary than it looks! We can use orthogonality of the sines:
(
 

 

/2, n = 3
5x
1
sin
sin
n
x dx =
2
2
0,
otherwise
0
So then
6
bn =


sin

5x
2


sin

1
n
2
5

(
 
3, n = 3
x dx =
.
0, otherwise

Thus b3 = 3/2, bn = 0 for n 6= 3. We could also just read it off:

 
1
x
2
n=1
 
 
 
 
 
x
3x
5x
5x
7x
9x
+ b2 sin
3 sin
= b1 sin
+ b3 sin
+ b4 sin
+ b5 sin
+ ...,
2
2
2
2
2
2
f (x)



bn sin

we can see quite plainly that b3 = 3, bn = 0 for n 6= 3.


Thus we have found our solution:
 
 2 !
5x
5
t .
u(x, t) = 3 sin
exp
2
2
Note that we can always check our solutions by plugging them back into the pde!
 
 2 !
75 2
5x
5
ut (x, t) = sin
exp
t
4
2
2
 
 2 !
5x
75
5
uxx (x, t) = sin
exp
t
4
2
2
and then
ut = 2 uxx
 
 2 !
 
 2 !!
5x
5
75
5x
5
75 2
2
exp
t = sin
exp
t
;
sin
4
2
2
4
2
2
check! The solution is correct.

3. Find the solution to the heat conduction problem:


ut

uxx , 0 x 2, t > 0

ux (0, t)

ux (2, t)

u(x, 0)

x = f (x)

Again, the mechanics of this problem are very VERY similar to the previous problem. In fact, thats the case
with most of the heat equation problems. The main difference is in the eigenvalue/eigenfunction part! Note
that this time around we have Neumann boundary conditions (the boundary conditions are on the spatial
derivative of the function; think of this as insulation, no heat flow in or out).
Solution:
We use separation of variables. Let u(x, t) = X(x)T (t). Then ut = uxx becomes X(x)T 0 (t) = X 00 (x)T (t).
We divide both sides by X(x)T (t) to obtain:
X 00
T0
=
= ,
T
X
where is a constant.
What happens to the boundary conditions under the separation of variables?
0 = u(0, t) = X 0 (0)T (t) X 0 (0) = 0 (since T (t) won0 t be 0 for allt)
0 = ux (, t) = X 0 (2)T (t) X 0 (2) = 0 (since T (t) won0 t be 0 for allt)
So we have X 0 (0) = X 0 (2) = 0.
6

(3)

Lets start with the T -equation from (3):


T 0 (t) = T (t),
which means T (t) = Cet (see above for details on solving this ODE).
Next we deal with the X-equation in (3) with conditions X 0 (0) = X 0 (2) = 0 derived from the boundary
conditions
X 00

= X

= X 0 (2) = 0.

X (0)

This is an eigenvalue problem. There are 3 cases to consider: > 0, = 0, and < 0.
We begin with the > 0 case - recall from above that we expect this to only yield the trivial solution
(aka X = 0). Set = 2 > 0. Then X 00 (x) 2 X(x) = 0. Use the substitution X(x) = erx to get the
characteristic equation r2 2 = 0, which has roots r = .Thus X(x) = C1 ex + C2 ex . We now use the
boundary conditions to find constants such that the conditions are satisfied:
X 0 (0)
0

X (2)

0 C1 C2 = 0

0 C1 e2 C2 e2 = 0.

Solving simultaneously we find C1 = C2 = 0. (The first equation gives C2 = C1 , plugging into the first
equation gives C1 e2 C1 e2 = 0 C1 (e2 e2 ) = 0, and this means that C1 = 0 because
e2 e2 is never zero for 6= 0 (which it isnt by assumption on , > 0). You could also use
X(x) = C1 sinh(x) + C2 cosh(x), and would find C1 = C2 = 0.
All right, next we consider the = 0 case (we could consider it jointly with the < 0 or > 0 cases, if
were very careful, but for the purposes of a systematic approach we wont here). Then X 00 = 0 X(x) =
Ax + B. Applying boundary conditions, 0 = X 0 (0) = A A = 0; 0 = X 0 (2) = A A = 0. So X(x) = B,
a constant, is still a possible solution! Therefore we do NOT have a trivial solution; rather we have found
that 0 = 0 is an eigenvalue with corresponding eigenfunction X0 (x) = 1, a constant (which we will multiply
by an arbitrary constant below to give the general solution).
Finally we look at the < 0 case. Set = 2 < 0. Then X 00 (x) + 2 X(x) = 0 and X(x) =
C1 sin(x) + C2 cos(x) (key steps to solving that ode above; for more details see your textbook, section
3.3). We now use the boundary conditions to find constants such that the conditions are satisfied:
X 0 (0)
0

X (2)

0 C1 cos(0) + C2 sin(0) = 0 C1 = 0

0 C2 sin(2) = 0.

Since sin() has roots at = n, n = 1, 2, 3, . . . , the second condition tells us that 2 = n or = n/2,
n = 1, 2, 3, . . . Thus we have our eigenfunctions an eigenvalues for < 0:
 n 2
n =
2nx 
Xn (x) = cos
.
2
Now we re-assemble. Recall u(x, t) = X(x)T (t). Therefore
un (x, t) = Xn (x)Tn (t) = cos

 nx 
2

 2 
n t
exp
4

for n = 0, 1, 2, 3, . . . are each solutions to the pde. Notice that this includes the n = 0 case! u0 (x, t) =
cos(0) exp(0) = 1. The pde is linear so we can use the principle of superposition, and sum them to make up
a general solution:
 2 

 nx 
n t
a0 X
u(x, t) =
+
an cos
exp
2
2
4
n=1
where the an are constants. We have used here the convention of writing the n = 0 term as a0 /2.
7

We solve for the bn using the initial condition. That is, u(x, 0) = f (x) so

f (x) =

 nx 
a0 X
,
+
an cos
2
2
n=1

which is a Fourier cosine series. Similar to the case for sines,


an =

2
L

f (x) cos

 nx 

dx =

f (x) cos
0

 nx 
2

dx

which we find by exploiting the orthogonality of cosines:

cos

 mx 
2

 nx 

cos

m 6= n
0,
dx = , m = n 6= 0 .

2, m = n = 0

What is different from the sine series here (other than the fact that we have cosines) is that we treat the
0-eigenvalue term as well, and that gives a different result. That is for m = n 6= 0:

cos
0

 mx 
2

1
dx =
2

1
(1 cos (mx)) dx =
2

but for m = n = 0:

 x=2

1
= ,
x
sin(mx)
m
x=0

dx = 2.
0

So now we integrate with f (x) = x to find an . First lets look at a0 :


a0 =
You can also think if this integral as

x dx =
0

2
0

x=2
1 x2
= 2.
2 x=0

x cos(n 0/2) dx. Now, for an , n 6= 0:

1
an =

x cos

 nx 

dx.

We
integrate by parts; u = x du = dx and dv = cos(nx/2) v = 2 sin(nx/2)/n. Then an = 1/(uv
vdu) or
"
#
 nx  x=2 2 2
 nx 
1 2x

an =
sin

sin
dx
n
2 x=0
n 0
2



 nx  x=2 
2
2
1

cos
=

n
n
2 x=0
4
an =
(cos(n) 1) ,
n2
since cos(0) = 1. Now, cos(n) = (1)n , so
an =

4
((1)n 1).
n2

Notice that this means for n even, an = 0; for n odd, an = 8/n2 . We can therefore say:
a2m = 0 and a2m1 =

8
.
(2m 1)2

n=0

n=1

Function
Fourier series approx.

0
0

0
0

Function
Fourier series approx.
1

x
n=5
6

2
1

Function
Fourier series approx.

0
0

x
n=10

0
0

Function
Fourier series approx.
1

Figure 2: Our Fourier cosine representation of f (x) = x for n = 0, 1, 5, 10.


Now lets re-assemble our solution.
u(x, t)

 2 

 nx 
X

a0 X
n t
a0
+
an cos
exp
=
+
a2m cos(mx) exp m2 t
2
2
4
2
n=1
m=1





X
(2m 1)
(2m 1)2 t
+
a2m1 cos
x exp
,
2
4
m=1

separating out even and odd terms b/c our coefficients are different for evens and odds! In particular,
a2m = 0. Thus,
u(x, t) =






(2m 1)2 t
8 X
1
(2m 1)
x
exp

.
cos
m=1 (2m 1)2
2
4

Thats our answer. Notice that as t , u , a constant solution, as expected. And that constant is ,
which is the average initial temperature in the bar, again as expected.
Lets think about how quickly our series solution converges to the actual solution by looking at the Fourier
cosine series representation we created of the initial condition. We showed that



1
(2n 1)
8X
cos
x , 0 x 2.
x=
n=1 (2n 1)2
2
Fig.2 shows x and the Fourier series version for m = 0, 1, 5, 10. Notice that the approximation is quite good
even for n = 5, and very good for n = 10! The series converges most slowly at the endpoints.

Вам также может понравиться