Go back to home page

Why λ Is the Sensitivity Variable

Proof note for "Cable Anchor Sensitivity Analysis for Reconfigurable Cable Robots."

Contents
  1. The optimization problem
  2. KKT conditions
  3. The identity: λ equals dV*/dw
  4. Geometric meaning of stationarity
  5. From w-sensitivity to U-sensitivity
  6. Generalization and the paper's equation (3)
How to read this page. Every numbered section is a general statement, true for any m, n, J(U), with no specific numbers in it. The shaded boxes labeled Example plug a single fixed instance into whatever was just derived, purely so it can be checked by hand. Nothing in the proof depends on the numbers chosen there.

01The Optimization Problem

f ∈ ℝm is the vector of cable forces, w ∈ ℝn is the required wrench, and J(U) ∈ ℝn×m is the structure matrix, depending on the reconfiguration vector U:

$$\min_{f}\ \frac12 f^Tf \quad\text{s.t.}\quad J(U)f=w,\quad f\ge 0$$

Write V*(w,U) for the optimal value of this program. The goal: show the multiplier λ obtained while solving it is exactly the rate at which V* changes, with respect to both w and U.

Example

Two cables, one wrench component: $m=2,\ n=1$. Cable 1's anchor is fixed; cable 2's anchor position is the only free coordinate, called $u$ (one component of the full vector $U$). Then:

$$J(u)=\begin{bmatrix}1 & u\end{bmatrix},\qquad f=\begin{bmatrix}f_1\\f_2\end{bmatrix},\qquad J(u)f=w \;\Longleftrightarrow\; f_1+uf_2=w$$

02KKT Conditions

Introduce λ ∈ ℝn for the equality constraint and μ ∈ ℝm (μ ≥ 0) for f ≥ 0:

$$L(f,\lambda,\mu,w,U)=\frac12 f^Tf-\lambda^T\big(J(U)f-w\big)-\mu^Tf$$
Stationarity
$$f-J(U)^T\lambda-\mu=0$$
Primal feasibility
$$J(U)f=w$$
Compl. slackness
$$\mu_i f_i=0\ \ \text{for every }i,\quad \mu\ge0,\ f\ge0$$

These hold at the optimum $(f^*,\lambda^*,\mu^*)$ for any fixed $(w,U)$, the only facts used below.

Example

With $J(u)=[1\ \ u]$, stationarity and feasibility read:

$$f_1=\lambda,\quad f_2=u\lambda\qquad\text{and}\qquad f_1+uf_2=w \;\Rightarrow\; \lambda^*=\frac{w}{1+u^2}$$

Fixing $u=1,\ w=4$: $\lambda^*=2$, $f_1^*=f_2^*=2$, and $V^*=\tfrac12(2^2+2^2)=4$.

03The Identity: λ Equals dV*/dw

Fix U and treat w as the variable. This is an exact identity, proved for any m, n, J, not a first-order approximation, and not specific to any example.

Step 1 - V* equals L at the optimum

The constraint term and the complementary-slackness term both vanish at the optimum, and do so for every nearby w. This is a function identity, not a one-point coincidence:

$$V^*(w)=\tfrac12 f^{*T}f^*=L(f^*(w),\lambda^*(w),\mu^*(w),w)$$

Step 2 - differentiate with respect to w (chain rule)

$$\frac{dV^*}{dw}=\frac{\partial L}{\partial f}\frac{df^*}{dw}+\frac{\partial L}{\partial \lambda}\frac{d\lambda^*}{dw}+\frac{\partial L}{\partial \mu}\frac{d\mu^*}{dw}+\frac{\partial L}{\partial w}$$

Step 3 - three terms vanish

Each of the three terms below is a product of two factors. In every case, one factor is forced to be exactly zero by a KKT condition, so the whole product is zero, regardless of what the other factor, the messy derivative $df^*/dw$, $d\lambda^*/dw$, or $d\mu^*/dw$, actually equals.

