The Helmholtz equation in free space¶
This page explains how pdemagic solves
in free space, in one to three dimensions. The equation describes waves of one frequency: with the time dependence \(e^{-i\omega t}\), a solution \(u(\mathbf{x})\) stands for the wave \(u(\mathbf{x})\, e^{-i\omega t}\).
The radiation condition¶
Poisson’s equation has one solution that vanishes at infinity. The Helmholtz equation has many solutions in free space, because waves can come in from infinity as well as go out, and all of them fall off equally slowly. The solution that belongs to a source which radiates into empty space is the one in which nothing comes in (Sommerfeld’s radiation condition). It is the convolution of the source with the outgoing Green’s function:
Dimension |
Green’s function |
|---|---|
1 |
\(\dfrac{i}{2k}\, e^{ik\lvert x\rvert}\) |
2 |
\(\dfrac{i}{4}\, H_0^{(1)}(kr)\) |
3 |
\(\dfrac{e^{ikr}}{4\pi r}\) |
\(H_0^{(1)}\) is the Hankel function of the first kind. These functions are complex, and so is the solution, also for a real source. Its magnitude is the amplitude of the wave, and its argument the phase.
In the problem description the condition at infinity is the same as for Poisson’s equation: the solution is the one that the sources alone produce. For the other sign of the time dependence, \(e^{+i\omega t}\), take the complex conjugate of the solution of a real source.
The method¶
The convolution is done as for Poisson’s equation. The Green’s function is cut off at a radius \(R\) that exceeds every distance within the box, which changes nothing inside the box. The transform of the truncated function is then smooth, and known in closed form. With \(E(a) = (e^{iaR} - 1)/a\):
Dimension |
Transform at the wave number \(s\) |
|---|---|
1 |
\(\dfrac{E(k + s) + E(k - s)}{2k}\) |
2 |
\(\dfrac{\tfrac{i\pi R}{2} \left( k H_1(kR) J_0(sR) - s H_0(kR) J_1(sR) \right) - 1}{k^2 - s^2}\) |
3 |
\(-\dfrac{E(k + s) - E(k - s)}{2s}\) |
The transform of the Green’s function without the cut, \(1/(s^2 - k^2)\), has a pole at \(s = k\), which is where the radiation condition hides. The truncated transforms have none. The formulas are evaluated so that this shows in the numbers too: in one and three dimensions through functions that are regular where their argument vanishes, and in two dimensions, where numerator and denominator both vanish at \(s = k\), by a polynomial through values beside that point.
The source is transformed on a padded grid, multiplied by the transform of the truncated Green’s function, and transformed back.
Periodic directions¶
A wave \(e^{i\kappa y}\) along the periodic directions reduces the equation along the free ones to a Helmholtz equation with \(q^2 = k^2 - \kappa^2\).
For \(q^2 > 0\) it radiates along the free directions, with the wave number \(q\).
For \(q^2 < 0\) it does not radiate. The equation is a screened Poisson equation, and the solution decays.
For \(q^2 = 0\) the wave travels exactly along the periodic directions and never leaves. No solution of finite size balances its source, and pdemagic refuses the problem.
On a domain that is periodic in every direction nothing radiates at all, and the equation is solved like any other with constant coefficients.
Accuracy¶
The method is spectral. For the source \(e^{-r^2}\), compared with the convolution integral evaluated by quadrature:
Problem |
Error |
|---|---|
One dimension, \(k = 3\), 96 points |
< 1e-11 |
Two dimensions, \(k = 2\), 40 points per axis |
< 1e-9 |
Three dimensions, \(k = 2\), 40 points per axis |
< 1e-9 |
A strip, periodic along one direction, \(k = 2.5\) |
< 1e-10 |
A source that is smooth on the scale of the wavelength hardly radiates: the wave that \(e^{-x^2}\) sends out in one dimension has the amplitude \(\sqrt{\pi}\, e^{-k^2/4} / (2k)\). The grid must resolve the source, as for Poisson’s equation, and needs nothing more for the solution to be right at its points.
What the planner chooses¶
The box holds the source, to \(10^{-12}\) of its maximum, and two wavelengths around it. The values are exact wherever the box ends, so this is a choice of what is worth looking at: the waves around the source.
The grid resolves the source, and has at least six points per wavelength, so that a plot shows the waves as they are.
Cost¶
Two padded transforms, as for Poisson’s equation. Two sources in the plane on a 192 × 139 grid take less than a tenth of a second.
Limits¶
A constant, real wave number. A medium whose wave speed varies, or that absorbs, in a bounded region is solved by an iteration on top of this method. Far from that region the wave number is real.
One to three free dimensions.
No bodies. Scattering by an obstacle with a sharp surface is a boundary value problem. A smooth obstacle is a medium. Inside walls, on a box, a round domain or a region of the plane, the Helmholtz equation is solved by collocation and spectral elements.
Unequal weights of the second derivatives are allowed. They stretch the wavelength along the axes.
Complex sources elsewhere¶
Poisson’s equation and its screened form take complex sources as well. They are linear with real coefficients, so the real and the imaginary part of the source are solved for one after the other.