Professional Documents
Culture Documents
INTRODUCTION
The linear partial differential equations considered in this paper for initial-value
problems will be indicated symbolically as
@a/at) + qzi) = 0, (1.1)
where 5$(ti) represents a linear spatial differential operator and ii is dependent
variable which is a function of a spatial variable x and a temporal variable t. A
specific example is the scalar convective equation:
(afipt) + c(at.l/ax) = 0, (1.2)
where c is a real constant.
STABILITY OF FINITE-DIFFERENCE METHODS 161
t=t”=nAt, x=xi=jAx.
n+1- 24”+ 2
u3 (pS)ujn- ; (gg” (8”)#,n= 0, (1.3)
TABLE I
8311 a3u
Partial Derivatives - ^^
dC dX atL dt
at2 ax
I I I ,
2 2
Coefficients of Eq. (1.5) -+At F 0
- F &(Eq. (1.5)]
I I i-$3 , At 0
-4
At2 0
At2 &
12 2.- [Eq. (l.S)]
12 IL
at2
2
$ At2 k-e [Eq. (1.5)1
ax2
a3
& At3 2 [Eq. (1.5)1
at ax
2
a3
-f~ At3 2 @a. (1.511
at ax
3
‘+ (Ax2 - c2 At’) a [Eq. (1.5)1
ax3
d
0 f Ax2 24
2
At3
; At2 0
-12
3
0 - $ At2 0
4””
-cf
2
At2 0 0
*(Ax'-c2 At')
-l----r 0 ~~(Ax~-c'A~~)I 0 0 0 0
2
5+x2-c* At*)
164 WARMING AND HYETT
(1.7)
The coefficient p(p) appearing in the sum denotes the coefficient of the pth spatial
derivative. These derivative terms are not in the original partial differential equation
and constitute a form of truncation error introduced by the finite-difference
analogue. Aside from round-off error, the modified equation represents the exact
partial differential equation solved by the finite-difference algorithm. This assertion
of the equivalence of the modified equation and the difference algorithm should be
qualified since the modified equation contains spatial derivatives of arbitrarily
high order. Thus, strictly speaking, an infinite number of boundary conditions are
required to define a solution. In our analysis (Sections 3 and 5), we assumespatial
periodicity to replace the required boundary conditions.
The essenceof the modified-equation approach is that various properties of a
finite-difference scheme can be deduced quite simply by examining a truncated
version of the modified equation. The first two properties we consider, i.e., order
of accuracy and consistency, are discussedin the following section.
ship between At and Ax, the right side of Eq. (1.7) does not tend to zero as the
increments vanish, then a finite-difference scheme is said to be inconsistent
with the original partial differential equation. In this situation, the modified
equation yields directly the differential equation with which the difference scheme
is consistent.
where the linear spatial operator 9&) has been moved to the right side and
included in the sums on the right by appropriate redefinition of the coefficients
p(p). If we assumean elementary solution for Eq, (3.1) of the form
24(x,t) = eateikx (3.2)
where the wave number k is real and 01= a + ib is complex, then a and b must
satisfy
a = -f (- 1)” k2Pp(2p), (3.3)
84
The last term on the right side is a fourth-order spatial difference operator with
a multiplicative parameter w, which was appended to the scheme to achieve
numerical stability. According to the von Neumann analysis [9], the algorithm is
stable if
4v2 - v4 < w < 3 and /VI < 1. (3.8)
The modified equation corresponding to this difference algorithm is
If the stability criterion (3.5) is applied to the above modified equation, we obtain
only the left-most inequality of Eq. (3.8), and so we have obtained only partial
information about the complete stability bound. In other situations, in particular
when applied to heat-equation algorithms, the heuristic stability condition yields
5WI4/2-5
168 WARMING AND HYETT
no obvious information about stability. Since condition (3.5) was obtained from
a plausibility argument in the small-wave-number limit, the insufficiency of the
condition is certainly no surprise.
The largest wave number that can be resolved by a finite-difference scheme is
k = n/Ax. The determination of the stability bound in this limit is of critical
importance since Fourier components corresponding to the largest wave numbers
tend to be the least stable. It does not appear feasible to use the modified equation
to predict a stability bound when k - 0(1/4x) for the following reason. For
a finite-difference analogue of either the simple convective equation where
p(2p) - O(AX~~-~)if At - O(dx), or the heat equation where I - O(LW~-~),
if At - O(Aa?), each term of the series(3.3) is of the same order if k - O(l/Ax).
Hence,one should hardly expect to obtain a sensiblebound from a truncated version
of the modified equation. However, we will describe in Section 5 a stratagem to
circumvent this apparent difficulty.
In this section, we briefly review the von Neumann method for two-level schemes
and give a formula for the square of the amplification factor modulus in the form
of a rational function. The particular structure of this formula provides the key to
understanding the relation between the number of spatial points used in an
algorithm, the order of the dissipative error (to be defined), the stability bound for
the method, and the connection between the heuristic condition (3.5) and that
found by the von Neumann method.
A two-level difference analogue of the differential equation (1.l) can be written in
the form
F Be = : A, (4.2)
a=-q q=-nt
is necessary for consistency. The von Neumann stability procedure [l] consists
of replacing each term uin of the difference equation (4.1) by the kth Fourier com-
ponent of a harmonic decomposition of ujR, i.e., by u”(k) exp(ikj Ax), where v”(k)
denotes the kth Fourier coefficient. The Fourier coefficients at n + 1 and n are
related by
v’*‘(k) = g(k) u”(k), (4.3)
STABILITY OF FINITE-DIFFERENCE METHODS 169
I g(k)1 G 1 (4.5)
for all values of k. If 1g(k)1 = I for all k, then the difference schemeis said to be
nondissipative or marginally stable, and if 1g(k)1 > 1 for some k, the scheme is
unstable. Henceforth, we restrict our attention to algorithms where ) g(k)/ is not
identically one.
For two-level schemes,it can be shown (see Appendix) that 1g(k)j2 can always
be expressedas the following rational function:
) g(k)12- 1 = -4z’S(z)/P(z), (4.6a)
where
z = sin2(8/2), t?=kAx, (4.6b)
Here, r is a positive integer and s is a nonnegative integer, and they are related by
the formula
r+s=m, (4.7a)
where
m = max(m, + m, , ne + nJ (4.7b)
is determined by the number of spatial grid points to the left and right of xj used
in the algorithm (4.1). The integer d of Eq. (4.6d) is nonnegative and d = m, + mc .
In the special caseof an implicit schemewhere
The polynomial S(z) determines the stability of a given difference scheme since
by comparing Eq. (4.6a) with (4.5) and using the fact P(z) > 0, it follows that a
necessaryand sufficient condition for stability is
The precise relation between the (heuristic) stability condition (3.5) of Section 3
and the von Neumann theory of the last section can be clarified by the following
discussion.
The elementary solution (3.2) of the modified equation (3.1) has the ampli-
fication factor
gm(k) = pAt = eaAteibAt
(5.1)
for one time increment. But since the modified equation representsthe exact partial
differential equation solved by a finite-difference scheme, the amplification factor
(5.1) must equal the amplification factor (4.4) of the difference scheme.Thus,
This linear case actually encompassesa large number of algorithms becauseif the
order s of the polynomial S(z) is greater than unity, this generally indicates that
more spatial points are used in the algorithm than necessary for the order of
accuracy achieved. If both sides of Eq. (5.9) are expanded as described above, we
find for t = 1
andforr >, 2
S(1) = ((-4)p+’ At/(2 Ax(2r+2)))[(1/12)(3 + r> AX2p(2r) - k42r + 31, r 3 2.
(5.12)
In either case, S(0) is given by Eq. (5.4.) For linear S(z), it is obvious that
S(0) > 0 and S(1) > 0 are both necessary and sufficient for stability since
S(z) 2 ~n(W>, S(l)).
In a recent paper, Morton [lo] considered the effect on numerical stability when
the viscous term oCZi,,
is added to the right side of convective equation (1.2) yielding
(acqat) + c(aqax) = o(a%/ax2), u > 0. (5.13)
The explicit finite-difference algorithm he analyzed was
.;+1 = ujn - v(p8 - (V/2) 62) ujn + y(S”) ujn, (5.14)
where v = c At/Ax and y = u At/A?. The modified equation is
If v is set to zero in the difference algorithm (5.14), one gets the explicit schemefor
the heat equation, and from inequality (5.17), there follows the well-known
stability bound y < l/2.
FIG. 1. Comparison of phase error Q/4, for second- and thud-order methods for Y = 0.3
and Y = 0.8.
STABILITY OF FINITE-DIFFERENCE METHODS 175
The phase shift 4 for a difference algorithm in terms of the odd-order coefficients
of the modified equation is given by
which follows from Eq. (5.3b) with b given by the sum (3.4). Since any sensible
difference analogue of the convective equation (1.2) will have a modified equation
with ~(1) = -c, the above equation can be rewritten as
Although this inequality is strictly true only for small wave numbers, it provides
a practical criterion for judging whether a particular algorithm has a dominant
leading or lagging phase error. From the modified equation (1.6) for the Lax-
Wendroff scheme, -~(3)/c is positive in the stable range, indicating a predominant
lagging phase error even though $/& can exceed 1 for large wave numbers as
illustrated in Fig. 1 for v = 0.8.
As an example of a second-order scheme with a leading phase error, consider
the “upwind” schemefor c > 0
uj
n+l = Ujn - V(l + $V) VUjn + *V2V2Uj”, c > 0, (6.7)
By virtue of Eq. (6.6), this upwind schemehas a leading phaseerror for 0 < u < 1.
Fromm [ll] based his method of zero-average phase error on the observation
that a reduction of dispersion should occur by using a linear combination of
methods of opposite phase error. If we represent the Lax-Wendroff scheme (1.3)
as $+l z L,(u,“) and the upwind scheme (6.7) by ~47~~ = L,(@ and form the
average
,;+1 = WL + 44) UT,
A more detailed analysis including phase error plots and numerical examples
for both linear and nonlinear problems is presented in Refs. 12 and 13.
In a recent paper, Taylor et al. [14] evaluated several methods for integrating the
one-dimensional inviscid gasdynamic equations. By numerical experiment, they
found for Rusanov’s [8] third-order method that the best results were obtained
for v = 0.7 and w = 2.0. For a Courant number of 0.7, the minimum dispersion
formula (6.9) yields w = 2.08. This predicted value certainly adds credence to
the practical utility of the modified equation analysis.
CONCLUDING REMARKS
Since the algebraic operations involved in the analysis are readily amenable to
automated machine calculation by a language such as FORMAC [6], the technique
can be applied with little effort on the part of the user. We have found it to be
particularly valuable in analyzing the relative merits of proposed schemesor in
constructing new ones.
We believe the modified equation concept can be used as an effective didactic
device since one quite often has, from experience,more physical intuition about the
properties of simple partial differential equations than for those of difference
equations. Thus it can be applied effectively to give insight into the nature and
control of dispersive and dissipative errors.
Finally, we should emphasize that although the stability analysis of this paper
has been confined to linear problems, Hirt [3] has argued that a criterion similar
to the heuristic necessarycondition (3.5) is applicable to nonlinear equations with
variable coefficients. In a recent paper, Lerat and Peyret [16] have used a nonlinear
modified equation analysis to demonstrate that the oscillations observed behind
a shock front are not always due to dispersive error but are also attributable to a
small local nonlinear instability.
where 8 = k dx. The square of the modulus of the sum in the numerator can be
expressedas
But since cos (9= 1 - 22, where z = sin2(8/2), one finds by using a trigonometric
multiple angle formula that
If we define w = nc + n, , then
nr 2 w
1 A,eiQO1 = z. yizi, yo = 1, yw = C-1)” 22’“A-,eA,,, , (A.2)
q=-nl
where without loss of generality we have normalized the coefficients A, such that
the consistency condition (4.2) is C A, = 1. Hence, one obtains for [ g(k)12 the
formula
and if a coefficient ai is defined as -4c+ = yi+r - pi+, then Eq. (A.3) can be
rewritten as Eq. (4.6) of the text.