184
4. Series-Expansion Methods
Away from the points where d P1/J/dx P is discontinuous, the maximum-norm error
in the truncated Fourier series decays at a rate similar to the magnitude of the
first few neglected Fourier coefficients, and according to (4.23) this rate is faster
than O(1/NP) . In practice, the error is O(1/Np+l) away from the points where
d P1/J/dx P is discontinuous and 0(1/NP) nearthe discontinuities (Fomberg 1996,
p. 13).
Time-Differencing
The spectral representation of the spatial derivatives reduces the original partial differential equation to the system of ordinary differential equations (4.9).
In most practical applications, this system must be solved numerically. The timedifferencing schemes discussed in Section 2.3 provide a number of possibilities,
among which the leapfrog and Adams-Bashforth methods are the most common choices . Integrations performed using the spectral method typically require
smaller time steps than those used when spatial derivatives are computed with
low-order finite differences. This decrease in the maximum allowable time step
is a natural consequence of the spectral method's ability to correctly resolve the
spatial gradient in a 28x wave.
In order to better examine the source of this time-step restriction, consider the
case of advection by a constant wind speed c. When e is constant, the time dependence of the kth Fourier component is govemed by (4.13), which is just the
oscillation equation (2.30) with K = ek. The maximum value of Ikl is N =
n / 8X e - ! n / 8x e , where 8x e is the equivalent mesh size introduced in connection with (4.22) and n / 8X e » ! if the total domain [-ot ; rr] is divided into at
least ten grid intervals. If the oscillation equation is integrated using the leapfrog
scheme, the stability requirement is IK8t I ::: 1. Thus, the time step in a stable
leapfrog spectral solution must satisfy [c8t / 8x e I ::: 1Irr .
Now suppose the advection equation (4.11) is approximated using a centered
second-order spatial difference. The time evolution of the approximate solution
at the jth grid point is, once again, govemed by the oscillation equation. In this
case, however, K = -esin(k8x)/8x. The misrepresentation ofthe shorter wavelengths by the finite difference reduces the maximum value of IKIto e/ 8x, and the
leapfrog stability criterion relaxes to [c8t/ 8x I ::: 1. If higher-order finite differences are used, the error in the shorter wavelengths is reduced , and the maximum
allowable value of leM/8xl decreases to 0.73 for a fourth-order difference, and
to 0.63 for a sixth-order difference. Machenhauer (1979) notes that as the order
of a centered finite-difference approximation approaches infinity, the maximum
value of [c8t/ 8x Ifor which the scheme is stable approaches 1[n . The maximum
stable time step for the leapfrog spectral method is therefore consistent with the
interpretation of the spectral method as an infinite-order finite-difference scheme.
4.2.2 Improving Ejjiciency Using the Transform Method
The computational effort required to obtain spectral solutions to the advection
equation ceases to be trivial if there are spatial variations in the wind speed . In
4. Series-Expansion Methods
Away from the points where d P1/J/dx P is discontinuous, the maximum-norm error
in the truncated Fourier series decays at a rate similar to the magnitude of the
first few neglected Fourier coefficients, and according to (4.23) this rate is faster
than O(1/NP) . In practice, the error is O(1/Np+l) away from the points where
d P1/J/dx P is discontinuous and 0(1/NP) nearthe discontinuities (Fomberg 1996,
p. 13).
Time-Differencing
The spectral representation of the spatial derivatives reduces the original partial differential equation to the system of ordinary differential equations (4.9).
In most practical applications, this system must be solved numerically. The timedifferencing schemes discussed in Section 2.3 provide a number of possibilities,
among which the leapfrog and Adams-Bashforth methods are the most common choices . Integrations performed using the spectral method typically require
smaller time steps than those used when spatial derivatives are computed with
low-order finite differences. This decrease in the maximum allowable time step
is a natural consequence of the spectral method's ability to correctly resolve the
spatial gradient in a 28x wave.
In order to better examine the source of this time-step restriction, consider the
case of advection by a constant wind speed c. When e is constant, the time dependence of the kth Fourier component is govemed by (4.13), which is just the
oscillation equation (2.30) with K = ek. The maximum value of Ikl is N =
n / 8X e - ! n / 8x e , where 8x e is the equivalent mesh size introduced in connection with (4.22) and n / 8X e » ! if the total domain [-ot ; rr] is divided into at
least ten grid intervals. If the oscillation equation is integrated using the leapfrog
scheme, the stability requirement is IK8t I ::: 1. Thus, the time step in a stable
leapfrog spectral solution must satisfy [c8t / 8x e I ::: 1Irr .
Now suppose the advection equation (4.11) is approximated using a centered
second-order spatial difference. The time evolution of the approximate solution
at the jth grid point is, once again, govemed by the oscillation equation. In this
case, however, K = -esin(k8x)/8x. The misrepresentation ofthe shorter wavelengths by the finite difference reduces the maximum value of IKIto e/ 8x, and the
leapfrog stability criterion relaxes to [c8t/ 8x I ::: 1. If higher-order finite differences are used, the error in the shorter wavelengths is reduced , and the maximum
allowable value of leM/8xl decreases to 0.73 for a fourth-order difference, and
to 0.63 for a sixth-order difference. Machenhauer (1979) notes that as the order
of a centered finite-difference approximation approaches infinity, the maximum
value of [c8t/ 8x Ifor which the scheme is stable approaches 1[n . The maximum
stable time step for the leapfrog spectral method is therefore consistent with the
interpretation of the spectral method as an infinite-order finite-difference scheme.
4.2.2 Improving Ejjiciency Using the Transform Method
The computational effort required to obtain spectral solutions to the advection
equation ceases to be trivial if there are spatial variations in the wind speed . In