f-term

$\partial L/\partial f=f-J^T\lambda-\mu$. This is exactly the stationarity condition, which equals $0$ at the optimum. So this factor is zero, and the whole f-term is $0\times df^*/dw=0$, no matter how complicated $df^*/dw$ is.

λ-term

$\partial L/\partial \lambda=-(Jf-w)$. By feasibility, $Jf^*=w$, so this is zero. The subtle part: this holds not just at one $w$, but for every $w$ near the baseline, since $f^*(w)$ is defined precisely as the solution that satisfies $Jf=w$ for that $w$. So as a function of $w$, this factor is identically zero, and a function that is identically zero has derivative zero too, which is what lets this whole term drop out.

μ-term

$\partial L/\partial \mu=-f$, so this term is $-\sum_i f_i^*\,d\mu_i^*/dw$. Check each component $i$ separately:

If $f_i^*>0$
complementary slackness ($\mu_i^*f_i^*=0$) forces $\mu_i^*=0$. This holds in a whole neighborhood of $w$, so $\mu_i^*(w)\equiv0$ nearby, meaning $d\mu_i^*/dw=0$ too. The term for this $i$ is $f_i^*\times0=0$.
If $f_i^*=0$
the coefficient $f_i^*$ itself is already zero, so the term for this $i$ is $0\times(\text{anything})=0$.

Either way every term in the sum is zero, so the whole sum is zero.

Step 4 - only the explicit term survives

w appears explicitly in L only in $+\lambda^Tw$, so $\partial L/\partial w=\lambda$. Result, exact:

$$\frac{dV^*}{dw}=\lambda^*$$
Example

Fix $u=1$ and repeat Step 2 of the KKT example without substituting a number for w:

$$f_1+f_2=w \;\Rightarrow\; \lambda^*(w)=\frac w2 \;\Rightarrow\; f_1^*(w)=f_2^*(w)=\frac w2 \;\Rightarrow\; V^*(w)=\frac12\!\left(\left(\frac w2\right)^{\!2}\!+\!\left(\frac w2\right)^{\!2}\right)=\frac{w^2}{4}$$

Differentiating directly: $\dfrac{dV^*}{dw}=\dfrac{d}{dw}\!\left(\dfrac{w^2}{4}\right)=\dfrac w2=\lambda^*(w)$, matching Step 4 above, for every w:

wλ*(w)dV*/dwMatch
21.01.0
42.02.0
63.03.0

04Geometric Meaning of Stationarity

Take the case $n=1$, so $w$ is a scalar and $g(f)=J(U)f-w$ is a single scalar-valued constraint function with gradient $\nabla g(f)=J(U)^T$, an $m$-vector. Stationarity, $f^*=J(U)^T\lambda^*+\mu^*$, with $\mu^*=0$ where $f^*>0$, then reads $\nabla V(f^*)=\lambda^*\,\nabla g(f^*)$: the cost's gradient is parallel to, and exactly $\lambda$ times, the constraint's gradient. This is most easily seen by drawing it.

Example

With $u=1$ (so $J(u)f=f_1+f_2$), $f^*=(2,2)$, $\lambda^*=2$:

