Pseudo-spectral method

From testwiki
Revision as of 22:18, 13 May 2024 by imported>Jlwoodwa (tag as more footnotes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:Refimprove Template:More footnotes 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 gridTemplate: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

itψ(x,t)=[2x2+V(x)]ψ(x,t),ψ(t0)=ψ0

with periodic conditions ψ(x+1,t)=ψ(x,t). This specific example is the Schrödinger equation for a particle in a potential V(x), 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,

ψ(x,t)=12πncn(t)e2πinx.

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

iddtcn(t)=(2πn)2cn+kVnkck,

where the elements Vnk are calculated through the explicit Fourier-transform

Vnk=01V(x) e2πi(kn)xdx.

The solution would then be obtained by truncating the expansion to N basis functions, and finding a solution for the cn(t). 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 V(x).

In the spectral representation, the multiplication with the function V(x) transforms into a vector-matrix multiplication, which scales as N2. Also, the matrix elements Vnk 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 cn(t), an inverse discrete Fourier transform yields the value of the function ψ at discrete grid points xj=2πj/N. At these grid points, the function is then multiplied, ψ(xi,t)=V(xi)ψ(xi,t), and the result Fourier-transformed back. This yields a new set of coefficients c'n(t) that are used instead of the matrix product kVnkck(t).

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

  1. f(x),f~(x)=V(x)f(x) 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 V,f at each grid point.

Expansion in a basis

The functions f,f~ can be expanded in a finite basis {ϕn}n=0,,N as

f(x)=n=0Ncnϕn(x)
f~(x)=n=0Nc~nϕn(x)

For simplicity, let the basis be orthogonal and normalized, ϕn,ϕm=δnm using the inner product f,g=abf(x)g(x)dx with appropriate boundaries a,b. The coefficients are then obtained by

cn=f,ϕn
c~n=f~,ϕn

A bit of calculus yields then

c~n=m=0NVnmcm

with Vnm=Vϕm,ϕn. This forms the basis of the spectral method. To distinguish the basis of the ϕn from the quadrature basis, the expansion is sometimes called Finite Basis Representation (FBR).

Quadrature

For a given basis {ϕn} and number of N+1 basis functions, one can try to find a quadrature, i.e., a set of N+1 points and weights such that

ϕn,ϕm=i=0Nwiϕn(xi)ϕm(xi)n,m=0,,N

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, xi,wi are a function of the basis and the number N.

The quadrature allows an alternative numerical representation of the function f(x),f~(x) 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.

f(xi)=n=0Ncnϕn(xi)
cn=f,ϕn=i=0Nwif(xi)ϕn(xi)

Multiplication

The multiplication with the function V(x) is then done at each grid point,

f~(xi)=V(xi)f(xi).

This generally introduces an additional approximation. To see this, we can calculate one of the coefficients c~n:

c~n=f~,ϕn=iwif~(xi)ϕn(xi)=iwiV(xi)f(xi)ϕn(xi)

However, using the spectral method, the same coefficient would be c~n=Vf,ϕn. The pseudo-spectral method thus introduces the additional approximation

Vf,ϕniwiV(xi)f(xi)ϕn(xi).

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

ϕn(x)=1Leıknx

with kn=(1)nn/22π/L, where is the ceiling function.

The quadrature for a cut-off at nmax=N is given by the discrete Fourier transformation. The grid points are equally spaced, xi=iΔx with spacing Δx=L/(N+1), and the constant weights are wi=Δx.

For the discussion of the error, note that the product of two plane waves is again a plane wave, ϕa+ϕb=ϕc with ca+b. Thus, qualitatively, if the functions f(x),V(x) can be represented sufficiently accurately with Nf,NV basis functions, the pseudo-spectral method gives accurate results if Nf+NV 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 NlnN. 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 wi and points xi such that

abw(x)p(x)dx=i=0Nwip(xi)

holds for any polynomial p(x) of degree 2N+1 or less. Typically, the weight function w(x) and ranges a,b 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 ϕn(x)=w(x)Pn(x), with Pn being a polynomial of degree n with the property

abw(x)Pn(x)Pm(x)dx=δmn.

Under these conditions, the ϕn form an orthonormal basis with respect to the scalar product f,g=abf(x)g(x)dx. 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 f is well represented by Nf basis functions and V is well represented by a polynomial of degree NV, their product can be expanded in the first Nf+NV 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.

Notes

Template:Reflist

References