Skip to main content

Tangent Hyperplanes IV: Residuals and Curvature

tangent-space
Finite linearization error, mixed Taylor terms and horizon-dependent bounds, distinguished from measurement and model discrepancy.

Define Which Residual Is Being Measured

A discrepancy between a nonlinear model and its linearization can arise even when both are implemented correctly. A discrepancy between that model and measured motion can also include parameter error, missing physics, sensor noise and numerical error. Calling every observed difference “curvature” would conceal these distinctions.

Let \(\bar x\) solve \(\dot{\bar x}=f(\bar x,\bar u)\) and let \(x\) solve the same nonlinear model under \(u=\bar u+\Delta u\). Define the actual finite increment \(\Delta x=x-\bar x\). Separately solve the linear prediction

\[ \dot{\hat\xi}=A(t)\hat\xi+B(t)\Delta u, \qquad \hat\xi(t_0)=\Delta x(t_0), \]

where \(A=D_xf(\bar x,\bar u)\) and \(B=D_uf(\bar x,\bar u)\). The predicted state is \(x_{\rm lin}=\bar x+\hat\xi\), and the trajectory residual is

\[ r=\Delta x-\hat\xi=x-x_{\rm lin}. \]

We do not set \(x=x_{\rm lin}\): that would make the residual identically zero by definition. The forced linear prediction \(\hat\xi\) uses a finite input increment; Part 2 separately defined the derivative of a parameterized solution family.

The Taylor Remainder Includes Mixed Terms

Choose a state/input scaling, set \(z=(x,u)\) and \(\Delta z=(\Delta x,\Delta u)\), and assume \(f\) is \(C^2\) on all line segments joining nominal and perturbed pairs in a finite-time tube. Taylor’s integral formula gives

\[ \begin{aligned} f(\bar z+\Delta z) &=f(\bar z)+Df(\bar z)\Delta z\\ &\quad+R_2. \end{aligned} \]

\[ R_2=\int_0^1(1-s)D^2f(\bar z+s\Delta z) [\Delta z,\Delta z]\,ds. \]

For a vector-valued \(f\), each component has a Hessian. The bracket denotes its bilinear action, including state-state, state-input and input-input products. It is not a matrix multiplying a vector of elementwise squares.

For example, \(f(x,u)=xu\) at \((0,0)\) has \(A=B=0\), but \(R_2=\Delta x\Delta u\). Dropping mixed derivatives would incorrectly predict no remainder. State-dependent input gain is precisely compatible with control affinity; it can still generate this mixed finite perturbation term.

If \(\|D^2f\|\le H\) in the scaled product norm, then

\[ \|R_2(t)\|\le\frac H2\|\Delta z(t)\|^2. \]

The norm combines different physical variables only after their scales have been declared. Otherwise a numerical constant cannot meaningfully compare radians, angular speeds and torques.

From Instantaneous Remainder to Trajectory Error

Subtracting the linear prediction from the finite-difference equation yields

\[ \dot r=A(t)r+R_2(t),\qquad r(t_0)=0. \]

Variation of constants therefore gives the exact error identity

\[ r(t)=\int_{t_0}^{t}\Phi(t,s)R_2(s)\,ds. \]

Suppose on an interval of length \(T\) that \(\|\Phi(t,s)\|\le K e^{L(t-s)}\) with \(L\ge0\), and \(\|\Delta z(t)\|\le C_0\epsilon\). Then

\[ \|r(t)\|\le\frac12 KHC_0^2 T e^{LT}\epsilon^2. \]

This is a finite-horizon upper bound, with explicit dependence on amplification and tube size. Under bounded derivatives, a bounded input perturbation and sufficiently small initial perturbation, continuous dependence of ODE solutions supplies such a tube over a fixed interval. The perturbation must remain inside the region where the derivative and Hessian bounds apply. An initial prediction mismatch would add \(\Phi(t,t_0)r(t_0)\).

The familiar notation \(O(\epsilon^2)\) hides these constants. It is not a guarantee that one linear approximation remains accurate over an arbitrarily long swing or simulation horizon.

What Quadratic Scaling Does and Does Not Say

Consider \(\dot x=x^2\), nominal \(\bar x=0\), with \(x(0)=\epsilon\). Before the solution’s pole,

\[ x(t)=\frac{\epsilon}{1-\epsilon t}, \qquad \hat\xi(t)=\epsilon, \qquad r(t)=\frac{\epsilon^2t}{1-\epsilon t}. \]

At fixed \(t>0\) and sufficiently small \(\epsilon\), the error has a quadratic leading term. Doubling \(\epsilon\) changes it by the ratio

\[ \frac{r(2\epsilon,t)}{r(\epsilon,t)} =4\frac{1-\epsilon t}{1-2\epsilon t}, \]

which approaches four but is not exactly four at finite amplitude. A direction with zero quadratic coefficient may show cubic error, and a linear system has zero Taylor remainder. Noise or solver error can dominate the smallest perturbations and obscure any asymptotic scaling.

A useful numerical check varies perturbation size and integration tolerance independently. Verify the same state definition, input perturbation, time horizon and event sequence across comparisons. A fitted slope near two supports a local consistency check; it does not validate the model against human motion.

“Curvature” Is a Geometric Interpretation

Second derivatives describe how a coordinate representation departs from its first-order model. They depend on the state chart and scaling. They are not, by themselves, the intrinsic Riemannian curvature tensor of a configuration manifold, nor a measurement of a clubhead path’s geometric curvature.

A smooth saddle or an unstable equilibrium still has a derivative and may satisfy the same finite-time remainder theorem. Instability can amplify the remainder through \(\Phi\); it does not invalidate Taylor’s theorem. A smooth nonlinear input map also has the same first-order-plus-quadratic-remainder structure. Genuine nonsmooth transitions require the separate treatment in Part 6.

Residuals During Trajectory Optimization

DDP/iLQR propose input changes using local derivatives and assess them by nonlinear rollout. The measured dynamics mismatch can guide step sizing and reveal unreliable derivatives. However, iterations do not necessarily reduce the initial state difference: the physical initial condition is normally fixed. Nor does decreasing objective value guarantee a monotonically decreasing linearization residual.

Quadratic local convergence of a suitable Newton-like method needs optimization assumptions beyond a quadratic Taylor remainder. Regularization, line search, active constraints and stopping conditions affect the result. Use residuals alongside objective, feasibility and stationarity checks rather than calling the optimizer a residual-reduction algorithm.

For a golf model, repeat the comparison across plausible inertia, shaft and actuation parameters. A small truncation residual says that the linearization represents that model locally; parameter uncertainty and disagreement with measured motion remain separate. Part 5 addresses differential stability, and Part 7 discusses controller decisions informed by residuals. The longer Residual-Aware Control manuscript provides companion material.

Citation

BibTeX citation: Download .bib
@online{untitled,
  author = {},
  title = {Tangent {Hyperplanes} {IV:} {Residuals} and {Curvature}},
  url = {https://affinedrift.com/articles/tangent-hyperplanes-series/part-4-residuals-curvature.html},
  langid = {en}
}
For attribution, please cite this work as:
“Tangent Hyperplanes IV: Residuals and Curvature.” n.d. https://affinedrift.com/articles/tangent-hyperplanes-series/part-4-residuals-curvature.html.