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_changedflag 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.
Warm-up: remember
1. A sweep is a sequence of solves
Setting: the problem, its sets and its symbols
Problem. Given the geometry (fixed) and the drive grid , find poses with for every , each by Newton seeded from ; and measure how far a seed lies from the converged pose, for the previous-pose and the tangent predictors, as a function of .
| Symbol | In | Meaning |
|---|---|---|
| lower-arm angle, the drive (rad) | ||
| frame index | ||
| frames in the sweep | ||
| step between frames, (rad) | ||
pose unknowns: position (m) and unit quaternion of each of lca, uca, up |
||
| geometry numbers: 10 points, 4 site frames, the tie-rod length (m) | ||
| the rows: 17 joint, 1 driver, 3 quaternion norms (m, rad, 1) | ||
| at a pose | ||
| tangent of the solution path (m/rad, 1/rad) | ||
| seed error, (mixed units) |
How these symbols connect
Fixing the geometry reduces the residual to a family of 21 equations in 21 pose unknowns , parametrised by the lower-arm angle rad. Discretising that interval into frames gives the grid with step rad, and solving sequentially from the previous pose traces out the solution path. Differentiating the identity links the Jacobian to the path tangent , letting us compare the seed error of the previous-pose seed against the tangent predictor .
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 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 changes from frame to frame.
$r$ — the 21 residual rows
At each drive angle , 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
is the derivative of all 21 rows with respect to the pose at fixed . Where is nonsingular, differentiating yields for the tangent , in m/rad for positions and 1/rad for quaternion components.
$e$ — seed error
The infinity norm between a predictor's starting guess and the converged pose 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 from
-0.10 to 0.10 rad in 81 frames. Each frame is one
square nonlinear system: 21 rows in the 21 pose unknowns (S02). Solving
them one after another, with as the parameter, is natural-parameter
continuation:
The seed is the last solution, the simplest predictor. How far is it from the answer? Expand the solution path: . So the previous pose is wrong by , an order-1 predictor in M01's sense. The tangent comes free from differentiating :
and seeding from (an Euler predictor) leaves an error. otkd uses the plain previous pose. The chart measures both seeds' distance from the converged pose at the design frame, for steps from to rad.
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 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 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 with on the design assembly and a target angle , find which solution of damped Newton reaches from within iterations: one on , one on , or none.
| Symbol | In | Meaning |
|---|---|---|
| seed angle (rad); is the design pose | ||
| target angle (rad) | ||
| seed pose, the solution at | ||
| the 21 rows (m, rad, 1) | ||
| the design assembly and the other assembly: solution sets, one pose per angle | ||
kingpin axis, through the ball joints lbj and ubj (m) |
||
tie-rod inner end tri (chassis) and outer end tro (upright) (m) |
||
| tie-rod length, the design separation (m) | ||
Newton's iteration limit in solvers/newton.py |
How these symbols connect
At any target angle , the 21 equations admit two valid poses, one on the design assembly and one on the other assembly , arising from the two intersections of the upright's kingpin circle about with the tie-rod sphere of radius centred at . Seeding damped Newton with a converged design-assembly pose from an angle tests which root's basin of attraction holds , or whether Newton fails to converge within iterations. Varying across rad maps out the regions that land on , jump to , or fail to converge.
Symbol-by-symbol notes
$\theta\lt em>s$, $q\lt /em>s$, and $\theta_t$ — seed versus target
is always a converged solution on at the seed angle rad (with giving the design pose). Newton then solves at the target angle rad, so the step in angle is rad.
$A\lt em>0$ and $A\lt /em>1$ — the two assemblies
Both sets are solution branches of the same 21 equations , each containing one pose per arm angle. is the branch holding the car's design pose; 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 through them, so its outer tie-rod end lies on a circle. The tie-rod constraint demands (a sphere about the chassis point ), 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 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).
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 and ask for the frame at
rad, using otkd's own sweep with a two-value table law. The step is
, from 0.5 to 1.3 rad. Each dot is one such two-frame sweep, coloured
by where frame 2 landed.
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 and the solution , otkd sets when some body has or . Decide whether means lies on a different assembly from , and whether means it does not.
| Symbol | In | Meaning |
|---|---|---|
| the moving bodies | ||
| body pose: where the body carries the world origin (m), and its rotation | ||
| angle of (rad) | ||
thresholds _JUMP_ANGLE (rad) and _JUMP_DISTANCE (m) |
||
branch_changed of frame |
||
| lower-arm angle for the long sweep (rad), steps of 0.01 rad | ||
| smallest singular value of at a frame |
How these symbols connect
After frame converges from seed to pose , otkd unpacks each moving body 's translation and rotation at both poses and computes the relative rotation angle and origin displacement . Comparing those two quantities against the fixed thresholds and sets the binary flag . Extending the sweep in out to rad while tracking the smallest singular value of 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 (m) with a rotation matrix built from its unit quaternion. Because a body's local frame coincides with the world frame at the design pose, is where body has carried the world origin, not a joint or centroid on the body.
$\phi_B$ — relative rotation angle
The geodesic angle in rad between and , from . It measures how far body turned in one frame step, independent of its translation .
$\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 sets .
$b\lt em>k$ — the branchchanged flag
A per-frame boolean ( or ) recorded by the sweep; setting never stops or alters the solve. This section tests what and can and cannot establish about staying on one assembly.
$\sigma_{\min}$ — distance to a singular Jacobian
The smallest singular value of at frame , in mixed residual-to-pose units. As , approaches singularity and the path tangent grows rapidly per unit step in .
Back to the opening prediction: the sweep from to 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 of the relative rotation, from
,
against 0.25 rad, and the distance between the two body positions
against 0.05 m. Either one over raises the flag; nothing stops
the sweep (problem-mapping.md §7: recorded, never raised).
What is ? A body's local frame is the world frame at the design position
(config/geometry.py), so 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 moves its by about 0.608 m times . 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 grows the smallest singular value of falls towards zero: a fold is near, where two solutions of the rows merge and the path in turns back. Close to it the pose moves fast for each step in , so a step that was harmless at design now moves the upright over 0.05 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 , 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 and the design reference (heading , contact point , hinge lines), compute camber , toe , track change , instant centre and roll centre , each a function of ; and trace them over the sweep as functions of wheel-centre travel .
| Symbol | In | Meaning |
|---|---|---|
| solved pose of a frame | ||
wheel centre wc and outer axle point wco (m); outboard, forward, up |
||
| axle unit vector | ||
| camber (degrees), positive top outboard | ||
| axle heading in plan view, now and at design (degrees) | ||
| toe , wrapped (degrees), positive toe-in | ||
| axle midpoint and contact point (m) | ||
tyre radius, scalars.tyre-radius (m) |
||
| track change, (mm) | ||
| instant centre in the front view (m) | ||
| roll centre on the centreline (m) | ||
| wheel-centre travel, minus its design value (mm) |
How these symbols connect
From each solved pose , otkd evaluates the world positions of the axle points and the ball joints, then forms the unit axle vector and the rim contact point using the tyre radius . Camber and heading come directly from the components of , with toe and track change referenced to design; meanwhile the projected arm lines meet at the instant centre , and the line from through crosses at the roll centre . Plotting all five outputs against wheel-centre travel 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
(wc) is the wheel centre and (wco) lies further outboard along the spindle, both in metres in the chassis frame ( outboard, forward, up). Normalising gives the dimensionless unit vector from which camber and toe are read.
$\gamma$, $\psi$, and $\tau$ — camber versus toe
Camber (degrees) measures vertical tilt (positive top outboard), whereas heading (degrees) measures direction in plan view. Toe is wrapped to 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 sits one tyre radius (scalars.tyre-radius, m) below the axle midpoint in the wheel plane. Track change is reported in millimetres ( the change in metres) and tracks sideways movement of .
$I$ and $C$ — instant centre and roll centre
Both live in the front view in metres: is where the two arm lines meet in the front plane, and is where the line from through crosses the centreline . The roll-centre height plotted below is , converted to millimetres.
$s$ — wheel-centre travel
Defined as in millimetres, so at design, positive in bump and negative in droop. Using instead of 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 and for the wheel
centre and a point further out on the axle (roles.axle: [wc, wco]), and
for the axle's unit vector; points outboard, forward,
up.
- Camber in degrees, positive when the top of the wheel leans outboard. This example's axle is horizontal at design, so its camber starts at zero: it is camber change. Section 1.2's front view starts from a static and counts the other way round.
- Toe is the change in the axle's plan-view heading from design, wrapped to a half-turn, positive for toe-in on this right-hand corner. Toe against travel is bump steer.
- Track change is the contact point's sideways movement. With no road in the model the contact point is the lowest point of a rim of radius in the wheel plane: , where is the midpoint of and and is straight down with its axle component removed, normalised.
- Instant centre (front view, –): for each arm, the line through its ball joint and the foot of the perpendicular from that joint to the arm's hinge line. The two lines meet at the upright's instantaneous pole. Exact when the hinge axes are perpendicular to the front view; an approximation of the order of their tilt otherwise.
- Roll centre: where the line from the contact point through the instant centre crosses the centreline , assuming the other corner is this one's mirror image.
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)))
Reveal result (lock in your prediction above first)
| 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
icandrcareNone. - Check: look at the hinge directions in
geometry.yaml, and treatNoneas 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 and the re-solved toe curve when the height of tri changes by , find the derivative of the full-bump toe by the central difference , and the step that makes most accurate.
| Symbol | In | Meaning |
|---|---|---|
geometry numbers; has point.tri.2 and the tie-rod length reset to (m) |
||
height change of tri for whole re-solved sweeps (mm) |
||
| wheel-centre travel (mm) | ||
| toe at travel on the geometry moved by (degrees) | ||
| toe at the full-bump frame ( rad) after re-solving with (degrees) | ||
| finite-difference step (m) | ||
| (degrees per m) | ||
| machine epsilon (M01) |
How these symbols connect
Perturbing the height coordinate of tri in the design geometry by (in mm for whole-sweep plots) or (in m for derivatives), and resetting the tie-rod length to the new design separation, produces a modified geometry and a re-solved toe curve . Fixing the drive at the full-bump frame ( rad) defines the scalar function of toe (degrees) against the perturbation (m). Forming the central difference estimates in degrees per metre, trading truncation error against floating-point noise scaled by machine epsilon .
Symbol-by-symbol notes
$g_0$ and $g(h)$ — why the tie-rod length resets too
adds (m) to point.tri.2 and resets length.tie-rod to at the new design points. That keeps the design pose assembled at , matching what Problem.solve does when resolving geometry.yaml.
$\Delta$ versus $h$ — unit distinction
Both perturb the same coordinate (point.tri.2), but is in millimetres for visualising whole re-solved sweeps , whereas is in metres so has units of degrees per metre.
$y(h)$ and $D(h)$ — re-solved output and central difference
Each evaluation of runs Newton on and reads toe from analysis/outputs.py (degrees). The central difference therefore costs two nonlinear solves per step .
$\epsilon$ — machine epsilon
IEEE 754 double-precision unit round-off, (dimensionless). It sets the floating-point floor inside both Newton's residual and the difference .
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.
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 directly (the height of tri by , 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 instead of in . The outputs read only the
axle points wc and wco, which nothing here moves, so compute can use the base
model's reference.
Reveal result (lock in your prediction above first)
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 .
- When it fails: too small an divides solver noise by ; too large an adds truncation and can cross a branch or a fold.
- Check: scan 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, with nonsingular, find and for each geometry number in and each output , from the identity near .
| Symbol | In | Meaning |
|---|---|---|
| frame index of the design sweep | ||
| solved pose at frame | ||
| geometry numbers, near the design values (m) | ||
coordinates of lcaf, lcar, ucaf, ucar, lbj, ubj, tri, tro |
||
| at | ||
| at ; one column per number | ||
| an output of the pose: camber or toe (degrees) | ||
| sensitivity (degrees per m; tables show degrees per mm) |
How these symbols connect
Because the residual vanishes identically along the solution manifold near , differentiating with respect to yields the linear system at each solved frame . Factorising the square pose Jacobian once per frame gives every pose sensitivity for by back-substitution against the corresponding column of , without re-solving Newton. Applying the chain rule then turns each pose sensitivity into the output sensitivity for camber or toe .
Symbol-by-symbol notes
$\mathcal{H}$ — the 24 hardpoint coordinates
The 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 .
$J\lt em>q$ — pose Jacobian (reused across all $g\lt /em>j$)
The square matrix evaluated at , the same Jacobian Newton forms at the converged pose. The implicit-function theorem requires to be nonsingular so that is locally unique and smooth.
$J_g$ — geometry Jacobian
The matrix at , where column measures how the 21 residual rows change when geometry number is nudged at fixed pose . Forming a column calls Problem.evaluate directly and needs no Newton solve.
$y$ and $dy/dg_j$ — output sensitivity and units
maps a pose to camber or toe in degrees. Differentiating with respect to (in metres) gives 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: . Differentiate with respect to :
is the Jacobian Newton already uses at the solved pose. , the rows'
derivative with respect to one geometry number, needs no solve at all: here it is a
central difference of Problem.evaluate in . Factorise once per frame (LU,
M03) and every geometry number is one back-substitution. The output's gradient enters
only along the direction , so one directional difference of compute finishes
it. The theorem needs square and nonsingular, which §3's smallest singular value
confirms over the travel.
The chart is at every frame, from one LU each, against central differences of two whole re-solved sweeps.
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.
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 at the solved pose, and outputs that are smooth in .
- When it fails: near a fold is nearly singular and blows up; a redundant model has a non-square , and the inverse must become a least-squares solve.
- Check: watch the smallest singular value of , 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, driven by the arm angle and driven by the road height , compare their problems (unknowns, rows, input) and their outputs as functions of wheel-centre travel .
| Symbol | In | Meaning |
|---|---|---|
| lower-arm angle, the arm model's drive (rad) | ||
| road height, the road model's drive (m) | ||
| pose unknowns, moving bodies | ||
| each model's rows (m, rad, 1) | ||
| wheel-centre travel relative to the chassis (mm) | ||
| contact point; its definition depends on the model (m) | ||
tyre radius: scalars.tyre-radius or joints.contact.gap (m) |
||
| camber, toe (degrees), track change (mm), roll centre (m) |
How these symbols connect
Both and represent the same suspension linkage, but they differ in their moving bodies and driving input: drives the lower-arm angle rad on 3 moving bodies, whereas adds a moving road body driven in vertical height m while a plane-gap row holds the wheel centre a tyre radius above it. Each model solves a square system for its pose vector ( or ), from which wheel-centre travel and the outputs are read. Comparing those outputs on the common axis separates what depends only on the mechanism's pose from what depends on each model's definition of the contact point .
Symbol-by-symbol notes
$\theta$ versus $\zeta$ — two different drives
is the lower-arm hinge angle in radians (lca-drive), whereas is the vertical height of the road body in metres. Evenly spaced grids in and in sample different points along the travel, so outputs are compared against wheel-centre travel .
$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). has 3 moving bodies (), while adds the road as a 4th moving body () together with its locked degrees of freedom and quaternion norm.
$r$ — square residual of each model
Maps with in both models (21 rows for , 28 for ), 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 (m) enters as scalars.tyre-radius in and as joints.contact.gap in . In the contact point is derived from the rim geometry in outputs.py, whereas in it is read on the road plane.
$\gamma$, $\tau$, $\Delta t$, $C$ — outputs on a common axis
Camber and toe (degrees) are read from the axle direction alone; track change (mm) and roll centre (m, or height in mm above ground) also use the contact point . Plotting against (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)
)
Reveal result (lock in your prediction above first)
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 = 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 these differ sideways by : 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
Hint 1
The roll centre is on the line from the contact point through the instant centre, at .
Hint 2
Parametrise with ; the answer is .
Mixed practice: which method, and why?
Check yourself (closed book)
Keep these:
- 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.
branch_changedmeasures how far a body moved from its seed, not which assembly it is on; refine or continue back before believing it.- 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.
- Differentiate a re-solved output with a central step near 1e-6 m, or better with : one LU per frame for every geometry number.
- 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
- McCarthy and Soh (2011), Geometric Design of Linkages: kinematic theory of linkages: assembly branches and singular configurations.
§3 The branch test
- otkd, the package and its design documents: branch continuity and its thresholds (
docs/problem-mapping.md§7,solvers/sweep.py), and the outputs' sign conventions (analysis/outputs.py).
§4 The outputs
- SAE J670, Vehicle Dynamics Terminology: the standard vocabulary for camber, toe, instant centre and roll centre.
- Milliken and Milliken (1995), Race Car Vehicle Dynamics: why camber and the roll centre matter to the tyre and the car.
§5 Finite differences
- Nocedal and Wright (2006), Numerical Optimization: finite-difference derivative approximations and how to choose the step.
§6 The implicit-function derivative
- Trefethen and Bau (1997), Numerical Linear Algebra: LU factorisation reused for many right-hand sides, and the conditioning that bounds a linear solve's accuracy.
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