96
2. Basic Finite-Difference Methods
The second-order nature of (2.102) mayaiso be demonstrated by expressing it
as a two-step formula in which each individual step is centered in space and time.
In the first step, intermediate values staggered in space and time are calculated
from the relations
(2.103)
c
ßx
rP
n+!
j_! -
I (n
2 rPj
n)
+rPj_1 __ (rP'j -rP'j_I)
----'---'----,----- -
!ßt
In the second step, rP'rI is computed from
.
(2.104)
(2.105)
The single-step formula (2.102) may be recovered by using (2.103) and (2.104) to
I
I
eliminate rP
n
+'1 and rP
n - '1 from (2.105). One advantage of the two-step formulation is that its extension to more complex problems can be immediately apparent.
For example , if the wind speed is a function of the spatial coordinate, c is replaced
by ci+ cl : and Cj in (2.103), (2.104), and (2.105), respectively. In contrast,
the equivalent modification of the single-step formula (see (2.107» is slightly less
obvious.
The amplitude and phase-speed errors of the Lax- Wendroff approximation to
the constant-wind-speed advection equation may be examined by substituting a
solution of the form (2.90) into (2.102), which yields
/AI(cosevrßt - i sinevrßt) = I + 1L
2(coskßx - I) - ilLsinkßx.
(2.106)
Equating the real and imaginary parts of the preceding equation, and then elimi -
nating IAI, one obtains the discrete-dispersion relation
Wr = -
I arctan
(
ßt
ILsinkßx
1 + 1L 2(coskßx - I)
) .
In the limit kßx « 1, Wr/k reduces to (2.94), showing that for well-resolved
waves, the phase-speed error of the Lax-Wendroff method is identical to that of
the leapfrog centered-space scherne. Eliminating Wr from the real and imaginary
parts of (2.106), one obtains
2. Basic Finite-Difference Methods
The second-order nature of (2.102) mayaiso be demonstrated by expressing it
as a two-step formula in which each individual step is centered in space and time.
In the first step, intermediate values staggered in space and time are calculated
from the relations
(2.103)
c
ßx
rP
n+!
j_! -
I (n
2 rPj
n)
+rPj_1 __ (rP'j -rP'j_I)
----'---'----,----- -
!ßt
In the second step, rP'rI is computed from
.
(2.104)
(2.105)
The single-step formula (2.102) may be recovered by using (2.103) and (2.104) to
I
I
eliminate rP
n
+'1 and rP
n - '1 from (2.105). One advantage of the two-step formulation is that its extension to more complex problems can be immediately apparent.
For example , if the wind speed is a function of the spatial coordinate, c is replaced
by ci+ cl : and Cj in (2.103), (2.104), and (2.105), respectively. In contrast,
the equivalent modification of the single-step formula (see (2.107» is slightly less
obvious.
The amplitude and phase-speed errors of the Lax- Wendroff approximation to
the constant-wind-speed advection equation may be examined by substituting a
solution of the form (2.90) into (2.102), which yields
/AI(cosevrßt - i sinevrßt) = I + 1L
2(coskßx - I) - ilLsinkßx.
(2.106)
Equating the real and imaginary parts of the preceding equation, and then elimi -
nating IAI, one obtains the discrete-dispersion relation
Wr = -
I arctan
(
ßt
ILsinkßx
1 + 1L 2(coskßx - I)
) .
In the limit kßx « 1, Wr/k reduces to (2.94), showing that for well-resolved
waves, the phase-speed error of the Lax-Wendroff method is identical to that of
the leapfrog centered-space scherne. Eliminating Wr from the real and imaginary
parts of (2.106), one obtains
