On boxes with walls¶
The equations that are solved on a pm.Box: an interval along each
coordinate, in any dimension, with a condition on each face. Some of the
coordinates may be periodic, and have no faces. How to read the tables
is on the overview.
A stationary problem and an eigenproblem on a box have one unknown. In time there may be several: see systems.
Stationary equations¶
Form |
Covers |
Method |
|---|---|---|
\(\sum_i (a_i\,\partial_i^2 u + b_i\,\partial_i u) + c\,u = f\) |
Laplace, Poisson, screened Poisson, Helmholtz, diffusion with drift |
|
the same with coefficients that vary: \(\nabla\cdot(\varepsilon(\mathbf{x})\nabla u)\), \(a_i(\mathbf{x})\,\partial_i^2 u\), \(b_i(\mathbf{x})\,\partial_i u\), \(c(\mathbf{x})\,u\) |
a medium, a potential, a drift that varies |
|
the same with a mixed derivative \(b(\mathbf{x})\,\partial_i\partial_j u\) |
a material whose axes are turned |
|
\(a\,\nabla^4 u + b\,\nabla^2 u + c\,u = f\) |
beams and plates, also under tension and on an elastic foundation |
|
one of the first three with a term \(N(u, \mathbf{x})\) that is nonlinear in \(u\) |
the problem of Bratu, \(\nabla^2 u - u^3 = f\) |
|
Constant coefficients may be complex. The equation needs a second derivative along every coordinate that has faces.
Coefficients that vary are formulas, not arrays. The equation must be elliptic, and must not leave its solution open up to a constant.
A mixed derivative \(b\,u_{xy}\) beside \(a\,u_{xx} + c\,u_{yy}\) needs \(b^2 < 4ac\) everywhere in the box.
The plate equation has constants \(a\), \(b\) and \(c\), and takes two conditions on each face. \(\nabla^4 u\) is written as
pm.laplacian(pm.laplacian(u))or with its derivatives.A nonlinear term 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: with a slope given on every face it needs a term that holds the unknown. Newton’s method starts from zero or from
guess=, which is a formula as well.A box that resonates is refused with
InvalidProblemError: the Helmholtz equation at a wave number at which the box with these conditions rings by itself has no unique solution.Slopes on every face, in an equation with constant coefficients and without a term in the unknown: the solution is fixed up to a constant, and the one with zero mean is returned. What the source holds beyond what flows through the faces is taken off, and the diagnostic
removed_source_meanreports it.
Equations in time¶
\(L u\) stands for \(\sum_i (a_i\,\partial_i^2 u + b_i\,\partial_i u) + c\,u\) with constant coefficients.
Form |
Covers |
Method |
|---|---|---|
\(u_t = L u + f\) |
heat, drift, decay, Schrödinger between walls |
|
\(u_{tt} + \gamma\,u_t = L u + f\) |
strings, membranes, rooms, damped waves |
|
\(u_t = L u + f\) with further terms that are nonlinear or have coefficients that vary in space or time |
reactions, Burgers, a potential in the Schrödinger equation |
|
\(u_{tt} + \gamma\,u_t = L u + f\) with such further terms |
sine-Gordon between walls, a string whose spring hardens, a wave speed that varies |
|
\(L u\) is propagated exactly. The further terms are stepped, with an error per step that
method.tolerancebounds. They hold the unknown and its derivatives up to the second order.The source and the values given on the faces may depend on time.
In an equation of second order in time the further terms hold no derivative in time: a damping that varies is not taken.
\(L\) holds no mixed derivative and nothing above the second order: the motion of a plate is not solved. Its modes are.
Systems¶
Several unknowns in time, each with its own condition on every face. \(L_j\) is an operator as \(L\) above, for the unknown \(u_j\).
Form |
Covers |
Method |
|---|---|---|
\(\partial_t u_j = L_j u_j + N_j(u_1, \dots, u_n, \mathbf{x}, t)\) for each unknown |
substances that diffuse and react between walls |
|
the same, with \(\partial_t w = c\,w + N(u_1, \dots, u_n, w, \mathbf{x}, t)\) for an unknown that has no derivative in space |
the model of FitzHugh and Nagumo, a substance that is bound and does not move |
|
the same, with \(\partial_t^2 u_j + \gamma_j\,\partial_t u_j = L_j u_j + N_j\) for some unknowns or for all |
a string that is coupled to heat, two strings that pull at each other |
|
the same, with a constraint \(L_c\,\varphi = R(u_1, \dots, u_n, \mathbf{x}, t)\) for an unknown that has no equation in time |
charges that drift in their own field, with Poisson’s equation for the potential |
|
Each equation is the equation in time of one unknown, of first or second order. \(L_j u_j\) is exact, in the modes of that unknown with its own conditions, for an equation of second order with the damping \(\gamma_j\). \(N_j\) is stepped: the terms that hold another unknown, nonlinear terms, coefficients that vary, and the source.
\(L_j\) holds a second derivative of its unknown along every coordinate that has faces. An unknown without any derivative in space is taken as well: it has no condition on a face, and is stepped at every point of the grid. At least one unknown has derivatives in space.
\(N_j\) holds the unknowns and their derivatives up to the second order.
Each condition holds one unknown. What is given on the faces may depend on time.
What is given may be an array: an initial state, a source, what is given on a face, and a coefficient in a term that is stepped. The arrays are on one grid, which is the grid of the solve.
An equation without a derivative in time is a constraint. It fixes the one unknown in it that has no equation in time, at every time: that unknown has no initial value, and its own conditions on the faces. The constraint is linear in it, with constant coefficients, and holds the other unknowns in any way. With its conditions it must fix the unknown: a Laplacian with no flux through any wall does not.
Stationary systems and eigenproblems for several unknowns are not solved on a box. An unknown without a derivative in space has an equation of first order in time, or a constraint.
Eigenproblems¶
Form |
Covers |
Method |
|---|---|---|
\(-\sum_i a_i\,\partial_i^2 u + \sum_i V_i(x_i)\,u = E\,u\) |
the modes of a string, a membrane, a room, a waveguide. An oscillator between walls |
|
\(-\nabla\cdot(\varepsilon(\mathbf{x})\nabla u) + V(\mathbf{x})\,u = E\,\rho(\mathbf{x})\,u\), also with a mixed derivative \(b\,\partial_i\partial_j u\) |
a medium, a potential of any form, a density, a material whose axes are turned |
|
\(a\,\nabla^4 u + b\,\nabla^2 u + c\,u = E\,u\) |
the tones of a beam and of a plate |
|
In the first row the \(a_i\) are constants, and the potential is a sum of functions of the single coordinates that does not vary along a periodic one. The modes are then products, and are sorted.
Every other operator has its modes found by an iteration on its stationary solve. It must be real and bounded below, with coefficients by formulas, and the density positive.
There are no first derivatives.
Each condition gives zero: the value, the slope, or a mix of both. In the last two rows a mix must not feed the modes: its coefficients have one sign along the outward normal. A plate takes its two conditions on each face, each of one derivative alone.
Conditions on the faces¶
Equation |
On each face |
Written as |
|---|---|---|
of second order |
one condition, \(\alpha\,u + \beta\,\partial_n u = g\) |
|
the plate equation |
two conditions, each a sum of derivatives of the unknown up to the third order |
a list of two equations |
a system in time |
one condition for each unknown, of the first kind |
a list with one equation for each unknown |
\(\alpha\) and \(\beta\) are constants, and may be complex. \(g\) is a number, a formula or an array, and may vary over the face and in time.
boundary=takes one condition for all faces, or a mapping from a face(x, 0)to its condition. A face without a condition is an error.An array for a face is given on the whole grid, and only its values on the face are read.
In a condition of the plate equation, what is given is a number or a formula.
The pairs of conditions of a plate:
A side that is |
Its two conditions |
|---|---|
clamped |
the value and the slope |
simply supported |
the value and the moment: the Laplacian, or the second derivative across the side |
sliding |
the slope and the shear: the normal derivative of the Laplacian |
free, on a beam |
the moment and the shear: the second and the third derivative |
A free edge of a plate in two or three dimensions is not taken.
What is refused¶
The list is on the page of known limits, under boundary conditions, with the entries for eigenproblems and systems.
See also: Boxes with walls, Boundary conditions, Media and potentials: coefficients that vary, Nonlinear stationary equations, Beams and plates and Modes of cavities, drums and waveguides.