f* = (2, 2) ∇g = (1,1) (constraint's direction) ∇V = (2,2) (cost increases fastest this way)
The arcs are level sets of V(f)=½(f12+f22); the line is f1+f2=w. ∇V and ∇g point the same direction, exactly the stationarity condition above.
0 2 4 6 8 10 w 0 10 20 V*(w) w=4, V*=4 tangent slope = λ*(4) = 2 V*(w) = w^2/4
The same λ=2, now seen as the tangent slope of V*(w) at w=4, Step 4 above, drawn.

05From w-Sensitivity to U-Sensitivity

Section 03 differentiated L with respect to w. The same machinery, unchanged, applies with respect to U instead, holding w fixed. It is Section 03 again with one symbol replaced.

Step 1 - same identity, now with U as the parameter

$$V^*(U)=L(f^*(U),\lambda^*(U),\mu^*(U),U)$$

Step 2 - chain rule with respect to U

$$\frac{dV^*}{dU}=\frac{\partial L}{\partial f}\frac{df^*}{dU}+\frac{\partial L}{\partial \lambda}\frac{d\lambda^*}{dU}+\frac{\partial L}{\partial \mu}\frac{d\mu^*}{dU}+\frac{\partial L}{\partial U}$$

Step 3 - the first three terms vanish, by the identical argument as Section 03

Stationarity, feasibility, and complementary slackness hold along the optimal path as U varies, exactly as they did as w varied. They do not care which parameter is moving.

Step 4 - only the explicit U-term survives

Here, with w held constant, U appears explicitly in L only inside $-\lambda^TJ(U)f$:

$$\frac{dV^*}{dU}=\frac{\partial L}{\partial U}\bigg|_{f,\lambda,\mu\text{ fixed}}=-\lambda^{*T}\frac{\partial J}{\partial U}f^*\qquad\Longrightarrow\qquad \Delta V\approx-\lambda^{*T}\Delta J\,f^*$$
Sign convention The paper's equation (3) states $\Delta V=\lambda^T\Delta Jf$, without the minus sign here. The difference is purely which sign is attached to $\lambda$ in the Lagrangian: flipping to $L=\tfrac12f^Tf-\lambda^T(w-Jf)-\mu^Tf$ recovers the paper's sign, leaving every other derived quantity unaffected up to the same global sign. Since the paper's proof is omitted, the convention cannot be confirmed directly, and it does not matter for ranking $|\Delta V|$ across candidate cables, the paper's actual use of $\lambda$.
Example

Baseline $u=1,\ w=4$: $f^*=(2,2)$, $\lambda^*=2$. Since $J(u)=[1\ \ u]$, differentiating each entry with respect to $u$ gives $\partial J/\partial u=[0,\ 1]$ (the first entry is constant, the second entry is $u$ itself). Move to $u=1.002$, so $\Delta u=0.002$:

$$\Delta Jf^*=[0,0.002]\cdot[2,2]^T=0.004\qquad\Delta V\approx-2\times0.004=-0.008$$

Exact resolve at $u=1.002$: $\lambda^*(1+1.002^2)=4\Rightarrow\lambda^*\approx1.996004$, $f^*\approx(1.996004,1.999996)$:

QuantityValue
V* before (u=1)4.000000
V* after (u=1.002, exact resolve)3.992008
ΔV actual-0.007992
ΔV predicted (no re-solve)-0.008000

With $\Delta u$ shrunk from 0.1 to 0.002 (50x smaller), the gap between predicted and actual shrank from 0.020 to 0.000008, about 2500x smaller, matching the expected $O(\Delta u^2)$ first-order error.

06Generalization and the Paper's Equation (3)

Nothing in Sections 03-05 depended on any example, or on a coordinate being a scalar. Replacing the scalar w with w ∈ ℝn, and replacing a single coordinate u with the full vector U ∈ ℝdr (so $\partial J/\partial u\,\Delta u$ becomes $\frac{\partial J}{\partial U}\Delta U$, summing the contribution of every anchor coordinate), the same argument applies component-wise: λ, already produced as a byproduct of solving the QP for cable forces, is precisely the sensitivity of the optimal cost to a perturbation of U, at no extra computational cost.

Reference. The general statement, with full regularity conditions (LICQ, strict complementarity), is the parametric-NLP sensitivity theorem.

Fiacco, A. V. (1983). Introduction to Sensitivity and Stability Analysis in Nonlinear Programming. Academic Press.

Boyd, S., & Vandenberghe, L. (2004). Convex Optimization, Section 5.6. Cambridge University Press. (Free PDF: web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf)