A concrete, linear example
Here we presume an understanding of basic multivariate calculus and Fourier series. If is a known, complex-valued function of two real variables, and g is periodic in x and y (that is, ) then we are interested in finding a function f(x,y) so that
where the expression on the left denotes the second partial derivatives of f in x and y, respectively. This is the Poisson equation, and can be physically interpreted as some sort of heat conduction problem, or a problem in potential theory, among other possibilities.
If we write f and g in Fourier series:
and substitute into the differential equation, we obtain this equation:
We have exchanged partial differentiation with an infinite sum, which is legitimate if we assume for instance that f has a continuous second derivative. By the uniqueness theorem for Fourier expansions, we must then equate the Fourier coefficients term by term, giving
-
|
|
(*) |
which is an explicit formula for the Fourier coefficients aj,k.
With periodic boundary conditions, the Poisson equation possesses a solution only if b0,0 = 0. Therefore, we can freely choose a0,0 which will be equal to the mean of the resolution. This corresponds to choosing the integration constant.
To turn this into an algorithm, only finitely many frequencies are solved for. This introduces an error which can be shown to be proportional to , where and is the highest frequency treated.
Algorithm
- Compute the Fourier transform (bj,k) of g.
- Compute the Fourier transform (aj,k) of f via the formula (*).
- Compute f by taking an inverse Fourier transform of (aj,k).
Since we're only interested in a finite window of frequencies (of size n, say) this can be done using a fast Fourier transform algorithm. Therefore, globally the algorithm runs in time O(n log n).
Nonlinear example
We wish to solve the forced, transient, nonlinear Burgers' equation using a spectral approach.
Given on the periodic domain
, find such that
where ρ is the viscosity coefficient. In weak conservative form this becomes
where following inner product notation. Integrating by parts and using periodicity grants
To apply the Fourier–Galerkin method, choose both
and
where . This reduces the problem to finding such that
Using the orthogonality relation where is the Kronecker delta, we simplify the above three terms for each to see
Assemble the three terms for each to obtain
Dividing through by , we finally arrive at
With Fourier transformed initial conditions and forcing , this coupled system of ordinary differential equations may be integrated in time (using, e.g., a Runge Kutta technique) to find a solution. The nonlinear term is a convolution, and there are several transform-based techniques for evaluating it efficiently. See the references by Boyd and Canuto et al. for more details.