Professional Documents
Culture Documents
case because the solution is unsteady and intermediate results are typically
desired at relatively small time intervals.
u(x, t ) = C ~ , e - a ~ * ‘ s (i nk ~ ) (4.72)
n= 1
where
and k = nr. Let us now examine some of the more important finite-difference
algorithms that can be used to solve the heat equation.
(4.75)
APPLICATION OF NUMERICAL METHODS TO SELECTED MODEL EQUATIONS 127
2
- - a1 2 A t ( A X )
12
2
+ -360
a1 ( A x )
(4.76)
G = 1 + ~ ~ ( CpO-S1) (4.77)
which has no imaginary part and hence no phase shift. The amplification factor
is plotted in Fig. 4.12 for two values of r and is compared with the exact
amplification factor of the solution. The exact amplification (decay) factor is
obtained by substituting the elemental solution
= e-ak2t ikmx
m e
into
u(t + At)
G, =
u(t>
which gives
G, = e - a k i At
(4.78)
or
G, =p p 2 (4.79)
where p = k , A x . Hence the amplitude of the exact solution decreases by the
factor e - r p z during one time step, assuming no boundary condition influence.
In Fig. 4.12, we observe that the simple explicit method is highly dissipative
for large values of p when r = i. As expected, the amplification factor is in
closer agreement with the exact decay factor when r = $.
The present simple explicit scheme marches the solution outward from the
initial data line in much the same manner as the explicit schemes of the
previous section. This is illustrated in Fig. 4.13. In this figure we see that the
unknown u can be calculated at point P without any knowledge of the boundary
conditions along AB and CD. We know, however, that point P should depend on
the boundary conditions along AB and CD, since the parabolic heat equation
has the characteristic t = const. From this we conclude that the present explicit
scheme (with a finite A t ) does not properly model the physical behavior of the
parabolic PDE. It would appear that an implicit method would be the more
appropriate method for solving a parabolic PDE, since an implicit method
normally assimilates information from all grid points located on or below the
characteristic t = const. On the other hand, explicit schemes seem to provide a
‘INITIAL MTA
LINE
Figure 4.13 Zone of influence of simple explicit scheme.
APPLICATION OF NUMERICAL METHODS TO SELECTED MODEL EQUATIONS 129
Example 4.2 Suppose the simple explicit method is used to solve the heat
equation ( a = 0.05) with the initial condition
u ( x , 0) = sin ( 2 7 ~ ~ ) 0
1 Qx G
and periodic boundary conditions. Determine the amplitude error after 10 steps
if A t = 0.1 and A x = 0.1.
Solution A unique value of p can be determined in this problem for the same
reason that was given in Example 4.1. Thus the value of p becomes
fl = k , A X = (27r)(O.l> = 0.27~
After computing r,
a At (0.05)(0.1)
r = -= = 0.5
(Ax)' (0.1)'
the amplification factor for the simple explicit method is given by
G = 1 + 2r(cos p - 1) = 0.809017
while the exact amplification factor becomes
G, = e-'OZ = 0.820869
(4.82)
+-
2
+ -121a * A t ( A x ) 2 + -360
1
-(AX)
(4.83)
+SIIIPLE IRLICIT
+CRANK-NICOLSON
This unconditionally stable algorithm has become very well known and is
referred to as the Crank-Nicolson scheme. This scheme makes use of trapezoidal
differencing to achieve second-order accuracy with a T.E. of O[(At)2,(Ax)’].
Once again, a tridiagonal system of linear algebraic equations must be solved at
each time level n + 1. The modified equation for the Crank-Nicolson method is
(4.86)
1 (Ax)2
2. 8= -
2
+ ~
12aAt
T.E. = O [ ( A t ) ’ , AX)^]
APPLICATION OF NUMERICAL METHODS TO SELECTED MODEL EQUATIONS 133
so that only one unknown, u;", appears in the scheme, and therefore it is
explicit. The T.E. for the DuFort-Frankel method is O[(At)', (Ax)', (At/Ax)'I.
Consequently, if this method is to be consistent, then (At/Ax)' must approach
zero as At and Ax approach zero. As pointed out in Chapter 3, if At/Ax
approaches a constant value y , instead of zero, the DuFort-Frankel scheme is
consistent with the hyperbolic equation
dU d2U d2U
-
dt
+a y 2 7
dt
=
(Yax2
If we let r remain constant as At and Ax approach zero, the term (At/Ax)'
becomes formally a first-order term of O(At). The modified equation is given by
+ [
The amplification factor
1
-a(Ax)
360
4
-
1
-a3(At)
3
2 (At)4
+ 2a5-(Ax)4
1U,,,,,, + *..
2r cos p f d 1 - 4 r 2 sin2 p
G=
1 2r +
is plotted in Fig. 4.14 for r = 3. The explicit DuFort-Frankel scheme has the
unusual property of being unconditionally stable for r 0. In passing, we note
that the DuFort-Frankel method can be extended to two and three dimensions
without any unexpected penalties. The scheme remains unconditionally stable.