LLGA · Course notes

Computer Animation

CSC_51085_EP · Year 1 · Period 1

Contents

Introduction and overview

Module Computer Animation
Code CSC_51085_EP
Team and workload Course coordinators (“Responsables” on the 2026-2027 sheet): Marie-Paule Cani and Mathieu Desbrun (École Polytechnique · Inria); coordinator of the occurrence: Mathieu Desbrun; the sheet’s teaching-design team lists Marie-Paule Cani, Mathieu Desbrun and Xianjin Gong · volume not displayed on the 2026-2027 sheet (36 h per the LLGA curriculum wiki, see the session plan); the sheet states half lectures, half exercise/lab sessions programmed in C++ with OpenGL · 4.5 ECTS · from the keyframe to simulation: numerical integration and stability, particles and mass-spring systems, rigid bodies, collisions, skinning, facial animation, cloth and fluids — then the bridge toward learned animation (motion matching, neural networks).
Period Autumn 2026 · period 1 (X-3A-P1, from 17/09/2026 to 18/12/2026) · course taught in English
Assessment Not displayed: the 2026-2027 sheet gives no assessment text, and its LLGA section is empty; for the other listed degrees it shows the grade format (out of 20, or letter grade) and that a resit is allowed
Status in the program P1 optionOutside recommended track

Audience: a graphics, games or simulation engineer who wants to animate without a black box. Empirical first: each topic starts from what goes wrong on screen — keyframes that pop, a mass-spring system that explodes when \Delta t is too large — and only then names the tools that fix it: splines, integrators, inverse kinematics, motion matching.

The course goes from physical simulation to learned motion, and in doing so it prepares the real-time and control-oriented modules of the program.

What you will be able to do

Official objectives and syllabus (2026-2027 catalog)

The official course description sets three objectives: master the “standard industry methods for real-time and interactive animation” (special effects, animated cinema, video games), complemented by research-oriented approaches; lay the “fundamentals of physical simulation and particle-based methods”; and be “able to implement several of these methods in C++/OpenGL in an interactive context”.

The official description (paraphrased) presents a module of 3D animation teaching the animation and deformation methods of 3D shapes used in special effects, video games and animated films, and more generally in animated, interactive virtual worlds; its content details procedural animation approaches and the simulation methods that model physical phenomena, prepares both for R&D engineering and for research in computer graphics, and illustrates them mostly with entertainment applications (animated film, games, virtual and augmented reality) and real-time physical simulation, the mechanisms carrying over to medicine, biology or aerodynamics.

The cases treated in lectures and labs are the interactive animation and deformation of an articulated character, the deformation of a garment with real-time collision handling, and the simulation of a moving fluid surface. The course is mostly practice-oriented, half lectures and half exercise/lab sessions programmed in C++ with OpenGL.

Official prerequisites: INF443 for the École Polytechnique engineering students, “C++ and basics of computer graphics” for exchange students; the sheet displays neither the teaching volume nor any assessment text. The table follows the sheet’s detailed course plan (the English syllabus of the sheet lists the same items).

Official syllabus topic Course section
Kinematic animation: procedural approaches, keyframing Chapter 1 (keyframes and splines), extended in chapter 9 (crowds) and chapter 10 (procedural versus data-driven)
Geometric deformations Chapter 7 (skinning, LBS, Definition 7.3: dual quaternions, cages and free-form deformations, learned skinning)
Articulated virtual characters, skinning Chapters 7 (skinning) and 8 (inverse kinematics)
Facial animation Chapter 7, def. 7.5 (blendshapes) and example 7.6 (fitting the weights to tracked markers, split and corrective shapes)
Animation methods in production (cinema, VFX) Chapter 10, section The production pipeline (def. 10.4 departments, def. 10.5 caches, Alembic and USD, games versus film, example 10.6) and the note on the “standard sandwich”
Simulation models: particles, rigid bodies, continua Chapter 4 (particles, def. 4.1–4.4), chapter 5 (rigid bodies), chapter 4 def. 4.5 and example 4.7 (continuum models)
Elastic deformations, cloth Chapter 4: example 4.3 (step for a garment), def. 4.5, section Elasticity, cloth and fluids in practice (example 4.7 from Young’s modulus to springs and the CFL step, def. 4.8 Baraff–Witkin cloth energies); garment collisions in chapter 6
Fluids (grid and particle approaches) Chapter 4: def. 4.6, def. 4.9 (SPH density, pressure, symmetric forces), def. 4.10 (grid step with pressure projection), example 4.11 (semi-Lagrangian advection)
Cases of the sheet: articulated character, garment with real-time collisions, moving fluid surface Chapters 7–8 (skinning, IK); chapter 4 and chapter 6 (cloth and collisions, project Ex. 10); chapter 4 (fluids, free surface as an isosurface)

All official topics are covered. Elastic deformation, cloth and fluids were only named in definitions 4.5 and 4.6, the production pipeline only in a note, and facial animation had no worked example: the section on elasticity, cloth and fluids in practice (def. 4.8–4.10, examples 4.7 and 4.11), the section on the production pipeline (def. 10.4–10.5, example 10.6) and example 7.6 were added against the 2026-2027 sheet.

Our extensions, beyond the official syllabus: chapters 0–3 (mathematical refreshers, numerical integration and stability theory — the tooling that distinguishes this course from a physics-engine tutorial), chapter 6 (collisions and constraints), chapter 9 (crowds and behaviors) and chapter 11 (research work).

Where this course fits in the program

Module of period 1 of M1 (36 h, 4.5 ECTS). These materials present it as an option outside the recommended track; the MSc&T brochure counts it among the period’s courses. It is taken at the very beginning of the year, with no prerequisites among the other modules of the master’s program.

Course outline

Session plan

36 h in class = 12 sessions of 3 h. The SynapseS 2026–2027 sheet displays no volume for this course (no hours in person, no lecture / small-class split), but the LLGA curriculum page of the programme wiki (msct.dix.polytechnique.fr/llga, last modified on 9 September 2026 by the programme director) states that “all subsequent M1 courses are 36h and will credit 4.5 ECTS”; the sheet only says that the course is half lectures, half exercise/lab sessions in C++ with OpenGL.

The sheet gives a course plan but no session-by-session programme, so the split below is our proposal for covering these notes in that time; it keeps the integration and stability tools (ch. 2–3) before the simulation topics that need them.

Level 1 = foundations (refreshers, definitions, first worked examples), 2 = core methods, 3 = advanced material (learned animation, open questions); the level never goes down from one session to the next.

Session Hours Level Content Practice
1 3 h 1 ch. 0 Refresher: ODEs, the harmonic oscillator; ch. 1 Keyframes and Hermite interpolation Ex. 1
2 3 h 1 ch. 1 (end) Bézier, Catmull-Rom, B-splines, easing lab: a spline editor for a camera path
3 3 h 1 ch. 2 Numerical integration: explicit, symplectic and implicit Euler, order Ex. 2
4 3 h 2 ch. 3 Stability: the oscillator theorem, stability regions, stiffness Ex. 5
5 3 h 2 ch. 4 Particles, mass-spring networks, eigenmodes, the implicit step (Def. 4.1–4.4 and the simulator code) Ex. 3
6 3 h 2 ch. 4 (end) Continuum models, cloth, fluids (Def. 4.5–4.6); elasticity, cloth and fluids in practice: Young’s modulus and the CFL step, Baraff–Witkin energies, SPH, grid step with projection, semi-Lagrangian advection (Ex. 4.7–4.11) Ex. 10 (start of the project)
7 3 h 2 ch. 5 Rigid bodies, quaternions, angular momentum Ex. 6
8 3 h 2 ch. 6 Collisions: detection, impulses (with rotation, C++ lab stub), constraints, PBD Ex. 4
9 3 h 2 ch. 7 Skinning: LBS, the candy-wrapper theorem, DQS, cages, blendshapes and their fitting to markers (Example 7.6) Ex. 7
10 3 h 2 ch. 8 Inverse kinematics: closed form, Jacobian, CCD, FABRIK Ex. 8
11 3 h 2 ch. 9 Crowds: boids, social forces, navigation Ex. 9
12 3 h 3 ch. 10 Procedural versus data-driven: motion matching, learned motion; the production pipeline (cinema, VFX): departments, caches, Alembic and USD Ex. 10 (project review)

Self-study, outside the 36 h (about 2 h in total): ch. 11 Course research notes (Desbrun) — smoothed particles, discrete exterior calculus and the landmark on animated implicit surfaces (≈ 2 h).

How to study this module

Independent note This module embodies a crossover that the master’s program deliberately cultivates: the virtual worlds simulated here become training environments for agents, and learned animation builds on the neural networks seen in P1. It is a gateway toward careers in video games, special effects and industrial simulation, as well as toward research in geometric deep learning extended in M2 by Analysis and Deep Learning on Geometric Data.

0. Refresher: ODEs, Taylor, rotations, energy

This chapter puts back in place the mathematics a simulator runs on: ordinary differential equations, Taylor expansions, rotations and mechanical energy. Its most important object is the harmonic oscillator, on which every integrator of the course will be tested.

L3 prerequisites mobilized

  • Cauchy problem: an ODE \dot{\mathbf{y}} = f(t, \mathbf{y}), \mathbf{y}(0) = \mathbf{y}_0, admits (Cauchy-Lipschitz theorem) a unique local solution as soon as f is Lipschitz in \mathbf{y} — all of physical animation is the numerical resolution of such problems;
  • Taylor expansion to order 2 and 3 of a smooth function, Lagrange remainder — it gives the order of integrators (chapter 2);
  • Orthogonal matrices and rotations: R \in SO(3) if and only if R^\top R = I, \det R = 1; eigenvectors, rotation angle; unit quaternions will be revisited in chapter 5;
  • Real symmetric matrices: diagonalizable in an orthonormal basis, real eigenvalues — the stiffness of a mass-spring system is read in the spectrum of M^{-1}K (chapters 3 and 4);
  • Mechanical energy: E = \frac12 m v^2 + U(x), conserved when the forces derive from a potential and there is no friction — an integrator that makes E grow “blows up”, an integrator that dissipates it artificially “damps”.

Proposition 0.1 — The harmonic oscillator, the course’s compass For m = 1, k = \omega^2, the system \ddot{x} = -\omega^2 x (one degree of freedom) rewrites as a first-order system with a two-dimensional state: \dot{\mathbf{y}} = A\,\mathbf{y}, \qquad \mathbf{y} = \begin{pmatrix} x \\ v \end{pmatrix}, \quad A = \begin{pmatrix} 0 & 1 \\ -\omega^2 & 0 \end{pmatrix}, \qquad \sigma(A) = \{\, i\omega,\ -i\omega \,\}. The exact solution is a uniform rotation of angular frequency \omega in the plane (x, v/\omega): x(t) = x_0\cos\omega t + \tfrac{v_0}{\omega}\sin\omega t , and the energy E = \tfrac12 v^2 + \tfrac12 \omega^2 x^2 is constant.

Any integrator that, on this trivial system, increases E will diverge on a real system — this is the stability criterion of chapter 3.

Why this refresher structures the whole module A spring (garment, muscle, soft body), a regularized walking step, a penalized contact: almost all forces in animation are stiff and dissipative. The behavior of a numerical scheme on the pair \{i\omega, -c \pm i\omega\} — pure imaginary and complex with negative real part — predicts its behavior in production. This reading grid will reappear in chapters 3 (stability), 4 (stiffness of springs) and 6 (penalization of contacts).

1. The animation pipeline: keyframes and splines

Concrete scene: a character walk that “floats” because the poses between the keyframes are interpolated without any control of the velocities. This chapter answers the first question of every animation system: given a few poses fixed by the animator, how do we fill in the frames between them smoothly?

What breaks Three classic failures: interpolating the keys without prescribing tangents (the velocity jumps at every key), ignoring contacts (feet that slide on the ground), and, once simulation enters, a time step \Delta t too large for the stiffness of the system (chapters 2 and 3).

Definition 1.1 — Keyframe animation An animator specifies keyframes — values of articulation parameters at given instants, (t_i, \mathbf{p}_i)_{i=0}^{n} — and the system interpolates between them. The parameters are typically the angles of a skeleton (chapter 7), the position of a camera, or temporal attributes (color, intensity). The interpolation must be at least C^1 to avoid visible velocity jerks (the brain is very sensitive to discontinuous first derivatives of motion).

Theorem 1.2 — Cubic Hermite interpolation: existence, uniqueness, basis Let instants t_0 < t_1, prescribed position \mathbf{p}_0, \mathbf{p}_1 and velocities \mathbf{v}_0, \mathbf{v}_1. There exists a unique vector polynomial of degree \leq 3, \mathbf{p}(t), such that \mathbf{p}(t_i) = \mathbf{p}_i, \qquad \dot{\mathbf{p}}(t_i) = \mathbf{v}_i . Setting s = \dfrac{t - t_0}{T}, T = t_1 - t_0:

