Skip to main content

Tangent-Space Series, Part 4: 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. \]

Fix a horizon \(T=t-t_0\) and a perturbation scale \(\epsilon>0\). Write \(z=(x,u)\) and \(\Delta z=(\Delta x,\Delta u)\) as above. Assume the nominal and perturbed trajectories stay in a region where \(\|D^2f\|\le H\), \(\|\Phi(t,s)\|\le \kappa_\Phi e^{L(t-s)}\) with growth rate \(L\ge0\) for the variational flow, and \(f\) is Lipschitz in state on that region with Lipschitz constant at most the same \(L\). Require an \(\epsilon\)-scaled experiment: \(\|\Delta x(t_0)\|\le c_x\epsilon\) and \(\|\Delta u(t)\|\le c_u\epsilon\).

The argument has three steps. First, bound how far the real motion can drift from the nominal one; that drift defines a tube of radius \(C_0(T)\epsilon\). Second, inside that tube the curvature term \(R_2\) is at most \(\frac H2\) times the tube radius squared. Third, the linearized dynamics carry the error that curvature injects at each instant forward to time \(t\), amplifying it by at most \(Ke^{L(t-s)}\); adding those contributions bounds \(r\).

The tube constant \(C_0(T)\) must come from the actual deviation, not from replacing \(\Delta z\) by the linear prediction \(\hat\xi\). Along the nonlinear increment,

\[ \dot{\Delta x}=f(\bar x+\Delta x,\bar u+\Delta u)-f(\bar x,\bar u) =A(t)\Delta x+B(t)\Delta u+R_2(t), \]

with \(\|R_2(t)\|\le\frac H2\|\Delta z(t)\|^2\) from the Taylor expansion above. Split

\[ f(\bar x+\Delta x,\bar u+\Delta u)-f(\bar x,\bar u) =[f(\bar x+\Delta x,\bar u+\Delta u)-f(\bar x,\bar u+\Delta u)]+[f(\bar x,\bar u+\Delta u)-f(\bar x,\bar u)]. \]

The first (state) part is bounded by \(L\|\Delta x\|\), using the state Lipschitz bound at the perturbed input \(\bar u+\Delta u\). The second (input) part is exactly \(B(t)\Delta u(t)\) for control-affine \(f\) when evaluated at the nominal state \(\bar x\), or bounded by \(L_u\|\Delta u(t)\|\) in general. With \(\|\Delta u(t)\|\le c_u\epsilon\), the input part has norm at most \(c_B\epsilon\), with \(c_B=\sup_t\|B(t)\|c_u\) for control-affine \(f\) (or \(c_B=L_u c_u\) in the non-affine case). Thus

\[ \|\dot{\Delta x}(t)\|\le L\|\Delta x(t)\|+c_B\epsilon. \]

No Taylor remainder enters this step. The split bounds the whole difference, so the inequality is exact, not a leading-order approximation, and it does not use the tube bound derived next. Gronwall on it is the familiar compound-interest picture: homogeneous growth \(e^{LT}\) plus accumulation of forcing—budgeting for the push running at full strength throughout (a worst case). We now show

\[ \|\Delta x(t)\|\le\left(c_x e^{LT}+\frac{c_B}{L}\bigl(e^{LT}-1\bigr)\right)\epsilon, \]

with the \(L\to0\) limit giving \(\|\Delta x(t)\|\le(c_x+c_B T)\epsilon\). In words: the real deviation is at most the initial offset compounded at rate \(L\) over the whole horizon, plus each instant’s push compounded for the time that remains. Because \(L\) is the largest growth rate allowed and \(c_B\epsilon\) the largest push, this is a ceiling, not a forecast; the true deviation can be much smaller, for example when the dynamics contract or the push changes direction. With \(\|\Delta u\|\le c_u\epsilon\), this gives \(\|\Delta z(t)\|\le C_0(T)\epsilon\) and \(C_0(T)=O(e^{LT})\).

The same forcing appears in the linear prediction \(\dot{\hat\xi}=A\hat\xi+B\Delta u\): variation of constants gives

\[ \|\hat\xi(t)\|\le \kappa_\Phi c_x e^{LT}\epsilon+\kappa_\Phi\frac{c_B}{L}\bigl(e^{LT}-1\bigr)\epsilon, \]

so zero initial data with a nonzero \(\epsilon\)-scaled push does not stay zero. The linear prediction follows the same compound-interest arithmetic, with the extra prefactor \(\kappa_\Phi\) from the propagator bound. The Taylor remainder \(R_2\) is the integral form of Taylor’s theorem with variation of constants and Gronwall (see Khalil, Nonlinear Systems, sensitivity equations). Then \(\|R_2(t)\|\le\frac12 HC_0(T)^2\epsilon^2\) and

\[ \|r(t)\|\le\frac12 \kappa_\Phi HC_0(T)^2\frac{e^{LT}-1}{L}\epsilon^2. \]

In words: at each instant, curvature injects error at a rate of at most \(\frac12 HC_0(T)^2\epsilon^2\); the linearized dynamics carry that error forward and can amplify it by up to \(\kappa_\Phi e^{L(t-s)}\) by time \(t\); the bound adds up those contributions. Because \(C_0\), \(\kappa_\Phi\), \(H\) and \(L\) do not depend on \(\epsilon\), halving \(\epsilon\) divides this certificate by four. That is a statement about the bound, not a measured scaling of \(r\).

The factor \(\frac{e^{LT}-1}{L}\) is the exact integral \(\int_{t_0}^t e^{L(t-s)}\,ds\), rather than the cruder \(Te^{LT}\) obtained by replacing the kernel by its largest value \(e^{LT}\); as \(L\to0\) it tends to \(T\). Think of a savings plan: an error deposited late in the horizon has less time to compound than one deposited at the start, so not every deposit earns the full factor \(e^{LT}\). With \(C_0(T)=O(e^{LT})\), the worst-case bound scales as \(O\!\left(\frac{e^{3LT}}{L}\epsilon^2\right)\) for large \(LT\); that is a certificate on \(\|r\|\), not a claim that the residual itself grows like \(e^{3LT}\).

This is a finite-horizon upper bound, with explicit dependence on amplification and tube size. 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-Space {Series,} {Part} 4: {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-Space Series, Part 4: Residuals and Curvature.” n.d. https://affinedrift.com/articles/tangent-hyperplanes-series/part-4-residuals-curvature.html.