Solution of the Diffusion Equation

advertisement
College of Engineering and Computer Science
Mechanical Engineering Department
Mechanical Engineering 501B
Seminar in Engineering Analysis
Spring 2009 Class: 14443 Instructor: Larry Caretto
February 9 Homework Solutions
Kreyszig, page 561 problems 5, 13, 14 and 27 – Finding the temperature in a one
dimensional solid as a function of time.
These problems involve the solution of the diffusion equation with various boundary conditions
and initial conditions. All problems start with the same separation of variables process which is
described below.
u
 2u
 2
t
x
[1]
Here,  = k/ρc, is the thermal diffusion coefficient with dimensions of length squared over time.
The initial condition specifies the value of u at all values of x at t = 0. This condition is written as
follows:
u(x,0) = f(x)
[2]
In problem 5 we have f(x) = sin(0.4πx) and in problem 13, f(x) = x. The boundary conditions at x
= 0 and x = xmax, can be functions of time in general. These are written as follows.
u(0,t) = uL(t)
u(xmax,t) = uR(t)
[3]
In problem 5 we have uL = uR = 0 and in problems 13 and 14 we have ∂u/∂x = 0 at x = 0 and x =
xmax.
We use the basic separation of variables approach in which we assume that the solution, u(x,t), is
the product of two functions, T(t) a function of time only and X(x) a function of the distance x only.
With this assumption, our solution becomes.
u(x,t) = X(x)T(t)
[4]
We do not know, in advance, if this solution will work. However, we assume that it will and we
substitute it for u in equation [1]. Since X(x) is a function of x only and T(t) is a function of t only,
we obtain the following result when we substitute equation [4] into equation [1].
u X ( x)T (t )
T (t )

 X ( x)

t
t
t
 2u
 2 X ( x)T (t )
 2 X ( x)
 2 


T
(
t
)
x
x 2
x 2
[5]
If we divide the final equation through by the product X(x)T(t), we obtain the following result.
Jacaranda (Engineering) Room 3333
Email: lcaretto@csun.edu
Mail Code
8348
Phone: 818.677.6448
Fax: 818.677.7062
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
Page 2
1 1 T (t )
1  2 X ( x)

 T (t ) t
X ( x) x 2
[6]
The left hand side of equation [6] is a function of t only; the right hand side is a function of x only.
The only way that this can be correct is if both sides equal a constant. This also shows that the
separation of variables solution works. In order to simply the solution, we choose the constant 1 to
be equal to2. This gives us two ordinary differential equations to solve.
1 1 dT (t )
 2
 T (t ) dt
The first equation becomes
to be2
1 d 2 X ( x)
 2
2
X ( x) dx
[7]
dT (t )
 2T (t ) . The general solution to this equation is known
dt
T (t )  Ae  t . The second differential equation in [7] can be written as
2
d 2 X ( x)
 2 X ( x)  0 . The general solution to this equation is X(x) = Bsin(x) + Ccos(x).
