Learning outcomes
- Derive M and c from kinetic and potential energy.
- Recognize the nonuniqueness of a Coriolis matrix.
- Validate a small arm model through energy and engine comparisons.
Prerequisites: Linear algebra, ODEs, and earlier lectures in this sequence.
Deriving equations from energy
For independent scalar coordinates q, define L(q,q˙)=T−V. Lagrange's equations are
dtd∂q˙i∂L−∂qi∂L=τi.
If T=21q˙⊤M(q)q˙, collecting accelerations produces M(q)q¨+c(q,q˙)=τ. Here c combines velocity-dependent inertial forces and the potential gradient.
These coordinate equations cannot be applied blindly to four independent quaternion coordinates. A quaternion has a constraint and qvel is a tangent quantity. Use generalized-speed formulations or a library with a declared manifold convention for floating-base systems.
A two-link planar arm
Take point masses m1,m2 at the link ends, massless rods l1,l2, and angles measured from downward vertical. Let q2 be relative to link 1. Then
M11=(m1+m2)l12+m2l22+2m2l1l2cosq2,
M12=M21=m2l22+m2l1l2cosq2,M22=m2l22.
With a=m2l1l2sinq2, the velocity bias is (−a(2v1v2+v22),av12). Gravity is
gq=[(m1+m2)gl1sinq1+m2gl2sin(q1+q2)m2gl2sin(q1+q2)].
Thus c is the sum of these two vectors.
Worked mass-matrix check
For unit masses and lengths at q2=0,
M=[5221].
Its determinant is 1 and its trace is 6, so both eigenvalues are positive. Off-diagonal entries express coupling: accelerating one joint generally requires torque at the other.
The point-mass model differs from an arm built from solid capsules. A fair MuJoCo comparison must match centers of mass and inertias rather than merely match link lengths.
Why c rather than C?
Many texts write C(q,v)v+g(q). The matrix C is not unique, even though the resulting bias vector is physically determined. This course uses MuJoCo's c and qfrc_bias. The common h notation is an alias, not an additional force. Passive damping remains separate.
Practice and exercise
Implement the point-mass arm acceleration with a linear solve, then test M symmetry and positive definiteness over random poses. Compare finite-difference energy changes with mechanical power.
Check: At zero velocity and with gravity disabled, what should c be? Answer: zero for this ideal model. A nonzero value suggests a derivation, configuration, or force-accounting error. Dissipative forces should not be hidden in the inertial bias.