Pseudo-spectral methods,
also known as discrete variable representation (DVR) methods, are a class of
numerical methods used in
applied mathematics and
scientific computing for the solution of
partial differential equation
In mathematics, a partial differential equation (PDE) is an equation which imposes relations between the various partial derivatives of a Multivariable calculus, multivariable function.
The function is often thought of as an "unknown" to be sol ...
s. They are closely related to
spectral methods, but complement the
basis by an additional pseudo-spectral basis, which allows representation of functions on a quadrature grid. This simplifies the evaluation of certain operators, and can considerably speed up the calculation when using fast algorithms such as the
fast Fourier transform
A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in th ...
.
Motivation with a concrete example
Take the initial-value problem
:
with periodic conditions
. This specific example is the
Schrödinger equation for a particle in a potential
, but the structure is more general. In many practical partial differential equations, one has a term that involves derivatives (such as a kinetic energy contribution), and a multiplication with a function (for example, a potential).
In the spectral method, the solution
is expanded in a suitable set of basis functions, for example plane waves,
:
Insertion and equating identical coefficients yields a set of
ordinary differential equations for the coefficients,
:
where the elements
are calculated through the explicit Fourier-transform
:
The solution would then be obtained by truncating the expansion to
basis functions, and finding a solution for the
. In general, this is done by
numerical methods, such as
Runge–Kutta methods. For the numerical solutions, the right-hand side of the ordinary differential equation has to be evaluated repeatedly at different time steps. At this point, the spectral method has a major problem with the potential term
.
In the spectral representation, the multiplication with the function
transforms into a vector-matrix multiplication, which scales as
. Also, the matrix elements
need to be evaluated explicitly before the differential equation for the coefficients can be solved, which requires an additional step.
In the pseudo-spectral method, this term is evaluated differently. Given the coefficients
, an inverse discrete Fourier transform yields the value of the function
at discrete grid points
. At these grid points, the function is then multiplied,
, and the result Fourier-transformed back. This yields a new set of coefficients
that are used instead of the matrix product
.
It can be shown that both methods have similar accuracy. However, the pseudo-spectral method allows the use of a fast Fourier transform, which scales as
, and is therefore significantly more efficient than the matrix multiplication. Also, the function
can be used directly without evaluating any additional integrals.
Technical discussion
In a more abstract way, the pseudo-spectral method deals with the multiplication of two functions
and
as part of a partial differential equation. To simplify the notation, the time-dependence is dropped. Conceptually, it consists of three steps:
#
are expanded in a finite set of basis functions (this is the
spectral method).
# For a given set of basis functions, a quadrature is sought that converts scalar products of these basis functions into a weighted sum over grid points.
# The product is calculated by multiplying
at each grid point.
Expansion in a basis
The functions
can be expanded in a finite basis
as
:
:
For simplicity, let the basis be orthogonal and normalized,
using the
inner product with appropriate boundaries
. The coefficients are then obtained by
:
:
A bit of calculus yields then
:
with
. This forms the basis of the spectral method. To distinguish the basis of the
from the quadrature basis, the expansion is sometimes called Finite Basis Representation (FBR).
Quadrature
For a given basis
and number of
basis functions, one can try to find a quadrature, i.e., a set of
points and weights such that
:
Special examples are the
Gaussian quadrature for polynomials and the
Discrete Fourier Transform for plane waves. It should be stressed that the grid points and weights,
are a function of the basis ''and'' the number
.
The quadrature allows an alternative numerical representation of the function
through their value at the grid points. This representation is sometimes denoted Discrete Variable Representation (DVR), and is completely equivalent to the expansion in the basis.
:
:
Multiplication
The multiplication with the function
is then done at each grid point,
:
This generally introduces an additional approximation. To see this, we can calculate one of the coefficients
:
:
However, using the spectral method, the same coefficient would be
. The pseudo-spectral method thus introduces the additional approximation
:
If the product
can be represented with the given finite set of basis functions, the above equation is exact due to the chosen quadrature.
Special pseudospectral schemes
The Fourier method
If periodic boundary conditions with period