Contents · Physics Engines
Part 0 · Orientation
Part 1 · Mathematical Foundations
Part 2 · Equations of Motion
Part 3 · Time Integration
Part 4 · Collision Detection
Part 5 · Contact & Constraints
Part 6 · Constraint Solvers
Part 7 · Position-Based Dynamics
Part 8 · GPU & Parallelism
Part 9 · Differentiable Simulation
Part 1 · Mathematical Foundations
Maximal vs Minimal Coordinates
Every engine answers one question before it simulates anything: which numbers are the state? Two answers split the field.
Two ways to write a configuration
Minimal (generalized) coordinates. One number per degree of freedom. A pendulum is a single angle ; an -link arm is angles . The rigid links and joints are baked into the parametrization, so every state you can write is automatically legal.
Maximal (Cartesian) coordinates. Give every body its full pose: per body in the plane, position plus orientation (6 numbers) in 3D. Joints become separate equations that the solver has to keep satisfied. A joint is just a constraint function pinned to zero,
For the same mechanism the two choices carry very different amounts of bookkeeping. Drag :
- minimal q
- 3
- maximal coords
- 9
- pin constraints
- −6
- net DOF
- 9 − 6 = 3
Same physical freedom either way. Minimal stores exactly 3; maximal stores 9 numbers and must actively enforce 6 constraints.
Why the choice shows up in the dynamics
In minimal coordinates the equations of motion are self-contained,
and there is nothing else to enforce: the coordinate space is the set of legal configurations.
In maximal coordinates you carry the constraints explicitly, with Lagrange multipliers that are the constraint (joint) forces,
That pairing (a differential equation in plus an algebraic equation ) is a differential-algebraic equation, and the algebraic half is where numerics bite.
The drift
You cannot hand to an integrator directly, so you differentiate it: once for , twice for a relation in that solves alongside the dynamics. But a discrete step only satisfies the acceleration-level equation, so small position errors pile up with nothing to remove them. The pin joint slowly stretches.
The usual fix is Baumgarte stabilization. Instead of , enforce a damped spring that pulls back toward zero,
Left is the pendulum in minimal coordinates; right is the same pendulum in
maximal coordinates. At the bob wanders off its dashed circle as the
constraint drifts (raise dt to see it sooner). Turn up and the rod
snaps back to length.
minimal · q = [θ]
‖p‖ − L = 0 (exact)
maximal · q = [x, y]
‖p‖ − L = +0.0000
Then why use maximal coordinates at all?
If minimal coordinates are smaller and drift-free, why do PhysX and Bullet default to maximal? Because minimal coordinates buy their tidiness with structure you do not always have.
- Closed loops. A four-bar linkage or a parallel robot has no independent set of joint angles, so you are forced back to constraints anyway.
- Contact. Every contact is a constraint that appears and vanishes at runtime. You cannot re-parametrize the configuration manifold each time two bodies touch; maximal coordinates just absorb contacts as more rows of .
- Uniform structure. Every body is the same 6-DOF blob, which is easy to batch across a GPU.
That is the real split from the landscape: MuJoCo, Drake, and RaiSim commit to minimal coordinates and lean on Featherstone's algorithms to keep them fast, while PhysX and Bullet stay maximal and pour their effort into the constraint solver. Both branches are coming up: Featherstone's algorithms for the minimal side, and the contact and constraint solvers for the maximal one.
Next in Part 1: rotations, , and the exponential map, the piece that makes 3D orientation its own small subject.