Maths Applied1.4

All books

S05 — Sweeping the travel: from poses to the numbers an engineer reads

A suspension engineer does not read poses. They read curves: camber, toe, track and roll centre against wheel travel, and how those curves move when a hardpoint moves. otkd makes the curves by solving the corner once per frame and reading each pose through analysis/outputs.py. This notebook takes that pipeline apart: how a sweep is solved, how it keeps to one assembly of the corner, what each output is geometrically, how to differentiate a whole curve with respect to a hardpoint, and what changes when the road drives the corner instead of the arm.

Book: Maths Applied Chapter 1, Sections 1.2 to 1.4 (the curves) and the chapter index. Design: solvers/otkd/docs/problem-mapping.md §7 to §9 and config-layer.md §8. Every number here is otkd's own, solved live and cached, or read from the book's committed payloads.

The question. otkd turns one arm angle into 81 poses and the poses into camber and toe curves. Why does each pose start from the last, how much does a curve move when a hardpoint moves, and what changes if the road drives the corner instead of the arm?

By the end you can:

  • describe a sweep as natural-parameter continuation, and say what the warm start buys in iterations and in which root Newton finds
  • read otkd's branch_changed flag for what it measures, and check a suspect frame
  • define camber, toe, track change, instant centre and roll centre from a pose, and find each in analysis/outputs.py
  • differentiate a re-solved curve with respect to a hardpoint by finite differences and by the implicit-function theorem, and say which costs less
  • say what driving ride height changes in the problem, and what it does not

