On shapes in the plane

The equations that are solved on a pm.Region: a shape in the plane that closed curves of lines and arcs bound, with holes and corners, and with a condition on each piece of the boundary. How to read the tables is on the overview.

Every equation is of second order in space. Nothing is asked of the coefficients far away, since there is no far away: they may vary over the whole region.

Stationary equations

One unknown.

Form

Covers

Method

\(a\,u_{xx} + b\,u_{xy} + c\,u_{yy} + d\,u_x + e\,u_y + q\,u = f\), with every coefficient a constant or a function of the position

Laplace, Poisson, screened Poisson, Helmholtz, a drift, a potential, directions that differ, a mixed derivative

spectral_elements

\(\nabla\cdot(\varepsilon(\mathbf{x})\nabla u) + d\,u_x + e\,u_y + q\,u = f\)

a medium, a conductivity that varies

spectral_elements

one of these with a term \(N(u, \mathbf{x})\) that is nonlinear in \(u\)

\(\nabla^2 u + e^u = 0\), Poisson–Boltzmann

element_newton

  • The equation is elliptic: its second derivatives act with the same sign in every direction, everywhere in the region. An equation like \(u_{xx} - u_{yy} = f\) is refused.

  • Coefficients are formulas or arrays, and may be complex.

  • A coefficient in front of a divergence whose inside varies as well is not taken: expand the product, or move the coefficient inside.

  • A nonlinear term is a function of the unknown and of the position, without a derivative of the unknown. Newton’s method starts from zero or from guess=.

  • An equation that resonates with a mode of the shape under its conditions, as the Helmholtz equation can, has no unique solution and is refused with InvalidProblemError.

  • Slopes on the whole boundary, in an equation without a term in the unknown: the solution is fixed up to a constant. What the source holds beyond what flows through the boundary is taken off, and the diagnostic removed_source_mean reports it.

Equations in time

One unknown. \(\rho\), \(\varepsilon\) and \(V\) may vary in space.

Form

Covers

Method

\(\rho\,u_t = \nabla\cdot(\varepsilon\nabla u) - V\,u + f\)

heat in a shape, in a medium. With a factor \(i\): the Schrödinger equation in a well

element_propagator

\(\rho\,u_{tt} = \nabla\cdot(\varepsilon\nabla u) - V\,u + f\)

a drum of any shape, a membrane whose density or tension varies

element_propagator

\(u_{tt} + \gamma\,u_t = \nabla\cdot(\varepsilon\nabla u) - V\,u + f\)

damped waves

element_propagator

\(u_t = a\,\nabla^2 u + \mathbf{b}\cdot\nabla u + c\,u + f\) and \(u_{tt} = a\,\nabla^2 u + \mathbf{b}\cdot\nabla u + c\,u + f\), with a constant \(\mathbf{b}\)

a steady wind

element_propagator

first order in time, with further terms in the unknown and its first derivatives: nonlinear, or with coefficients that vary in space and time

reactions, a flow that turns, Burgers

element_stepping

second order in time, \(u_{tt} + \gamma\,u_t\), with such further terms

a membrane whose spring hardens, sine-Gordon on a shape

element_stepping

  • The first four forms are exact in time. The modes of the shape are computed, and each evolves by itself.

  • The density and the medium are positive. They and the potential are real, apart from one factor that they share with the whole right-hand side, like the \(i\) of the Schrödinger equation.

  • The second derivatives are a Laplacian or a divergence with a medium inside. Different coefficients along the two coordinates and a mixed derivative are not taken in time.

  • A density beside a damping, \(\rho\,u_{tt} + \gamma\,u_t\), is not taken.

  • A drift with constant coefficients is exact up to a strength \(|\mathbf{b}|\,L/a\) of 24, with \(L\) the size of the region. A stronger one is stepped, in an equation of first order in time, and so is a drift whose coefficients vary.

  • Terms that are stepped hold the unknown, its first derivatives, the position and the time, with an error per step that method.tolerance bounds. A potential that changes in time is one of them. An equation of second order in time takes them as well, apart from a drift that the modes do not hold.

  • The source and what is given on the boundary may depend on time.

Systems

Several unknowns, each with its own condition on every piece of the boundary.

Form

Covers

Method

stationary: for each unknown an elliptic equation of second order, coupled through values and first derivatives

a plate as two equations of second order: \(\nabla^2 w = m\), \(\nabla^2 m = f\)

spectral_elements

the same with nonlinear terms

element_newton

in time: for each unknown an equation of first order in time

substances that diffuse and react on a dish of any shape

element_stepping

in time: an equation of second order in time, \(u_{tt} + \gamma\,u_t\), for some unknowns or for all

a membrane that is coupled to a substance

element_stepping

in time: an unknown without a derivative in space, \(\partial_t w = c\,w + N\)

the model of FitzHugh and Nagumo on a dish of any shape

element_stepping

in time: a constraint, an equation without a derivative in time, for an unknown that has no equation in time

charges that drift in their own field, with Poisson’s equation for the potential

element_stepping

  • Each equation holds the second derivatives of one unknown. The other unknowns enter it with their values and their first derivatives, with coefficients that may vary, or in nonlinear terms.

  • Each condition on the boundary holds one unknown.

  • A stationary system whose solution is fixed up to a constant only is refused.

  • In time, each equation is the equation of one unknown, of first or second order in time. What it does to that unknown is exact, and the terms that couple the unknowns are stepped.

  • An unknown without any derivative in space has an equation of first order in time and no condition on the boundary. It is stepped at every point of the elements. At least one unknown has derivatives in space.

  • 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 boundary. The constraint is linear in it, with coefficients of its own, and with its conditions it must fix the unknown: a Laplacian with a slope given all around does not.

Eigenproblems

Form

Covers

Method

\(-\nabla\cdot(\varepsilon(\mathbf{x})\nabla u) + V(\mathbf{x})\,u = E\,\rho(\mathbf{x})\,u\)

the tones of a drum of any shape, the cutoffs of a waveguide, a skin that is heavier on one side, a potential that couples the coordinates

element_modes

  • \(\varepsilon\) and \(\rho\) are positive, and the operator is real. There are no first derivatives.

  • Each condition gives zero, with real coefficients: the value, the slope, or a mix of both.

  • One unknown, and the lowest eigenvalues.

Conditions on the boundary

Each piece of the boundary takes one condition for each unknown, \(\alpha\,u + \beta\,\partial_n u = g\), where \(\partial_n\) is the slope along the normal that points out of the region, pm.normal_derivative(u).

  • \(\alpha\) and \(\beta\) are constants. \(g\) is a number, a formula or an array, and may vary along the boundary and in time.

  • In a problem in time the ratio of \(\alpha\) and \(\beta\) is real.

  • boundary= takes one condition for the whole boundary, or a mapping from a curve or the name of a piece to its condition. In a system a list of equations stands where one stood, one for each unknown.

  • In a medium, pm.normal_derivative(u) is still the slope, not the flux: divide a flux that is given by the conductivity.

What is refused

The lists are on the page of known limits: under boundary conditions the forms on a region, under equations in time the terms that are stepped, and under limits that do not refuse what a corner and the size of a mesh cost in time.

See also: Shapes in the plane, Boundary conditions, Systems of equations and Modes of cavities, drums and waveguides.