Pseudo-spectral method

From HandWiki
Short description: Class of analytical partial differential equation-solving processes


Pseudo-spectral methods,[1] 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 equations. 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[definition needed]. This simplifies the evaluation of certain operators, and can considerably speed up the calculation when using fast algorithms such as the fast Fourier transform.

Motivation with a concrete example

Take the initial-value problem

[math]\displaystyle{ i \frac{\partial}{\partial t} \psi(x, t) = \Bigl[-\frac{\partial^2}{\partial x^2} + V(x) \Bigr] \psi(x,t), \qquad\qquad \psi(t_0) = \psi_0 }[/math]

with periodic conditions [math]\displaystyle{ \psi(x+1, t) = \psi(x, t) }[/math]. This specific example is the Schrödinger equation for a particle in a potential [math]\displaystyle{ V(x) }[/math], 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 [math]\displaystyle{ \psi }[/math] is expanded in a suitable set of basis functions, for example plane waves,

[math]\displaystyle{ \psi(x,t) = \frac{1}{\sqrt{2\pi}} \sum_n c_n(t) e^{2\pi i n x} . }[/math]

Insertion and equating identical coefficients yields a set of ordinary differential equations for the coefficients,

[math]\displaystyle{ i\frac{d}{dt} c_n(t) = (2\pi n)^2 c_n + \sum_k V_{n-k} c_k, }[/math]

where the elements [math]\displaystyle{ V_{n-k} }[/math] are calculated through the explicit Fourier-transform

[math]\displaystyle{ V_{n-k} = \int_0^{1} V(x) \ e^{2\pi i (k-n) x} dx . }[/math]

The solution would then be obtained by truncating the expansion to [math]\displaystyle{ N }[/math] basis functions, and finding a solution for the [math]\displaystyle{ c_n(t) }[/math]. 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 [math]\displaystyle{ V(x) }[/math].

In the spectral representation, the multiplication with the function [math]\displaystyle{ V(x) }[/math] transforms into a vector-matrix multiplication, which scales as [math]\displaystyle{ N^2 }[/math]. Also, the matrix elements [math]\displaystyle{ V_{n-k} }[/math] 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 [math]\displaystyle{ c_n(t) }[/math], an inverse discrete Fourier transform yields the value of the function [math]\displaystyle{ \psi }[/math] at discrete grid points [math]\displaystyle{ x_j = 2\pi j/N }[/math]. At these grid points, the function is then multiplied, [math]\displaystyle{ \psi'(x_i, t) = V(x_i) \psi(x_i, t) }[/math], and the result Fourier-transformed back. This yields a new set of coefficients [math]\displaystyle{ c'_n(t) }[/math] that are used instead of the matrix product [math]\displaystyle{ \sum_k V_{n-k} c_k(t) }[/math].

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 [math]\displaystyle{ O(N\ln N) }[/math], and is therefore significantly more efficient than the matrix multiplication. Also, the function [math]\displaystyle{ V(x) }[/math] 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 [math]\displaystyle{ V(x) }[/math] and [math]\displaystyle{ f(x) }[/math] as part of a partial differential equation. To simplify the notation, the time-dependence is dropped. Conceptually, it consists of three steps:

  1. [math]\displaystyle{ f(x), \tilde{f}(x) = V(x)f(x) }[/math] are expanded in a finite set of basis functions (this is the spectral method).
  2. 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.
  3. The product is calculated by multiplying [math]\displaystyle{ V,f }[/math] at each grid point.

Expansion in a basis

The functions [math]\displaystyle{ f, \tilde f }[/math] can be expanded in a finite basis [math]\displaystyle{ \{\phi_n\}_{n = 0,\ldots,N} }[/math] as

[math]\displaystyle{ f(x) = \sum_{n=0}^N c_n \phi_n(x) }[/math]
[math]\displaystyle{ \tilde f(x) = \sum_{n=0}^N \tilde c_n \phi_n(x) }[/math]

For simplicity, let the basis be orthogonal and normalized, [math]\displaystyle{ \langle \phi_n, \phi_m \rangle = \delta_{nm} }[/math] using the inner product [math]\displaystyle{ \langle f, g \rangle = \int_a^b f(x) \overline{g(x)} dx }[/math] with appropriate boundaries [math]\displaystyle{ a,b }[/math]. The coefficients are then obtained by

[math]\displaystyle{ c_n = \langle f, \phi_n \rangle }[/math]
[math]\displaystyle{ \tilde c_n = \langle \tilde f, \phi_n \rangle }[/math]

A bit of calculus yields then

[math]\displaystyle{ \tilde c_n = \sum_{m=0}^N V_{n-m} c_m }[/math]

with [math]\displaystyle{ V_{n-m} = \langle V\phi_m, \phi_n \rangle }[/math]. This forms the basis of the spectral method. To distinguish the basis of the [math]\displaystyle{ \phi_n }[/math] from the quadrature basis, the expansion is sometimes called Finite Basis Representation (FBR).

Quadrature

For a given basis [math]\displaystyle{ \{\phi_n\} }[/math] and number of [math]\displaystyle{ N+1 }[/math] basis functions, one can try to find a quadrature, i.e., a set of [math]\displaystyle{ N+1 }[/math] points and weights such that

[math]\displaystyle{ \langle \phi_n, \phi_m \rangle = \sum_{i=0}^N w_i \phi_n(x_i) \overline{\phi_m(x_i)} \qquad\qquad n,m = 0,\ldots,N }[/math]

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, [math]\displaystyle{ x_i,w_i }[/math] are a function of the basis and the number [math]\displaystyle{ N }[/math].