Assumes: M01 (step choice), M02 (Newton, basins), M03 (LU, SVD), S01–S04 (the corner, its rows, otkd's API).

How to use it: predict before you reveal, commit before you check, and move the controls until the equation's behaviour stops surprising you.

Predict first. Try first: otkd sweeps the lower arm from −0.10-0.10 to +0.10+0.10 rad, but with 2 frames instead of 81. Frame 2 is solved from frame 1's pose, 0.2 rad away. What does otkd report for frame 2?

Choose a prediction

Check answer (without scripting)

Answer: The right pose, flagged branch_changed. The step stays inside Newton's basin, so the pose is the 81-frame sweep's last pose to round-off. But the upper arm's frame origin moved more than 0.05 m, so the distance test fires: a false alarm.

Warm-up: remember

1. Which null space of the constraint Jacobian JJ holds the motions the joints allow?

Question 1
How sure?

2. A consistent redundant model is solved with different row weights. What changes?

Question 2
How sure?

3. The axle's outboard unit vector has nz=−0.0157n_z = -0.0157. With otkd's convention camber=arcsin⁡(−nz)\text{camber} = \arcsin(-n_z), the camber is

Question 3
How sure?

Show answers and explanations

1. The right null space: motions dq with J dq = 0. A motion that changes no row to first order is a vector vv with Jv=0Jv = 0. Its dimension n−rn - r is the mobility.

2. Nothing that matters: the same pose, perhaps a different iteration path. The zero-residual point is the minimum for every positive weighting. Weights change the conditioning and the path, not where the iteration ends.

3. about +0.9 degrees: the top of the wheel leans out. arcsin⁡(0.0157)=0.90°\arcsin(0.0157) = 0.90°. The outboard end of the axle dips, so the wheel plane tips its top outboard: positive camber.

1. A sweep is a sequence of solves

Setting: the problem, its sets and its symbols

Problem. Given the geometry gg (fixed) and the drive grid θk=θ0+k Δθ\theta_k = \theta_0 + k\,\Delta\theta, find poses qkq_k with r(qk,θk)=0r(q_k, \theta_k) = 0 for every kk, each by Newton seeded from qk−1q_{k-1}; and measure how far a seed lies from the converged pose, for the previous-pose and the tangent predictors, as a function of Δθ\Delta\theta.

Symbol In Meaning
θ\theta [−0.10, 0.10][-0.10,\ 0.10] lower-arm angle, the drive (rad)
kk {0,…,N−1}\{0, \dots, N-1\} frame index
NN {2,3,5,9,17,41,81}\{2, 3, 5, 9, 17, 41, 81\} frames in the sweep
Δθ\Delta\theta R>0\mathbb{R}_{>0} step between frames, 0.2/(N−1)0.2/(N-1) (rad)
qq R21\mathbb{R}^{21} pose unknowns: position (m) and unit quaternion of each of lca, uca, up
gg R67\mathbb{R}^{67} geometry numbers: 10 points, 4 site frames, the tie-rod length (m)
rr R21×R→R21\mathbb{R}^{21} \times \mathbb{R} \to \mathbb{R}^{21} the rows: 17 joint, 1 driver, 3 quaternion norms (m, rad, 1)
JqJ_q R21×21\mathbb{R}^{21 \times 21} ∂r/∂q\partial r / \partial q at a pose
q′q' R21\mathbb{R}^{21} tangent dq/dθdq/d\theta of the solution path (m/rad, 1/rad)
ee R≥0\mathbb{R}_{\ge 0} seed error, max⁡i∣qi−seedi∣\max_i \lvert q_i - \text{seed}_i \rvert (mixed units)
How these symbols connect

Fixing the geometry g∈R67g \in \mathbb{R}^{67} reduces the residual r(q,θ)r(q, \theta) to a family of 21 equations in 21 pose unknowns q∈R21q \in \mathbb{R}^{21}, parametrised by the lower-arm angle θ∈[−0.10,0.10]\theta \in [-0.10, 0.10] rad. Discretising that interval into NN frames gives the grid θk\theta_k with step Δθ=0.2/(N−1)\Delta\theta = 0.2/(N - 1) rad, and solving r(qk,θk)=0r(q_k, \theta_k) = 0 sequentially from the previous pose qk−1q_{k-1} traces out the solution path. Differentiating the identity r(q(θ),θ)=0r(q(\theta), \theta) = 0 links the Jacobian JqJ_q to the path tangent q′=dq/dθq' = dq/d\theta, letting us compare the seed error ee of the previous-pose seed qk−1q_{k-1} against the tangent predictor qk−1+q′Δθq_{k-1} + q'\Delta\theta.

Symbol-by-symbol notes
$q$ — 21 pose unknowns (mixed units)

Each of the three moving bodies (lca, uca, up) contributes 7 numbers: 3 translation components in metres and 4 dimensionless unit-quaternion components. Because positions and quaternion entries sit in one vector, norms and seed errors on qq combine metres and dimensionless numbers.

$g$ — fixed geometry numbers

All 67 scalar parameters resolved from geometry.yaml (10 points, 4 site frames, and the tie-rod length, in metres and dimensionless frame entries). They stay constant across every frame of a sweep; only the drive θk\theta_k changes from frame to frame.

$r$ — the 21 residual rows

At each drive angle θk\theta_k, r(q,θk)=0r(q, \theta_k) = 0 enforces 17 locked joint constraints (metres or dimensionless rotation components), 1 driver row setting the lower-arm angle (rad), and 3 unit-quaternion norm rows (dimensionless). Matching 21 rows to 21 unknowns makes every frame a square nonlinear system.

$J_q$ and $q'$ — Jacobian and path tangent

Jq=∂r/∂q∈R21×21J_q = \partial r / \partial q \in \mathbb{R}^{21 \times 21} is the derivative of all 21 rows with respect to the pose qq at fixed θ\theta. Where JqJ_q is nonsingular, differentiating r(q(θ),θ)=0r(q(\theta), \theta) = 0 yields Jq q′=−∂r/∂θJ_q\,q' = -\partial r / \partial \theta for the tangent q′=dq/dθq' = dq/d\theta, in m/rad for positions and 1/rad for quaternion components.

$e$ — seed error

The infinity norm max⁡i∣qi−seedi∣\max_i \lvert q_i - \text{seed}_i \rvert between a predictor's starting guess and the converged pose qq at the same angle. It measures how close the seed starts in pose space, in mixed units, before Newton iterates.

double-wishbone/study.yaml drives the lower arm's angle θ\theta from -0.10 to 0.10 rad in 81 frames. Each frame is one square nonlinear system: 21 rows r(q,θ)=0r(q, \theta) = 0 in the 21 pose unknowns qq (S02). Solving them one after another, with θ\theta as the parameter, is natural-parameter continuation:

θk+1=θk+Δθ,qk+1=Newton(r(⋅,θk+1), seed=qk).\theta_{k+1} = \theta_k + \Delta\theta, \qquad q_{k+1} = \text{Newton}\big(r(\cdot, \theta_{k+1}),\ \text{seed} = q_k\big).

The seed is the last solution, the simplest predictor. How far is it from the answer? Expand the solution path: q(θ+Δθ)=q(θ)+q′(θ) Δθ+O(Δθ2)q(\theta + \Delta\theta) = q(\theta) + q'(\theta)\,\Delta\theta + O(\Delta\theta^2). So the previous pose is wrong by O(Δθ)O(\Delta\theta), an order-1 predictor in M01's sense. The tangent q′q' comes free from differentiating r(q(θ),θ)=0r(q(\theta), \theta) = 0:

Jq q′+∂r∂θ=0⇒q′=−Jq−1 ∂r∂θ,J_q\, q' + \frac{\partial r}{\partial \theta} = 0 \quad\Rightarrow\quad q' = -J_q^{-1}\,\frac{\partial r}{\partial \theta},

and seeding from qk+q′Δθq_k + q'\Delta\theta (an Euler predictor) leaves an O(Δθ2)O(\Delta\theta^2) error. otkd uses the plain previous pose. The chart measures both seeds' distance from the converged pose at the design frame, for steps from 10−410^{-4} to 0.30.3 rad.

10⁻⁴10⁻³10⁻²10⁻¹10⁻⁸10⁻⁶10⁻⁴10⁻²previous pose (otkd)tangent predictorstep Δθ (rad)seed error, max |q − seed|

Predict first. The slopes are 1.00 and 2.00: orders 1 and 2. Now go from 81 frames to 5, so the step grows 20 times (0.0025 to 0.05 rad) and the seed error with it. Newton's iterations per frame

Choose a prediction

Check answer (without scripting)

Answer: rise by about one. Quadratic convergence: ek+1≈Cek2e_{k+1} \approx C e_k^2. A seed 20 times worse needs one more squaring to reach 10−1210^{-12}. The table shows 3 iterations becoming 4.

Figure 1
Reveal result (lock in your prediction above first)
frames step (rad) iterations, frame 1 (from design) mean iterations, later frames
2 0.2000 4 4.00
3 0.1000 4 4.00
5 0.0500 4 4.00
9 0.0250 4 3.00
17 0.0125 4 3.00
41 0.0050 4 3.00
81 0.0025 4 3.00

At 81 frames each later frame needs 3.00 iterations. Frame 1 always starts from the design pose, 0.1 rad away, so it always pays 4. The sweep's cost is set by the number of frames, not by the iterations per frame: halving the frame count halves the work and adds at most one iteration. The single-frame solves behind the chart say the same: from the design pose, the previous-pose seed needs 2 iterations at a step of 1e-04 rad and 5 at 0.32 rad; the tangent seed needs 1 and 4.

So why 81 frames? Not for Newton. For the curve: an engineer reads camber at every millimetre of travel, and a figure draws through the frames. The step is set by what you want to read, and the warm start makes small steps nearly free.

When natural-parameter continuation breaks
  • Assumes: the pose is a smooth function of the drive with JqJ_q nonsingular along the path, and the step is small next to the distance to the nearest other root.
  • When it fails: at a fold, where JqJ_q turns singular and the path turns back: past about 1.23 rad of arm angle there is no solution to step to, and Newton stops converging.
  • Check: read frame.singular_values[-1] along the sweep; a smallest singular value falling towards zero, and iteration counts rising, say a fold is near.

2. Why the warm start keeps Newton on one assembly

Setting: the problem, its sets and its symbols

Problem. Given a seed pose qsq_s with r(qs,θs)=0r(q_s, \theta_s) = 0 on the design assembly and a target angle θt\theta_t, find which solution of r(q,θt)=0r(q, \theta_t) = 0 damped Newton reaches from qsq_s within KK iterations: one on A0A_0, one on A1A_1, or none.

Symbol In Meaning
θs\theta_s [−0.8, 0][-0.8,\ 0] seed angle (rad); θs=0\theta_s = 0 is the design pose
θt\theta_t {0.5, 0.8}\{0.5,\ 0.8\} target angle (rad)
qsq_s R21\mathbb{R}^{21} seed pose, the solution at θs\theta_s
rr R21×R→R21\mathbb{R}^{21} \times \mathbb{R} \to \mathbb{R}^{21} the 21 rows (m, rad, 1)
A0, A1A_0,\ A_1 ⊂R21\subset \mathbb{R}^{21} the design assembly and the other assembly: solution sets, one pose per angle
ℓ\ell line in R3\text{line in } \mathbb{R}^3 kingpin axis, through the ball joints lbj and ubj (m)
ti, tot_i,\ t_o R3\mathbb{R}^3 tie-rod inner end tri (chassis) and outer end tro (upright) (m)
LL R>0\mathbb{R}_{>0} tie-rod length, the design separation ∥to−ti∥\lVert t_o - t_i \rVert (m)
KK 6060 Newton's iteration limit in solvers/newton.py
How these symbols connect

At any target angle θt\theta_t, the 21 equations r(q,θt)=0r(q, \theta_t) = 0 admit two valid poses, one on the design assembly A0A_0 and one on the other assembly A1A_1, arising from the two intersections of the upright's kingpin circle about ℓ\ell with the tie-rod sphere of radius LL centred at tit_i. Seeding damped Newton with a converged design-assembly pose qsq_s from an angle θs\theta_s tests which root's basin of attraction holds qsq_s, or whether Newton fails to converge within K=60K = 60 iterations. Varying θs\theta_s across [−0.8,0][-0.8, 0] rad maps out the regions that land on A0A_0, jump to A1A_1, or fail to converge.

Symbol-by-symbol notes
$\theta\lt em>s$, $q\lt /em>s$, and $\theta_t$ — seed versus target

qs∈R21q_s \in \mathbb{R}^{21} is always a converged solution on A0A_0 at the seed angle θs∈[−0.8,0]\theta_s \in [-0.8, 0] rad (with θs=0\theta_s = 0 giving the design pose). Newton then solves r(q,θt)=0r(q, \theta_t) = 0 at the target angle θt∈{0.5,0.8}\theta_t \in \{0.5, 0.8\} rad, so the step in angle is θt−θs\theta_t - \theta_s rad.

$A\lt em>0$ and $A\lt /em>1$ — the two assemblies

Both sets are solution branches of the same 21 equations r(q,θ)=0r(q, \theta) = 0, each containing one pose per arm angle. A0A_0 is the branch holding the car's design pose; A1A_1 is the second mathematical solution where the upright flips to the other intersection of the tie-rod constraint.

$\ell$, $t\lt em>i$, $t\lt /em>o$, and $L$ — geometry of the second root

Once the arms place lbj and ubj, the upright can only spin about the kingpin line ℓ\ell through them, so its outer tie-rod end tot_o lies on a circle. The tie-rod constraint demands ∥to−ti∥=L\lVert t_o - t_i \rVert = L (a sphere about the chassis point tit_i), and a circle meets a sphere in up to two points.

$K$ — Newton's iteration cap

The hard limit of 60 iterations in solvers/newton.py, with line-search damping. If the residual has not met tolerance within KK steps, otkd raises SolverError rather than returning an unconverged pose.

The corner has two assemblies at every arm angle. The upright is pinned to the arms at two ball joints, so once the arms are placed it can only spin about the line through them (the kingpin axis). The tie-rod's outer end then lies on a circle about that line, and the tie rod demands that it lie on a sphere about the inner end. A circle meets a sphere in two points: the design assembly and a second one. Both satisfy all 21 rows; only one is a car. Newton finds whichever root's basin holds the seed (M02).

Predict first. From the design pose (θ = 0), solve one frame at θ = 0.8 rad: eight times the sweep's half-travel in angle, 301 mm of wheel-centre travel. Newton

Choose a prediction

Check answer (without scripting)

Answer: lands on the design assembly. It does, in 7 iterations: the design assembly's basin around the design pose is wide for this corner. The other assembly is far away in pose space.

Reveal result (lock in your prediction above first)

One frame, seeded from the design pose at 0.8 rad: 7 iterations, and the pose matches the continuation path (0.01 rad steps) to 7.2e-14 in every body's rotation and position. The basin is wide here. To leave it the seed must come from far on the other side of the travel, which is what the strip below does.

Seed Newton from the design-assembly pose at angle θs\theta_s and ask for the frame at θ=0.5\theta = 0.5 rad, using otkd's own sweep with a two-value table law. The step is 0.5−θs0.5 - \theta_s, from 0.5 to 1.3 rad. Each dot is one such two-frame sweep, coloured by where frame 2 landed.

design assembly0.5no convergence1.16other assembly1.14step from the seed, 0.5 − θs (rad)

Seed -0.64 rad, step 1.14 rad. Frame 2: other assembly, 30 iterations. Camber 15.41° and toe 139.61°, against -8.90° and -4.04° on the design assembly. The arms differ from the design assembly's by 8.1e-16; the upright is turned 2.55 rad.

Over the strip: design assembly 22, no convergence 3, other assembly 1. Every escape needs a step of at least 1.14 rad, and the outcomes interleave: near a basin boundary a slightly different seed gives a different answer (M02). A sweep with 81 frames takes steps of 0.0025 rad, 456 times smaller than the smallest step here that escaped.

3. otkd's branch test, and what it cannot tell

Setting: the problem, its sets and its symbols

Problem. Given consecutive frames of a sweep, the seed qk−1q_{k-1} and the solution qkq_k, otkd sets bk=1b_k = 1 when some body BB has ϕB>ϕmax⁡\phi_B > \phi_{\max} or ∥pB(qk)−pB(qk−1)∥>dmax⁡\lVert p_B(q_k) - p_B(q_{k-1}) \rVert > d_{\max}. Decide whether bk=1b_k = 1 means qkq_k lies on a different assembly from qk−1q_{k-1}, and whether bk=0b_k = 0 means it does not.

Symbol In Meaning
BB {lca,uca,up}\{\texttt{lca}, \texttt{uca}, \texttt{up}\} the moving bodies
(pB,RB)(p_B, R_B) R3×SO(3)\mathbb{R}^3 \times SO(3) body pose: where the body carries the world origin (m), and its rotation
ϕB\phi_B [0,π][0, \pi] angle of RB(qk)TRB(qk−1)R_B(q_k)^{\mathsf T} R_B(q_{k-1}) (rad)
ϕmax⁡, dmax⁡\phi_{\max},\ d_{\max} R>0\mathbb{R}_{>0} thresholds _JUMP_ANGLE (rad) and _JUMP_DISTANCE (m)
bkb_k {0,1}\{0, 1\} branch_changed of frame kk
θ\theta [0, 1.22][0,\ 1.22] lower-arm angle for the long sweep (rad), steps of 0.01 rad
σmin⁡\sigma_{\min} R≥0\mathbb{R}_{\ge 0} smallest singular value of JqJ_q at a frame
How these symbols connect

After frame kk converges from seed qk−1q_{k-1} to pose qkq_k, otkd unpacks each moving body BB's translation and rotation (pB,RB)∈R3×SO(3)(p_B, R_B) \in \mathbb{R}^3 \times SO(3) at both poses and computes the relative rotation angle ϕB\phi_B and origin displacement ∥pB(qk)−pB(qk−1)∥\lVert p_B(q_k) - p_B(q_{k-1}) \rVert. Comparing those two quantities against the fixed thresholds ϕmax⁡\phi_{\max} and dmax⁡d_{\max} sets the binary flag bk∈{0,1}b_k \in \{0, 1\}. Extending the sweep in θ\theta out to 1.221.22 rad while tracking the smallest singular value σmin⁡\sigma_{\min} of JqJ_q then shows how approaching a singular Jacobian interacts with this step-size test.

Symbol-by-symbol notes
$(p\lt em>B, R\lt /em>B)$ — what $p_B$ actually tracks

Each body's pose pairs a position vector pB∈R3p_B \in \mathbb{R}^3 (m) with a rotation matrix RB∈SO(3)R_B \in SO(3) built from its unit quaternion. Because a body's local frame coincides with the world frame at the design pose, pB(q)p_B(q) is where body BB has carried the world origin, not a joint or centroid on the body.

$\phi_B$ — relative rotation angle

The geodesic angle in [0,π][0, \pi] rad between RB(qk)R_B(q_k) and RB(qk−1)R_B(q_{k-1}), from cos⁡ϕB=(tr⁡(RB(qk)TRB(qk−1))−1)/2\cos\phi_B = (\operatorname{tr}(R_B(q_k)^{\mathsf T} R_B(q_{k-1})) - 1)/2. It measures how far body BB turned in one frame step, independent of its translation pBp_B.

$\phi\lt em>{\max}$ and $d\lt /em>{\max}$ — step thresholds

Constants _JUMP_ANGLE (rad) and _JUMP_DISTANCE (m) in solvers/sweep.py. Exceeding either threshold on any single moving body B∈{lca,uca,up}B \in \{\texttt{lca}, \texttt{uca}, \texttt{up}\} sets bk=1b_k = 1.

$b\lt em>k$ — the branchchanged flag

A per-frame boolean (00 or 11) recorded by the sweep; setting bk=1b_k = 1 never stops or alters the solve. This section tests what bk=1b_k = 1 and bk=0b_k = 0 can and cannot establish about staying on one assembly.

$\sigma_{\min}$ — distance to a singular Jacobian

The smallest singular value of Jq∈R21×21J_q \in \mathbb{R}^{21 \times 21} at frame kk, in mixed residual-to-pose units. As σmin⁡→0\sigma_{\min} \to 0, JqJ_q approaches singularity and the path tangent q′=−Jq−1∂r/∂θq' = -J_q^{-1}\partial r/\partial\theta grows rapidly per unit step in θ\theta.

Back to the opening prediction: the sweep from −0.10-0.10 to +0.10+0.10 rad with 2 frames, so frame 2 is seeded from a pose 0.2 rad away.

Reveal result (lock in your prediction above first)

Frame 2 took 4 iterations and converged to a pose within 4.8e-13 of the 81-frame sweep's last frame: the same assembly. It is flagged branch_changed all the same (at θ = 0.10 rad). The flag fired on a correct frame.

The test is _jumped in solvers/sweep.py. For every body it compares the solved pose with the seed: the angle ϕ\phi of the relative rotation, from cos⁡ϕ=(tr⁡(RsolvedTRseed)−1)/2\cos\phi = (\operatorname{tr}(R_{\text{solved}}^{\mathsf T} R_{\text{seed}}) - 1)/2, against 0.25 rad, and the distance between the two body positions pp against 0.05 m. Either one over raises the flag; nothing stops the sweep (problem-mapping.md §7: recorded, never raised).

What is pp? A body's local frame is the world frame at the design position (config/geometry.py), so pp is where the body has carried the world origin. The upper arm's hinge line passes 0.608 m from the world origin, so turning that arm by ϕ\phi moves its pp by about 0.608 m times ϕ\phi. From the design pose the flag first fires at a lower-arm step of 0.06 rad: the upper arm turns 0.0828 rad, and 0.608 × 0.0828 = 0.0503 m against the measured 0.0503 m, just over the threshold. That frame agrees with a fine continuation to 3.0e-12: a false alarm. The distance test is in metres at a point chosen by where the model's origin happens to be.

source: `open_textbook.otkd.solvers.sweep._jumped` — `solvers/otkd/src/open_textbook/otkd/solvers/sweep.py:251`

The whole branch test: one pose comparison per body.

def _jumped(problem: Problem, q: np.ndarray, seed: np.ndarray) -> bool:
    a = problem.poses(q)
    b = problem.poses(seed)
    for body in a:
        delta = a[body][1].T @ b[body][1]
        angle = float(np.arccos(np.clip((np.trace(delta) - 1.0) / 2.0, -1.0, 1.0)))
        if angle > _JUMP_ANGLE or np.linalg.norm(a[body][0] - b[body][0]) > _JUMP_DISTANCE:
            return True
    return False

The flag has a second blind side. Sweep on past the travel, from 0 to 1.22 rad in 0.01 rad steps. As θ\theta grows the smallest singular value of JqJ_q falls towards zero: a fold is near, where two solutions of the rows merge and the path in θ\theta turns back. Close to it the pose moves fast for each step in θ\theta, so a step that was harmless at design now moves the upright over 0.05 m.

00.3050.610.9151.220.005770.02720.04860.070.0914lower-arm angle θ (rad)smallest singular value of J
00.3050.610.9151.22-0.005840.02140.04870.07590.103not flaggedflaggedlower-arm angle θ (rad)upright's p moved this step (m)

Flagged frames: θ = 1.18 to 1.22 rad, where σ_min is down to 0.0104 (from 0.0857 at design) and the toe has swung to -79.8°. Are they a different assembly? Continue back from 1.22 rad to 1.10 rad, before the first flag, in 0.01 rad steps: the pose returns to the forward sweep's pose there to 3.1e-15. Same assembly all the way; every flag was a false alarm. One frame further, at 1.25 rad, Newton does not converge: natural-parameter continuation cannot step round a fold. Arc-length continuation, which takes the arc length along the path as the parameter instead of θ\theta, can.

When the branch test breaks
  • Assumes: a step on one assembly moves every body less than 0.25 rad and 0.05 m, and a switch to another assembly moves some body more.
  • When it fails: a coarse step (0.06 rad from design) or any step near a fold trips it on the same assembly; two assemblies that are close, near a fold, can swap without tripping it.
  • Check: refine the step and see whether the flag goes; or continue back to the design drive and see whether the design pose comes back.

4. From a pose to the numbers an engineer reads

Setting: the problem, its sets and its symbols

Problem. Given a solved pose qq and the design reference (heading ψ0\psi_0, contact point c0c_0, hinge lines), compute camber γ\gamma, toe τ\tau, track change Δt\Delta t, instant centre II and roll centre CC, each a function of qq; and trace them over the sweep as functions of wheel-centre travel ss.

Symbol In Meaning
qq R21\mathbb{R}^{21} solved pose of a frame
w, wow,\ w_o R3\mathbb{R}^3 wheel centre wc and outer axle point wco (m); xx outboard, yy forward, zz up
nn S2S^2 axle unit vector (wo−w)/∥wo−w∥(w_o - w)/\lVert w_o - w \rVert
γ\gamma [−90,90][-90, 90] camber (degrees), positive top outboard
ψ, ψ0\psi,\ \psi_0 (−180,180](-180, 180] axle heading in plan view, now and at design (degrees)
τ\tau (−180,180](-180, 180] toe ψ−ψ0\psi - \psi_0, wrapped (degrees), positive toe-in
m, cm,\ c R3\mathbb{R}^3 axle midpoint and contact point (m)
rr R>0\mathbb{R}_{>0} tyre radius, scalars.tyre-radius (m)
Δt\Delta t R\mathbb{R} track change, cx−c0,xc_x - c_{0,x} (mm)
II R2\mathbb{R}^2 instant centre in the front view (x,z)(x, z) (m)
CC {0}×R\{0\} \times \mathbb{R} roll centre on the centreline x=0x = 0 (m)
ss R\mathbb{R} wheel-centre travel, wzw_z minus its design value (mm)
How these symbols connect

From each solved pose q∈R21q \in \mathbb{R}^{21}, otkd evaluates the world positions of the axle points w,wow, w_o and the ball joints, then forms the unit axle vector n∈S2n \in S^2 and the rim contact point c∈R3c \in \mathbb{R}^3 using the tyre radius rr. Camber γ\gamma and heading ψ\psi come directly from the components of nn, with toe τ=ψ−ψ0\tau = \psi - \psi_0 and track change Δt=cx−c0,x\Delta t = c_x - c_{0,x} referenced to design; meanwhile the projected arm lines meet at the instant centre II, and the line from cc through II crosses x=0x = 0 at the roll centre CC. Plotting all five outputs against wheel-centre travel ss turns a sequence of 21-dimensional poses into the curves an engineer reads.

Symbol-by-symbol notes
$w$, $w_o$, and $n$ — axle points and unit vector

ww (wc) is the wheel centre and wow_o (wco) lies further outboard along the spindle, both in metres in the chassis frame (xx outboard, yy forward, zz up). Normalising wo−ww_o - w gives the dimensionless unit vector n∈S2n \in S^2 from which camber and toe are read.

$\gamma$, $\psi$, and $\tau$ — camber versus toe

Camber γ=arcsin⁡(−nz)\gamma = \arcsin(-n_z) (degrees) measures vertical tilt (positive top outboard), whereas heading ψ=atan2⁡(ny,nx)\psi = \operatorname{atan2}(n_y, n_x) (degrees) measures direction in plan view. Toe τ=ψ−ψ0\tau = \psi - \psi_0 is wrapped to (−180,180](-180, 180] degrees and records the heading change from design (positive toe-in on this right-hand corner).

$m$, $r$, $c$, and $\Delta t$ — rim contact point and track change

With no road body in the model, the contact point cc sits one tyre radius rr (scalars.tyre-radius, m) below the axle midpoint m=(w+wo)/2m = (w + w_o)/2 in the wheel plane. Track change Δt=cx−c0,x\Delta t = c_x - c_{0,x} is reported in millimetres (1000×1000\times the change in metres) and tracks sideways movement of cc.

$I$ and $C$ — instant centre and roll centre

Both live in the front (x,z)(x, z) view in metres: I∈R2I \in \mathbb{R}^2 is where the two arm lines meet in the front plane, and C∈{0}×RC \in \{0\} \times \mathbb{R} is where the line from cc through II crosses the centreline x=0x = 0. The roll-centre height plotted below is Cz−c0,zC_z - c_{0,z}, converted to millimetres.

$s$ — wheel-centre travel

Defined as 1000 (wz−w0,z)1000\,(w_z - w_{0,z}) in millimetres, so s=0s = 0 at design, positive in bump and negative in droop. Using ss instead of θ\theta on the horizontal axis lets curves be compared across different drive laws.

A solved frame is a pose: every body's position and rotation. analysis/outputs.py turns it into five numbers, each a piece of geometry. Write ww and wow_o for the wheel centre and a point further out on the axle (roles.axle: [wc, wco]), and n=(wo−w)/∥wo−w∥n = (w_o - w)/\lVert w_o - w \rVert for the axle's unit vector; xx points outboard, yy forward, zz up.

source: `open_textbook.otkd.analysis.outputs.compute` — `solvers/otkd/src/open_textbook/otkd/analysis/outputs.py:84`
def compute(problem: Problem, q: np.ndarray, reference: Reference) -> Outputs:
    poses = problem.poses(q)
    points = problem.world_points(q)
    p_ref, r_ref = poses[problem.resolved.reference]

    def to_ref(point: np.ndarray) -> np.ndarray:
        return r_ref.T @ (point - p_ref)

    axle = _axle(problem, points)
    heading = float(np.arctan2(axle[1], axle[0]))
    toe = float(
        np.degrees(np.arctan2(np.sin(heading - reference.heading), np.cos(heading - reference.heading)))
    )
    camber = float(np.degrees(np.arcsin(np.clip(-axle[2], -1.0, 1.0))))
    contact = to_ref(_contact(problem, points, poses, axle, reference.tyre_radius))
    track = float(contact[0] - reference.contact[0])

    ic = None
    rc = None
    if reference.lines is not None:
        structure = _front_view(problem)
        assert structure is not None
        lbj, _, ubj, _ = structure
        lower = to_ref(points[lbj])
        upper = to_ref(points[ubj])
        ic = _intersect(
            (
                np.array([lower[0], lower[2]]),
                np.array([reference.lines[0][1][0] - lower[0], reference.lines[0][1][2] - lower[2]]),
            ),
            (
                np.array([upper[0], upper[2]]),
                np.array([reference.lines[1][1][0] - upper[0], reference.lines[1][1][2] - upper[2]]),
            ),
        )
        if ic is not None:
            rc = _roll_centre(contact, ic)

    return Outputs(
        camber=camber,
        toe=toe,
        ic=ic,
        rc=rc,
        track=track,
        # Always reported: the solved patch where there is a road, the lowest point of the
        # wheel where there is not. A figure wants it either way.
        contact=(float(contact[0]), float(contact[2])),
    )
source: `open_textbook.otkd.analysis.outputs._contact` — `solvers/otkd/src/open_textbook/otkd/analysis/outputs.py:168`
def _contact(
    problem: Problem,
    points: dict[str, np.ndarray],
    poses: dict[str, tuple[np.ndarray, np.ndarray]],
    axle: np.ndarray,
    radius: float,
) -> np.ndarray:
    a, b = problem.resolved.axle
    centre = 0.5 * (points[a] + points[b])
    road = problem.resolved.road
    if road is not None:
        for joint in problem.resolved.joints.values():
            if joint.family == "plane" and joint.a == road:
                p_a, r_a = poses[joint.a]
                site = problem.resolved.sites[joint.from_]
                normal = _unit(r_a @ site.normal)
                distance = float(normal @ (centre - (p_a + r_a @ site.origin)))
                return centre - distance * normal
    down = -np.array([0.0, 0.0, 1.0])
    in_plane = down - float(down @ axle) * axle
    return centre + radius * _unit(in_plane)
source: `open_textbook.otkd.analysis.outputs._roll_centre` — `solvers/otkd/src/open_textbook/otkd/analysis/outputs.py:271`
def _roll_centre(contact: np.ndarray, ic: tuple[float, float]) -> tuple[float, float] | None:
    x_c, z_c = float(contact[0]), float(contact[2])
    x_i, z_i = ic
    if abs(x_i - x_c) < 1e-12:
        return None
    t = (0.0 - x_c) / (x_i - x_c)
    return (0.0, float(z_c + t * (z_i - z_c)))

Predict first. Over the sweep the wheel centre rises 85.0 mm. The roll centre

Choose a prediction

Check answer (without scripting)

Answer: falls, by roughly three quarters of the wheel's rise. It falls 65.7 mm, from 52.2 mm to -13.5 mm above the ground: 0.77 mm per mm of wheel travel. The instant centre swings down and towards the wheel as the arms rotate, and the roll centre follows.

Reveal result (lock in your prediction above first)
-42.4-21.20.063521.342.5-1.25-0.683-0.1150.4531.02otkd, solved herebook payloadwheel-centre travel (mm)camber (°)
output droop (-42.4 mm) design bump (+42.5 mm) max gap to payload
camber (°) 0.8992 0.0000 -1.1287 5.0e-05
toe (°) 0.6514 0.0000 -0.6224 4.9e-05
track (mm) -2.9497 0.0000 -1.2005 4.9e-04
rc height (mm) 52.1794 18.4880 -13.5364 4.9e-04
ic x (m) -2.2892 -1.6223 -1.1438 4.9e-07

The last column compares this notebook's live solve with the book's committed payload frame by frame; the payload rounds angles to 4 decimals, so a gap below 5e-05 degrees is agreement. "rc height" is above the ground, the contact point's height at design (120 mm in model coordinates). At design it is 18.5 mm; Section 1.2's front-view table gives 19 mm. The instant centre at design is 1.62 m across the centreline, 2.43 m from the contact point in x; it sits so far out because the arms are nearly parallel.

When the front-view instant centre breaks
  • Assumes: both hinge axes are perpendicular to the front view, so each arm's motion is a rotation in that view.
  • When it fails: with tilted axes it is an approximation of order the tilt; with parallel lines there is no intersection and ic and rc are None.
  • Check: look at the hinge directions in geometry.yaml, and treat None as a result: the arms are parallel in front view at that frame.

5. Sensitivity by finite differences

Setting: the problem, its sets and its symbols

Problem. Given the design geometry g0g_0 and the re-solved toe curve τ(s;Δ)\tau(s; \Delta) when the height of tri changes by Δ\Delta, find the derivative y′(0)y'(0) of the full-bump toe y(h)y(h) by the central difference D(h)D(h), and the step hh that makes D(h)D(h) most accurate.

Symbol In Meaning
g0, g(h)g_0,\ g(h) R67\mathbb{R}^{67} geometry numbers; g(h)g(h) has point.tri.2 +h+ h and the tie-rod length reset to ∥to−ti∥\lVert t_o - t_i \rVert (m)
Δ\Delta {−10,−5,0,5,10}\{-10, -5, 0, 5, 10\} height change of tri for whole re-solved sweeps (mm)
ss R\mathbb{R} wheel-centre travel (mm)
τ(s;Δ)\tau(s; \Delta) R\mathbb{R} toe at travel ss on the geometry moved by Δ\Delta (degrees)
yy R→R\mathbb{R} \to \mathbb{R} toe at the full-bump frame (θ=0.1\theta = 0.1 rad) after re-solving with g(h)g(h) (degrees)
hh [10−10, 10−1][10^{-10},\ 10^{-1}] finite-difference step (m)
D(h)D(h) R\mathbb{R} (y(h)−y(−h))/2h(y(h) - y(-h))/2h (degrees per m)
ϵ\epsilon ≈2.2×10−16\approx 2.2 \times 10^{-16} machine epsilon (M01)
How these symbols connect

Perturbing the height coordinate of tri in the design geometry g0∈R67g_0 \in \mathbb{R}^{67} by Δ\Delta (in mm for whole-sweep plots) or ±h\pm h (in m for derivatives), and resetting the tie-rod length to the new design separation, produces a modified geometry g(h)g(h) and a re-solved toe curve τ(s;Δ)\tau(s; \Delta). Fixing the drive at the full-bump frame (θ=0.1\theta = 0.1 rad) defines the scalar function y(h)y(h) of toe (degrees) against the perturbation hh (m). Forming the central difference D(h)=(y(h)−y(−h))/(2h)D(h) = (y(h) - y(-h))/(2h) estimates y′(0)y'(0) in degrees per metre, trading truncation error against floating-point noise scaled by machine epsilon ϵ\epsilon.

Symbol-by-symbol notes
$g_0$ and $g(h)$ — why the tie-rod length resets too

g(h)∈R67g(h) \in \mathbb{R}^{67} adds hh (m) to point.tri.2 and resets length.tie-rod to ∥to−ti∥\lVert t_o - t_i \rVert at the new design points. That keeps the design pose assembled at θ=0\theta = 0, matching what Problem.solve does when resolving geometry.yaml.

$\Delta$ versus $h$ — unit distinction

Both perturb the same coordinate (point.tri.2), but Δ∈{−10,−5,0,5,10}\Delta \in \{-10, -5, 0, 5, 10\} is in millimetres for visualising whole re-solved sweeps τ(s;Δ)\tau(s; \Delta), whereas h∈[10−10,10−1]h \in [10^{-10}, 10^{-1}] is in metres so D(h)D(h) has units of degrees per metre.

$y(h)$ and $D(h)$ — re-solved output and central difference

Each evaluation of y(h)y(h) runs Newton on r(q,g(h),0.1)=0r(q, g(h), 0.1) = 0 and reads toe from analysis/outputs.py (degrees). The central difference D(h)=(y(h)−y(−h))/(2h)D(h) = (y(h) - y(-h))/(2h) therefore costs two nonlinear solves per step hh.

$\epsilon$ — machine epsilon

IEEE 754 double-precision unit round-off, 2−52≈2.2×10−162^{-52} \approx 2.2 \times 10^{-16} (dimensionless). It sets the floating-point floor inside both Newton's residual and the difference y(h)−y(−h)y(h) - y(-h).

Geometry is an argument of the derived functions, not part of them: Problem.solve(geometry) reuses the derivation and only re-resolves the numbers (entry-points.md §4). So a hardpoint study is a loop of re-solved sweeps, about a second each after the one compile. Move the inner tie-rod point tri up or down and watch the toe curve. The tie-rod length is not given in geometry.yaml, so it defaults to the new design separation and the design pose still assembles.

-42.4-21.20.063221.342.5-1.02-0.5020.01780.5381.06design geometrytri +5 mmwheel-centre travel (mm)toe (°)

Toe at full bump: -0.622° on the design geometry; -0.048° with tri -10 mm, -0.335° with tri -5 mm, -0.911° with tri +5 mm, -1.199° with tri +10 mm. Every curve passes through zero at design, because toe is measured from the design heading of its own geometry. Moving tri changes the curve's slope.

One frame is enough to study the step. Take the full-bump frame, perturb the geometry vector gg directly (the height of tri by ±h\pm h, and the tie-rod length to the new separation, as resolving the geometry would), and re-solve with Newton seeded from the unperturbed pose: a warm start in gg instead of in θ\theta. The outputs read only the axle points wc and wco, which nothing here moves, so compute can use the base model's reference.

Predict first. Differentiate toe at full bump with respect to the height of tri by a central difference, (y(h)−y(−h))/2h(y(h) - y(-h))/2h, re-solving the frame each time. Newton converges to about 10−1210^{-12} in the residual. Which step hh (metres) gives the most accurate derivative?

Choose a prediction

Check answer (without scripting)

Answer: somewhere near 1e-6 m, where M01 put the best central step. Truncation ∝h2\propto h^2 against noise ∝ϵ/h\propto \epsilon/h puts the best step near ϵ1/3\epsilon^{1/3} times the input's scale. The scan has a flat floor around it.

Reveal result (lock in your prediction above first)
10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²10⁻¹⁰10⁻⁸10⁻⁶10⁻⁴10⁻²step h (m)|central difference − reference| (°/m)

The reference is §6's implicit-function value, -57.577496 °/m, which needs no step in g. Smallest error at h = 1.0e-06 m (1.1e-10 °/m). From 3e-07 to 1e-04 m the error stays between 1.1e-10 and 5.6e-08 °/m: a floor, on which the lowest point is luck. At 1 mm the error is 6.5e-06 °/m, second-order truncation: 117 times the top of the floor, yet only 1e-07 relative. At 1e-10 m it is 8.3e-05 °/m: the round-off side of M01's V. The floor is low because Newton's last step squares an error that was already near 1e-12.

When a finite-difference sensitivity breaks
  • Assumes: both re-solves converge to the same assembly, tightly, so the output noise is near round-off and the response is smooth over ±h\pm h.
  • When it fails: too small an hh divides solver noise by hh; too large an hh adds O(h2)O(h^2) truncation and can cross a branch or a fold.
  • Check: scan hh over decades and use the plateau; check one value against the implicit-function derivative.

6. Sensitivity by the implicit-function theorem

Setting: the problem, its sets and its symbols

Problem. Given a solved frame, r(qk,g0,θk)=0r(q_k, g_0, \theta_k) = 0 with JqJ_q nonsingular, find dq/dgjdq/dg_j and dy/dgjdy/dg_j for each geometry number gjg_j in H\mathcal{H} and each output y∈{γ,τ}y \in \{\gamma, \tau\}, from the identity r(q(g),g,θk)=0r(q(g), g, \theta_k) = 0 near g0g_0.

Symbol In Meaning
kk {0,…,80}\{0, \dots, 80\} frame index of the design sweep
qkq_k R21\mathbb{R}^{21} solved pose at frame kk
gg R67\mathbb{R}^{67} geometry numbers, near the design values g0g_0 (m)
H\mathcal{H} 8×3 numbers8 \times 3 \text{ numbers} coordinates of lcaf, lcar, ucaf, ucar, lbj, ubj, tri, tro
JqJ_q R21×21\mathbb{R}^{21 \times 21} ∂r/∂q\partial r / \partial q at (qk,g0)(q_k, g_0)
JgJ_g R21×67\mathbb{R}^{21 \times 67} ∂r/∂g\partial r / \partial g at (qk,g0)(q_k, g_0); one column per number
yy R21→R\mathbb{R}^{21} \to \mathbb{R} an output of the pose: camber γ\gamma or toe τ\tau (degrees)
dy/dgjdy/dg_j R\mathbb{R} sensitivity (degrees per m; tables show degrees per mm)
How these symbols connect

Because the residual vanishes identically along the solution manifold r(q(g),g,θk)=0r(q(g), g, \theta_k) = 0 near g0g_0, differentiating with respect to gg yields the linear system Jq (dq/dg)=−JgJ_q\,(dq/dg) = -J_g at each solved frame (qk,g0)(q_k, g_0). Factorising the square 21×2121 \times 21 pose Jacobian JqJ_q once per frame gives every pose sensitivity dq/dgj∈R21dq/dg_j \in \mathbb{R}^{21} for gj∈Hg_j \in \mathcal{H} by back-substitution against the corresponding column of Jg∈R21×67J_g \in \mathbb{R}^{21 \times 67}, without re-solving Newton. Applying the chain rule ∇qy⋅(dq/dgj)\nabla_q y \cdot (dq/dg_j) then turns each pose sensitivity into the output sensitivity dy/dgjdy/dg_j for camber γ\gamma or toe τ\tau.

Symbol-by-symbol notes
$\mathcal{H}$ — the 24 hardpoint coordinates

The x,y,zx, y, z coordinates (indices 0, 1, 2, in metres) of the 8 named suspension hardpoints (lcaf, lcar, ucaf, ucar, lbj, ubj, tri, tro). They form a 24-entry subset of the 67-entry geometry vector gg.

$J\lt em>q$ — pose Jacobian (reused across all $g\lt /em>j$)

The square 21×2121 \times 21 matrix ∂r/∂q\partial r / \partial q evaluated at (qk,g0,θk)(q_k, g_0, \theta_k), the same Jacobian Newton forms at the converged pose. The implicit-function theorem requires JqJ_q to be nonsingular so that q(g)q(g) is locally unique and smooth.

$J_g$ — geometry Jacobian

The 21×6721 \times 67 matrix ∂r/∂g\partial r / \partial g at (qk,g0,θk)(q_k, g_0, \theta_k), where column jj measures how the 21 residual rows change when geometry number gjg_j is nudged at fixed pose qkq_k. Forming a column calls Problem.evaluate directly and needs no Newton solve.

$y$ and $dy/dg_j$ — output sensitivity and units

yy maps a pose q∈R21q \in \mathbb{R}^{21} to camber γ\gamma or toe τ\tau in degrees. Differentiating with respect to gjg_j (in metres) gives dy/dgjdy/dg_j in degrees per metre; dividing by 1000 converts it to degrees per millimetre for the ranking tables.

Central differences cost two re-solved sweeps per geometry number. There is a cheaper route. At every frame the rows vanish for every geometry near the design: r(q(g),g)=0r(q(g), g) = 0. Differentiate with respect to gg:

Jqdqdg+Jg=0⇒dqdg=−Jq−1Jg,dydg=∇qy⋅dqdg.J_q \frac{dq}{dg} + J_g = 0 \quad\Rightarrow\quad \frac{dq}{dg} = -J_q^{-1} J_g, \qquad \frac{dy}{dg} = \nabla_q y \cdot \frac{dq}{dg}.

JqJ_q is the Jacobian Newton already uses at the solved pose. JgJ_g, the rows' derivative with respect to one geometry number, needs no solve at all: here it is a central difference of Problem.evaluate in gg. Factorise JqJ_q once per frame (LU, M03) and every geometry number is one back-substitution. The output's gradient enters only along the direction dq/dgdq/dg, so one directional difference of compute finishes it. The theorem needs JqJ_q square and nonsingular, which §3's smallest singular value confirms over the travel.

The chart is d(toe)/d(tri height)d(\text{toe})/d(\text{tri height}) at every frame, from one LU each, against central differences of two whole re-solved sweeps.

-42.4-21.20.063221.342.5-0.0646-0.0320.00060.03320.0658implicit function, one LU a framere-solved sweeps, h = 0.1 mmwheel-centre travel (mm)d toe / d tri height (° per mm)

Largest gap over the 81 frames: 3.2e-07 °/m, against values up to 58.8 °/m. The derivative is zero at design (toe is zero there for every geometry) and grows almost linearly with travel: tri mainly sets the slope of the bump-steer curve.

Predict first. The same machinery gives every hardpoint at once. lcar is the lower arm's rear inner pivot. Raise it by 1 mm: camber at full bump changes by

Choose a prediction

Check answer (without scripting)

Answer: exactly nothing. No row contains lcar, so its column of JgJ_g is exactly zero. In this example the hinge direction is a separate number in axes, and lcar is only a label.

Reveal result (lock in your prediction above first)
number camber (°/mm) toe (°/mm) largest entry of J_g column
tri.2 0.00223 -0.0576 0.115
tro.2 -0.00186 0.0481 0.0963
ucaf.2 0.0199 0.0297 0.138
lcaf.2 -0.0162 0.0282 0.0997
ubj.2 -0.0171 -0.0259 0.118
lbj.2 0.0131 -0.0225 0.0799
ucaf.0 -0.00441 -0.00659 0.138
tro.1 -0.000241 0.00624 0.0125
ubj.0 0.0036 0.0051 0.118
tri.0 -0.000189 0.0049 0.00981
lbj.1 0.0029 -0.00429 0.0159
tro.0 0.000129 -0.00333 0.00668
ucaf.1 -0.000994 -0.00149 0.00689
ubj.1 -0.000995 -0.00147 0.0105
lcaf.1 -0.000676 0.00117 0.00416
lbj.0 -0.00275 -0.000453 0.0801
lcaf.0 0.00362 0.000379 0.0998
tri.1 6.34e-06 -0.000164 0.000328
lcar.0 0 0 0
lcar.1 0 0 0
lcar.2 0 0 0
ucar.0 0 0 0
ucar.1 0 0 0
ucar.2 0 0 0

Exactly zero columns: lcar.0, lcar.1, lcar.2, ucar.0, ucar.1, ucar.2. The rear pivots are labels in this example: axes.lca-axis and axes.uca-axis carry the hinge directions (the file's comment says they were computed from lcaf to lcar). Move a rear pivot in geometry.yaml and nothing happens; move the axis. Of the numbers that are read, the tie-rod heights (tri.2, tro.2) dominate toe, as bump-steer folklore says; the heights of the inner pivots and ball joints (ucaf.2, ubj.2, lcaf.2, lbj.2) dominate camber. 24 numbers cost 24 back-substitutions on one LU here; by differences they would cost 48 sweeps.

When the implicit-function derivative breaks
  • Assumes: a square, nonsingular JqJ_q at the solved pose, and outputs that are smooth in qq.
  • When it fails: near a fold JqJ_q is nearly singular and dq/dgdq/dg blows up; a redundant model has a non-square JqJ_q, and the inverse must become a least-squares solve.
  • Check: watch the smallest singular value of JqJ_q, and compare one column with a finite difference of re-solved sweeps.

7. Ride height: same mechanism, different input

Setting: the problem, its sets and its symbols

Problem. Given two models of one corner, MarmM_{\text{arm}} driven by the arm angle θ\theta and MroadM_{\text{road}} driven by the road height ζ\zeta, compare their problems (unknowns, rows, input) and their outputs as functions of wheel-centre travel ss.

Symbol In Meaning
θ\theta [−0.10, 0.10][-0.10,\ 0.10] lower-arm angle, the arm model's drive (rad)
ζ\zeta [−0.042, 0.042][-0.042,\ 0.042] road height, the road model's drive (m)
qarm, qroadq_{\text{arm}},\ q_{\text{road}} Rn\mathbb{R}^{n} pose unknowns, n=7×n = 7 \times moving bodies
rr Rn×R→Rm\mathbb{R}^{n} \times \mathbb{R} \to \mathbb{R}^{m} each model's rows (m, rad, 1)
ss R\mathbb{R} wheel-centre travel relative to the chassis (mm)
cc R3\mathbb{R}^3 contact point; its definition depends on the model (m)
rtr_t R>0\mathbb{R}_{>0} tyre radius: scalars.tyre-radius or joints.contact.gap (m)
γ, τ, Δt, C\gamma,\ \tau,\ \Delta t,\ C R\mathbb{R} camber, toe (degrees), track change (mm), roll centre (m)
How these symbols connect

Both MarmM_{\text{arm}} and MroadM_{\text{road}} represent the same suspension linkage, but they differ in their moving bodies and driving input: MarmM_{\text{arm}} drives the lower-arm angle θ∈[−0.10,0.10]\theta \in [-0.10, 0.10] rad on 3 moving bodies, whereas MroadM_{\text{road}} adds a moving road body driven in vertical height ζ∈[−0.042,0.042]\zeta \in [-0.042, 0.042] m while a plane-gap row holds the wheel centre a tyre radius rtr_t above it. Each model solves a square system r(q,drive)=0r(q, \text{drive}) = 0 for its pose vector (qarmq_{\text{arm}} or qroadq_{\text{road}}), from which wheel-centre travel ss and the outputs γ,τ,Δt,C\gamma, \tau, \Delta t, C are read. Comparing those outputs on the common axis ss separates what depends only on the mechanism's pose from what depends on each model's definition of the contact point cc.

Symbol-by-symbol notes
$\theta$ versus $\zeta$ — two different drives

θ\theta is the lower-arm hinge angle in radians (lca-drive), whereas ζ\zeta is the vertical height of the road body in metres. Evenly spaced grids in θ\theta and in ζ\zeta sample different points along the travel, so outputs are compared against wheel-centre travel ss.

$q\lt em>{\text{arm}}$ and $q\lt /em>{\text{road}}$ — different state sizes

Each moving body contributes 7 pose unknowns (position in m and unit quaternion). MarmM_{\text{arm}} has 3 moving bodies (n=21n = 21), while MroadM_{\text{road}} adds the road as a 4th moving body (n=28n = 28) together with its locked degrees of freedom and quaternion norm.

$r$ — square residual of each model

Maps Rn×R→Rm\mathbb{R}^n \times \mathbb{R} \to \mathbb{R}^m with m=nm = n in both models (21 rows for MarmM_{\text{arm}}, 28 for MroadM_{\text{road}}), combining locked joint rows (m or dimensionless), 1 driver row (rad or m), and 1 quaternion norm per moving body (dimensionless).

$c$ and $r_t$ — contact point and tyre radius

The tyre radius rtr_t (m) enters as scalars.tyre-radius in MarmM_{\text{arm}} and as joints.contact.gap in MroadM_{\text{road}}. In MarmM_{\text{arm}} the contact point cc is derived from the rim geometry in outputs.py, whereas in MroadM_{\text{road}} it is read on the road plane.

$\gamma$, $\tau$, $\Delta t$, $C$ — outputs on a common axis

Camber γ\gamma and toe τ\tau (degrees) are read from the axle direction alone; track change Δt\Delta t (mm) and roll centre CC (m, or height in mm above ground) also use the contact point cc. Plotting against ss (mm) puts both models on the same horizontal coordinate.

The ride-height example holds the car still and moves the road. The chassis is the fixed body, the road is a fourth moving body on a vertical slide, and one plane-gap row keeps the wheel centre a tyre radius above it (problem-mapping.md §8). The study drives the road's height in metres instead of the arm's angle in radians. Counted from each model's resolved joints (locked components, one driver, one quaternion norm per moving body):

double-wishbone ride-height
moving bodies 3 4
unknowns 21 28
joint rows 17 23
driver rows 1 1
norm rows 3 4
total rows 21 28
driven joint and unit lca-ground.rz, rad road-chassis.tz, m

The arm model's count matches its compiled problem (21 unknowns, 21 rows). Both are square with one degree of freedom, so both are Newton problems. What else changes: the frames are evenly spaced in road height rather than arm angle; the contact point is now solved on the road; and the closed-form agreement panel is gone, because _attach_analytic only compares rigid, angle-driven models.

The arm payload carries agreement.max_abs_diff = 2e-13; the road payload's agreement is null.

source: `open_textbook.otkd.solvers.sweep._attach_analytic` — `solvers/otkd/src/open_textbook/otkd/solvers/sweep.py:222`
def _attach_analytic(result: Sweep) -> None:
    """The independent closed form, where the model has one. Never raises: a model without
    the wishbone structure simply has no agreement panel."""
    from ..analysis import analytic

    # The closed form is a rigid, angle-driven statement. A compliant or length-driven model
    # has no directly comparable closed form, and pretending otherwise would put a number on
    # an agreement panel that means nothing.
    if result.problem.has_springs or result.unit != "rad":
        return
    wishbone = analytic.extract(result.problem)
    if wishbone is None:
        return
    thetas = result.theta
    result.analytic = analytic.camber_curve(wishbone, thetas)
    result.agreement = max(
        abs(a - frame.outputs.camber) for a, frame in zip(result.analytic, result.frames)
    )

Predict first. Plot camber against wheel-centre travel for both models, from the book's two payloads. How far apart are the curves?

Choose a prediction

Check answer (without scripting)

Answer: within the payloads' rounding, about 1e-4 degrees. One mechanism: a road-driven pose, re-solved with the arm angle it implies, is the arm-driven pose (otkd tests this to 10−910^{-9}). Camber depends only on the pose.

Reveal result (lock in your prediction above first)
-42.4-21.20.063521.342.5-1.25-0.683-0.1150.4531.02arm-drivenroad-drivenwheel-centre travel (mm)camber

Largest gap at equal travel (the arm curve interpolated onto the road frames): camber 8.0e-05°, toe 8.0e-05°, but track 3.88 mm and roll centre 0.83 mm. Camber and toe read only the axle's pose, and the pose is the same. Track and roll centre read the contact point, and the two models define it differently. The arm model takes the lowest point of a rim of radius rtr_t = 0.2 m in the wheel plane. The road model takes the foot of the axle midpoint on the road plane. With the wheel cambered by γ\gamma these differ sideways by −rtsin⁡γ-r_t\sin\gamma: subtracting it leaves 1.3e-03 mm. So "the same mechanism" is exactly true of the poses, and not of every output: an output is a pose plus a definition, and the definition came with the model.

source: `open_textbook.otkd.analysis.outputs._contact` — `solvers/otkd/src/open_textbook/otkd/analysis/outputs.py:168`

Two contact points: the road branch, then the rim branch.

def _contact(
    problem: Problem,
    points: dict[str, np.ndarray],
    poses: dict[str, tuple[np.ndarray, np.ndarray]],
    axle: np.ndarray,
    radius: float,
) -> np.ndarray:
    a, b = problem.resolved.axle
    centre = 0.5 * (points[a] + points[b])
    road = problem.resolved.road
    if road is not None:
        for joint in problem.resolved.joints.values():
            if joint.family == "plane" and joint.a == road:
                p_a, r_a = poses[joint.a]
                site = problem.resolved.sites[joint.from_]
                normal = _unit(r_a @ site.normal)
                distance = float(normal @ (centre - (p_a + r_a @ site.origin)))
                return centre - distance * normal
    down = -np.array([0.0, 0.0, 1.0])
    in_plane = down - float(down @ axle) * axle
    return centre + radius * _unit(in_plane)

Practice

Practice A (steps partly filled). In the book's payload, toe is 0.6514° at -42.4 mm of travel and -0.6224° at +42.5 mm. The average bump steer is (toeb−toed)/(zb−zd)(\text{toe}_b - \text{toe}_d)/(z_b - z_d) = ? degrees per mm. Enter it in degrees per 10 mm.

Worked solution

(−0.6224−0.6514)/(42.5−(−42.4))×10(-0.6224 - 0.6514) / (42.5 - (-42.4)) \times 10 = -0.1500° per 10 mm: toe-out in bump, about 0.15° every centimetre.

Practice B (with a hint). At design the contact point is (0.81, 0.12) m and the instant centre is (-1.6223, 0.1755) m, in front-view (x,z)(x, z). Enter the roll centre's height above the contact point, in mm.

Worked solution

t=−0.81/(−1.6223−0.81)t = -0.81 / (-1.6223 - 0.81) = 0.3330, so the height is 0.3330 × (0.1755 − 0.12) m = 18.48 mm. The roll centre is close to the ground because the instant centre is low and far away.

Hint 1

The roll centre is on the line from the contact point through the instant centre, at x=0x = 0.

Hint 2

Parametrise z=zc+t(zi−zc)z = z_c + t(z_i - z_c) with t=(0−xc)/(xi−xc)t = (0 - x_c)/(x_i - x_c); the answer is z−zcz - z_c.

Practice C (on your own). At full bump the toe is -0.6224° and its derivative with respect to the height of tri is -0.0576 ° per mm. To first order, how far (mm, signed) should tri move to make the toe at full bump zero?

Worked solution

One Newton step in the design space: Δ=−−0.6224/−0.0576\Delta = --0.6224/-0.0576 = -10.81 mm. Re-solving the sweep with tri moved by -10.81 mm gives toe -0.0010° at full bump and 0.0192° at full droop: one linear step nearly removes the bump steer over the whole travel, because the derivative curve of §6 is nearly linear in travel.

Mixed practice: which method, and why?

1. You need camber's sensitivity to 24 hardpoint coordinates at all 81 frames, and the solver gives you its Jacobian. Which method, and why?

Question 1

2. Each hardpoint is built to within ±0.5 mm, independently. You want the spread of camber at full bump. Which method, and why?

Question 2

3. A sweep past the travel stops converging, and the smallest singular value of J falls towards zero on the way. Which method, and why?

Question 3

4. You must find the height of tri that makes toe at full bump exactly zero, to 1e-6 degrees. Which method, and why?

Question 4

Show answers and explanations

1. The implicit-function theorem: one LU of J_q per frame, one back-solve per coordinate. M03's factorise-once, solve-many. Newton already formed JqJ_q; JgJ_g needs no solve.

2. Propagate with the gradient, then confirm with a modest Monte Carlo. §5 showed the response is linear to 10−710^{-7} over a millimetre, so Var⁡y≈∑ki2σi2\operatorname{Var} y \approx \sum k_i^2 \sigma_i^2 (M07) is nearly exact; a few hundred re-solves check it.

3. Arc-length continuation: parametrise by distance along the solution path. The path is smooth through the fold; only the arm angle is a bad parameter there. Arc length stays monotone, so the bordered system stays nonsingular.

4. Newton or secant on one scalar, using the implicit-function derivative. M02 in one unknown: one linear step got within about 0.001° (Practice C); a second converges quadratically.

Check yourself (closed book)

1. otkd seeds each frame of a sweep from the previous frame's solution. What does that buy?

Question 1
How sure?

2. A frame of an otkd sweep has branch_changed = True. What do you know for certain?

Question 2
How sure?

3. You raise the inner tie-rod point by 5 mm and re-solve the sweep. What is the toe at the design frame?

Question 3
How sure?

4. You want the sensitivity of camber to 24 hardpoint coordinates at all 81 frames. Why is dq/dg=−Jq−1Jgdq/dg = -J_q^{-1} J_g cheaper than central differences of re-solved sweeps?

Question 4
How sure?

5. You difference a re-solved output with respect to a hardpoint height in metres. Newton converges to round-off. Which step is most accurate?

Question 5
How sure?

6. The ride-height model drives the road instead of the lower arm. At the same wheel-centre height, which output differs from the arm-driven model?

Question 6
How sure?

7. In otkd's double-wishbone example, you raise lcar, the lower arm's rear pivot, by 1 mm. Camber at full bump changes by

Question 7
How sure?

Show answers and explanations

1. A seed within about the step size of the answer, so Newton stays on the assembly it started on. The pose moves by about ∣q′(θ)∣ Δθ|q'(\theta)|\,\Delta\theta between frames, so the seed sits deep inside the basin of the root it came from. That is branch continuity.

2. Some body moved more than 0.25 rad or 0.05 m from the frame's seed. That is exactly the test in _jumped. Whether it means a different assembly is for you to check, by refining the step or continuing back to the design pose.

3. Exactly zero, because toe is measured from the design heading of the same geometry. toe is the change of the axle's plan-view heading from the design position, so it is zero there for every geometry; its derivative with respect to any hardpoint is zero too.

4. One factorisation of J_q per frame serves every coordinate; differences need two sweeps per coordinate. Central differences cost 2×242 \times 24 re-solved sweeps. The implicit-function route factorises the Jacobian Newton already has once per frame and back-solves 24 times.

5. Around 1e-6 to 1e-5 m. M01's balance: truncation ∝h2\propto h^2 against noise ∝ϵ/h\propto \epsilon/h, best near ϵ1/3\epsilon^{1/3} times the scale of the input. The scan in §5 bottoms out there.

6. Track change, by about r sin(camber), because the contact point is defined differently. The arm-driven model takes the lowest point of a rim of radius rr in the wheel plane; the road model takes the foot of the axle centre on the road. Their gap is rsin⁡γr\sin\gamma.

7. exactly nothing. No row of the model contains lcar: its column of JgJ_g is zero. Move the axis direction in axes to move the hinge.

Keep these:

  1. A sweep is natural-parameter continuation: each frame seeded from the last, an order-1 predictor that keeps Newton in its basin for a few iterations a frame.
  2. branch_changed measures how far a body moved from its seed, not which assembly it is on; refine or continue back before believing it.
  3. Camber, toe, track, instant and roll centre are geometry read off a pose; track and roll centre also depend on how the model defines the contact point.
  4. Differentiate a re-solved output with a central step near 1e-6 m, or better with dq/dg=−Jq−1Jgdq/dg = -J_q^{-1}J_g: one LU per frame for every geometry number.
  5. Driving the road instead of the arm changes the problem's size and input, not the poses.

Your connection

Pick one curve you have relied on that came from a sweep (a camber curve, a load case, a parameter study). How would you know that every frame was on the same branch, and what would its derivative with respect to one input have cost you?

Answers

Practice A. -0.1500° per 10 mm.

Practice B. 18.48 mm above the contact point.

Practice C. -10.81 mm (lower tri).

Mixed practice. implicit-function derivative; gradient propagation checked by Monte Carlo; arc-length continuation; Newton on one scalar.

Where the maths is derived

Optional. These notes give the intuition and application; the sources below give the full derivations and proofs.

§1 Continuation

§3 The branch test

§4 The outputs

§5 Finite differences

§6 The implicit-function derivative


Compiled from notebooks/suspension/s05_sweeping_the_travel.py — run locally with cd notebooks && uv run marimo edit suspension/s05_sweeping_the_travel.py for live Python scratch cells.

Back to the book: 1.4 The redundancy was ours · Chapter 1 Review

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Reading offline

Keep this book on this device and read it offline.