7. Pseudo-spectral method and aliasing errors¶
As we have seen, the evaluation of the nonlinear term in equation (6.2) pertaining to the Galerkin discretisation of the Burgers equation is computationally of order \(\mathcal{O}(K^2)\). It is therefore desirable to find more efficient ways to compute this sum. The most imporant way to do this is via Fourier transforms leading to an order \(\mathcal{O}(K \log K)\) for the same operation which is significantly less than \(\mathcal{O}(K^2)\) for large \(K\).
To illustrate such an algorithm, consider the product \(w_j=w(x_j)\), \(j=1,\ldots,N\) of two grid functions \(u_j=u(x_j)\) and \(v_j=v(x_j)\) in physical space
We proceed by transforming to spectral space with the help of
and the discrete form of the orthogonality relation
In the last equation, \(n\in \mathbb{Z}\) leads to an arbitrary multiple of \(N\) which is closely related to aliasing errors (see further down).
Finally one obtains
i.e. the well-known result that a multiplication in physical space corresponds to a convolution in spectral space. To put it into other words, the fairly expensive evaluation of a convolution in spectral space, equation (7.2), is equivalent to the direct evaluation of a pointwise multiplication in physical space, equation (7.1).
Comparing our latest result, equation (7.2), to equation (6.2) we see that an efficient evaluation of a nonlinear product of two variables given in spectral space, \(\hat{u}_k\) and \(\hat{v}_m=i m \hat{u}_m\) may be done via the following steps
Transform \(\hat{u}_k\) and \(\hat{v}_m\) to physical space using FFT: \(u_j=\mathcal{F}^{-1}(\hat{u}_k)\), \(v_j=\mathcal{F}^{-1}(\hat{v}_m)\)
Multiplication in physical space: \(w_j=u_j\cdot v_j\)
Transform back to spectral space: \(\hat{w}_l=\mathcal{F}(w_j)\). This final results then reads:
Such an evaluation of the spectral convolution in physical space is usually termed pseudo-spectral evaluation of the nonlinear terms, since the calculations are not done exclusively in spectral space.
7.1. Aliasing errors¶
According to the sampling theorem, the highest wave number that can be represented as a grid function \(f_j\) with \(j=1,\ldots N=2K\) is \(K\). Higher wave numbers \(k_h>K\) are mapped to this representable region \(|k|\leq K\) via
An example of such a case is given in Figure Fig. 7.1 illustrating the misrepresentation of wave numbers when mapped on a grid function with not enough grid points.
7.2. Pseudo-spectral method¶
Such aliasing errors also appear when evaluating a convolution sum via Fourier transforms. To understand this, compare the nonlinear term in equations (6.2) and (7.3): The difference is the appearance of the term \(\ldots +n\cdot N\) in the expression computed via the FFT. For the computed result to be correct, measures have to be taken to avoid the inclusion of these additional parts (aliasing errors) in the sum.
Another way to look at aliasing errors is by realising that the non-linear evaluation in \(\hat{w}_l\) in equation (7.2) involves factors of \(\hat{v}_m\) with \(|m|=|l-k|\leq 2K\), i.e. wave numbers up to twice as high as representable on the grid. These wave numbers are thus mapped back to the represented wave-number space according to the above expression (7.4). Thus the sum will contain errors due to these spurious contributions, exactly the aliasing errors.
The additional conditions on the convolutional sum when using a pseudo-spectral evaluation of the nonlinear terms are however not directly possible to implement using the above algorithm for computing \(\hat{w}_l\) given in equation (7.2). There are however some possibilities to remove (or at least reduce) aliasing errors even in the pseudo-spectral case. The main options are, commonly termed dealiasing:
remove via phase shifting: In this method, the nonlinear terms are calculated twice with phase shifts, which can then be used to remove the spurious contributions.
apply a filter in spectral space before and after the transform to physical space which removes the highest \(1/3\) of the wavenumber content. This means that the actual resolution in physical space is only \(2N/3\). Therefore, this method is called the \(2/3\)-rule.
Another popular variant is the so-called 3/2-rule: The original grid in physical space is refined by a factor \(3/2\) to \(M=3/2N\) in every direction, and the nonlinear multiplications are then performed on this finer grid. Afterwards, the resulting product is transformed back to spectral space, cutting away the wave numbers with \(|k|>K\). Using the \(3/2\)-rule, the aliasing errors are completely removed for a quadratic nonlinearity as in the case of the Burgers equation, and thus the pseudo-spectral method becomes equivalent to a true Galerkin method in spectral space. As discussed in the literature, it turns out that explicitly removing aliasing errors yields better results than just incrasing the resolution (i.e. the filtering step is necessary).
For Chebyshev and Legendre methods based on Gaussian quadrature similar issues arise, which can be treated using overintegration. In this technique, the mesh is extended again by a factor of \(3/2\) prior to quadrature, to make the Gauss formula exact for the required order.
Note that aliasing errors are more severe for marginally resolved cases, as then the energy content in the highest resolved modes is typically larger. Alternative methods, such as finite-difference methods, are equally affected by aliasing errors, however their suppression is less obvious. Different formulations of the nonlinear term such as the skew-symmetric form, albeit analytically identical, have been shown to reduce aliasing errors, and are thus commonlly employed in particular for large-eddy simulations (LES).