58
2. Basic Finite-Difference Methods
which case A+ = A_ , and the physical and computational modes are not linearly
independent. In such circumstances, the general solution to (2.43) has the form
rjJn = CI (iKfit)n + C2n(iKfit)n.
Since the magnitude of the preceding solution grows as function of time step, the
leapfrog scheme is not stable when IKMI = 1. Nevertheless, the O(n) growth of
the solution that occurs when Kfit = ± 1 is far slower than the 0 (A n) amplification that is produced when IK MI> 1.
The source of the computational mode is particularly easy to analyze in the
trivial case of K = 0; then the analytic solution to the oscillation equation (2.30)
is 1/I(t) = C, where C is a constant determined by the initial condition at t = to.
Under these circumstances, the leapfrog scheme reduces to
rjJn+1 = rjJn-1 ,
(2.45)
and the amplification factor has the roots A+ = I, A _ = -1. The initial condition requires rjJ0 = C, which, according to the difference scheme (2.45), also
guarantees that rjJ2 = rjJ4 = rjJ6 = . .. = C. The odd time levels are determined by
a second, computational, initial condition imposed on rjJl. In practice, rjJl is often
obtained from rjJ0 by taking a single time step with a two-Ievel method, and the
resulting approximation to 1/I(to + M) will contain some error E. It is obvious
that in our present example, the correct choice for rjJl is C, but in order to mimic
the situation in a more general problem, suppose that rjJl = C + E . Then the
numerical solution at any subsequent time will be the sum of two modes,
rjJn = (C + E /2) - (_l)n E /2.
to yield rjJn = (C + E /2) - (_l)n E /2.
Here, the first term represents the physical mode, and the second term represents the computational mode. The computational mode oscillates with aperiod of
2fit, and does not decay with time. In this example, the amplitude of the computational mode is completely determined by the error in the specification of the computational initial condition rjJl. Since there is no coupling between the physical
and computational modes in solutions to linear problems, the errors in the initial
conditions also govem the amplitude of the computational mode in leapfrog solutions to most linear equations. If the goveming equations are nonlinear, however,
the nonlinear terms introduce a coupling between rjJ+ and rjJ_ that often amplifies
the computational mode until it eventually dominates the solution. This spurious
growth of the computational mode can be avoided by periodically discarding the
solution at rjJn-1 and taking a single time step with a two-Ievel scheme , or by filtering the high-frequency components of the numerical solution. Various techniques
for controlling the leapfrog scheme's computational mode will be discussed in
Section 2.3.5.
The relative phase changes in the two leapfrog modes are
Précédent

- 73/476

Suivant