M54. Stationary systems on a shape¶
Package: A4, its thirteenth part: several unknowns on a region of the plane with stationary equations of second order, coupled through terms with the other unknowns, linear or nonlinear.
What was built¶
Elements::solve_system: the linear system of several unknowns on spectral elements. On an element the weak form gives a block for each equation and each unknown. The points inside the element are eliminated for all unknowns at once, and the sparse system for the points that elements share is factorized directly. Each unknown has its own conditions on the pieces of the boundary.shaped_coupled: the classification, the planner and the solver of a stationary system. Each equation is the one of the unknown whose second derivatives it holds. That unknown’s terms are read as the operator of a single equation is, with a medium, a drift, a potential and directions that differ. Another unknown enters with its value and its first derivatives, with coefficients that may vary. Nonlinear terms may hold every unknown.Newton’s method for a system, as for one equation: the slope of each nonlinear term along each unknown is added to the block of that pair, a step solves the linearized system for the next iterate, and a step that does not reduce the residual is halved.
The planner solves on one mesh and degree after the other, by the search of a single equation, which now takes what is solved on a candidate as an argument (
choose_by).In Python nothing new is written: the list of conditions of milestone 53 and the starting values by unknown serve.
What it reaches¶
On the disk with a hole, \(u = \sin(3x + 0.7)\cos(2y - 0.3)\) and \(v = \sin x \cos y\) solve \(\nabla^2 u + 2v + v_x = f\) and \(\nabla\cdot((2 + x)\nabla v) - u + x\,u_y = g\), with the value of \(u\) on both curves, the slope of \(v\) on the rim and its value on the edge of the hole. On elements of the size 1/2:
Degree |
4 |
6 |
8 |
10 |
|---|---|---|---|---|
Error |
\(3\cdot10^{-5}\) |
\(7\cdot10^{-8}\) |
\(7\cdot10^{-11}\) |
\(8\cdot10^{-14}\) |
The planner’s own plan is right to \(10^{-9}\) and better. The tests assert the fall by a factor of 30 from degree to degree.
The same two functions solve \(\nabla^2 u - u v^2 = f\) and \(\nabla^2 v - e^{u} v + u_x = g\): Newton’s method from zero reaches the residual \(10^{-10}\), and the solution is right to \(10^{-9}\).
A plate that rests on its edge under an even load, \(\nabla^4 w = 1\) as \(\nabla^2 w = m\) and \(\nabla^2 m = 1\), on the unit disk: the deflection \((r^4 - 4r^2 + 3)/64\) to \(3\cdot10^{-15}\), in half a second.
Where one unknown has a singularity at a corner and the other has none, the mesh shrinks towards that corner: \(\sqrt r \sin(\theta/2)\) beside a smooth unknown, coupled through a complex coefficient, is right to \(4\cdot10^{-8}\) with 24 layers.
Decisions¶
D54.1. One direct solve for all unknowns¶
Developer, 2026-11-20.
The system is assembled in blocks, one for each pair of unknowns, and factorized as one matrix. The alternative was to keep the solve of one equation and iterate over the coupling: GMRES with the single equations as the preconditioner. That reuses more, but its number of iterations depends on the strength of the coupling, and it fails where a single equation resonates while the system does not. A direct solve does not ask how strong the coupling is: a plate, whose two equations are coupled as strongly as can be, is solved as easily as two equations that barely know of each other. The cost is a matrix with as many blocks as pairs of unknowns, which for the two or three unknowns of a system in the plane is small.
D54.2. An equation belongs to the unknown whose second derivatives it holds¶
Developer, 2026-11-20.
Each equation holds second derivatives of exactly one unknown, and each unknown has one such equation. That decides which condition on the boundary enters which equation: the slope of an unknown along the normal is what the weak form of its own equation leaves on the boundary. Second derivatives of two unknowns in one equation, cross-diffusion, would put the flux of one unknown into the condition of another, and are refused. So is an equation without second derivatives, an algebraic constraint.
D54.3. No solution that is fixed up to a constant¶
Developer, 2026-11-20.
One equation with slopes given all around and no term with the value is solved up to a constant, with the mean taken off (milestone 33). For a system, which constants are free depends on the coupling, and reading that off the equations is a problem of its own. A system that is singular is refused, with the words that its equations have no solution or more than one. A term with the value, or a value given on one piece, makes it solvable.
D54.4. The mesh follows the unknown with the strongest singularity¶
Developer, 2026-11-20.
Which corners have a singularity depends on the conditions, which differ from unknown to unknown. The mesh takes its layers from one unknown: the one whose weakest exponent is the smallest. The plan holds the number of layers, and the solve and the values anywhere find the same unknown again. Where two unknowns have singularities at different corners, the second is left with what the degree does for it. That is in the backlog.
D54.5. The budget counts all unknowns¶
Developer, 2026-11-20.
The planner solves with up to 30 000 points on the sides of elements, and a plan may ask for 80 000. For a system the points of all unknowns count together, since the matrix that is factorized holds them all.
What is left¶
Systems of second order in time, second derivatives of two unknowns in one equation, constraints, and conditions that hold several unknowns: a plate that is clamped has both of its conditions on the deflection.
A stationary system that is fixed up to constants.
A mesh that shrinks towards the corners of every unknown.