How this calculation works
Solve a one-dimensional lower-obstacle variational inequality with nodal contact reactions and complementarity checks.
u≥g; λ=Au−b≥0; (u−g)⊙λ=0; minimize(1/2)uᵀAu−bᵀu.A worked example
For five nodes, unit interval, source−1 and interior obstacle −0.02, all three interior nodes contact the obstacle with positive reactions.
Good to know
3–20 uniform nodes, unit stiffness, finite nodal source and lower obstacle, positive interval length≤1000. Dirichlet endpoints must satisfy the obstacle. Lumped load h f, bounded active set and KKT checks; no continuum contact-location certificate or dynamic contact.
Reference: Dapogny: obstacle constraints and variational inequalities (opens in a new tab) ↗
A constraint changes the Poisson solution
An unconstrained Poisson equation can produce a displacement below a physical lower barrier. The obstacle problem replaces that equality everywhere with a variational inequality: the solution must stay above the obstacle, and a contact reaction supplies the force needed where the constraint is active.
The finite problem minimizes a convex quadratic energy over nodal lower bounds. This is not a rule that clips an unconstrained solution after solving it. Clipping alone generally breaks force balance at neighboring nodes and does not solve the coupled constrained energy problem.
Compare this with the Finite element one dimensional Poisson equation calculator. Solve a variational inequality with a lower obstacle and return contact reactions; unconstrained Poisson solutions can pass below that obstacle.
Nodes, source and endpoint data
Enter equally spaced nodal source values and an obstacle value at each node. The positive interval length determines spacing from the node count. Left and right endpoint values are prescribed Dirichlet conditions and must already lie above their corresponding obstacle values.
The model uses unit stiffness and a lumped source load equal to spacing times the interior nodal source. This convention is explicit because a finite-element load integrated exactly from another interpolated source can differ. Matching node values alone does not make different load-assembly conventions identical.
The shallow-obstacle example
The default interval has five nodes and source minus one. Both endpoints are zero, while each interior obstacle value is minus zero-point-zero-two. The load would push the unconstrained solution farther down, so all three interior nodes are held at their lower bounds.
The returned reactions are positive: approximately zero-point-one-seven at the outer interior nodes and zero-point-two-five at the middle node. The complementarity product vanishes because contact nodes have zero gap. These values are nodal forces under the discrete load convention, not an inferred continuous pressure distribution.
Active and free nodes
The active-set algorithm partitions interior nodes into those fixed at the obstacle and those free to satisfy the equilibrium equations. For a proposed active set, a reduced linear system solves the free values while including the fixed active contributions in its right-hand side.
If a free value falls below the obstacle, that node is added to the active set. If an active node has a negative reaction, it is released. The loop continues until both feasibility and nonnegative reactions hold, subject to an explicit iteration cap rather than an assumption that every attempted set is already valid.
The KKT certificate
The stiffness matrix is symmetric positive definite after fixing endpoints. Feasible nodal values, nonnegative reactions and zero gap-reaction products are therefore sufficient optimality conditions for this finite convex problem. The implementation checks these conditions before returning a successful solution.
Complementarity captures the physical split: a free node has positive gap and zero contact reaction, while a constrained node can carry a positive reaction at zero gap. A nearly active node can sit on a numerical tolerance boundary, so contact membership itself can be more sensitive than the displacement vector.
Reading contact counts and reactions
Contact indices refer to the original zero-based node positions and exclude the prescribed endpoints. Endpoint reactions are not computed and their placeholder entries should not be interpreted as proof that no boundary force exists. The headline contact count is the number of active interior nodes in the returned finite problem.
Energy uses the reduced discrete objective. Adding constants associated with prescribed boundary values would not change the minimizer, but could change a differently normalized reported energy. Compare solutions and KKT residuals before treating a numerical objective offset as a disagreement between implementations.
From a finite model to a physical barrier
Refine the node spacing when the contact interval or a sharp obstacle feature matters. Nodal contact sets approximate a continuous contact region and do not locate its endpoints exactly. A successful KKT certificate applies to the stated discretization, not automatically to the infinite-dimensional obstacle problem.
Use a more general contact solver for variable material stiffness, higher dimensions, friction or time-dependent impact. This page studies a static lower-bound model. Its value is a coupled solution with inspectable reactions and constraints, not an automatic replacement for mechanical contact analysis.
A few questions, answered
Is the solution just a clipped Poisson curve?
No. The free-node equations are solved together with active constraints and nonnegative contact reactions.
Are endpoint reactions included?
No. Dirichlet endpoint reactions are not computed; the reported contact indices concern interior nodes.
What does complementarity mean?
At each interior node, obstacle gap times contact reaction is zero under the finite optimality conditions.
Does contact count give an exact continuous contact interval?
No. It counts active nodes of the chosen discretization.