# In free space and on periodic boxes The equations that are solved on `pm.FreeSpace` and `pm.Space`, in Cartesian coordinates. How to read the tables is on the [overview](equations.md#how-to-read-the-pages). A direction is free or periodic. What is taken depends on whether the domain has a free direction: - **Periodic in every direction**: a box that repeats. The widest class of equations is solved here. - **With free directions**: free space, and domains that mix free and periodic directions, such as a slab or a wire. The solution is the one that its sources produce, and the equation must have a known behaviour far away. ## Stationary equations | Form | Covers | With free directions | Periodic in every direction | Method | |---|---|---|---|---| | $\sum_i a_i\,\partial_i^2 u = f$ | Poisson, also with unequal weights | yes, in any dimension | yes | `fourier` | | $\sum_i a_i\,\partial_i^2 u - \kappa^2 u = f$ | screened Poisson, Yukawa, Debye–Hückel | up to three free directions | yes | `fourier` | | $\sum_i a_i\,\partial_i^2 u + k^2 u = f$ | Helmholtz | one to three free directions | yes | `fourier` | | any linear equation with constant coefficients, of any order | first and mixed derivatives, $\nabla^4$, complex coefficients | no | yes | `fourier` | | a linear equation with coefficients that vary in space | a medium $\nabla\cdot(\varepsilon(\mathbf{x})\nabla u)$, a potential, an index of refraction $k^2 n^2(\mathbf{x})$ | if the coefficients settle far away | yes, of any order | `fourier_iterative` | | one of the above with a term that is nonlinear in $u$ | Poisson–Boltzmann, ground states | if the solution decays far away | yes | `fourier_newton` | | $\nabla^2 u = f$ around bodies | conductors and dielectrics with sharp surfaces | free space in three dimensions only | no | `boundary_elements` | With free directions: - The $a_i$ are real and of one sign, and $\kappa$ and $k$ are real. The source may be complex. - More than three free directions are taken for Poisson's equation alone, and without periodic directions beside them. - **Poisson** has the vacuum condition: the solution is the source convolved with the Green's function of free space. From three free dimensions on it vanishes at infinity. In one and two dimensions the Green's function is $-|x|/2$ and $-\ln(r)/(2\pi)$. - **Helmholtz** has the radiation condition: waves leave, and none come in. The solution is complex. An incoming wave is split off by hand, and the unknown is the scattered wave. - **Coefficients that vary** must approach constants along the free directions, and the equation that is left there must be a Poisson, a screened Poisson or a Helmholtz equation with real coefficients. - **A nonlinear term** is a function of the unknown and of the position, without a derivative of the unknown, and differentiable. The equation must not be a Helmholtz equation far away. Periodic in every direction: - Poisson's equation has a solution only for a source with zero mean. The mean is taken off, and the diagnostic `removed_source_mean` reports it. - A linear equation that has no unique solution on the box is refused with `InvalidProblemError`, which names the wave that causes it. Around bodies the equation is Poisson's, with a real source and constant coefficients. Bodies do not touch. ## Equations in time One unknown, with the state at the start given, and for an equation of second order in time its rate of change as well. | Form | Covers | With free directions | Periodic in every direction | Method | |---|---|---|---|---| | $u_t = \sum_i (a_i\,\partial_i^2 u + b_i\,\partial_i u) + c\,u + f$ | heat, drift, decay, Schrödinger | yes | yes | `fourier_propagator` | | $u_{tt} + \gamma\,u_t = \sum_i (a_i\,\partial_i^2 u + b_i\,\partial_i u) + c\,u + f$ | waves, damped waves, Klein–Gordon | yes | yes | `fourier_propagator` | | any linear equation of first or second order in time with constant coefficients | the linear Korteweg–de Vries equation, a beam, a plate: third derivatives, $\nabla^4$, mixed derivatives | yes | yes | `fourier_propagator` | | first order in time, with further terms whose coefficients vary in space or time | a potential in the Schrödinger equation, a reaction, a drift | the unknown and its first derivatives may carry them, beside an operator of the first form | yes | `exponential_runge_kutta` | | first order in time, with nonlinear terms | Burgers, Korteweg–de Vries, nonlinear Schrödinger | no | yes | `exponential_runge_kutta` | | second order in time, with nonlinear terms or coefficients that vary | sine-Gordon | no | yes | `exponential_runge_kutta` | - The linear part with constant coefficients is propagated exactly. Only the other terms are stepped, with an error per step that `method.tolerance` bounds. - With free directions the transform holds what leaves the box. For the first two forms, with real $b_i$, how far the solution travels is known. For any other operator it is bounded from the waves that the initial state and the source contain. - An equation whose waves grow the faster the finer they are, as $u_t = u_{xxxx}$, is refused as ill-posed. - With free directions a coefficient that varies must settle to a constant away from where it acts, and that constant must not change in time. - The source $f$ may depend on time. ## Systems Several unknowns, in Cartesian coordinates, without bodies. | Form | Covers | With free directions | Periodic in every direction | Method | |---|---|---|---|---| | linear, constant coefficients, in time | Maxwell's equations in vacuum, coupled waves | if the system describes waves | yes, any such system | `fourier_propagator` | | in time, with nonlinear terms or coefficients that vary | reaction and diffusion | no | yes | `exponential_runge_kutta` | | in time, with constraints | a potential that follows a density at every time | no | yes | `exponential_runge_kutta` | | linear, constant coefficients, stationary | | no | yes | `fourier` | - The equations may be of first or second order in time, also mixed, and need not be solved for their derivatives in time. - A constraint is an equation without a derivative in time. It is linear in the unknown that it fixes, with constant coefficients there. - A system is written component by component: there are no vector unknowns. ## Eigenproblems | Form | Covers | With free directions | Periodic in every direction | Method | |---|---|---|---|---| | $-\sum_i a_i\,\partial_i^2 u + V(\mathbf{x})\,u = E\,u$ | Schrödinger operators: wells, oscillators, bands, Mathieu's equation | the bound states | yes | `fourier_subspace` | - The $a_i$ are positive constants, which may differ from coordinate to coordinate. The potential $V$ is real: a formula or an array. - The eigenvalue stands as a factor in front of the unknown alone, and the lowest eigenvalues are found. - With free directions the potential must bind: the states are found on a box that the planner chooses. A potential with a singularity where it is lowest, such as $-1/r$, is refused there, and is solved in a [ball or a disk](equations-round.md#eigenproblems). ## What is refused The lists are on the page of known limits: for [stationary equations](../dev/limits.md#stationary-equations), for [equations in time](../dev/limits.md#equations-in-time), for [systems](../dev/limits.md#systems), for [eigenproblems](../dev/limits.md#eigenproblems) and for [bodies](../dev/limits.md#bodies). See also: [Free space and periodic directions](../topics/free-space.md), [Stationary equations](../topics/stationary.md), [Problems in time](../topics/time.md), [Systems of equations](../topics/systems.md), [Eigenproblems: bound states](../topics/eigen.md) and [Bodies](../topics/bodies.md).