Fundamentals / Numerical mathematics / Nonlinear equations

Inequalities and active constraints

Translate one-sided equilibrium into complementarity equations, identify an active set and verify both force and feasibility.

From first principles

Express one-sided contact as a complementarity condition

Consider a point constrained to have gap \(g\ge0\) above a frictionless rigid stop. A compressive reaction \(p\ge0\) can prevent penetration, but a separated stop exerts no force. These requirements give the scalar conditions

\[g\ge0,\qquad p\ge0,\qquad gp=0 .\]

They allow either an open gap with zero force or closed contact with a nonnegative force. To connect this with optimization, suppose the physical coordinate is the gap itself and the unconstrained stored energy is differentiable and convex. At a constrained minimum on \(g\ge0\), every feasible first-order change has nonnegative energy change. Thus the equilibrium derivative obeys

\[E'(g)=p,\qquad p\ge0,\]
\[gE'(g)=0 .\]

In the interior one may move in both directions, forcing zero derivative. At the boundary only increases in gap are feasible, allowing positive derivative. The balance equation for a specific spring or load supplies the remaining relationship needed to determine the gap and force.

Background · Complementarity
\[x\ge0,\quad y\ge0,\quad xy=0\]

Both quantities are nonnegative and at least one vanishes. Active-set changes can make a smooth Newton model inappropriate across the switch.

Derivation and applications

Quantify the gap introduced by smoothing a contact condition

Algebraic regularization can replace the sharp switch between an open and a closed contact with a differentiable approximation. First scale the gap and reaction into dimensionless variables \(g,p\), using stated positive reference scales. One exact residual is \(\sqrt{g^2+p^2}-g-p\): setting it to zero implies \(g+p\ge0\), and squaring gives \(gp=0\), which together force nonnegativity. Introduce a smoothing parameter \(\mu>0\),

\[\phi_\mu(g,p)=\sqrt{g^2+p^2+2\mu}-g-p .\]

At a zero, \(g+p>0\), and squaring gives \(gp=\mu\). Thus both quantities are positive even where the physical contact would be exactly open or closed. For a one-degree-of-freedom linear balance \(p=k(g-g_0)\) with positive scaled stiffness \(k\) and unloaded gap \(g_0\), solve the positive quadratic root:

\[k g(g-g_0)=\mu,\]
\[g_\mu=\frac{g_0+\sqrt{g_0^2+4\mu/k}}{2},\]
\[p_\mu=\frac{\mu}{g_\mu}.\]

For an exactly grazing load \(g_0=0\), the smoothing affects gap and force on square-root scales,

\[g_\mu=\sqrt{\mu/k},\]
\[p_\mu=\sqrt{k\mu}.\]

Far from this switching point the smaller of the two quantities decays linearly with \(\mu\). A small residual of the smoothed equation only proves that the regularized balance has been solved. The value of \(\mu\) and the physical reference scales determine the discrepancy from exact contact.

Worked example

Measure parasitic force across an open gap

Let \(k=4,\ g_0=0.50,\ \mu=0.010\). The exact unsmoothed balance is

\[g=0.50,\ p=0.\]

The smoothed solution gives

\[g_\mu=(0.50+\sqrt{0.26})/2=0.50495,\]

with \(p_\mu=0.01980\). Multiplication gives \(g_\mu p_\mu=0.0100\), an independent check on the source of this residual force.

Second application

Choose smoothing at a grazing contact

With \(k=9\) and dimensionless admissible gap error \(0.002\), a grazing contact requires \(\sqrt{\mu/9}\le0.002\). Thus \(\mu\le3.60\times10^{-5}\). At this upper value the induced reaction is \(0.0180\). If the admissible reaction is only \(0.009\), the stricter requirement is

\[\mu\le0.009^2/9=9.0\times10^{-6}.\]

A stop can push in only one direction

A constrained coordinate \(u\) must remain nonnegative and has an elastic energy \(E(u)=ku^2/2-fu\), \(k>0\). Minimising a differentiable energy on a half-line gives an interior stationary point when \(u>0\). At the endpoint zero, only nonnegative variations are possible, so the one-sided derivative must be nonnegative. Introduce the reaction \(w=ku-f\). These conditions read \(u\ge0,\ w\ge0,\ uw=0\). They express that at least one of gap and reaction vanishes. A similar rule applies componentwise to a vector of gaps coupled through a stiffness matrix.

The scalar solution is

\[u=\max(f/k,0),\]
\[w=\max(-f,0).\]

Increasing \(f\) through zero changes the slope of the load–displacement graph. The solution stays continuous while its derivative jumps. Near that change an unconstrained differentiable root solver can produce a negative gap or an inadmissible attractive reaction unless its equations include the inequalities.

Couple two potential contact points

Let \(K=\left(\begin{smallmatrix}2&-1\\-1&2\end{smallmatrix}\right)\), \(f=(-1,1)^T\), \(w=Ku-f\) and \(u_i\ge0\). The unconstrained equilibrium gives \(u=K^{-1}f=(-1/3,1/3)^T\), violating the first gap. Test the set with \(u_1=0\), \(w_2=0\). The second equation becomes \(2u_2-1=0\), hence \(u_2=1/2\). Recover the first reaction \(w_1=-1/2+1=1/2\). Every gap and reaction is now nonnegative and every product vanishes. Positive definiteness of \(K\) makes the quadratic energy strictly convex, so a feasible stationary state satisfying these inequalities is its unique minimum.

For a changed load \(f=(-0.4,1)^T\), the same assumed active set yields \(w_1=-0.1\), which is inadmissible. Release the first coordinate and solve \(Ku=f\). Using \(K^{-1}=\left(\begin{smallmatrix}2&1\\1&2\end{smallmatrix}\right)/3\) gives \(u=(1/15,8/15)^T\), positive in both coordinates, with zero reactions. A small change of loading has switched the equations that determine the state.

A residual for switching equations

After compatible nondimensionalisation, \(\min(u_i,w_i)=0\) is equivalent to the three componentwise complementarity conditions. Where \(u_i<w_i\), linearising the minimum selects the gap equation; where \(w_i<u_i\), it selects the equilibrium equation. At equality the derivative is not unique, which explains the need for a switching rule or a nonsmooth Newton formulation. A product alone is insufficient: a negative gap and zero reaction give a zero product. Report the largest feasibility violation and a complementarity residual together. At the scalar switching load \(f=0\), both gap and reaction vanish and the active designation is ambiguous even though the state itself is unique.

Read the reaction as the price of a constraint

Return to a single gap with stiffness 2 and load −4. Its minimum over \(u\ge0\) occurs at zero with reaction 4. Now move the lower stop to \(u\ge d\) for a small positive \(d\). The constrained minimum becomes \(E(d)=d^2+4d\), whose derivative at zero is 4, precisely the original reaction. A small imposed displacement of the active stop requires work to first order. For a positive load producing a strictly open gap, the same small stop shift would initially have no effect and the reaction would be zero. These energy changes provide an independent check on the reaction sign.

Derive a discrete obstacle problem from virtual work

Consider a membrane represented by three interior displacements with fixed zero displacements at its ends. In scaled units the elastic energy is one half the sum of squared neighbouring differences, including the terms at both supports. Its stiffness matrix has diagonal two and neighbouring entries minus one. An obstacle at height \(g_j\) requires

\[u_j\ge g_j.\]

Minimising \(E(u)=u^TKu/2-f^Tu\) over this convex feasible set gives a simple test involving every feasible variation: \((Ku-f)^T(v-u)\ge0\) for every feasible \(v\).

To see necessity, move a small fraction of the distance from \(u\) toward \(v\) and differentiate the energy at zero step. For sufficiency, the exact energy difference equals that linear term plus \((v-u)^TK(v-u)/2\), which is nonnegative and strictly positive for a nonzero displacement because both endpoints are fixed. At an interior free node both signs of variation are allowed, so its reaction vanishes. At an active obstacle only upward variations are feasible, so the signed reaction is nonnegative. These properties give complementarity between the gap \(u-g\) and the reaction \(Ku-f\).

Determine which part of an obstacle actually supplies force

Let \(g=(0,1,0)^T\), \(f=0\). Setting all displacements equal to the obstacle would give

\[Ku=(-1,2,-1)^T,\]

with negative endpoint reactions at the first and third interior nodes. Those two active guesses are inadmissible. Keep only the middle node in contact and solve free-node equilibrium: \(2u_1-u_2=0\) and \(2u_3-u_2=0\). With \(u_2=1\) this yields \(u=(0.5,1,0.5)^T\), whose reactions are \((0,1,0)^T\). The end gaps are both positive and the central gap is zero, satisfying the complete optimality test.

The energy is half the sum of four squared slopes \(0.5,0.5,-0.5,-0.5\), hence 0.5. The candidate that hugs the entire obstacle has slopes \(0,1,-1,0\) and energy one. Lifting the two free nodes lets the membrane distribute curvature more economically while remaining above the obstacle. Independently the sum of the support reactions balances the unit central contact force, since each outer spring slope has magnitude 0.5 in these scaled units.

Apply an additional positive force \(f_2=t\) at the centre while keeping the obstacle fixed. The contact-state reaction becomes \(1-t\). Up to \(t=1\) the position stays fixed and the contact load decreases. For \(t>1\) the contact can no longer sustain a negative reaction; solving the unconstrained equations gives \(u=(t/2,t,t/2)^T\), now above every obstacle node. This piecewise response exhibits an observable change of slope in displacement at the contact transition. Reusing the old active set without checking the sign of its reaction would incorrectly predict an unchanging displacement for arbitrarily large lifting forces.

A force test and a gap test remain necessary even when the computed energy looks sensible. For example \(u=(0.4,1,0.4)^T\) is feasible and has energy only 0.52, close to the optimal 0.5. Yet its outer reactions are each −0.2 at strictly open gaps. The complementarity equations identify the reducible energy error even without knowing the exact energy minimum.

Locate the switch between free motion and contact

A unit-stiffness spring has free displacement equal to applied force but a rigid stop enforces \(x\le1\). With contact force \(r\ge0\) the force balance is \(x+r=f\) and complementarity gives \(r(1-x)=0\). Examine each active set.

Locate the switch between free motion and contact. Horizontal axis: Applied force (normalised). Vertical axis: Scaled displacement or contact force. Data follow the figure.
At f = 0.5 the gap is 0.5 and contact force vanishes. At f = 2 the gap is zero and the contact supplies one force unit. The solution is continuous but its derivative jumps at engagement, a feature a smooth unconstrained Newton model misses.
Read values from the plot
Scaled displacement or contact force at selected values of Applied force (normalised).
Applied force (normalised)DisplacementReaction
−2−20
−0.25−0.250
1.510.5
3.2512.25
514

Download all 281 plotted samples (CSV)

Change parameters · Locate the switch between free motion and contact

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.