Recap: Lagrangian Mechanics
Rigid body dynamics is an application of Lagrangian Mechanics to systems with specific geometric constraints.
Let the state be represented by generalized coordinates and the Lagrangian be . The equations of motion are derived from the Least Action Principle, which yields the Euler-Lagrange equations:
When applying the Lagrangian to the optimality for least action, we get
If there is only kinetic energy and no potential energy then the resulting motion is called pure inertial motion.
Lagrangian in Newtonian Mechanics
The generalized coordinate is a low dimensional parameterization of infinitely many atoms . There is1 a smooth function describing the physical 3D position of each atom as a function of :
The kinetic and potential energy on by pulling back the energies from 3D space
In general, the kinetic energy is a positive definite quadratic function of 2. This defines an inner product
Definition (Momentum, Generalized Coordinate)
The momentum for the generalized coordinate is defined as
This notion of momentum is the pullback of the momentum form from the moment of the classical particle system ().
Rigid Body Kinematics
A rigid body is a system of particles that maintains fixed distances between all pairs of particles. For a rigid body, the degrees of freedom is given by the space of Euclidean transformations:
Here, is a rotation matrix in the special orthogonal group and is a translation vector. represents the special Euclidean group, which is the group of all rigid transformations in three-dimensional space. Each element is a transformation that maps a position in the body coordinate to a position in the world coordinate. For example,
is described by the transformation
To be more preicse, .
Tangent Vectors in Rigid Bodies
How can we describe a tangent vector ?
Differential
We can consider but we’d need to account for the constraint that .
Recall that since is a rotation matrix, it must be orthogonal, meaning that . So, taking the derivative of both sides with respect to time, we get
Therefore is a skew-symmetric matrix. Similarly,
Taking the derivative of both sides with respect to time, we get
and so both and are skew-symmetric matrices. Let
Then . By theorem, every skew-symmetric matrix is a cross product with a vector, such that
where
We call the body coordinate angular velocity and the world coordinate angular velocity. Indeed, one can verify that .
Thus, a tangent vector is represented by a 6D vector
We can pick if we want to represent the angular velocity in the world coordinate or the body coordinate. In particular, suppose the th point in the body has position and mass
then the translated position of the th point in the world coordinate is
and the velocity of the th point in the world coordinate is
This makes sense because we get the world angular velocity contribution from . Then we can convert to the body angular velocity contribution by multiplying with , and finally we apply theorem to show the cross product.
With out velocity, we can compute the kinetic energy as
In the first term, we can remote because the norm of a rotation matrix is (it preserves lengths). In the third term, is simply the total mass of the body.
Consider the second term. All the operations listed are linear, and that are not dependent on particle , so we can factor them out of the summation:
Center of Mass
Recall that the formula for calculating the position vector of the center of mass is
We can get
If we choose the body coordinate such that the center of mass is at the origin, then (recall it is relative to the body coordinate) and so
Returning back to the kinetic energy, we get
Theorem (Kinetic Energy Decoupling)
If the origin of the body coordinate is at the center of mass, then the kinetic energy is
That is, the translation and rotation contributions to the kinetic energy are decoupled. Indeed,
- the pure translational kinetic energy of the center of mass moving through space is the first term
- the pure rotational kinetic energy about the center of mass is the second term
Definition (Inertia Tensor)
We can further expand the term.
There are many steps.
- By the anti-commutative property of the cross product and theorem
- Since is a vector, its squared norm is equivalent to dot product with itself.
- We can factor out body angular velocity since it is identical to every particle.
- By theorem, we get the final line.
For a rigid body centered at the origin of the body coordinate, the moment of intertia or the inertia tensor is defined as
For a continuous object, we can replace the summation with an integral:
Inertia Tensor in Kinetic Energy
With the inertia tensor, we can express the total inertial kinetic energy (assuming the center of mass is at the origin) from Theorem (Kinetic Energy Decoupling) as
where the symmetric matrix is the moment of inertia which is time independent.
Using the world coordinate, we can express the total inertial kinetic energy as
where
is the inertia in the world coordinate. For a rigid body, is time-independent. However, is dynamic, and co-rotates with the rigid body.
Inertia Tensor in World Coordinate
In particular, we say it is dynamic because its axes of rotation changes with the rigid body’s rotation with respect to the world coordinate axes. The fact that
means that finding its position in the world coordinate, we must update to reflect the object’s current orientation.
As the rigid body rotates, changes, causing to change accordingly. This reflects how the distribution of mass relative to the world axes changes as the body rotates, even though the distribution of mass relative to the body axes (captured by ) remains constant.
Theorem (Moment of Inertia Semi-Definiteness)
The moment of inertia is positive semi-definite, and its eigenvalues satisfy the triangle inequality.
Proof:
WLOG, we can choose3 the basis that diagonalizes the inertia tensor, such that
These variables will act as “intermediates” to help us express the eigenvalues of the inertia tensor.
The diagonal entries (and thus the eigenvalues) of the inertia tensor are
and similarly and . Because are all non-negative, then any sum of them must also be positive. Therefore are non-negative. This proves that the inertia tensor is positive semi-definite.
Moreover, we can check that the eigenvalues satisfy the triangle inequality.
and so we are done.
Main Idea
Recall that the moment of inertia is defined as
where is the mass and is the distance from the axis of rotation (radius). The idea is that on each axis, the moment of inertia is the sum of the contributions from all mass elements, and each contribution is proportional to the square of the distance from that axis.
In particular, if we consider the -axis, then the distance from the -axis for a mass element at position is .
Definition (Spinning Top)
A rigid body is called a spinning top if a pair of eigenvalues of its inertia tensor are equal. That is, for the spinning top, there is a continuous family of rotation so that
Equations of Motion for Rigid Bodies
The equations of motion for a rigid body can be described as follows. Let
- be the rotation matrix representing the orientation of the rigid body
- be the translation vector representing the position of the center of mass of the rigid body
- be the world coordinate angular velocity
- be the body coordinate angular velocity
- be the inertia tensor in the body coordinate
- be the inertia tensor in the world coordinate
In total,
and likewise,
Applying the Lagrangian to Rigid Bodies
Recall that the Lagrangian is defined as . If we assume there are no external forces, then the potential energy is and so . From Inertia Tensor in Kinetic Energy, we can take the variation from only the rotational kinetic energy.
Theorem (Angular Momentum is Conserved in World Coordinate)
The conservation of angular momentum depends on which coordinate system we use. The world coordinate angular momentum is defined as
We say that the world coordinate angular momentum is conserved if is constant over time. In particular,
Since both and are dependent on time, we can apply the product rule to get
The goal is to manipulate the first term so that is equal to one of the World-Frame Formulation equations of motion. Indeed, we can compute the product rule again
Recall that is time independent, so its derivative is . By equation 1 of the World-Frame Formulation, we can substitute to get
Thus
Since is equivalent to (via theorem), and (by anti-commutative property of the cross product), we get
Substituting back into the product rule, we get
which is exactly the second equation of the World-Frame Formulation. Therefore using the world coordinate angular momentum conserves angular momentum.
Theorem (Angular Momentum is Not Conserved in Body Coordinate)
Imagine we are an ant glued to the rigid body flying around in empty space. Since we have the world frame angular momentum, translating it to the body frame is just a rotation. The angular momentum in the body frame is defined as
Recall this is similar to the classical definition of angular momentum, where is the moment of inertia and is the angular velocity. From how we derived the integrand, we know kinetic energy wrt to the body is
Thus,
We can reuse from before that
and so . And since (and thus ) is dependent on time, angular momentum is not conserved.
Numerical Methods for Rigid Body Simulation
We’ll use the World-Frame Formulation equations of motion to simulate the rigid body dynamics.
Current methods such as forward Euler or RK4 do not respect rotation matrices4.
Simple First-Order Method
Here is an example of a simple first-order method based on conservation of angular momentum.
Input: Initial
- Compute world-space moment of inertia:
- Compute world-space angular momentum: (this is conserved if no external torques)
- For each frame: a. Update angular velocity: b. Update rotation: (angle-axis rotation) c. Recompute world-space moment of inertia: d. Render the object using as the orientation matrix.
- End
Buss’ Augmented Second-Order Method
From Samuel Buss 2001 "Accurate and Efficient Simulation of Rigid Body Dynamics", (link to paper). This method provides better accuracy for large time steps.
Input: Initial
- Compute world-space moment of inertia:
- Compute world-space angular momentum: (conserved)
- For each frame: a. Update angular velocity: b. Compute angular acceleration term: c. Compute effective angular velocity: d. Update rotation: e. Recompute world-space moment of inertia: f. Render the object using as the orientation matrix.
- End
The idea is that we use Dynkin’s formula and Baker-Campbell-Hausdorff formula to derive a more accurate effective angular velocity that accounts for the non-commutativity of rotations (i.e. ). Instead,
where . Indeed, this means that
giving us line (3c) of the algorithm.
Idea
This is similar to RK2.
Footnotes
-
Why? ↩
-
Kinetic energy cannot be negative. Since kinetic energy here is expressed as a quadratic form in generalized velocities , the matrix must be positive definite to ensure that is always positive for any nonzero . Especially if we consider when , then for all . ↩
-
TODO: show that we can always choose such a basis. Let ↩
-
Why? ↩