2
dx
Thus, our general solution for u(x,t) = X(x)T(t) becomes (after defining AB as C1 and AC as C2)
u ( x, t )  T (t ) X ( x)  Ae  t B sin( x)  C cos(x)  e   t C1 sin( x)  C2 cos(x) [8]
2
2
At this point we have to consider the initial conditions, boundary conditions and property values
for each problem separately. Equation [8] will be the starting point for the analysis of all four
problems.
Problem 5 – Find the temperature, u(x,t) in a bar of silver (length = 10 cm, constant cross
section of area 1 cm2, density 10.6 g/cm3, thermal conductivity 1.04 cal/(s cm oC), specific
heat 0.056 cal/(g oC) that is perfectly insulated laterally, whose ends are kept at
temperature 0oC and whose initial temperature (in oC) is sin(0.4x).
In this case the boundary conditions are u(0,t) = 0 and u(xmax,t) = 0. If we substitute the boundary
condition at x = 0 into equation [8], get the following result because sin(0) = 0 and cos(0) = 1.
u(0, t )  0  e  t C1 sin( 0)  C2 cos(0)  C2 e  t
2
2
[9]
Equation [9] will be satisfied for all t if C2 = 0. With C2 = 0, we can apply the solution in equation
[8] to the boundary condition at x = xmax.
u ( xmax , t )  0  C1e  t sin( xmax )
2
[10]
Equation [10] can only be satisfied if the sine term is zero. This will be true only if xmax is an
integral times . If n denotes an integer, we must have
The choice of –2 for the constant as opposed to just plain  comes from experience. Choosing
the constant to have this form now gives a more convenient result later. If we chose the constant
to be simply , we would obtain the same result, but the expression of the constant would be
awkward.
2 As usual, you can confirm that this solution satisfies the differential equation by substituting the
solution into the differential equation.
1
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
xmax  n

or
Page 3
n
xmax
[11]
Since any integral value of n gives a solution to the original differential equations, with the
boundary conditions that u = 0 at both boundaries, the most general solution is one that is a sum
of all possible solutions, each multiplied by a different constant, C n. This general solution is
written as follows

u( x, t )   Cn e nt sin( n x)
2
n 
with
n 1
n
xmax
[12]
We still have to satisfy the initial condition that u(x,0) = f(x). Substituting this condition for t = 0
into equation [12] gives
 nx 

f ( x )  u( x,0)  Cn sin 
x
n 1
 max 

[13]
Since the ordinary differential equation for X(x) forms a Sturm-Liouville problem, the solutions
Cnsin(nx/xmax) are eigenfunction solutions to the problem in the interval 0 ≤ x ≤ xmax. Thus we
can expand any initial condition function, f(x) in terms of these eigenfunctions. We can obtain the
usual equation for eigenfunction expansion coefficients of Sturm-Liouville solutions by using the
orthogonality relationships for integrals of the sine. If we multiply both sides of equation [13] by
sin(mx/xmax), where m is another integer, and integrate both sides of the resulting equation from
a lower limit of zero to an upper limit of xmax, we get the following result.
x max

0
 mx 
dx 
f ( x ) sin 
 xmax 
 x max


n 1 0
x max 
 C
n 1
0
n
 mx   nx 
 sin 
dx
sin 
 xmax   xmax 
 mx   nx 
 sin 
dx  Cm
Cn sin 
x
x
 max   max 
x max

0
[14]
 mx 
dx
sin 
x
 max 
2
In the second row of equation [14] we reverse the order of summation and integration because
these operations commute. We then recognize that the integrals in the summation all vanish
unless m = n, leaving only this integral to evaluate. Solving for C m and evaluating the last
integral3 in equation [14] gives the following result.
 mx 
dx
f ( x ) sin 
xmax 
2

0
Cm  xmax

xmax
2  mx 


sin
dx
0  xmax 
xmax

xmax

0
 mx 
dx
f ( x ) sin 
 xmax 
[15]
3
Using a standard integral table, and the fact that the sine of zero and the sine of an integral
multiple of  are zero, we find the following result:
x max

0
x max
x x
 mx 
 2mx 
dx    max sin 

sin 
2
4
m

x
max
 xmax 

 0

2

 2mxmax
xmax
x
 max sin 
2
4m
 xmax
 xmax
 
2

February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
Page 4
For any initial condition, then, we can perform the integral on the right hand side of equation [15]
to compute the values of Cm and substitute the result into equation [12] to compute u(x,t). We
recognize that equation [15] is the usual equation for eigenfunction expansions in Sturm-Liouville
problems.
In this problem we have f(x) = sin(0.4x). No dimensions are given for the constant 0.4 in this
equation, but we know that it must have units of inverse length to make the argument of the sine
a dimensionless quantity. Since other length data are given in units of cm, we assume that the
units value multiplying x is 0.4 cm-1; since xmax = 10 cm, the value of 0.4 cm -1 = 4/xmax and we
can write this initial condition as f(x) = sin[(4)x/xmax]. If we substitute f(x) = sin[(4)x/xmax] into
equation [15] we find Cm as follows.
Cm 
2
xmax
x max

0
 4x
sin 
 xmax
  mx 
2
 sin 
dx 
 4m
x
x
max
  max 
x max

0
 x
sin 2 
 xmax

dx

[16]
Because sin(mx/xmax) is an orthogonal function in the region 0 ≤ x ≤ x max, the only time that this
integral is non zero is when m = 4. We have just shown3 that the integral of sin2(mx/xmax)
between x = 0 and x = xmax = xmax/2 so that equation [16] tells us that Cm = 1 when m = 4 and Cm
= 0 for all other values of m.
m4
 1

Cm  
0

[17]
m4
Substituting this result into equation [12] gives the following solution to the diffusion equation
when f(x) sin(x/xmax) and the boundary temperatures are zero.
u ( x, t ) 
 4

x
e  max
2

 t


sin 
4x
x
 max



[18]
For the data in this problem we can compute the thermal diffusivity as follows.
1.04 cal
o
k
1.752 cm 2
cm

s

C



c 10.6 g 0.056 cal
s
3
o
cm
g C
[19]
The solution to the problem uses cm as the unit for length.
Problem 13 – Adiabatic means no heat exchange with the neighborhood, because the bas
is completely insulated, also at the ends. Physical information: The heat flux at the ends
of a bar is found to be proportional to ∂u/∂x there. Show that for the completely insulated
bar, ux(0,t) = ux(L,t) = 0, u(x,0) = f(x) and separation of variables gives the following
solution with An given by (2) in section 11.3.
February 9 homework solutions

L. S. Caretto, Spring 2009, ME 501B
u( x, t )  A0   An e nt cos( n x )
n 
2
n 1
n
n

xmax
L
Page 5
c2  
Again we use equation [8] as the starting point.
u( x, t )  e  t C1 sin( x)  C2 cos(x)
2
[8]
Taking the first derivative of this equation with respect to x gives.
2
u( x, t )
 e   t  C1 cos( x )  C2 sin( x )
x
[20]
The boundary condition that the ∂u/∂x = 0 at x = 0 gives the following result.
2
2
u( x, t )
 0  e   t C1 cos(0)  C2 sin( 0)  e  t C1
x x  0
[21]
We can satisfy this condition by having C1 = 0. Setting C1 to zero in equation [20] and applying
the boundary condition that ∂u/∂x = 0 at x = L gives.
2
u( x, t )
 0  e   t C2 sin( L)
x x  L
[22]
We can satisfy this condition is the sine term is zero, which it will be if λL is an integer multiple of
π.
L  n
or

n
L
integer n
[23]
As usual, we take the general solution to be the sum of all solutions that satisfy the differential
equation and the boundary conditions. Note that when the eigenfunction is cos(nπx/L) we do
have a nonzero eigenfunction for n = 0, so we include this in our sum. However, this
eigenfunction is simply cos(0) = 1. We will write this term separately outside the sum.
u ( x, t )  A0 e
0
cos(0) 

 An e
n 1
 2n t
cos( n x)  A0 

 An e   t cos( n x)
n 1
2
n
n 
n
L
As usual we find the coefficients, An, by using an eigenfunction expansion. A specific example of
this is given in the next problem. The development in the next problem solution shows that the
equations for these coefficients match those of equation (2) in section 11.3.
The solution gives u → A0 as t → ∞. That is, the steady-state solution is a constant temperature
everywhere in the region. This seems correct. For the adiabatic boundary conditions, there is no
way for heat to leave the region. The initial temperature profile will head to heat transfer in the x
direction so long as there is a temperature difference. At steady state, there is no mechanism to
maintain any temperature difference so that the solution approaches a constant.
[24]
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
Page 6
Problem 14 – Find the temperature in the bar of problem 13 with L = π, α = c2 = 1 and f(x) =
x.
Here we use the general solution in equation [24] that satisfies the differential equation and the
boundary conditions and apply it to the given initial condition. Setting L = π in equation [24] gives
λn = n and the following result for our general solution.

u( x, t )  A0   An e  n t cos( nx )
2
[25]
n 1
As usual we set t = 0 so that u(x,t = 0) becomes the initial condition, f(x) = x.
u ( x,0)  f ( x)  x  A0 

 An cos(nx)
[26]
n 1
If we multiply both sides of this equation by cos(mx) and integrate the result from 0 to π, we
obtain.





x cos mx dx   A0 
An cos( nx) cos mx dx

n 1

0
0



[27]
We have to consider the case of m = 0, in which case the eigenfunction is 1, separately. This
gives.





x(1) dx   A0 
An cos( nx)(1) dx

n 1

0
0


x 
 sin m

 cos mx dx  sin mx m

The integral
x 0
0

m
 sin 0 m  0.
[28]
Thus, all the integrals on
the right, except for the integral of A0dx are zero. (This is consistent with the notion that the set of
eigenfunctions ym = cos(mπx/L) for the cosine solution, which starts at n = 0, gives y0 = 1; since
the y0 eigenfunction must be orthogonal to all other eigenfunctions, we expect that the integral of
any eigenfunction, other than y0, will be zero.) This gives the following result for A0.

x

 x2 
2
2

x dx   

0
 A0 dx  A0   A0 
 2 
2
2
2
  x 0
0
0


Returning to equation [27], we find Am for m ≥ 1, using the result for the orthogonality of the
cosine function to give.
[29]
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
Page 7

Am 
 x cos mx dx
0

[30]
 cos
2
mx dx
0
Using integral tables gives the following result for the integral in the numerator.


cos m  1
 cos mx x sin mx 
0 x cos mx dx   m2  m  0  m2
[31]
The integral in the denominator can also be found using integral tables as


cos m sin m 

 cos mx sin mx x 
  
 0 
0 cos mx dx   2m
2 0
2m
2
2
2
[32]
Using these results and noting that (cos(m – 1) equals 2 for odd m and zero for even m gives
Am as follows.
4
cos m  1  2
m odd
m
2

m
Am  0



2
 0
m even
0 cos mx dx
2



 x cos mx dx
[30]
Substituting this result for Am (m ≥ 1) and the previous result for A0 into equation [25] gives.
e  n t cos( nx)
u ( x, t )  

2  n1,3,5,
n2

4

2
[31]
Setting α = 1 (given) gives the following result for the first few terms in the series.
u ( x, t ) 

2


4  t
e9t cos(3x) e25t cos(5 x) e49t cos(7 x)
e
cos(
x
)



 


9
25
49

[32]
Problem 27 – (Non-homogenous heat equation) Show that the problem consisting of
ut – αuxx = Ne-ax
and (2), (3) can be reduced to a problem for the homogenous heat equation by setting
u(x,t) = v(x,t) + w(x) and determining w so that v satisfies the homogenous equation and
the conditions v(0,t) =v(L,t) = 0, v(x,0) = f(x) – w(x). (The term Ne-ax may represent heat loss
due to radioactive decay in the bar.)
The differential equation and the boundary conditions given in the problem statement are shown
below.
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
u
 2u
  2  Ne ax
t
x
Page 8
u(0, t )  u( L, t )  0 u( x,0)  f ( x )
[33]
Substituting the proposed solution, u(x,t) = v(x,t) + w(x) into the diffusion equation gives, after
some manipulation, the result shown in equation [34]. In the first step we drop the ∂w/∂t
derivative since w is a function of x only. In the second step we drop the v terms since they are
exactly the diffusion equation and v satisfies that partial differential equation.
Ne ax 
 v  w
 2 v  w v
 2v
2w
2w









t
x 2
t
x 2
x 2
x 2
[34]
Since w is a function of x only, the first and last terms in [34] give us an ordinary differential
equation that we can solve for w. Writing this equation and integrating it two times gives.
Ne
 ax
2w
d 2w
  2   2
x
dx

d 2w
N
  e  ax
2
dx

[35]
dw
N
N  ax
   e  ax dx  C1 
e  C1
dx

a
[36]
N
 N  ax

w  
e  C1 dx  C2   2 e  ax  C1 x  C2
a
 a

[37]
We can combine the solution definition, u(x,t) = v(x,t) + w(x), with the initial condition, u(x,t) = f(x),
to get an initial condition for v.
v(x,0) = u(x,0) – w(x) = f(x) – w(x)
[38]
We would have to use this initial condition for v(x,0) in developing any eigenfunction expansion to
match the initial conditions. The constants of integration in equation [37] can be found by
matching boundary temperatures. If u(0,t) = w(0) = uA and u(L,t) = w(L) = uB we have the
following results form equation [37].
w(0)  u A  
N a0
N
e  C1 (0)  C2   2  C2
2
a
a
w( L)  uB  
 C2  u A 
N
a 2
N  aL
N
N
e  C1L  C2   2 e  aL  C1L  u A  2
2
a
a
a
[39]
[40]
Solving equation [40] gives C1 as follows.
C1 
uB  u A
N
 2 e aL  1
L
a L
[41]
Substituting the results of equations [40] and [41] for C1 and C2 into equation [37] gives.
w
N  ax  uB  u A
N
N

e 
 2 e  aL  1 x  C2  u A  2
2
a
a L
a
 L

[42]
February 9 homework solutions
L. S. Caretto, Spring 2009, ME 501B
Page 9
A rearrangement gives
w  uA 
uB  u A
N 
x

x  2 e aL  1  1  e ax 
L
a
L

[42]
The solution for v(x,t) which satisfies the diffusion equation with zero boundary conditions has
already been found; it is given by equation [12].

v ( x, t )   Cn e  nt sin( n x )
2
n 1
with
n 
n
L
[12]
The coefficients Cn are found by the following formula for eigenfunction expansion coefficients.
This is the same formula as equation [15] with f(x) replaced by f(x) – w(x).
L
Cm 
 mx 
dx
L
L 
2
 mx 
   f ( x )  w( x ) sin 
dx
L
L0
 L 
2  mx 
0 sin  L dx
  f ( x )  w( x )sin 
0
[43]
Substituting equation [42] for w(x) gives the equation necessary to compute the expansion
coefficients, Cm.
2 
uB  u A
N 
x
   mx 
x  2 e  aL  1  1  e  ax   sin 
dx
 f ( x)  uA 

L0
L
a
L
  L 
L
Cm 
[44]
In this problem we are given uA = uB = 0 which makes only a slight simplification in the final result.
Download