Key result — cubic Hermite interpolation \mathbf{p}(t) = h_{00}(s)\,\mathbf{p}_0 + T\,h_{10}(s)\,\mathbf{v}_0 + h_{01}(s)\,\mathbf{p}_1 + T\,h_{11}(s)\,\mathbf{v}_1 h_{00} = 2s^3 - 3s^2 + 1,\qquad h_{10} = s^3 - 2s^2 + s,\qquad h_{01} = -2s^3 + 3s^2,\qquad h_{11} = s^3 - s^2.

Proof. A cubic polynomial has 4 coefficients; the 4 conditions (value and derivative at t_0 and t_1) form a square linear system. By temporal scaling we reduce to t_0 = 0, t_1 = 1.

The Vandermonde matrix of the system (conditions at 0 and 1) is invertible: its determinant equals 1 (rows (1,0,0,0), (0,1,0,0), (1,1,1,1), (0,1,2,3) after rearrangement).

Solving the system for each of the four right-hand sides (1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1) (value at 0, derivative at 0, value at 1, derivative at 1) yields exactly h_{00}, h_{10}, h_{01}, h_{11}: each one equals 1 on one condition and 0 on the three others, so they form a basis of the cubic polynomials, and the general solution is the announced linear combination. ∎

Example 1.3 — Obstacle jump, numerical values An object leaves \mathbf{p}_0 = 0 and reaches \mathbf{p}_1 = 2 meters in T = 1 s, with prescribed velocities \mathbf{v}_0 = \mathbf{v}_1 = 1 m/s. At the midpoint s = \tfrac12: h_{10} = \tfrac18 - \tfrac12 + \tfrac12 = 0.125, \quad h_{01} = -\tfrac14 + \tfrac34 = 0.5, \quad h_{11} = \tfrac18 - \tfrac14 = -0.125, \quad h_{00} = \tfrac14 - \tfrac34 + 1 = 0.5 . Hence \mathbf{p}(\tfrac12) = 0.5 \cdot 0 + 0.125 \cdot 1 + 0.5 \cdot 2 - 0.125 \cdot 1 = 1.0 \text{ m} — the expected symmetric value.

Differentiating, \mathbf{p}(s) = h_{10} + 2h_{01} + h_{11} = -2s^3 + 3s^2 + s has velocity \dot{\mathbf{p}}(s) = -6s^2 + 6s + 1: 1 m/s at both ends, as prescribed, and 2.5 m/s at the midpoint.

The object accelerates then decelerates around its mean speed of 2 m/s — an ease-in/ease-out profile obtained without any physics, simply because the end velocities are lower than the mean velocity.

Definition 1.4 — Bézier, Catmull-Rom, B-splines

  • Cubic Bézier: the tangents become control points \mathbf{b}_0,\dots,\mathbf{b}_3, with \mathbf{v}_0 = 3(\mathbf{b}_1 - \mathbf{b}_0)/T. The de Casteljau algorithm evaluates through three successive affine subdivisions — stable and parallelizable (GPU);
  • Catmull-Rom: the velocities are deduced from the neighbors, \mathbf{v}_i = \dfrac{\mathbf{p}_{i+1} - \mathbf{p}_{i-1}}{t_{i+1} - t_{i-1}} : the curve passes through all the keys, is C^1, and local: moving the key \mathbf{p}_i changes \mathbf{p}_i and the tangents \mathbf{v}_{i-1}, \mathbf{v}_{i+1}, hence the four segments between t_{i-2} and t_{i+2} (the locality of a cubic B-spline);
  • Cubic B-splines: C^2 but the curve does not interpolate the keys (they become approximation points) — the standard compromise for camera curves, where continuity of acceleration avoids shaking.
Curve Continuity Passes through the keys? Locality Typical use
Hermite / Bézier C^1 yes strong animator poses, UI
Catmull-Rom C^1 yes four segments trajectories, cameras
Cubic B-spline C^2 no four segments cinematic camera

