Methods¶
How pdemagic solves what it solves. You do not need these pages to use it: the planner picks the method. They are for when you want to know what happens, how accurate it is, and where its limits are.
Each page states the equation, explains the method, gives measured errors and costs, and lists the limits.
Which method is used when¶
Problem |
Method |
Accuracy |
|---|---|---|
Poisson’s equation in free space, with periodic directions |
spectral |
|
Screened Poisson equations, and any linear equation on a periodic box |
spectral |
|
The Helmholtz equation in free space |
spectral |
|
Equations on boxes with boundary conditions, stationary and in time |
spectral, exact in time where the equation is linear |
|
The same on disks, rings, balls, shells and cylinders |
Collocation along the radius, with waves or harmonics along the angles |
spectral, exact in time where the equation is linear |
Linear equations of second order on a region of the plane that curves bound: Laplace, Poisson, Helmholtz, and the same in a medium, with drift, with a potential, with directions that differ |
spectral, where the solution is smooth up to the boundary |
|
Heat, waves and the Schrödinger equation on such a region |
spectral, exact in time |
|
Poisson’s equation in disks and balls with vacuum outside |
spectral |
|
Poisson’s equation in finite cylinders with vacuum outside |
second order |
|
Linear equations whose coefficients vary in space, in free space and on periodic boxes: a permittivity, a potential, a medium for waves |
spectral |
|
The same between walls and on round domains |
spectral |
|
Nonlinear stationary equations in free space and on periodic boxes: Poisson–Boltzmann, ground states |
spectral |
|
Nonlinear stationary equations on a region of the plane |
spectral |
|
The plate equation on a box, with two conditions on each face |
spectral |
|
Nonlinear stationary equations between walls and on round domains |
spectral |
|
Poisson’s equation around conductors and sharp dielectrics |
second order |
|
Linear equations in time, in free space and on periodic boxes: heat, waves, Schrödinger |
spectral, exact in time |
|
Nonlinear equations in time, on periodic boxes, on boxes and round domains with boundary conditions, and on regions of the plane |
spectral, fourth order in time |
|
Systems of equations |
spectral |
|
Systems in time on boxes and round domains with boundary conditions |
spectral, fourth order in time |
|
Stationary systems on a region of the plane |
spectral |
|
The lowest eigenvalues of a Schrödinger operator on a periodic box |
spectral |
|
The lowest modes of a box or a round domain with boundary conditions |
spectral |
|
The lowest modes of a box or a round domain with a medium, a potential of any form or a mixed derivative, and of a plate |
spectral |
|
The lowest modes of a region of the plane |
The same block iteration, on the stationary solve of spectral elements |
spectral |
Values between the points of a grid¶
A solution comes on a grid, and has a value at any other point of its
domain too: solution(x, y). That value is not interpolated from the
neighbours of the point. It is the value of the expansion that the method
solved with, read off the values on the grid, which hold all of it:
Along a periodic axis, the trigonometric sum through the points of the axis. With an even number of points the highest wave is taken as a cosine, which is all that the points see of it.
Along an axis between walls, and along a radius, the polynomial through the points of the axis: Chebyshev points, which include the walls, or Gauss points, which lie inside, so that the polynomial also gives the values on the rim of a disk and at its centre.
On a region of the plane, the polynomials of the elements: see spectral elements.
The axes of a grid are taken one after the other. For a wave that the grid holds the result is exact up to rounding: a sum of three waves on a periodic grid of 12 by 12 points comes out to \(2\cdot10^{-13}\) at random points, and a solution between walls to \(10^{-13}\), also on the walls. A value sums over the whole grid, so a thousand points on a grid of \(64^3\) take a tenth of a second.
The integral of a solution over its domain, solution.integral(), is
taken by the quadrature of the same points: equal weights along a
periodic axis, the weights of Gauss or of Clenshaw and Curtis along the
others, the radius or its square as the measure of polar, cylindrical
and spherical coordinates, and on a region the areas that the points of
the elements stand for. For a resolved solution it is exact up to
rounding: \(\pi/8\) for the membrane on a disk comes out to \(10^{-14}\) on a
grid in polar coordinates and on elements alike.
Where a direction is free there are no such values yet. The grid is then a cut out of all of space, and the method summed its waves over a larger, padded box that is not kept. In a ball the polar angle has an axis of neither kind, and the cylinder with vacuum outside is solved by finite differences.
What the methods have in common¶
Free space is exact. No method cuts the domain off at an artificial boundary and puts a condition there. The condition at infinity is built into a Green’s function, or into the padding of a transform. A boundary is there only when the problem has one.
What can be exact, is. Linear parts with constant coefficients are inverted or propagated exactly, wave by wave or mode by mode. Only what cannot be treated that way is discretized.
The planner’s choices are data. The method, the grid and every tolerance are entries of a plan, and can be changed.