The quadrature allows an alternative numerical representation of the function [math]\displaystyle{ f(x), \tilde f(x) }[/math] 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.

[math]\displaystyle{ f(x_i) = \sum_{n=0}^N c_n \phi_n(x_i) }[/math]
[math]\displaystyle{ c_n = \langle f, \phi_n \rangle = \sum_{i=0}^{N} w_i f(x_i) \overline{\phi_n(x_i)} }[/math]

Multiplication

The multiplication with the function [math]\displaystyle{ V(x) }[/math] is then done at each grid point,

[math]\displaystyle{ \tilde f(x_i) = V(x_i) f(x_i). }[/math]

This generally introduces an additional approximation. To see this, we can calculate one of the coefficients [math]\displaystyle{ \tilde c_n }[/math]:

[math]\displaystyle{ \tilde c_n = \langle \tilde f, \phi_n \rangle = \sum_i w_i \tilde f(x_i) \overline{\phi_n(x_i)} = \sum_i w_i V(x_i) f(x_i) \overline{\phi_n(x_i)} }[/math]

However, using the spectral method, the same coefficient would be [math]\displaystyle{ \tilde c_n = \langle Vf, \phi_n \rangle }[/math]. The pseudo-spectral method thus introduces the additional approximation

[math]\displaystyle{ \langle Vf, \phi_n \rangle \approx \sum_i w_i V(x_i) f(x_i) \overline{\phi_n(x_i)}. }[/math]

If the product [math]\displaystyle{ Vf }[/math] 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 [math]\displaystyle{ [0,L] }[/math] are imposed on the system, the basis functions can be generated by plane waves,

[math]\displaystyle{ \phi_n(x) = \frac{1}{\sqrt{L}} e^{-\imath k_n x} }[/math]

with [math]\displaystyle{ k_n = (-1)^n \lceil n/2 \rceil 2\pi/L }[/math], where [math]\displaystyle{ \lceil\cdot\rceil }[/math] is the ceiling function.

The quadrature for a cut-off at [math]\displaystyle{ n_{\text{max}} = N }[/math] is given by the discrete Fourier transformation. The grid points are equally spaced, [math]\displaystyle{ x_i = i \Delta x }[/math] with spacing [math]\displaystyle{ \Delta x = L / (N+1) }[/math], and the constant weights are [math]\displaystyle{ w_i = \Delta x }[/math].

For the discussion of the error, note that the product of two plane waves is again a plane wave, [math]\displaystyle{ \phi_{a} + \phi_b = \phi_c }[/math] with [math]\displaystyle{ c \leq a+b }[/math]. Thus, qualitatively, if the functions [math]\displaystyle{ f(x), V(x) }[/math] can be represented sufficiently accurately with [math]\displaystyle{ N_f, N_V }[/math] basis functions, the pseudo-spectral method gives accurate results if [math]\displaystyle{ N_f + N_V }[/math] basis functions are used.

An expansion in plane waves often has a poor quality and needs many basis functions to converge. However, the transformation between the basis expansion and the grid representation can be done using a Fast Fourier transform, which scales favorably as [math]\displaystyle{ N \ln N }[/math]. As a consequence, plane waves are one of the most common expansion that is encountered with pseudo-spectral methods.

Polynomials

Another common expansion is into classical polynomials. Here, the Gaussian quadrature is used, which states that one can always find weights [math]\displaystyle{ w_i }[/math] and points [math]\displaystyle{ x_i }[/math] such that

[math]\displaystyle{ \int_a^b w(x) p(x) dx = \sum_{i=0}^N w_i p(x_i) }[/math]

holds for any polynomial [math]\displaystyle{ p(x) }[/math] of degree [math]\displaystyle{ 2N+1 }[/math] or less. Typically, the weight function [math]\displaystyle{ w(x) }[/math] and ranges [math]\displaystyle{ a,b }[/math] are chosen for a specific problem, and leads to one of the different forms of the quadrature. To apply this to the pseudo-spectral method, we choose basis functions [math]\displaystyle{ \phi_n(x) = \sqrt{w(x)} P_n(x) }[/math], with [math]\displaystyle{ P_n }[/math] being a polynomial of degree [math]\displaystyle{ n }[/math] with the property

[math]\displaystyle{ \int_a^b w(x) P_n(x) P_m(x) dx = \delta_{mn}. }[/math]

Under these conditions, the [math]\displaystyle{ \phi_n }[/math] form an orthonormal basis with respect to the scalar product [math]\displaystyle{ \langle f, g \rangle = \int_a^b f(x) \overline{g(x)} dx }[/math]. This basis, together with the quadrature points can then be used for the pseudo-spectral method.

For the discussion of the error, note that if [math]\displaystyle{ f }[/math] is well represented by [math]\displaystyle{ N_f }[/math] basis functions and [math]\displaystyle{ V }[/math] is well represented by a polynomial of degree [math]\displaystyle{ N_V }[/math], their product can be expanded in the first [math]\displaystyle{ N_f+N_V }[/math] basis functions, and the pseudo-spectral method will give accurate results for that many basis functions.

Such polynomials occur naturally in several standard problems. For example, the quantum harmonic oscillator is ideally expanded in Hermite polynomials, and Jacobi-polynomials can be used to define the associated Legendre functions typically appearing in rotational problems.

References

  1. Orszag, Steven A. (September 1972). "Comparison of Pseudospectral and Spectral Approximation". Studies in Applied Mathematics 51 (3): 253–259. doi:10.1002/sapm1972513253.