Easing and temporal interpolation The same bases apply to time: resampling s \mapsto \sigma(s) (ease-in/out functions, polynomials of degree 3 or 5 satisfying \sigma(0)=0, \sigma(1)=1, \sigma'=0 at the endpoints) amounts to composing the spline with a change of clock.

Caution: composing two C^1 functions ensures nothing beyond C^1 — the perceived quality depends on \dot{\sigma}, hence the “slow-in / slow-out” profiles inspired by the classic Disney animation principles.

2. Numerical integration of ODEs

Physical animation reduces to solving an ODE \dot{\mathbf{y}} = f(\mathbf{y}) one frame at a time, without access to its exact solution. This chapter defines the three integrators used throughout the course and measures their accuracy; their stability, which matters even more, is the subject of chapter 3.

Definition 2.1 — One integration step An integrator (or scheme) builds a sequence \mathbf{y}_{n} \approx \mathbf{y}(t_n), t_n = n h, through a map \mathbf{y}_{n+1} = \Phi_h(\mathbf{y}_n). The module’s three reference schemes, for \dot{\mathbf{y}} = f(\mathbf{y}):

Key result — the three Euler schemes \text{Explicit Euler}\ (EE)\ : \quad \mathbf{y}_{n+1} = \mathbf{y}_n + h f(\mathbf{y}_n) \text{Symplectic Euler}\ (ES)\ : \quad \begin{cases} \mathbf{v}_{n+1} = \mathbf{v}_n + h\, \mathbf{a}(\mathbf{x}_n, \mathbf{v}_n)\\ \mathbf{x}_{n+1} = \mathbf{x}_n + h\, \mathbf{v}_{n+1} \end{cases} \text{Implicit Euler}\ (EI)\ : \quad \mathbf{y}_{n+1} = \mathbf{y}_n + h f(\mathbf{y}_{n+1}) \ \ \text{(to be solved, e.g. by Newton)}

For Newton’s second law \dot{\mathbf{x}} = \mathbf{v},\ \dot{\mathbf{v}} = \mathbf{a}(\mathbf{x}), ES updates the velocity first, then the position with the new velocity — a single line of code different from EE, and a qualitatively different behavior (chapter 3).

Definition 2.2 — Local error and order The local error of a scheme is e(h) = \|\Phi_h(\mathbf{y}(t_n)) - \mathbf{y}(t_n + h)\| (a single step from the exact solution). The scheme is of order p if e(h) = O(h^{p+1}); the global error accumulated over a fixed time interval is then O(h^p).

Theorem 2.3 — Explicit Euler is of order 1 If f is C^2, the local error of explicit Euler is \mathbf{y}(t_n + h) - \Phi_h(\mathbf{y}(t_n)) = \tfrac{h^2}{2}\ddot{\mathbf{y}}(t_n) + O(h^3) : the scheme is of order 1 (global error in O(h)).

Proof. Taylor: \mathbf{y}(t_n + h) = \mathbf{y}(t_n) + h\dot{\mathbf{y}}(t_n) + \tfrac{h^2}{2}\ddot{\mathbf{y}}(t_n) + O(h^3). Now \dot{\mathbf{y}}(t_n) = f(\mathbf{y}(t_n)) and \Phi_h(\mathbf{y}(t_n)) = \mathbf{y}(t_n) + h f(\mathbf{y}(t_n)) : the difference is exactly the term \tfrac{h^2}{2}\ddot{\mathbf{y}} + O(h^3). ∎

Example 2.4 — Fall with friction: EE versus exact \dot{v} = g - \tfrac{c}{m} v with g = 9.8, c/m = 2 (terminal velocity v_\infty = 4.9 m/s), v_0 = 0. Exact solution: v(t) = v_\infty (1 - e^{-2t}). With EE, v_{n+1} = v_n(1 - 2h) + 9.8h:

t exact EE, h = 0.1 error
0.5 3.097 3.294 +6.4%
1.0 4.237 4.374 +3.2%
2.0 4.810 4.844 +0.7%

The error decreases as equilibrium is approached (the system is dissipative); but if h > 2/(c/m) = 1 s, the factor 1 - 2h < -1 and the sequence oscillates while diverging — a prelude to chapter 3.

Note that RK4 (order 4, four evaluations of f per step) divides the error by \sim 10^3 at equal h on this smooth example, without decisively changing the stability condition.

Example 2.5 — Three schemes, one oscillator, by hand Take the oscillator of Proposition 0.1 with \omega = 1, h = 0.1, start (x_0, v_0) = (1, 0), energy E_0 = \tfrac12(x^2 + v^2) = 0.5. One step of each scheme:

  • EE: x_1 = x_0 + h v_0 = 1, v_1 = v_0 - h x_0 = -0.1, so E_1 = 0.505 — the energy has grown by 1%;
  • ES: v_1 = -0.1 first, then x_1 = x_0 + h v_1 = 0.99, so E_1 = 0.495;
  • EI: the two equations x_1 = x_0 + h v_1, v_1 = v_0 - h x_1 are coupled; substituting gives x_1 = 1/(1 + h^2) \approx 0.9901, \qquad v_1 \approx -0.0990, \qquad E_1 \approx 0.495 .

After one step ES and EI look alike. The difference appears over a period, 2\pi/h \approx 63 steps:

  • EE ends at E \approx 0.94 (+87%);
  • EI ends at E \approx 0.27 (−47%, the oscillation is visibly damped);
  • ES returns to E \approx 0.499, having stayed between 0.48 and 0.53 the whole time.

Three schemes of the same order 1 and the same cost, three qualitatively different motions: this is why chapter 3 judges integrators by stability rather than by order.

Which scheme for which animation? In production:

  • symplectic Euler for particles and garments (free, stable, slightly damping);
  • implicit Euler (or semi-implicit via Newton, a few iterations) for stiff systems — hair, fine cloth, fluids;
  • “leapfrog” Verlet (order 2, symplectic) in video games;
  • RK4 rarely, because it is expensive and not symplectic.

Order is not the first criterion in animation; stability and qualitative conservation (bounded energy) take precedence — this is the subject of the next chapter.

3. Stability: the oscillator theorem

A small time step does not guarantee a sane simulation: some schemes add energy at every step, whatever the step. This chapter makes this precise on the harmonic oscillator and derives, for each scheme of chapter 2, the condition under which the simulation stays bounded.

Definition 3.1 — Amplification and stability Applied to the linear system \dot{\mathbf{y}} = A\mathbf{y}, the schemes of chapter 2 write \mathbf{y}_{n+1} = G\,\mathbf{y}_n with G linear.

The scheme is stable on this system if every component remains bounded. This holds when the spectral radius \rho(G) \leq 1 and every eigenvalue of modulus 1 is semisimple (no Jordan block larger than 1 \times 1).

It is unstable if \rho(G) > 1 (geometric divergence), or if an eigenvalue of modulus 1 is defective (linear growth, as at h\omega = 2 in Theorem 3.5).

For EE, G = I + hA; for EI, G = (I - hA)^{-1}: in both cases stability depends on the product h\lambda for each eigenvalue \lambda of A. The set \{z \in \mathbb{C} : |1 + z| \leq 1\} \quad (\text{resp. } \{z \in \mathbb{C} : |1 - z| \geq 1\}) is the stability region of EE (resp. EI): for a diagonalizable A, such as the oscillator’s, the scheme is stable when z = h\lambda lies in it for every eigenvalue \lambda.

Theorem 3.2 — Explicit Euler diverges on the oscillator, for every step For the oscillator \ddot{x} = -\omega^2 x (eigenvalues \lambda = \pm i\omega), EE gives x_{n+1} = x_n + h v_n, v_{n+1} = v_n - h\omega^2 x_n, that is G_{EE} = \begin{pmatrix} 1 & h \\ -h\omega^2 & 1 \end{pmatrix}, \qquad \det(G_{EE} - \lambda I) = (1-\lambda)^2 + h^2\omega^2, whose roots are \lambda_\pm = 1 \pm i\,h\omega. Hence, for every h > 0,

Key result — explicit Euler on the oscillator \rho(G_{EE}) = \sqrt{1 + h^2\omega^2} > 1 :

the energy grows by \rho^2 = 1 + h^2\omega^2 per step, independently of the fineness of the step.

Proof. The characteristic polynomial is computed directly. The roots are obtained by solving (1 - \lambda)^2 = -(h\omega)^2, i.e. 1 - \lambda = \pm i h\omega.

The modulus of 1 \pm i h\omega equals \sqrt{1 + h^2\omega^2}, strictly greater than 1 as soon as h\omega \neq 0.

The component of \mathbf{y}_0 on an eigenvector grows like \rho^n: after n steps, \|\mathbf{y}_n\| \gtrsim \rho^n. ∎

Example 3.3 — A measured explosion With \omega = 1, h = 0.1 (about 63 steps per period, yet a “fine” step): \rho = \sqrt{1.01} \approx 1.005. The amplitude grows by 0.5% per step and the energy by \rho^2 - 1 = 1\%:

  • after 100 steps (1.6 periods) the amplitude is ×1.64 and the energy ×2.7;
  • after 1000 steps, the amplitude is ×145 and the energy ×21 000.

On screen: a ball bouncing higher and higher without any energy injected — the classic artifact of the intern who codes EE on a spring.

Theorem 3.4 — Implicit Euler is unconditionally stable (A-stable) On the same oscillator, EI writes G_{EI} = (I - hA)^{-1}, with eigenvalues \dfrac{1}{1 \mp i h\omega}, of modulus \dfrac{1}{\sqrt{1 + h^2\omega^2}} < 1 : stable for every h, with a numerical damping that grows with h.

More generally, \rho(G_{EI}) < 1 as soon as all the eigenvalues of A have real part < 0 — a property called A-stability (Dahlquist, 1963).

Proof. (I - hA)\mathbf{u} = (1 - h\lambda)\mathbf{u} for every eigenvector \mathbf{u}, so the eigenvalues of the inverse are the inverses (1 - h\lambda)^{-1}.

  • If \lambda = i\omega, |1 - i h\omega| = \sqrt{1 + h^2\omega^2} > 1 so the inverse has modulus < 1.
  • If \mathrm{Re}\,\lambda < 0, then |1 - h\lambda|^2 = (1 - h\mathrm{Re}\lambda)^2 + (h\mathrm{Im}\lambda)^2 > 1, whence the result for every h > 0. ∎

Theorem 3.5 — Symplectic Euler: conditional stability and bounded energy With ES, v_{n+1} = v_n - h\omega^2 x_n, x_{n+1} = x_n + h v_{n+1}: G_{ES} = \begin{pmatrix} 1 - h^2\omega^2 & h \\ -h\omega^2 & 1 \end{pmatrix}, \qquad \det G_{ES} = 1, \qquad \mathrm{tr}\, G_{ES} = 2 - h^2\omega^2. The scheme is stable if and only if h\omega < 2 (at exactly h\omega = 2 a double eigenvalue -1 makes the amplitude drift linearly, Exercise 5).

Moreover \det G_{ES} = 1 (conservation of areas in the phase plane): under this condition the energy oscillates around its initial value instead of drifting.

Proof. \lambda_+ \lambda_- = \det = 1 and \lambda_+ + \lambda_- = \mathrm{tr} = 2 - h^2\omega^2. Set c = 1 - \tfrac{h^2\omega^2}{2} = \tfrac{\mathrm{tr}}{2}.

  • If |c| < 1 (i.e. 0 < h\omega < 2), the roots of \lambda^2 - 2c\lambda + 1 are the two distinct complex numbers \lambda_\pm = c \pm i\sqrt{1 - c^2}, of modulus \sqrt{c^2 + 1 - c^2} = 1 : bounded.
  • If h\omega > 2, then c < -1, the roots are real, \lambda_\pm = c \pm \sqrt{c^2 - 1}, and \max|\lambda_\pm| = |c| + \sqrt{c^2 - 1} > 1 with a sign change (zigzag divergence).

Conservation of areas is the determinant: it is the trace of a geometric property (symplecticity) that EE and EI lack. ∎

Scheme Order Stability condition (oscillator) Energy on stable h\omega Cost/step
Explicit Euler 1 never stable grows geometrically 1 eval. of f
Symplectic Euler 1 h\omega < 2 bounded, oscillating 1 eval. of f
Verlet (leapfrog) 2 h\omega < 2 bounded, oscillating 1 eval. of f
Implicit Euler 1 always stable decreases (damped) 1 linear solve

Stiff systems: why garments are “unstable” A cloth mass-spring network contains very stiff bending springs: its natural frequencies range from \omega_{\min} to \omega_{\max} \gg \omega_{\min}.

The constraint h < 2/\omega_{\max} then imposes a minuscule step dictated by the fastest modes while the visible motion is slow: this is stiffness. Two ways out: the implicit approach (solve a system at every step, chapter 4) or abandoning forces for position constraints (PBD, chapter 6). The link with symplectic schemes and variational methods is a research theme of the teaching team (chapter 11).

4. Particles, forces, mass-spring systems

This chapter builds the first complete physical system of the course: a set of point masses subjected to gravity, drag and springs. It then shows how the stability results of chapter 3 dictate the time step, and how the same machinery extends to continuous materials, cloth and fluids.

Definition 4.1 — Particle system A system of n particles is the state (\mathbf{x}_i, \mathbf{v}_i)_{i=1}^n \in \mathbb{R}^{6n} endowed with a force field \mathbf{F}_i(\mathbf{x}, \mathbf{v}). The dynamics \dot{\mathbf{x}}_i = \mathbf{v}_i,\ m_i \dot{\mathbf{v}}_i = \mathbf{F}_i is integrated by one of the schemes of chapter 2. Usual forces:

  • gravity m_i \mathbf{g};
  • linear drag -c_d \mathbf{v}_i or quadratic -c_q \|\mathbf{v}_i\| \mathbf{v}_i;
  • spring, with \ell = \mathbf{x}_j - \mathbf{x}_i and rest length r_{ij}: \mathbf{F}_{i\leftarrow j} = k(\|\ell\| - r_{ij})\,\hat{\ell} ;
  • axial damper -c\,(\mathbf{v}_j - \mathbf{v}_i)\cdot \hat{\ell}\,\hat{\ell} .

This is the basic model of “magical” effects (fire, smoke, dust) and the forerunner of the SPH fluids of Definition 4.6.

Proposition 4.2 — Eigenmodes of a mass-spring network For small displacements around rest, a network with masses M (diagonal) and stiffness matrix K (symmetric, positive definite if the network is anchored) linearizes to M\ddot{\mathbf{u}} = -K\mathbf{u}. The natural frequencies are \omega_k^2 = \lambda_k(M^{-1}K), \qquad k = 1, \dots, 3n, and the stability condition of symplectic Euler (Theorem 3.5) becomes h < 2/\omega_{\max} = 2/\sqrt{\lambda_{\max}(M^{-1}K)}.

Example 4.3 — Choosing the step for a garment A discrete cloth of 20 \times 20 points, mesh size d = 1 cm, structural springs k_s = 50 N/m, mass per point m = 2 g. The fastest mode is the zigzag in which neighboring points move in opposite directions, so each point is pulled by the two springs of its row; as for the chain of Example 4.7, the largest eigenvalue of M^{-1}K is just below 4k_s/m: \omega_{\max} \approx 2\sqrt{k_s/m} = 2\sqrt{50 / 0.002} \approx 316 \text{ rad/s}, hence h < 2/\omega_{\max} \approx 6.3 ms (≈ 160 Hz). The frequency \sqrt{2k_s/m} of an isolated pair of masses would underestimate it.

With “2-hop” bending springs five times stiffer, \omega_{\max} grows by a factor of about 2.3 (\sqrt{5} \approx 2.24 from the bending springs alone, a little more with the structural ones) and the allowed step shrinks accordingly — hence the value of the implicit approach. Remember the orders of magnitude:

  • real-time garment simulation: h \sim 2–5 ms, implicit;
  • effects particles: h \sim 16–33 ms, symplectic.

Definition 4.4 — Implicit: the system to solve The implicit Euler step M\mathbf{v}_{n+1} = M\mathbf{v}_n + h\,\mathbf{F}(\mathbf{x}_{n+1}), \qquad \mathbf{x}_{n+1} = \mathbf{x}_n + h\,\mathbf{v}_{n+1} is nonlinear in the unknowns. Linearizing the forces once, \mathbf{F}(\mathbf{x}_{n+1}) \approx \mathbf{F}(\mathbf{x}_n) + J\,h\,\mathbf{v}_{n+1} \quad \text{with} \quad \mathbf{v}_{n+1} = \mathbf{v}_n + \Delta\mathbf{v}, gives the semi-implicit step of Baraff and Witkin:

Key result — the semi-implicit step \big(M - h^2 J\big)\,\Delta\mathbf{v} = h\,\big(\mathbf{F}(\mathbf{x}_n) + h\,J\,\mathbf{v}_n\big), \qquad J = \frac{\partial \mathbf{F}}{\partial \mathbf{x}} \ \ \text{(force Jacobian)},

then \mathbf{v}_{n+1} = \mathbf{v}_n + \Delta\mathbf{v}, \mathbf{x}_{n+1} = \mathbf{x}_n + h\,\mathbf{v}_{n+1}.

For springs near rest, J = -K is symmetric negative semi-definite, so M - h^2 J is symmetric positive definite for every h: the system always has a unique solution. In practice one solves it by conjugate gradient without assembling J (the matrix-vector products are computed by looping over the springs) — the same matrix-free idea as backpropagation, which never forms a Jacobian either.

Beyond springs: spheres and density Interactional particle systems (SPH fluids, MPM sand) replace fixed links with finite-range interactions: each particle carries a density \rho_i = \sum_j m_j W(\|\mathbf{x}_j - \mathbf{x}_i\|) \quad (\text{kernel } W), and the forces derive from a compression energy potential. The free surface is the isosurface \rho = \rho_0 — this is the smoothed particles paradigm of Desbrun & Cani (1996), chapter 11: merging, splashing and object separation emerge without any imposed topology.

Definition 4.5 — Continuum models: elasticity and cloth Mass-spring networks imitate the continuum; continuum models discretize it.

Linear elasticity: the strain energy \int_S \|\varepsilon\|^2 \, \mathrm{d}S (Hooke’s law) is computed after cutting into elements — for surfaces, co-rotational triangles that remove the rigid rotation before measuring the strain; the gradient of the energy yields forces, integrated by the schemes of ch. 2.

Cloth: the standard Baraff–Witkin (1998) model decouples stretching (stiff, penalized locally), shearing and bending (soft); a garment becomes a constrained mesh — collisions and friction with the body via ch. 6, and high stiffnesses that call for the implicit method (def. 4.4).

A modern alternative: position-based dynamics — projecting the positions directly onto the inextensibility constraints: stable, fast, somewhat dissipative; this is the PBD/XPBD family of real-time engines (ch. 6).

Definition 4.6 — Fluids: particle (SPH) and grid (Eulerian) approaches Two main families, depending on what lives in memory:

  • Lagrangian — particles (SPH): the fluid is a particle system carrying mass and smoothed density; pressure and viscosity derive from kernels (cf. the Note above). Free of topology: splashes and separation for free; difficulty: the sampling degenerates under high pressures;

  • Eulerian — grids: the velocity lives on a fixed grid, the state (\mathbf{u}, \rho) evolves by incompressible Navier–Stokes: advect (semi-Lagrangian, unconditionally stable), add the forces, then project onto divergence-free fields (a Poisson equation per step — the Hodge projection of Stable Fluids, Stam, 1999).

    The grid captures the vortices, but numerical diffusion kills them at small scales — hence the FLIP/PIC hybrids (particles for advection, grid for pressure) and MPM for granular materials (sand, snow — ch. 11).

Production choices: SPH for interactive splashes, grid and FLIP for movie fluids, MPM for soft materials: all three share the integration loop and the stability concerns of the rest of the chapter.

import numpy as np

# ------------- Particle simulator: symplectic Euler -------------
# n particles, gravity, chain of springs, impenetrable ground (restitution 0.8)
def simulate(n=40, steps=1200, h=1/240, seed=0):
    rng = np.random.default_rng(seed)
    x = rng.uniform(-1, 1, (n, 3)); x[:, 2] += 1.5   # initial positions
    v = np.zeros((n, 3))
    m = np.full(n, 0.05)                             # 50 g per particle
    g = np.array([0, 0, -9.81]); mu = 0.7            # gravity, linear drag
    # springs (i, j, stiffness k, damping c, rest length r)
    edges = [(i, i + 1, 80.0, 0.4, 0.15) for i in range(n - 1)]
    for _ in range(steps):
        F = m[:, None] * g[None, :]                  # gravity
        for (i, j, k, c, r) in edges:                # spring + damper
            d = x[j] - x[i]; L = np.linalg.norm(d); u = d / L
            Fij = (k * (L - r) + c * np.dot(v[j] - v[i], u)) * u
            F[i] += Fij; F[j] -= Fij
        v += h * F / m[:, None]     # (1) velocity first   -- symplectic Euler
        v *= (1 - mu * h)           # global linear drag
        x += h * v                  # (2) position next
        hit = x[:, 2] < 0           # ground z = 0: projection + bounce
        x[hit, 2] = 0
        v[hit, 2] = -0.8 * v[hit, 2]
        yield x.copy(), v.copy()

# total mechanical energy = kinetic + gravity + springs (same m, k, r as above)
def energy(x, v, m=0.05, k=80.0, r=0.15):
    L = np.linalg.norm(np.diff(x, axis=0), axis=1)   # lengths of the chain springs
    return (0.5 * m * (v ** 2).sum() + m * 9.81 * x[:, 2].sum()
            + 0.5 * k * ((L - r) ** 2).sum())

# drag, dampers and restitution 0.8 only remove energy: E must decay
# (about 2800 J -> 0.03 J); any sustained growth means an unstable step
for step, (x, v) in enumerate(simulate()):
    if step % 240 == 0:
        print(f"t = {step/240:5.2f} s   E = {energy(x, v):9.3f} J")

Reading the code Two details matter more than everything else:

  1. the order of the “velocity then position” lines — swapping these two lines gives back explicit Euler and makes the chain explode (try it with k = 500);
  2. handling of the ground by projection (position corrected, velocity reflected) foreshadows the constraints of chapter 6: no contact spring, hence no added stiffness.

The energy printout is the most useful diagnostic of a physics engine, provided it counts every term (kinetic, gravity and springs). This system is deliberately dissipative — global drag, dampers, restitution 0.8 — so its energy must decay, with small step-to-step wiggles. A sustained growth is the signature of an unstable step (Theorem 3.2); without the dissipative terms, symplectic Euler would keep the energy oscillating around its initial value (Theorem 3.5).

Elasticity, cloth and fluids in practice

Definitions 4.5 and 4.6 name the models of the official syllabus (elastic deformation, cloth, fluids on grids and with particles). This section gives the equations a simulator actually implements, with one computation for each, and shows that the stability analysis of chapter 3 governs all of them.

Example 4.7 — From Young’s modulus to springs, and the time step it forces Cut an elastic bar of length L, cross-section A, Young’s modulus E and density \rho into N segments of length \Delta x = L/N.

A segment stretched from \Delta x to \Delta x + \delta has strain \varepsilon = \delta/\Delta x, stress E\varepsilon and tension EA\,\delta/\Delta x: it is a spring of stiffness, and each node carries the mass, k = EA/\Delta x, \qquad m = \rho A\,\Delta x .

The stiffness therefore depends on the mesh: halving \Delta x doubles k, so a mass-spring model whose k is not rescaled with the resolution changes material when it is refined — the main reason to start from continuum quantities (E, \rho) rather than from springs.

The stiffness matrix of the chain is k times a tridiagonal matrix (2 on the diagonal, -1 beside it) whose eigenvalues are at most 4, so by Proposition 4.2 \omega_{\max} \;\leq\; 2\sqrt{k/m} \;=\; \frac{2}{\Delta x}\sqrt{\frac{E}{\rho}}, \qquad\text{and Theorem 3.5 asks}\qquad h \;<\; \frac{2}{\omega_{\max}} \;=\; \frac{\Delta x}{c}, \quad c = \sqrt{E/\rho}. Here c is the speed of sound in the material: within one step, a wave must not cross more than one element (a CFL condition).

Numbers:

  • soft rubber (E \approx 1 MPa, \rho \approx 1000 kg/m³) gives c \approx 32 m/s and, with \Delta x = 1 cm, h < 0.3 ms;
  • steel (E \approx 200 GPa, \rho \approx 7800 kg/m³) gives c \approx 5000 m/s and h < 2\ \mus.

Stiff materials are therefore simulated with the implicit step of Definition 4.4, or treated as rigid bodies (ch. 5).

Definition 4.8 — Cloth energies (Baraff and Witkin, 1998) Each triangle of a garment has rest coordinates (u, v) in the flat sewing pattern and a world-space map \mathbf{w}(u, v), linear on the triangle; its derivatives \mathbf{w}_u, \mathbf{w}_v measure how the pattern is deformed (\|\mathbf{w}_u\| = 1 means no stretch along u). With a the rest area of the triangle, define the conditions C_{\text{stretch}} = a\,\big(\|\mathbf{w}_u\| - 1,\ \|\mathbf{w}_v\| - 1\big), \qquad C_{\text{shear}} = a\,\mathbf{w}_u \cdot \mathbf{w}_v, \qquad C_{\text{bend}} = \theta - \theta_0, the last one for two triangles sharing an edge, with \theta their dihedral angle. Each condition gives an energy E = \tfrac{k}{2}\|C\|^2 and the forces \mathbf{F} = -\partial E/\partial \mathbf{x} = -k\,(\partial C/\partial \mathbf{x})^\top C .

Stretch receives a large k (woven cloth hardly stretches), shear and bending small ones: only the stiff stretch term limits h, which is why Baraff and Witkin introduced the implicit step of Definition 4.4 together with these energies; collisions of the garment with the body are the subject of chapter 6.

Definition 4.9 — SPH: density, pressure and forces Take a smoothing kernel W(r, \ell) — positive, of support radius \ell, integrating to 1. Each particle i estimates the density, then a pressure from a state equation, then the pressure acceleration: \rho_i = \sum_j m_j\, W(\|\mathbf{x}_i - \mathbf{x}_j\|, \ell), \qquad p_i = \kappa\,(\rho_i - \rho_0), \qquad \mathbf{a}_i^{\text{press}} = -\sum_j m_j \Big(\frac{p_i}{\rho_i^2} + \frac{p_j}{\rho_j^2}\Big) \nabla_i W(\|\mathbf{x}_i - \mathbf{x}_j\|, \ell). Since \nabla_j W = -\nabla_i W, the force that j exerts on i is exactly opposite to the force that i exerts on j: momentum is conserved. Viscosity is added in the same pairwise way, gravity per particle, and the system is integrated with symplectic Euler (ch. 2).

The stiffness \kappa plays the role of k above: the speed of sound is c = \sqrt{\kappa} (since c^2 = \mathrm{d}p/\mathrm{d}\rho), so a nearly incompressible fluid (large \kappa) needs h \lesssim \ell/c — Example 4.7 again.

Definition 4.10 — One step of a grid fluid (Stable Fluids, Stam 1999) The velocity \mathbf{u} lives on a grid of spacing \Delta x and obeys the incompressible Navier–Stokes equations \partial_t \mathbf{u} + (\mathbf{u}\cdot\nabla)\mathbf{u} = -\nabla p/\rho + \nu \nabla^2 \mathbf{u} + \mathbf{g}, \qquad \nabla\cdot\mathbf{u} = 0. A step splits them into three parts:

  1. advection — trace the point back along the flow and interpolate (semi-Lagrangian): \mathbf{u}^\ast(\mathbf{x}) = \mathbf{u}(\mathbf{x} - \Delta t\,\mathbf{u}(\mathbf{x})) ;
  2. forces, then viscosity — add the body force, then diffuse implicitly (a sparse linear solve, stable for every \Delta t, as Stable Fluids does): \mathbf{u}^{+} = \mathbf{u}^\ast + \Delta t\,\mathbf{g}, \qquad \big(I - \nu\,\Delta t\,\nabla^2\big)\,\mathbf{u}^{\ast\ast} = \mathbf{u}^{+} ;
  3. projection: solve the Poisson equation and set the new velocity, \nabla^2 p = \frac{\rho}{\Delta t}\nabla\cdot\mathbf{u}^{\ast\ast}, \qquad \mathbf{u}_{n+1} = \mathbf{u}^{\ast\ast} - \frac{\Delta t}{\rho}\nabla p , which is divergence-free because \nabla\cdot\mathbf{u}_{n+1} = \nabla\cdot\mathbf{u}^{\ast\ast} - \frac{\Delta t}{\rho}\nabla^2 p = 0.

Step (3) is the expensive one: a sparse linear system per step (conjugate gradient or multigrid). In FLIP, particles carry the velocity through step (1), avoiding the diffusion of Example 4.11, while the grid performs step (3).

Example 4.11 — Semi-Lagrangian advection: stable but diffusive Advect a scalar q with constant velocity u = 1 on a 1D grid with \Delta x = 1 and \Delta t = 0.5.

The value arriving at node i started at x_i - 0.5, halfway between nodes i-1 and i, so linear interpolation gives q_i^{\text{new}} = \tfrac12 q_{i-1} + \tfrac12 q_i . A spike (0, 0, 1, 0, 0) becomes (0, 0, \tfrac12, \tfrac12, 0), then (0, 0, \tfrac14, \tfrac12, \tfrac14): the total is conserved and the mean position advances by 0.5 per step, as it should, but the spike spreads — numerical diffusion.

Each new value is a convex combination of old ones, so the maximum can never grow: the scheme is stable for every \Delta t (with \Delta t = 2.5 one interpolates between nodes i-3 and i-2), whereas an explicit upwind scheme needs u\,\Delta t/\Delta x \leq 1. This is the trade-off stated in Definition 4.6: grids are robust but smear small vortices, hence the FLIP/PIC hybrids.

5. Rigid bodies and quaternions

Particles have a position but no orientation; boxes, wheels and bones need both. This chapter describes the state of a rigid body, explains why orientations are stored as unit quaternions rather than angles, and gives the conservation law that a rotating body must respect.

Definition 5.1 — Rigid body A rigid body is a set of material points whose mutual distances are constant. Its configuration is an element of SE(3) = SO(3) \ltimes \mathbb{R}^3 (rotation + translation; a semidirect product, since composing two motions rotates the second translation), its state (\mathbf{c}, R, \mathbf{P}, \mathbf{L}): center of mass, orientation, linear momentum \mathbf{P} = M\mathbf{V} (with \mathbf{V} = \dot{\mathbf{c}} the velocity of the center of mass and M the total mass), angular momentum \mathbf{L}. The motion obeys \dot{\mathbf{P}} = \mathbf{F}_{ext}, \qquad \dot{\mathbf{L}} = \boldsymbol{\tau}_{ext} \ \ (\text{wrenches}), \qquad \mathbf{v}(\mathbf{p}) = \mathbf{V} + \boldsymbol{\omega} \times (\mathbf{p} - \mathbf{c}) where \boldsymbol{\omega} is the angular velocity, related to the angular momentum by \mathbf{L} = R\, I_{body}\, R^\top \boldsymbol{\omega}, with I_{body} the inertia matrix in the body frame (symmetric positive definite): R\,I_{body}R^\top is the same inertia expressed in the world frame.

Proposition 5.2 — Why unit quaternions Parameterizing SO(3) by three Euler angles suffers from gimbal lock (loss of rank of the parameterization, e.g. at ±90° of pitch) and from poor-quality interpolations.

Unit quaternions q = (w, \mathbf{u}), w^2 + \|\mathbf{u}\|^2 = 1, form the group \mathrm{Sp}(1) \simeq SU(2), double cover of SO(3). The rotation of angle \theta around the unit axis \mathbf{n} is

Key result — rotation as a unit quaternion q = (\cos\tfrac{\theta}{2},\ \mathbf{n}\sin\tfrac{\theta}{2}),

composition is the quaternion product, and q and -q give the same rotation (anticipation for the weighted summation of chapter 7).

With \boldsymbol{\omega} the world-frame angular velocity of Definition 5.1, integration uses \dot{q} = \tfrac12\, (0, \boldsymbol{\omega}) \otimes q \qquad \big(\text{equivalently } \tfrac12\, q \otimes (0, \boldsymbol{\omega}_{body}),\ \ \boldsymbol{\omega}_{body} = R^\top\boldsymbol{\omega}\big), then renormalization (q \leftarrow q/\|q\|) — the symplectic approach applies here too.

Theorem 5.3 — Conservation of angular momentum For a system of points subjected to central internal forces (\mathbf{F}_{ij} collinear with \mathbf{p}_j - \mathbf{p}_i) and with no external wrench, \mathbf{L} is constant: this is the “skater’s physics”.

Proof. We have \dot{\mathbf{L}} = \sum_i (\mathbf{p}_i - \mathbf{c}) \times \mathbf{F}_i . Let us group the internal forces in pairs (i, j), with \mathbf{F}_{ij} = -\mathbf{F}_{ji} collinear with \mathbf{d} = \mathbf{p}_j - \mathbf{p}_i (action-reaction principle + central forces): (\mathbf{p}_i - \mathbf{c}) \times \mathbf{F}_{ij} + (\mathbf{p}_j - \mathbf{c}) \times \mathbf{F}_{ji} = \big[(\mathbf{p}_i - \mathbf{c}) - (\mathbf{p}_j - \mathbf{c})\big] \times \mathbf{F}_{ij} = -\mathbf{d} \times \mathbf{F}_{ij} = 0 by collinearity. With no external wrench, \dot{\mathbf{L}} = 0. ∎

Example 5.4 — Pirouette: the numbers A skater modeled as a cylinder: arms spread I_1 = 4.0 kg·m², arms folded I_2 = 1.6 kg·m². She starts at \omega_1 = 1 turn/s. Conservation of L gives \omega_2 = (I_1/I_2)\,\omega_1 = 2.5 \text{ turns/s}. Kinetic energy E = \tfrac12 I\omega^2 with L = I\omega ⟹ E = \tfrac{L^2}{2I}: E_1 = L^2/8, \qquad E_2 = L^2/3.2 = 2.5\,E_1 — the energy increases: it is the muscular work of drawing the arms in (no contradiction with the conservation of L).

For a physics engine: integrating L and then recovering \omega = (R I_b R^\top)^{-1} L avoids the rotational energy drifts of stacked rigid bodies.

Solid (mass M, radius/length r or l) I (symmetry axis) Numerical example
Solid cylinder \tfrac12 M r^2 M=2 kg, r=0.3 m ⟹ I = 0.09 kg·m²
Solid sphere \tfrac25 M r^2 M=1 kg, r=0.1 m ⟹ I = 0.004 kg·m²
Rod (median axis) \tfrac{1}{12} M l^2 M=1.2 kg, l=1 m ⟹ I = 0.1 kg·m²

Implementation detail: sleeping is stable Stacking boxes at rest is the nightmare of real-time engines: micro-bounces keep the system alive. Industrial standard: “sleeping” (freezing bodies whose average velocity remains below a threshold for n frames), contact margins (allowing slight interpenetration), and sub-stepping (several small steps per frame rather than one large one). The major architectures (PhysX, Jolt, Bullet) combine all of this; the algorithm remains that of chapter 6.

6. Collisions and constraints

Simulated objects must not pass through each other or through the ground. This chapter splits the problem in two: finding the pairs that touch (detection), then changing velocities or positions so that the contact is respected (response).

Definition 6.1 — Detection: broad and narrow phases

  • Broad phase: eliminate distant pairs via axis-aligned bounding volumes (AABB, O(1) cost per pair, acceleration by sweeping — sweep and prune — or spatial grids); typically O(n \log n) for n particles.
  • Narrow phase: exact test of the pair (sphere-sphere: distance; sphere-plane: signed distance; box-box: separating axis test; arbitrary convex shapes: GJK, which searches the Minkowski difference A - B for its point closest to the origin with a sequence of simplices — the shapes intersect if and only if that difference contains the origin).

In physics-based animation, one also detects between steps (continuous collision: swept segment against triangles, or conservative advancement) to avoid wall tunneling at high velocities.

Theorem 6.2 — Impulse response: formula and consistency Two bodies a, b of masses m_a, m_b come into contact at a point with unit normal \mathbf{n} (from a to b), with relative velocity \mathbf{v}_{rel} = \mathbf{v}_b - \mathbf{v}_a and coefficient of restitution e \in [0, 1].

The scalar impulse that resolves the contact is

Key result — the contact impulse j = -\,\frac{(1 + e)\,(\mathbf{v}_{rel} \cdot \mathbf{n})}{\dfrac{1}{m_a} + \dfrac{1}{m_b}}, \qquad \mathbf{v}_a^+ = \mathbf{v}_a - \frac{j}{m_a}\mathbf{n}, \quad \mathbf{v}_b^+ = \mathbf{v}_b + \frac{j}{m_b}\mathbf{n}.

It conserves momentum and realizes exactly the restitution law (\mathbf{v}_{rel}^+ \cdot \mathbf{n}) = -e\,(\mathbf{v}_{rel} \cdot \mathbf{n}).

Proof. Write \Delta\mathbf{v}_a = -\tfrac{j}{m_a}\mathbf{n}, \Delta\mathbf{v}_b = +\tfrac{j}{m_b}\mathbf{n}: the total momentum varies by m_a \Delta\mathbf{v}_a + m_b \Delta\mathbf{v}_b = -j\mathbf{n} + j\mathbf{n} = 0. The normal relative velocity evolves as \mathbf{v}_{rel}^+ \cdot \mathbf{n} = \mathbf{v}_{rel}\cdot\mathbf{n} + j\big(\tfrac{1}{m_a} + \tfrac{1}{m_b}\big). Imposing the restitution law \mathbf{v}_{rel}^+\cdot\mathbf{n} = -e\,\mathbf{v}_{rel}\cdot\mathbf{n} gives (1 + e)\,\mathbf{v}_{rel}\cdot\mathbf{n} + j\big(\tfrac{1}{m_a} + \tfrac{1}{m_b}\big) = 0, that is, the announced formula. ∎

Example 6.3 — Billiard balls Ball a (m_a = 2 kg, v_a = 3 m/s) against ball b (m_b = 1 kg, at rest), head-on impact, e = 0.5.

With \mathbf{n} carried by the velocity: \mathbf{v}_{rel}\cdot\mathbf{n} = -3, and j = \tfrac{1.5 \times 3}{0.5 + 1} = 3 \text{ N·s}. Hence v_a^+ = 3 - \tfrac{3}{2} = 1.5 m/s, v_b^+ = 0 + 3 = 3 m/s.

Checks:

  • restitution (3 - 1.5)/3 = 0.5 ✓;
  • momentum 2 \times 1.5 + 1 \times 3 = 6 = 2 \times 3 ✓;
  • energy: from 9 to 6.75 J (2.25 J dissipated in deformation and sound), consistent with e < 1.

Billiard balls hit head-on, so the impulse passes through their centers and nothing turns. A box landing on a corner, a rod hitting the ground with one end or a car door slamming all receive the impulse off-center: part of it goes into rotation, and the formula of Theorem 6.2 must account for it.

Proposition 6.4 — Contact impulse between rotating bodies Let the bodies of Theorem 6.2 also rotate, with angular velocities \boldsymbol{\omega}_a, \boldsymbol{\omega}_b and world-frame inverse inertias I_a^{-1}, I_b^{-1} (Definition 5.1). Call \mathbf{r}_a = \mathbf{p} - \mathbf{c}_a and \mathbf{r}_b = \mathbf{p} - \mathbf{c}_b the lever arms of the contact point \mathbf{p}. The relative velocity is now taken at the contact point: \mathbf{v}_{rel} = (\mathbf{v}_b + \boldsymbol{\omega}_b \times \mathbf{r}_b) - (\mathbf{v}_a + \boldsymbol{\omega}_a \times \mathbf{r}_a), and the impulse gains one angular term per body in its denominator:

Key result — the contact impulse with rotation j = -\,\frac{(1 + e)\,(\mathbf{v}_{rel}\cdot\mathbf{n})}{\dfrac{1}{m_a} + \dfrac{1}{m_b} + (\mathbf{r}_a \times \mathbf{n})^\top I_a^{-1}(\mathbf{r}_a \times \mathbf{n}) + (\mathbf{r}_b \times \mathbf{n})^\top I_b^{-1}(\mathbf{r}_b \times \mathbf{n})}

The linear velocities change as in Theorem 6.2, and the angular velocities as \boldsymbol{\omega}_a^+ = \boldsymbol{\omega}_a - j\,I_a^{-1}(\mathbf{r}_a \times \mathbf{n}), \qquad \boldsymbol{\omega}_b^+ = \boldsymbol{\omega}_b + j\,I_b^{-1}(\mathbf{r}_b \times \mathbf{n}). The angular terms are nonnegative, so rotation can only lower the impulse: the body turns instead of stopping. For a static body such as the ground, set 1/m_b = 0 and I_b^{-1} = 0.

Proof. The impulse j\mathbf{n} acts on b at the contact point, and -j\mathbf{n} on a. It changes the angular momenta by \mathbf{r}_b \times j\mathbf{n} and -\mathbf{r}_a \times j\mathbf{n}, which gives the angular updates.

The velocity of b at the contact point therefore changes by \frac{j}{m_b}\,\mathbf{n} + j\,\big(I_b^{-1}(\mathbf{r}_b \times \mathbf{n})\big) \times \mathbf{r}_b , and that of a by the opposite of the same expression written for a.

Dot the difference with \mathbf{n} and use the triple product identity \mathbf{n} \cdot (\mathbf{u} \times \mathbf{r}) = \mathbf{u} \cdot (\mathbf{r} \times \mathbf{n}), \qquad \mathbf{u} = I^{-1}(\mathbf{r} \times \mathbf{n}): the normal relative velocity changes by j times the denominator. Imposing the restitution law, as in the proof of Theorem 6.2, gives j. Each angular term is a quadratic form of the positive definite I^{-1}, hence nonnegative. ∎

Example 6.5 — A falling rod lands on a ledge with one end A rod of mass M = 1.2 kg and length l = 1 m has I = Ml^2/12 = 0.1 kg·m² (table of chapter 5). It falls horizontally, without rotating, at 2 m/s. Only its left end lands on the edge of a rigid ledge; the rest of the rod overhangs it. Take e = 0.5.

Work in the vertical plane, with the ledge as body b (infinite mass) and \mathbf{n} = (0, -1) pointing from the rod into the ledge.

  1. Lever arm \mathbf{r}_a = (-0.5, 0). In the plane, \mathbf{r}_a \times \mathbf{n} is the scalar 0.5, so the angular term is 0.5^2/0.1 = 2.5 kg⁻¹.
  2. The rod approaches with \mathbf{v}_{rel}\cdot\mathbf{n} = -2 m/s, so j = \frac{1.5 \times 2}{1/1.2 + 2.5} = \frac{3}{3.33} = 0.9 \text{ N·s}, four times less than the 3.6 N·s a point mass would receive.
  3. After impact the center still falls, at V^+ = -2 + 0.9/1.2 = -1.25 m/s, and the rod spins clockwise: \omega^+ = -0.9 \times 0.5/0.1 = -4.5 \text{ rad/s}. The left end now rises at -1.25 + 4.5 \times 0.5 = 1.0 m/s, which is e \times 2 m/s ✓.
  4. Energy: from 2.4 J to 0.94 + 1.01 = 1.95 J (translation plus rotation). The loss of 0.45 J equals \tfrac12 m_{\text{eff}}(1 - e^2)\,v_n^2 with m_{\text{eff}} = 1/3.33 = 0.3 kg, the effective mass that the contact sees.

Ignoring rotation — applying Theorem 6.2 as if the rod were a point mass, a classic lab bug — gives j = 3.6 N·s: the rod bounces like a block and never starts to spin.

Lab stub (C++) The labs of the course are in C++ with OpenGL. The physics step does not depend on the drawing code: below is Proposition 6.4 for one body against static ground, written with the GLM vector types (Eigen, or the vector types of your framework, work the same way).

For the window, camera and drawing, the open CGP library of D. Rohmer (graphicscomputing.fr/cgp, MIT licence) is a minimal C++/OpenGL framework used in the École Polytechnique courses INF443 (the official prerequisite) and INF585 (3D animation and simulation), whose lab code is public (inf585_lab_code). This is a pointer of these notes, not the official kit of the 2026–2027 occurrence.

#include <glm/glm.hpp>
using glm::vec3; using glm::mat3;

struct RigidBody {
    float m;  mat3 Ibody_inv;        // mass, inverse inertia in the body frame
    vec3 c, V, L;  mat3 R;           // center, velocity, angular momentum, orientation
};

// Contact with static ground at point p; n = unit normal from the body into the ground.
void contact_impulse(RigidBody& a, vec3 p, vec3 n, float e) {
    mat3 Iinv = a.R * a.Ibody_inv * glm::transpose(a.R);  // world inverse inertia
    vec3 r = p - a.c, w = Iinv * a.L;                      // lever arm, angular velocity
    float vn = -glm::dot(a.V + glm::cross(w, r), n);       // v_rel . n, ground at rest
    if (vn >= 0.0f) return;                                // separating: no impulse
    vec3 rn = glm::cross(r, n);
    float denom = 1.0f / a.m + glm::dot(rn, Iinv * rn);    // angular term >= 0
    float j = -(1.0f + e) * vn / denom;
    a.V -= (j / a.m) * n;                                  // linear update
    a.L -= j * rn;                                         // angular: L += r x (-j n)
}

Definition 6.6 — Three ways to handle constraints

  • Penalty: a spring of stiffness k on the interpenetration \delta: simple but stiff (constraint h < 2/\sqrt{k/m}, cf. ch. 4); a common choice for compliant contacts is k \approx m/h^2, which gives h\sqrt{k/m} = 1, safely inside the stability limit;
  • Impulse / projection: solve the contacts in velocities by linear complementarity (LCP): \delta \geq 0 \ (\text{no interpenetration}), \qquad j \geq 0, \qquad \delta \cdot j = 0 : solvable by projected Gauss-Seidel iterations — the approach of game engines;
  • Position Based Dynamics (PBD): directly move positions to satisfy each constraint (distance, volume, bend), then deduce the velocities \mathbf{v} = (\mathbf{x}^+ - \mathbf{x}^-)/h. Stable, fast, artist-controllable (stiffness as an ad hoc parameter): XPBD restores a physically calibrated stiffness via a compliant solver.

Friction, an honest word Coulomb friction (\|\mathbf{f}_t\| \leq \mu\,j) turns the LCP into a nonlinear complementarity problem, with no guaranteed unique solution: engines cheat through iterated tangential projection. Practical consequence: a “too stiff” PBD sand pile slides; adjusting \mu and the number of iterations is as much artistic tuning as physics.

7. Skinning: LBS and its artifacts

An animated character is a skeleton of a few dozen bones covered by a skin mesh of thousands of vertices. Skinning is the rule that moves each vertex of the skin when the bones move; this chapter studies the standard rule, its characteristic artifact and the remedies, then the face, which has no bones.

Definition 7.1 — Skeletal deformation (LBS) A mesh is attached to a skeleton of K bones. Each bone i has a rest transformation B_i (local frame) and a current one M_i.

Each vertex \mathbf{v} carries weights \{w_i\}, \sum_i w_i = 1 (typically 4 bones max, painted or computed by heat diffusion). Linear blend skinning computes

Key result — linear blend skinning \mathbf{v}' = \sum_{i} w_i\, M_i\, B_i^{-1}\, \mathbf{v}.

The quantity B_i^{-1}\mathbf{v} places the vertex in the bone’s local frame, M_i puts it back into the animated world; the summation of matrices (hence linear: hence the name) precedes the application to the vertex — this is where the artifacts are born.

Theorem 7.2 — The “candy wrapper” collapse Consider a point at distance r from the axis of an elbow, with weights \tfrac12/\tfrac12 on the two bones that share the same axis, one rotated by \theta, the other fixed. Then its distance to the axis after LBS is r' = \tfrac12\,\|R_\theta\,\mathbf{u} + \mathbf{u}\|\,r = r\,\cos\!\Big(\frac{\theta}{2}\Big), \qquad \mathbf{u} \perp \text{axis},\ \|\mathbf{u}\| = 1. The volume collapses:

  • at \theta = 90°, r' = r\cos 45° \approx 0.707\,r (50% section loss);
  • at \theta = 180°, r' = 0 — the arm annihilates itself.

Proof. Take the z axis, \mathbf{u} = (0,1,0). Then R_\theta \mathbf{u} = (-\sin\theta, \cos\theta, 0) and \tfrac12(R_\theta\mathbf{u} + \mathbf{u}) = (-\tfrac{\sin\theta}{2}, \tfrac{1+\cos\theta}{2}, 0), of norm (half-angle formula) \tfrac12\sqrt{\sin^2\theta + (1+\cos\theta)^2} = \tfrac12\sqrt{2 + 2\cos\theta} = \sqrt{\tfrac{1+\cos\theta}{2}} = \cos\tfrac{\theta}{2}. ∎

Definition 7.3 — Responses: DQS, cages, learning

  • Dual Quaternion Skinning: replace the matrix average by an average of dual quaternions (rigid rotation + translation): the blended transformation remains an isometry ⟹ no more collapse, at the price of a slight bulging of folds and the loss of the expressivity property of weights;
  • Cages and free-form deformations: embed the mesh in a simple shell and deform it through harmonic or Green coordinates — fine control of folds, higher cost;
  • Learned skinning: predict the weights or the deformation with a neural network (for instance, learning the folds from sculpted examples): cf. Deep Learning, ch. 1–2 (networks and backpropagation), or ch. 0 of its P2 variant — skinning becomes a regression problem on (pose, mesh) pairs.

Example 7.4 — Assessing the artifact then correcting it Elbow at \theta = 90°, weights (0.4\,;\,0.6): redoing the computation of Theorem 7.2 with non-uniform weights, \|\,0.4\,R_\theta\mathbf{u} + 0.6\,\mathbf{u}\|^2 = 0.16 + 0.36 + 0.48\cos\theta = 0.52 + 0 \;\Longrightarrow\; r' = r\sqrt{0.52} \approx 0.72\,r .

Classical rigging remedy: distributing the twist over k intermediate bones, each rotated by \theta/k relative to its neighbor; each blend zone then sees only a relative rotation \theta/k, and its radius factor becomes \cos(\theta/2k).

For k = 3, \cos 15° \approx 0.97 versus \cos 45° \approx 0.71 — much better, but the artifact remains of the same nature, and only a blended isometry (DQS) eliminates it. Moral: no blend replaces a well-constructed rig, and DQS saves average rigs.

Definition 7.5 — Facial animation: blendshapes A face has no bones: the skin slides over the muscles, and skeletal skinning collapses there. The standard is the blendshape: a neutral mesh \mathbf{v}_0 and sculpted target deformations \mathbf{v}_i (smile, raised eyebrow, “visemes” of phonemes for dubbing), combined by \mathbf{v}' \;=\; \mathbf{v}_0 \;+\; \sum_i \alpha_i\,(\mathbf{v}_i - \mathbf{v}_0), \qquad \alpha_i \in [0, 1]\ \text{(or even beyond, to exaggerate)}. The \alpha_i come from the performance: marker or video capture, today by regression (a network learned from the image to the coefficients — the same move as the learned skinning of def. 7.3), with the artist’s touch-ups on top.

In production: blendshapes for the face, LBS/DQS for the body, sculpted fixes at the joints — the vocabulary of real-time avatars and automatic dubbing.

Example 7.6 — Blendshape weights from tracked markers Track three markers on an actor’s face — left mouth corner, right mouth corner, chin — and keep only their vertical displacements (in cm). On the rig, the “smile” target moves the markers by \mathbf{b}_1 = (1, 1, 0) and the “jaw open” target by \mathbf{b}_2 = (0, 0, -2); the observed displacement is \mathbf{d} = (0.6, 0.4, -1.0).

The weights solve the least-squares problem (then clamped to [0, 1]) \min_{\boldsymbol\alpha} \|B\boldsymbol\alpha - \mathbf{d}\|^2, \qquad B = [\mathbf{b}_1\ \mathbf{b}_2]. The two columns are orthogonal, so each weight is a projection: \alpha_1 = \mathbf{b}_1\cdot\mathbf{d}/\|\mathbf{b}_1\|^2 = 1.0/2 = 0.5, \qquad \alpha_2 = \mathbf{b}_2\cdot\mathbf{d}/\|\mathbf{b}_2\|^2 = 2.0/4 = 0.5. The fit B\boldsymbol\alpha = (0.5, 0.5, -1.0) leaves the residual (0.1, -0.1, 0): an asymmetric smile that no combination of these two targets can produce.

The cure used in production is to split the target into “smile left” and “smile right” — the basis of FACS-style rigs, whose targets each move one muscle group — and to add corrective shapes for combinations (smile with jaw open) that the linear sum renders badly.

8. Inverse kinematics

Animators rarely want to set every joint angle by hand: they want a hand to reach a cup or a foot to rest on a step. Inverse kinematics computes joint angles from such goals; this chapter gives the closed-form solution for two segments and the iterative methods used for longer chains.

Definition 8.1 — Forward and inverse problems

  • Forward (FK): angles \theta \in \mathbb{R}^n ⟹ positions of the effectors by composition T(\theta) = T_1(\theta_1)\cdots T_n(\theta_n).
  • Inverse (IK): find \theta such that an effector reaches a target \mathbf{p}^\ast (and possibly an orientation).

The problem is nonlinear, possibly without a solution (target out of reach), with multiple solutions (redundancy) — an entire family if n > 6 for an effector of 6-DoF pose.

Proposition 8.2 — Jacobian method The effector error \mathbf{e} = \mathbf{p}^\ast - \mathbf{p}(\theta) is linearized: d\mathbf{p} = J(\theta)\,d\theta, where column i of J equals \mathbf{a}_i \times (\mathbf{p} - \mathbf{q}_i) (joint axis \mathbf{a}_i, center \mathbf{q}_i). The iterations

Key result — damped least squares IK \Delta\theta = J^+\mathbf{e} \quad \text{with} \quad J^+ = J^\top (J J^\top + \lambda I)^{-1} \ \ (\text{damped least squares})

converge locally to a minimum of \|\mathbf{e}\|^2; the damping \lambda > 0 avoids jumps near singularities (where \det JJ^\top \to 0).

Example 8.3 — Planar two-segment arm, closed-form solution Lengths L_1 = L_2 = 1, target (x, y) = (1.2\,;\,0.6).

  1. Distance to the origin: d = \sqrt{1.44 + 0.36} = \sqrt{1.8} \approx 1.342 \leq L_1 + L_2 \;\Longrightarrow\; \text{two solutions.}
  2. Law of cosines: \cos\theta_2 = \dfrac{d^2 - L_1^2 - L_2^2}{2L_1L_2} = \dfrac{1.8 - 2}{2} = -0.1 \;\Longrightarrow\; \theta_2 = \pm 95.7° \ (\text{elbow up/down}).
  3. Then \theta_1 = \mathrm{atan2}(y, x) - \mathrm{atan2}(L_2\sin\theta_2,\, L_1 + L_2\cos\theta_2) \;\Longrightarrow\; \theta_1 \approx -21.3° for the elbow-down solution (\theta_2 = +95.7°).
  4. FK check: x = \cos(-21.3°) + \cos(74.4°) = 0.932 + 0.268 = 1.20 ✓ and y = -0.363 + 0.963 = 0.60 ✓.

A target at d > 2 is not reachable: the damped IK then stops at the boundary of the reachable space, arm extended.

Definition 8.4 — CCD and FABRIK

  • CCD (Cyclic Coordinate Descent): correct one joint at a time, from the effector toward the root — each step is an elementary 2D rotation; trivial to implement, widely used for foliage and plants;
  • FABRIK: geometric resolution by back-and-forth (target positions propagated along the chain, length constraints reimposed); converges in few iterations, handles multi-parent chains (hands on an object) naturally;
  • Analytic multi-body IK (foot on the ground): character engines combine closed-form 2-3 segment solutions and Jacobian relaxation for the rest.

IK and data: framing the solution space Redundancy (infinitely many \theta for the same target) makes IK an ill-posed problem: the choice of the minimum is a matter of prior. Data-driven approaches (chapter 10) replace the “articular energy” prior with real poses: IK in the latent space of a learned model of motion. It is also the natural bridge to crowds (chapter 9), where thousands of agents economize by reusing IK solutions.

9. Crowds and behaviors

Animating hundreds of characters one by one is impossible, so crowds are animated by rules: each agent reacts to its neighbors and to its goal, and the collective behavior emerges. This chapter presents the two classical rule sets, for flocks and for pedestrians.

Definition 9.1 — Boids (Reynolds, 1987) Each agent (boid) is a particle endowed with three local behavioral forces (perception neighborhood):

  • separation — anti-collision: \mathbf{f}_s = \sum_{j \in \mathcal{N}} \dfrac{\mathbf{x}_i - \mathbf{x}_j}{\|\mathbf{x}_i - \mathbf{x}_j\|^2} ;
  • alignment — same direction as the neighborhood: \mathbf{f}_a = \overline{\mathbf{v}}_{\mathcal{N}} - \mathbf{v}_i ;
  • cohesion — stay with the group: \mathbf{f}_c = \overline{\mathbf{x}}_{\mathcal{N}} - \mathbf{x}_i .

Emergence (flocks, schools) comes from local rules without a leader or a plan; cost O(n \cdot k) with k neighbors, neighborhood found by a spatial grid (a broad-phase structure of chapter 6, Definition 6.1) or a kd-tree; kd-trees, grids and BVHs are compared in Image Synthesis, ch. 6.

Definition 9.2 — Social forces (Helbing and Molnár, 1995; Helbing, Farkas and Vicsek, 2000) For human crowds, each agent i is a disc of radius r_i with a desired velocity \mathbf{v}_i^0 (toward its goal, via a navigation graph), and undergoes m_i\dot{\mathbf{v}}_i = \underbrace{m_i\tfrac{1}{\tau}\big(\mathbf{v}_i^0 - \mathbf{v}_i\big)}_{\text{goal attainment}} + \underbrace{\sum_{j\neq i} \mathbf{f}_{ij}}_{\text{other agents}} + \underbrace{\mathbf{f}_{i}^{wall}}_{\text{walls}}. Write d_{ij} = \|\mathbf{x}_i - \mathbf{x}_j\| for the distance of the centers, \mathbf{n}_{ij} = (\mathbf{x}_i - \mathbf{x}_j)/d_{ij} for the unit vector from j to i, and r_{ij} = r_i + r_j for the sum of the two radii. The psychological repulsion is \mathbf{f}_{ij}^{soc} = A\,e^{(r_{ij} - d_{ij})/B}\,\mathbf{n}_{ij} . When the bodies touch (d_{ij} < r_{ij}), the 2000 model adds a body compression k\,(r_{ij} - d_{ij})\,\mathbf{n}_{ij} and a sliding friction of strength \kappa\,(r_{ij} - d_{ij}) times the tangential relative velocity. Its parameters are m_i \approx 80\ \text{kg},\quad r_i \in [0.25, 0.35]\ \text{m},\quad A = 2\times10^3\ \text{N},\quad B = 0.08\ \text{m}, \tau = 0.5\ \text{s},\quad k = 1.2\times10^5\ \text{kg/s}^2,\quad \kappa = 2.4\times10^5\ \text{kg/(m·s)}. The radii matter: at the touching distance d_{ij} = r_{ij} \approx 0.6 m the repulsion equals A = 2000 N, whereas A\,e^{-d_{ij}/B} without them would give about 1 N, negligible against the driving term m_i v^0/\tau \approx 160 N of an agent starting from rest with v^0 = 1 m/s.

Documented emergent phenomena: formation of opposing lanes in corridors, arches in front of doors (held by the contact and friction forces), “faster-is-slower” (pushing more slows down evacuation).

Example 9.3 — Two flows, one door, one jam 60 agents, half heading right, half heading left, a door of width 1.2 m in a wall. Measured flow as a function of “impatience” (gain on \|\mathbf{v}^0\|):

  • at v^0 = 1 m/s, flow of 1.1 agents/s, orderly queues;
  • at v^0 = 2.5 m/s, unstable arches, flow drops to 0.6 agents/s.

Approximate analytical check: flow \approx \rho\,v\,w_{eff} with w_{eff} the effective width; the arch blocks the section (w_{eff} drops by half), density does not compensate — the qualitative summary of “faster-is-slower”.

An animation engine uses this to regulate background crowds (level of detail: full simulation < 30 m, sprites beyond).

Navigation: graph, grid, fields The goal \mathbf{v}^0 comes from a navigation layer: waypoint graph (A*, Dijkstra — cf. Refresher in Computer Science, ch. 7), navigation mesh (navmesh) with hierarchical search, or potential fields precomputed by the eikonal equation (fast marching — the same equation as the geodesic distances of the geometry module).

The RVO/ORCA techniques (reciprocal velocity obstacles) replace forces with a chosen velocity avoiding collisions over a short horizon: more stable at high density than social forces, the standard of real-time urban simulations.

10. Procedural versus data-driven

The previous chapters produced motion either by hand (keyframes, IK) or by rules (physics, behaviors). This chapter compares these two approaches with a third one, learning motion from captured data, and shows how a production character combines all three.

Definition 10.1 — Three genealogies of animation

  • Artistic: keyframes + interpolation (chapter 1), IK constraints (chapter 8) — maximal control, human cost;
  • Procedural/physical: simulation (chapters 2 to 6), behaviors (chapter 9) — emergence and physical realism, indirect control;
  • Data-driven: learn from motion captures (mocap: optical markers at 100–240 Hz, or IMU) — realism of gesture, generalization limited by the data.

Definition 10.2 — Motion matching Search at every frame, in a mocap database (hours of clips), for the pose/trajectory closest to a query (direction, speed, contact) i^\ast = \arg\min_i \big\|\mathbf{c}_i - \mathbf{c}_{goal}\big\|^2_W, then blending toward that clip — the weights W on (future position, direction, foot speed) are tuned by the designer.

The standard of AAA games: no state machine to write, but a galaxy of data to record and a search cost (accelerated by kd-tree) at every frame.

Proposition 10.3 — Learning motion Recurrent networks (or transformers) on mocap windows predict the next pose conditioned on control; phase-functioned networks (Holden et al., 2017) condition an MLP on the phase of the walking cycle; temporal autoregressive networks drift in the long run — hence learning in latent space with reinjected constraints (feet on the ground: IK losses).

Differentiable physics (gradients of the solver, cf. chapter 4: the linear system (M - h^2J)\Delta\mathbf{v} = \dots can be differentiated) closes the loop: learning controllers through simulation.

All these models rest on the foundations of Deep Learning (ch. 2 backpropagation, ch. 5 RNN and LSTM, ch. 6 transformers; in the P2 variant, ch. 0) and prepare the generative models of Multimodal Generative AI, ch. 8 (video, robot actions, 3D).

Criterion Keyframe Procedural physics Data-driven
Production cost high (human) medium (tuning) high (capture)
Artistic control total indirect medium (data)
Generalization none total limited to the domain
Determinism yes yes (at fixed h) no (sampling)
Flagship example author-driven cinematics garments, fluids motion matching, PFNN

Production: the standard sandwich A modern character superposes the three generations:

  1. data-driven locomotion (motion matching);
  2. local physical layer (garment, hair, accessory via PBD/XPBD);
  3. artistic touch-up by keyframes/IK (hand placed on an object).

Skinning (chapter 7) remains the rendering interface between the skeleton (whatever its source) and the mesh; neural deformation networks do not change this architecture — they replace blocks, not the sandwich.

The production pipeline (cinema, VFX)

The official syllabus lists the animation methods “in production”. In a film or visual-effects studio, the techniques of this course are not run by one person in one program: each shot flows through a chain of departments, and what passes from one to the next is data with a fixed format.

Definition 10.4 — Departments of an animation / VFX pipeline For one shot, in order:

  1. modeling (the meshes of characters, sets and props);
  2. rigging (the skeleton, the skinning weights of ch. 7, the facial blendshapes of Definition 7.5 and the controls — handles, IK targets of ch. 8 — that animators manipulate);
  3. layout (camera and staging in the set);
  4. animation (keyframes of ch. 1, motion capture and its clean-up, the procedural layers of ch. 9 and 10);
  5. simulation / FX (cloth, hair, rigid-body destruction, fluids — the methods of chapters 4 to 6, run on the animated characters);
  6. lighting and rendering;
  7. compositing (assembling the rendered layers with the live-action plates in VFX).

Each department hands caches to the next and can be re-run without redoing the previous ones; a change upstream (a new animation take) triggers the re-run of everything downstream.

Definition 10.5 — Caches and scene description A geometry cache stores, for every frame, the vertex positions of a deformed mesh, so that downstream departments read results instead of re-running the rig or the simulator; the open Alembic format (Sony Pictures Imageworks and Industrial Light & Magic) is the usual carrier.

A scene description says which assets, caches and overrides compose a shot; Pixar’s USD (Universal Scene Description) organizes it in layers that each department edits separately and that are composed at load time.

Games use a different pipeline: everything must run in the engine at 30–60 frames per second, so the animation is stored as skeletal clips (played by state machines or by the motion matching of Definition 10.2), and the simulation runs live, with the real-time methods (PBD/XPBD) seen in chapter 6.

Example 10.6 — A garment through the pipeline A 6-second shot at 24 frames per second has 144 frames. The character’s dress has 20\,000 vertices; its simulation runs with the implicit step at h = 2 ms, i.e. \frac{1/24\ \text{s}}{2\ \text{ms}} \approx 21 \text{ substeps per frame}, but only one state per frame is cached: 20\,000 \times 3 \times 4 bytes = 240 kB per frame, about 35 MB for the shot.

If the director asks for ten animation takes, the cloth department re-runs the simulation ten times and the pipeline keeps ten versioned caches (\approx 350 MB for one garment of one shot); lighting renders only the approved one.

Reading: the cost of a pipeline lies less in one simulation than in its re-runs — which is why the stability results of chapter 3 matter in production: a simulator that explodes on take seven stops every department downstream.

11. Course research notes (Desbrun)

Mathieu Desbrun — from animation to discrete geometry Before becoming one of the fathers of discrete differential geometry, M. Desbrun (Caltech, then Inria associate researcher, head of the course) left his mark on physical animation:

  • Smoothed Particles: a new paradigm for animating highly deformable bodies (with M.-P. Cani, Eurographics Workshop on Computer Animation and Simulation, 1996) — paper on HAL. The “smoothed” particles carry a density: the object’s surface is the isosurface of this density, so that merging, fragmentation and flows emerge without re-topologizing (chapter 4);
  • Discrete Exterior Calculus (with A. Hirani, M. Leok, J. Marsden, 2005) — arXiv math/0508341, and Discrete Differential Forms for Computational Modeling (with E. Kanso, Y. Tong) — Springer chapter: an exact discrete structure for the differential operators (curl, divergence, Laplacian) on meshes, which preserves continuous identities — the theoretical foundation of shell, fluid and elastic simulations on surfaces;
  • The SIGGRAPH Asia course Digital Geometry Processing with Discrete Exterior Calculus (with K. Crane, F. de Goes, P. Schröder, 2013) — ACM DL — and the open version DDG (course notes) are the reference for the master’s geometry labs (M2 Geometric DL module).

Scientific landmark — Marie-Paule Cani: implicit surfaces and animated modeling Professor at École Polytechnique (and Inria researcher, French Academy of Sciences), co-coordinator of this course unit on the 2026-2027 sheet, historical co-author of the smoothed particles, M.-P. Cani built much of the theory of animated implicit surfaces:

  • Active Implicit Surface for Animation (with M. Desbrun, Graphics Interface, 1998) — paper on HAL: the surface is an isosurface of a density field whose source particles move; the field follows the physics — automatic union and merging, ideal for viscous fluids and soft flesh; the natural continuation of the duo’s smoothed particles;
  • Interactive Sculpting with Implicit Surfaces (Shape Modeling International, 2002) — abstract and links: two schools of digital sculpting (sampled fields versus CSG constructions) and their control/quality trade-offs;
  • Her profile page People of ACM summarizes the research program: high-level models for geometry and animation (implicit and developable surfaces, frame-based deformations) — exactly the building blocks of chapters 4, 6 and 7 of this module.

What this work changes for the course The Desbrun–Cani duo’s smoothed particles are the direct ancestor of the SPH simulators of modern DCCs (Blender, Houdini).

Their animated implicit surfaces will motivate the “reconstruction” chapter of the M1P1 module Digital Representation and Analysis of Shapes (isosurfaces, marching cubes); Desbrun’s DEC resurfaces in the M2 module Geometric Deep Learning (discrete operators on meshes). Geometry and animation are but a single discipline seen from two sides.

Exercises

  1. ★ Guided Hermite.

      1. Verify that the four polynomials h_{00}, h_{10}, h_{01}, h_{11} of Theorem 1.2 satisfy the conditions (1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1) at s = 0 and s = 1.
      1. Recover h_{00} by solving the linear system by hand.
      1. Recompute Example 1.3 with \mathbf{v}_0 = 2, \mathbf{v}_1 = 0 — where is the maximum of the curve now?
  2. ★ Implicit fall. For \dot{v} = g - \tfrac{c}{m}v, write the implicit Euler step, solve it exactly in v_{n+1}, and show that v_n \to v_\infty for every h > 0. What is the local error in O(h^2)? Compare with the table of Example 2.4 for h = 0.1.

  3. ★ Guided 2-DoF network. Two masses m linked to each other and to the walls by three springs k (chain).

      1. Write M, K.
      1. Compute the natural frequencies \omega_{1,2} (one should correspond to the in-phase mode, the other to the opposite-phase one).
      1. Deduce the critical step of symplectic Euler for m = 0.1, k = 300, and verify it by simulating.
  4. ★ Oblique impact. Two spheres of masses 1 and 3 kg, velocities (4, 0) and (-1, 2) m/s, contact with normal \mathbf{n} = (1, 0), e = 0.8, no friction. Compute the post-impact velocities by Theorem 6.2 and check: momentum, restitution, conservation of the tangential components.

  5. ★★ Guided stability.

      1. Take up the proof of Theorem 3.5 and show that for exactly h\omega = 2, G_{ES} has a double eigenvalue -1 — what does the trajectory become?
      1. For \omega = 2, compute the critical step and verify numerically (30 lines of Python) that the energy remains bounded at h = 0.9 and diverges at h = 1.1.
      1. Compare the energy drift of EE at h = 0.01 over 1000 steps with the prediction \rho^{2000}.
  6. ★★ Quaternions.

      1. Show that q and -q give the same rotation (write the conjugation action v \mapsto qvq^{-1}).
      1. Compose two 90° rotations about x then y with quaternions; recover the product matrix R_y R_x and its axis-angle.
      1. What happens if one naively averages q and -q — why must the signs be aligned before blending?
  7. ★★ Guided LBS.

      1. Take up the proof of Theorem 7.2 with weights (w, 1-w) and show r'^2/r^2 = w^2 + (1-w)^2 + 2w(1-w)\cos\theta.
      1. Evaluate for \theta = 120°, w = 0.5 then w = 0.3.
      1. Implement LBS in NumPy on a 16-segment cylinder around an elbow and visualize the collapse; compare with DQS (normalized dual quaternion average).
  8. ★★ Damped IK. For the two-segment arm of Example 8.3, implement \Delta\theta = J^\top(JJ^\top + \lambda I)^{-1}\mathbf{e} ; plot the effector trajectory for a target moving on a circle of radius 2.4 (unreachable, since the arm reaches at most L_1 + L_2 = 2); where does it stop and why? Test \lambda \in \{10^{-4}, 10^{-2}, 1\}.

  9. ★★ Crowd. Implement the three boids forces (Definition 9.1) with a grid-based neighborhood; tune the weights to observe (a) a coherent flock, (b) fragmentation into subgroups, (c) the instability when separation dominates. Which force corresponds to which stability term of chapter 3?

  10. ★★★ Project — mini-garment. A 16 \times 16 grid of masses, structural/shear/bend springs, symplectic then implicit integrator by conjugate gradient, collision with a moving sphere; measure the critical step of each scheme and the achievable real time (frame < 16 ms); conclude on the PBD versus implicit choice for a game.

Projects and assessment

The course sheet summarized above records the official assessment as not displayed: “the 2026-2027 sheet gives no assessment text, and its LLGA section is empty; for the other listed degrees it shows the grade format (out of 20, or letter grade) and that a resit is allowed”. The sheet describes the course as half lectures and half C++/OpenGL lab sessions. The subjects below are proposals of these notes, not official rules: a project can stand for lab or project marks, and the exam proposal for a final written test.

The projects exercise mainly O7 (simulators written from the equations and measured against the theory) and O6 (motion as a generated modality: text-to-motion, faces tracked from video). O4 enters with the mesh-graph surrogate, O1 with the learned components and O3 with the language model that drafts keyframes.

Solo projects

  1. [Solo · ≈ 20 h] Integrator zoo: the oscillator theorem on chains and cloth. Do the critical steps predicted from the spectrum of M^{-1}K match the ones a simulator actually shows?
    • Work: explicit, symplectic and implicit Euler, Verlet and RK4 (ch. 2) on 1D chains and on anchored N \times N cloth grids with structural, shear and 2-hop bending springs (ch. 4). Compute \omega_{\max} from the eigenvalues of M^{-1}K (scipy.sparse.linalg.eigsh), predict the critical step (Proposition 4.2), and measure it by bisection on the energy growth of a small-amplitude start over 2000 steps.
    • Data: synthetic only; Examples 4.3 and 4.7 serve as test cases (the zigzag bound 2\sqrt{k/m}, the factor of about 2.3 brought by bending springs five times stiffer).
    • Success criterion: measured critical steps within 2 % of the predictions for symplectic Euler and Verlet at three grid sizes; the RK4 limit h\omega_{\max} \approx 2.83 recovered; energy-drift curves that match the table of chapter 3.
    • Deliverables: code, a 4–6 page report, a 10-minute talk; chapters 2–4, Exercises 3 and 5.
  2. [Solo · ≈ 20 h] Paper study: dual quaternion skinning (Kavan, Collins, Žára and O’Sullivan, 2008). How much volume does LBS lose at a twisting and at a bending joint, and what does DQS trade to fix it?
    • Work: LBS (Definition 7.1) and DQS (Definition 7.3) in NumPy on a cylinder of 32 rings around a two-bone joint with smooth weights. Measure the minimum radius against the twist angle, compared with the r\cos(\theta/2) of Theorem 7.2; the enclosed volume (divergence theorem on the closed mesh) in twist and in bend; the bulge of DQS at a 90° bend.
    • Data: the synthetic cylinder; optionally a free Mixamo character driven by a clip of the CMU Graphics Lab Motion Capture Database.
    • Success criterion: the LBS radius within 1 % of r\cos(\theta/2) at weights ½–½; the DQS radius constant under pure twist; the DQS bulge measured, and the paper’s comparison figures reproduced qualitatively.
    • Deliverables: code, report, talk; chapters 5 and 7, Exercises 6 and 7.
  3. [Solo · ≈ 20 h] Blendshape weights from video landmarks. Does a bounded least-squares fit on split and corrective targets (Example 7.6) track a face as well as a learned regressor?
    • Data: the open ICT FaceKit face model (USC Institute for Creative Technologies, MIT licence for its light model), whose 53 expression blendshapes follow the ARKit naming, map to FACS action units and are mostly split left and right; landmarks and ARKit-style blendshape scores from MediaPipe Face Landmarker, run on a self-recorded one-minute video.
    • Work: 40–60 landmark–vertex correspondences chosen once; head pose by a similarity (Procrustes) fit; then the weights by scipy.optimize.lsq_linear with bounds [0, 1] and a small temporal smoothness term. Compare with MediaPipe’s own scores, which come from a learned regressor (Definition 7.5).
    • Success criterion: landmark error and frame-to-frame jitter of the fitted weights against those of the regressor’s scores, on frames not used to tune the smoothness weight (the fit minimizes landmark error by construction, so jitter decides); the gain of split and corrective targets over a symmetric basis, measured as in Example 7.6.
    • Deliverables: code, report, talk; chapter 7 (Definition 7.5, Example 7.6) and chapter 1 for temporal filtering.

Group projects

  1. [Group of 3 · ≈ 30 h each] Paper study: a learned cloth surrogate (Pfaff, Fortunato, Sanchez-Gonzalez and Battaglia, 2021). Can a mesh-graph network trained on the mini-garment of Exercise 10 replace the semi-implicit step, and at what time step does its rollout stay stable?
    • Data: trajectories from the group’s own simulator — Baraff–Witkin energies and semi-implicit step (Definitions 4.4 and 4.8), collisions with a moving sphere (ch. 6) — over varied sphere paths; the flag_simple dataset released with the MeshGraphNets paper as a second benchmark.
    • Work: an encode–process–decode GNN that predicts per-node accelerations from mesh-space and world-space edges, by the message passing of Graph ML, ch. 5, trained with noise injection; rollouts compared with the reference simulator and with PBD (Definition 6.6).
    • Split: simulator and data generation; GNN and training; evaluation (rollout error, energy, collisions, speed).
    • Success criterion: position RMSE over a 100-step rollout on held-out sphere paths; the largest step at which rollouts stay bounded, against the 2/\omega_{\max} of Proposition 4.2 and the implicit step; wall-clock time per frame.
    • Deliverables: code, an 8–10 page joint report, a 20-minute talk; chapters 3, 4 and 6, Exercise 10.
  2. [Group of 3 · ≈ 30 h each] Text-to-motion with physical cleanup. Generated motions often slide their feet and jitter: how much of that can the classical tools of this course remove, without changing what the motion means?
    • Data: HumanML3D (Guo, Zou, Zuo, Wang, Ji, Li and Cheng, 2022), text descriptions of AMASS and HumanAct12 motions (AMASS needs a free research registration), with its standard evaluator.
    • Work: motions from a pretrained text-to-motion diffusion model (MDM, Tevet et al., 2023) and, as a baseline, keyframes (root path, foot contacts, a few joint targets) proposed by an instruction-tuned LLM and interpolated by splines (ch. 1). Then foot-contact detection, damped least-squares IK (Proposition 8.2) to pin the feet, and skinning by LBS or DQS (ch. 7).
    • Split: generation (diffusion model and LLM prompts); cleanup (contacts, IK, filtering); skinning, metrics and figures.
    • Success criterion: foot skating (mean horizontal speed of a foot during contact) cut by at least half, without raising the mean jerk; the HumanML3D text–motion R-precision unchanged within its confidence interval.
    • Deliverables: code, joint report, talk; chapters 1, 7, 8 and 10. It continues Multimodal Generative AI, ch. 8 and the motion priors of Proposition 10.3.
  3. [Group of 3 · ≈ 30 h each] Paper study: escape panic and faster-is-slower (Helbing, Farkas and Vicsek, 2000). Does the social-force model of Definition 9.2 reproduce clogging at a narrow exit, and can a learned desired speed beat the best hand-tuned one?
    • Work: social forces with body radii, body compression and sliding friction as in the paper; walls; navigation by A* on a grid or a navmesh (Real-time AI for video games, ch. 2); RVO avoidance as a comparison. Then a policy that sets each agent’s desired speed, trained by policy gradient (Reinforcement Learning, ch. 5) to maximize the evacuation flow.
    • Data: synthetic rooms with a single 1 m exit and about 200 agents; lane formation in a corridor with two opposing flows (Helbing and Molnár, 1995).
    • Split: simulator and integrator (time step chosen from ch. 3); navigation and RVO; RL environment and training.
    • Success criterion: evacuation time against desired speed, with the faster-is-slower minimum reproduced (confidence intervals over 20 seeds); the learned policy’s flow against the best constant speed.
    • Deliverables: code, joint report, talk; chapters 2–3 and 9. The simulator can serve as an extra RL environment in the Y1.2 fleet-dispatch project.

Written exam (proposal)

Two hours, one handwritten A4 sheet and a simple calculator allowed; four exercises: a course question, two computations and a short proof.

  1. Question (4 points). A mass m hangs on a spring of stiffness k, with \omega = \sqrt{k/m}. Explain what explicit, symplectic and implicit Euler do to its energy, give the stability condition of each in terms of h\omega, and say which scheme you would choose for effects particles and which for a stiff garment.
    • Expected: explicit Euler has \rho = \sqrt{1 + h^2\omega^2} > 1: the energy grows by the factor 1 + h^2\omega^2 per step, for every h (Theorem 3.2).
    • Symplectic Euler has \det G = 1 and is stable if and only if h\omega < 2, with an energy that oscillates (Theorem 3.5); implicit Euler has \rho = 1/\sqrt{1 + h^2\omega^2}: stable for every h, but damped (Theorem 3.4).
    • Symplectic Euler for cheap particles at frame-rate steps; the semi-implicit step of Definition 4.4 for a stiff garment, where 2/\omega_{\max} would force tiny steps.
  2. Question (6 points). A thin rod of mass 2 kg and length 1.2 m falls horizontally, without rotating, at 3 m/s. Only one end lands on a rigid ledge, the rest of the rod overhanging it; restitution e = 0. Using I = Ml^2/12, compute the impulse, the velocity of the center and the angular velocity just after impact, and the energy lost. Compare with a point mass of 2 kg.
    • Expected: I = 0.24 kg·m², lever arm 0.6 m, angular term 0.6^2/0.24 = 1.5 kg⁻¹, denominator 0.5 + 1.5 = 2 (Proposition 6.4), so j = 3/2 = 1.5 N·s.
    • V^+ = -3 + 1.5/2 = -2.25 m/s and |\omega^+| = 1.5 \times 0.6/0.24 = 3.75 rad/s. The end that hit stops, since -2.25 + 3.75 \times 0.6 = 0, as e = 0 requires.
    • Energy: 9 J before, 5.06 + 1.69 = 6.75 J after, so 2.25 J lost, which is \tfrac12 m_{\text{eff}} v_n^2 with m_{\text{eff}} = 0.5 kg. A point mass would receive 6 N·s and lose all 9 J.
  3. Question (5 points). Prove that symplectic Euler applied to \ddot{x} = -\omega^2 x is stable, in the sense of Definition 3.1, if and only if 0 < h\omega < 2.
    • Expected: \det G_{ES} = 1 and \mathrm{tr}\,G_{ES} = 2 - h^2\omega^2, so the eigenvalues are the roots of \lambda^2 - 2c\lambda + 1 with c = 1 - h^2\omega^2/2.
    • If |c| < 1, the roots are two distinct conjugates of modulus 1: G_{ES} is diagonalizable and every component stays bounded.
    • If h\omega > 2, then c < -1 and one real root has modulus |c| + \sqrt{c^2 - 1} > 1.
    • If h\omega = 2, the eigenvalue -1 is double but G_{ES} \neq -I, so it is defective: linear growth, unstable.
  4. Question (5 points). A planar arm has two segments of length 1. Find both joint configurations that reach the target (0, 1.6) and check one by forward kinematics. Give the Jacobian at that pose and its determinant, and explain why damped least squares (Proposition 8.2) is needed near a fully extended arm.
    • Expected: \cos\theta_2 = (2.56 - 2)/2 = 0.28, so \theta_2 = \pm 73.74° and \sin\theta_2 = \pm 0.96.
    • For \theta_2 = +73.74°: \theta_1 = 90° - \mathrm{atan2}(0.96, 1.28) = 53.13°; the other solution is (126.87°, -73.74°). Forward kinematics: x = 0.6 - 0.6 = 0 and y = 0.8 + 0.8 = 1.6 ✓.
    • At the first pose, J = \begin{pmatrix} -1.6 & -0.8 \\ 0 & -0.6 \end{pmatrix}, \qquad \det J = L_1 L_2 \sin\theta_2 = 0.96 .
    • As the arm straightens, \theta_2 \to 0 and \det J \to 0: the undamped inverse produces huge steps, and the damping \lambda > 0 keeps them bounded.

Grading rubric (proposal)

Criterion Weight What earns the marks
Model and question 15 % the physical model, its parameters (masses, stiffnesses, time step) and the question stated and justified from the chapters
Correct simulation code 25 % code written from the definitions and tested on a case with a known answer (oscillator, two-body impulse, closed-form IK)
Stability and accuracy evidence 20 % time steps chosen from the theory (ch. 3–4), energy or error curves, several seeds or scenes
Analysis tied to the theory 25 % each result, failures included, explained by a statement of the course (stability, locality, collapse, conservation)
Communication 15 % videos or figures with units that answer the question, a talk on time, honest limits

References