# On round domains The equations that are solved on `pm.Disk`, `pm.Ball` and `pm.Cylinder`, in polar, spherical and cylindrical coordinates. How to read the tables is on the [overview](equations.md#how-to-read-the-pages). A round domain is used in one of two ways, and what is solved differs: | | Vacuum outside | Conditions on the surface | |---|---|---| | Stated by | no `boundary=` | `boundary=` | | Domains | a disk, a ball, a solid cylinder with its caps | a disk, a ring, a ball, a shell, a cylinder that is solid or hollow, with caps or periodic along its axis | | Equations | Poisson's, stationary | $a\,\nabla^2 u + c\,u$: stationary, in time, as an eigenproblem, and in a system in time | The derivatives in space are written as `pm.laplacian(u)`. A stationary problem and an eigenproblem have one unknown. In time there may be several: see [systems](#systems-with-conditions). ## With vacuum outside The unknown is the solution in free space for a source that vanishes outside the domain. The source may reach right up to the surface. | Form | Domain | Method | Accuracy | |---|---|---|---| | $\nabla^2 u = f$ | a disk, a ball | `harmonics` | spectral | | $\nabla^2 u = f$ | a solid cylinder with caps | `finite_differences` | second order | - The Laplacian is the only term with the unknown. The source is real: a formula or an array. - Nothing in time, and no eigenproblem. - In a ball and a cylinder the solution vanishes at infinity. In a disk it is the solution in the plane, as on [free space](equations-free-space.md#stationary-equations). - An array is given at the points of the grid, which `disk.axes(shape)` returns, as `pm.GridData(values)` without bounds. ## Stationary equations with conditions | Form | Covers | Method | |---|---|---| | $a\,\nabla^2 u + c\,u = f$ | Laplace, Poisson, screened Poisson, Helmholtz | `collocation` | | $a\,\nabla^2 u + c(\mathbf{x})\,u = f$ | a potential, a loss that varies | `collocation_iterative` | | $a\,\nabla^2 u + c(\mathbf{x})\,u + N(u, \mathbf{x}) = f$ | $\nabla^2 u - u^3 = f$, the problem of Bratu | `collocation_newton` | - $a$ is a constant, and so is $c$ in the first form, where it may be complex. - $c(\mathbf{x})$ is a formula, not an array, and may depend on every coordinate. The equation must not leave its solution open up to a constant. - A nonlinear term $N$ is a function of the unknown and of the position, by a formula, without a derivative of the unknown. The linear part must fix the solution by itself. Newton's method starts from zero or from `guess=`, which is a formula as well. - There are no first derivatives, no mixed derivative and no medium inside the Laplacian. A disk with such an equation is drawn as a [region](equations-regions.md). ## Equations in time with conditions | Form | Covers | Method | |---|---|---| | $u_t = a\,\nabla^2 u + c\,u + f$ | heat, decay, Schrödinger in a disk or a ball | `mode_propagator` | | $u_{tt} + \gamma\,u_t = a\,\nabla^2 u + c\,u + f$ | a round drum, a ball that rings, damped waves | `mode_propagator` | | $u_t = a\,\nabla^2 u + c\,u + f$ with further terms that are nonlinear or have coefficients that vary | reactions, a potential that varies | `exponential_runge_kutta` | | $u_{tt} + \gamma\,u_t = a\,\nabla^2 u + c\,u + f$ with such further terms | a drum whose spring hardens, sine-Gordon in a disk | `exponential_runge_kutta` | - $a$ and $c$ are constants. The linear part is propagated exactly. - The further terms hold the unknown itself, the position and the time, and no derivative of the unknown. They are stepped, with an error per step that `method.tolerance` bounds. - There is no drift. - The source and what is given on the surface may depend on time. ## Systems with conditions Several unknowns in time, each with its own condition on every face. | Form | Covers | Method | |---|---|---| | $\partial_t u_j = a_j\,\nabla^2 u_j + c_j\,u_j + N_j(u_1, \dots, u_n, \mathbf{x}, t)$ for each unknown | substances that diffuse and react in a dish, a ball or a pipe | `exponential_runge_kutta` | | the same, with $\partial_t^2 u_j + \gamma_j\,\partial_t u_j$ on the left for some unknowns or for all | a drum that is coupled to heat | `exponential_runge_kutta` | - Each equation is the equation in time of one unknown, of first or second order. $a_j$ and $c_j$ are constants: that part is exact, in the modes of the unknown with its own conditions. An unknown with $a_j = 0$, which does not diffuse, has no condition on the surface and is stepped at every point of the grid. At least one unknown diffuses. - $N_j$ is stepped. It holds the unknowns themselves, the position and the time, and no derivative of an unknown. - Each condition holds one unknown. What is given on the surface may depend on time. What is given may be an array on the grid of the solve. - An equation without a derivative in time is a constraint, as [on a box](equations-boxes.md#systems): $a\,\nabla^2\varphi + c\,\varphi = R(u_1, \dots, u_n, \mathbf{x}, t)$ fixes $\varphi$ at every time. - Stationary systems are not solved on a round domain. ## Eigenproblems | Form | Domain | Covers | Method | |---|---|---|---| | $-a\,\nabla^2 u + V(r)\,u = E\,u$ | a disk, a ring, a ball, a shell | a round drum, a ball that rings, hydrogen: $V = -1/r$ | `collocation_modes` | | $-a\,\nabla^2 u = E\,u$ | a cylinder | the modes of a cylinder, solid or hollow | `collocation_modes` | | $-a\,\nabla^2 u + V(\mathbf{x})\,u = E\,u$ | every round domain | a potential that depends on an angle, any potential in a cylinder | `collocation_inverse_modes` | - In the first row the potential is a function of the radius alone, by a formula, and the modes are products. A potential of any other form has its modes found by an iteration on the stationary solve. - Each condition gives zero: the value, the slope, or a mix of both. - The modes that turn around an axis come in pairs of one eigenvalue, and are returned as real functions. - The surface is a wall. A state that reaches it is squeezed, and its eigenvalue rises: choose the radius large enough for the states to have faded. ## Conditions on the surface Each face takes one condition, $\alpha\,u + \beta\,\partial_n u = g$: a value, a slope along the coordinate of the face, or a mix of both. In a system each unknown has one, and `boundary=` takes them as a list. | Domain | Faces | |---|---| | a disk, a ball | the rim or the surface: `(r, radius)` | | a ring, a shell | the inner and the outer one: `(r, inner)`, `(r, radius)` | | a cylinder | the wall and the two caps: `(rho, radius)`, `(z, lower)`, `(z, upper)` | | a hollow cylinder | the inner wall as well | | a cylinder that is periodic along its axis | no caps | - $\alpha$ and $\beta$ are constants over the face. $g$ is a number, a formula or an array, and may vary over the face and in time. - `pm.normal_derivative(u)` is the derivative along the coordinate of the face, pointing out of the domain. - The grid holds no points on a curved surface. An array for the rim of a disk or the surface of a ball is read off the outermost ring of grid points. ## What is refused The lists are on the page of known limits: under [domains](../dev/limits.md#domains) for vacuum outside, and under [boundary conditions](../dev/limits.md#boundary-conditions) and [eigenproblems](../dev/limits.md#eigenproblems) for domains with conditions. See also: [Disks, rings, balls, shells and cylinders](../topics/round.md), [Boundary conditions](../topics/boundary-conditions.md) and [Modes of cavities, drums and waveguides](../topics/modes.md).