Round domains with boundary conditions¶
This page explains how pdemagic solves \(a\,\nabla^2 u + c\,u = f\) on disks, rings, balls, spherical shells and cylinders, with a condition on each surface. The method is that of boxes, collocation in the modes of each coordinate, which is explained under boxes with boundary conditions. This page says what differs on a round domain.
Disks and rings¶
On a disk the equation is \(a\,\nabla^2 u + c\,u = f\) in polar coordinates, with a condition \(\alpha\,u + \beta\,\partial u/\partial r = g(\varphi)\) on the rim. A ring has a second rim, with a condition of its own.
Along the angle the unknown is expanded in the waves \(e^{im\varphi}\), which the Laplacian does not mix. For each \(m\) what is left is an ordinary equation along the radius:
Along the radius it is solved by collocation, as an axis of a box is, with two differences.
The grid points are Gauss points, which lie strictly inside the interval: a disk keeps the grid that it has with vacuum outside. The rims are therefore no grid points. They are added as further points of the polynomial: on a disk it runs through the values at the \(n\) Gauss points and at the rim, and has the degree \(n\). The equation is asked to hold at the Gauss points and the condition at the rim, which gives the value at the rim in terms of the others and of \(g\), as on a box.
And the centre of a disk needs nothing. The equation along the radius has solutions that are singular at the centre, \(\ln r\) and \(r^{-|m|}\), and a method must not find them. No Gauss point lies at the centre, so the equation is never evaluated there, and the singular solutions are no polynomials: the polynomial that satisfies the equation at the Gauss points is the regular solution.
The matrix along the radius depends on \(m\) through the term \(m^2/r^2\) alone. It is diagonalised once for each \(|m|\), and in the basis of these modes the operator is diagonal again. Everything else on the page for boxes then holds as it stands: the stationary equation is a division per mode, a constant is left open when the rim gives the derivative alone, and an equation in time is propagated exactly.
The modes are those of a drum. With the value zero on the rim of the unit disk the eigenvalues are \(-j^2\), with \(j\) the zeros of the Bessel functions, and 24 points along the radius give the lowest of them for \(m = 0, 1, 2, 5\) to \(10^{-9}\). All eigenvalues are real and negative on the grid too.
For \(\nabla^2 u - u = f\) on the unit disk with \(2u + \partial u/\partial r\) given on the rim and the solution \(e^{x + y/2}\):
Points along the radius |
Largest error |
|---|---|
4 |
\(4.1 \cdot 10^{-4}\) |
6 |
\(2.3 \cdot 10^{-6}\) |
8 |
\(7.5 \cdot 10^{-9}\) |
10 |
\(1.6 \cdot 10^{-11}\) |
12 |
\(5.9 \cdot 10^{-14}\) |
The grid has twice as many points along the angle as along the radius: a polynomial in \(x\) and \(y\) of the degree that the radius holds turns that often around the centre. A solve on \(64 \times 128\) points takes 0.03 s, and on \(192 \times 384\) points 1.4 s.
Balls and shells¶
In a ball the functions of the angles that the Laplacian does not mix are the spherical harmonics \(Y_l^m(\theta, \varphi)\), and the equation along the radius is
It does not depend on \(m\), so there is one matrix to diagonalise for each degree \(l\). Along the radius everything is as on a disk.
The grid of the angles is the one of the method for vacuum outside: Gauss points in \(\cos\theta\) and equally spaced azimuths. With \(n\) polar points it holds the harmonics up to the degree \(n - 1\), and the expansion of a field in them is exact for those. The grid has more points than there are such harmonics, about twice as many. What a field on the grid has beyond them is dropped when it is expanded, as that method drops it too.
With the value zero on the unit sphere the eigenvalues are \(-j^2\) with the zeros \(j\) of the spherical Bessel functions: \(\pi\), \(2\pi\) for \(l = 0\), and 4.4934 for \(l = 1\), each to \(10^{-9}\) with 24 points. For \(\nabla^2 u - u = f\) in the unit ball with \(2u + \partial u/\partial r\) given on the surface and the solution \(e^{x + y/2 - z/3}\):
Points along the radius |
Largest error |
|---|---|
4 |
\(8.2 \cdot 10^{-3}\) |
6 |
\(2.0 \cdot 10^{-4}\) |
8 |
\(1.1 \cdot 10^{-6}\) |
10 |
\(2.0 \cdot 10^{-9}\) |
12 |
\(1.2 \cdot 10^{-11}\) |
16 |
\(6.4 \cdot 10^{-14}\) |
with as many polar points as radial ones and twice as many azimuths. A solve on \(64 \times 64 \times 128\) points takes 0.2 s.
Cylinders¶
A cylinder is a disk times an interval, and its Laplacian is the sum of the two: the Laplacian of the disk, and the second derivative along the axis. The method is the product of the two that exist. Along the angle and the radius the modes are those of a disk, with a condition on the wall. Along the axis they are those of an axis of a box, at Chebyshev points, with a condition on each cap. The eigenvalue of a product of two modes is the sum of their eigenvalues,
and the solve is again a division. A hollow cylinder has a second wall, like a ring. A cylinder that is periodic along its axis has Fourier waves there in place of the modes of an axis with faces.
A can of the radius 1 and the height 1.5 with the value zero on every face has the eigenvalues \(-j^2 - (k\pi/1.5)^2\), with \(j\) the zeros of the Bessel functions, and 24 points along the radius and along the axis give them to \(10^{-8}\). For \(\nabla^2 u - u = f\) in a can with the value given on the wall, the slope on one cap and a mix of both on the other, and the solution \(e^{x + y/2 - z/3}\):
Points along the radius |
Largest error |
|---|---|
4 |
\(1.5 \cdot 10^{-4}\) |
6 |
\(9.0 \cdot 10^{-7}\) |
8 |
\(2.9 \cdot 10^{-9}\) |
10 |
\(5.9 \cdot 10^{-12}\) |
12 |
\(9.1 \cdot 10^{-14}\) |
A solve on \(64 \times 128 \times 128\) points takes 0.35 s.
The grid of a cylinder with conditions is not the one that it has with vacuum outside. That method is of second order and works at cell centres, and this one needs Gauss points along the radius and the caps among the points of the axis.
Limits¶
On round domains the operator is a Laplacian and a constant, the condition is the same on the whole surface up to what is given, and terms that are stepped contain no derivative of the unknown. The values on the surface are not part of the solution arrays.
Sources¶
Polar coordinates, and what to do at the centre of a disk, are treated in Canuto, Hussaini, Quarteroni and Zang, Spectral Methods: Fundamentals in Single Domains (2006), in Trefethen, Spectral Methods in MATLAB (2000), and in Boyd, Chebyshev and Fourier Spectral Methods (2001).