Linear equations with constant coefficients

Poisson’s equation is one member of a family that the Fourier method solves with the same machinery: linear equations whose coefficients do not depend on position. This page says which of them pdemagic solves, and how.

On a periodic box: any such equation

A linear operator \(L\) with constant coefficients maps every wave \(e^{i\mathbf{k}\cdot\mathbf{x}}\) to a multiple of itself. The factor \(\sigma(\mathbf{k})\) is called the symbol of the operator: each \(\partial/\partial x_j\) contributes \(i k_j\), and each Laplacian \(-|\mathbf{k}|^2\). On a domain that is periodic in every direction the waves that fit the periods form a basis, so the equation \(L u = f\) is solved wave by wave,

\[\hat u(\mathbf{k}) = \frac{\hat f(\mathbf{k})}{\sigma(\mathbf{k})} ,\]

with one FFT forwards and one back. This covers every order and every combination of derivatives: Helmholtz and screened Poisson equations, the biharmonic equation, mixed derivatives, first-order terms.

For a source that the grid resolves the result is exact to rounding error. The test with \(\nabla^4 u - 2\nabla^2 u + 3 u_x + 5u\) on a 12×12 grid has an error of \(10^{-14}\).

When there is no unique solution

The division fails where the symbol vanishes.

  • For the constant wave. If the operator has no term with the unknown itself, \(\sigma(0) = 0\): the equation determines \(u\) only up to a constant, and it has a solution only if the source has zero mean. As for Poisson’s equation, the mean of the source is dropped and reported as removed_source_mean, and the solution returned has zero mean.

  • For any other wave. Then that wave solves the equation without a source, and the solution is not unique. This happens for a Helmholtz equation \(\nabla^2 u + k^2 u = f\) when \(k^2\) is an eigenvalue of the box, and for an operator that does not involve one of the coordinates at all. pdemagic refuses with InvalidProblemError and names the wave vector.

On a grid with an even number of points along an axis, the wave at the highest frequency has no well-defined derivative of odd order. Those terms are left out for that one wave, which is the usual convention. For a resolved source it makes no difference.

With free directions: screened and weighted Poisson equations

Where the domain extends to infinity, the solution must be singled out by its behaviour there, and a Green’s function is needed. pdemagic handles the equations of the form

\[\gamma u - \sum_j a_j \frac{\partial^2 u}{\partial x_j^2} = f, \qquad a_j > 0, \quad \gamma \ge 0 .\]

Screening. With \(\gamma > 0\) this is the screened Poisson equation, also called the Yukawa, Debye–Hückel or modified Helmholtz equation. Its Green’s function decays like \(e^{-\sqrt{\gamma}\,r}\), so the solution that decays at infinity is unique in every dimension, and that is the one pdemagic returns.

The method is the one for Poisson’s equation with periodic directions, which already solves a screened equation for every wave along the periodic axes: the Green’s function is truncated beyond the size of the box, and its transform is known in closed form in one, two and three free dimensions. A screening of the equation itself adds to the one from the periodic waves. Free space, wires and slabs all work.

Weights. Unequal weights \(a_j\) are a Laplacian in stretched coordinates \(x_j / \sqrt{a_j}\). The equation is solved on the grid of the plan with its spacings scaled accordingly. The values are those at the original grid points.

The accuracy is spectral. For \(u = e^{-r^2}\) in three dimensions with \(\gamma = 9\), on a box of half-width 5.5:

Points per axis

Error

12

8.4e-3

16

4.6e-4

24

3.1e-7

32

2.2e-11

What the planner chooses

The box and the grid are chosen from the source, exactly as for Poisson’s equation. The plan names the kind of equation that was recognised in its first note.

Limits

  • Constant coefficients, Cartesian coordinates. Coefficients that vary in space are solved by an iteration on top of this method. Disks, balls and cylinders with vacuum outside, and bodies, take Poisson’s equation only. With boundary conditions, round domains take a Laplacian and a constant, and boxes equations of second order: see collocation. Regions of the plane take equations of second order, there also with coefficients that vary: see spectral elements.

  • The Helmholtz equation with free directions has a method of its own. For \(\nabla^2 u + k^2 u = f\) in free space the solutions oscillate instead of decaying, and the physical one is singled out by a radiation condition. Its solution is complex.

  • No equations of higher order or with mixed derivatives with free directions. Their Green’s functions grow at infinity or need a rotated grid.

  • A screening with at most three free directions.