Source-linked AI summary
Scalable Differentiable Physics for Learning and Control
Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin
TL;DR
Differentiable physics frameworks remain limited in their ability to simulate complex scenes of many detailed interacting objects. This paper uses meshes, localized collision handling, and accelerated implicit differentiation to build a scalable framework. Experiments report improved scalability and learning and control performance against prior methods and baselines.
Problem
Existing differentiable-physics frameworks remain limited in simulating complex scenes with many detailed interacting objects.
Source: §1 · p. 1Method
The framework uses meshes, localized collision handling, and an acceleration scheme for implicit differentiation with nonlinear constraints.
Source: §1 · pp. 1–2Results
The method outperforms derivative-free and model-free baselines by at least an order of magnitude in learning and control scenarios, while its runtime and memory scale linearly with scene complexity compared with cubic scaling for the MPM-based method.
Source: §1 · p. 2, §7.1 · p. 6Takeaways & Limitations
The framework supports end-to-end gradient-based controller training and two-way coupling of rigid bodies and cloth.
Source: §1 · p. 2The framework’s support for deformable solids and articulated bodies is conditional on mesh-based representations with repulsive contact forces.
Source: §8 · p. 9
Abstract
from arXiv · showhide
Differentiable physics is a powerful approach to learning and control problems that involve physical objects and environments. While notable progress has been made, the capabilities of differentiable physics solvers remain limited. We develop a scalable framework for differentiable physics that can support a large number of objects and their interactions. To accommodate objects with arbitrary geometry and topology, we adopt meshes as our representation and leverage the sparsity of contacts for scalable differentiable collision handling. Collisions are resolved in localized regions to minimize the number of optimization variables even when the number of simulated objects is high. We further accelerate implicit differentiation of optimization with nonlinear constraints. Experiments demonstrate that the presented framework requires up to two orders of magnitude less memory and computation in comparison to recent particle-based methods. We further validate the approach on inverse problems and control scenarios, where it outperforms derivative-free and model-free baselines by at least an order of magnitude.
1. Introduction
The paper targets differentiable physics frameworks that struggle to scale to complex scenes with many detailed interacting objects. It uses meshes, localized collision handling, and accelerated implicit differentiation, then evaluates the framework on scalability, generality, learning, and control.
1. Introduction
- Existing frameworks have limited capacity for complex scenes with many detailed interacting objects, owing to restricted object classes or poor scaling of grid- and particle-based approaches.A 1024^3 grid has about a billion elements yet remains coarse relative to detailed environments; particle approaches face growth or resolution limits.Source: §1 · p. 1
- Meshes provide a sparse representation that supports objects of arbitrary shape and environments combining large spatial extent with fine detail.Meshes are widely used in computer graphics and scientific computing.Source: §1 · p. 1
- Grouping sparse contacts into localized impact zones reduces optimization variables and constraints and speeds backpropagation.This avoids the scalability limits of prior global LCP-based collision formulations.Source: §1 · p. 1
- The framework uses implicit differentiation for gradients through embedded optimization and introduces an acceleration scheme for nonlinear constraints.The implicit differentiation approach follows prior work.Source: §1 · p. 2
- The framework outperforms derivative-free and model-free baselines by at least an order of magnitude in learning and control scenarios.Experiments also evaluate scalability and generality.Source: §1 · p. 2
2. Related Work
Prior differentiable-physics systems have variously restricted object geometry, contact handling, or scene scale. The paper positions its mesh-based approach as a way to support detailed, interacting objects while retaining differentiability.
2. Related Work
- Degrave et al. (2019) restrict contacts to balls and planes, while de Avila Belbute-Peres et al. (2018) handle simple 2D shapes but not general 3D objects.Toussaint et al. (2018) target path planning with sphere-swept shapes and frictionless interactions rather than general control tasks.Source: §2 · p. 2
- Differentiable simulators for cloth, rigid-body dynamics, and articulated bodies leave gaps in rigid-body constraints or dynamic contact and collision response.Liang et al. (2019) assume independently moving nodes tied by soft constraints; Carpentier & Mansard (2018) do not handle collision; Millard et al. (2020) do not handle dynamic contact and collision response.Source: §2 · p. 2
- Hu et al. (2019) and Spielberg et al. (2019) use particle- and grid-based MPM for deformable objects and soft-robot controller design, but have limited rigid structure and scene scalability.The paper contrasts this with meshes for precise geometry across large scenes and fine local features.Source: §2 · p. 2
- Hu et al. (2020) provide a domain-specific language and compiler, but their examples do not handle general mesh-based rigid and deformable objects.Their rigid-body scenario uses rectangles and ground-plane contact; their 3D scenario uses particle- and grid-based soft bodies.Source: §2 · p. 2
- Particle-based differentiable frameworks for fluids and unified fluids and solids approximate rigid bodies and detailed geometry and face high growth rates with scene scale.The paper instead models objects as meshes.Source: §2 · p. 2
- Function approximators trained on demonstrations may not capture true underlying physics or may degenerate outside their training distribution.The paper instead aims to backpropagate through true physical dynamics, enforcing physical correctness by construction.Source: §2 · p. 2
3. Overview
The overview presents a differentiable physics engine as part of an end-to-end learning pipeline. It uses mesh objects and local collision handling to support scalable scenes and differentiable coupling.
3. Overview
- The simulator is embedded in a neural network so loss gradients can be backpropagated through physics to the control signal for end-to-end controller training.The figure caption describes this approach as enabling faster convergence with higher accuracy in learning and control.Source: Figure 1 · p. 3, §3 · p. 3
- The engine performs time integration, collision response, and mesh-state updates; simulation results provide observations and losses to the network.The network computes control signals from observations and sends them to the simulator, closing the loop.Source: §3 · p. 3
- Sparse collisions are handled locally in independent impact zones, giving collision handling linear computational complexity in the number of constraints rather than total nodes.The unified formulation also supports differentiable two-way coupling of rigid bodies and cloth.Source: §3 · p. 3
- Meshes serve as the basic object representation, while an acceleration scheme addresses implicit differentiation with nonlinear constraints.The overview assigns the forward integration scheme to Section 4, collision handling to Section 5, and differentiation to Section 6.Source: §3 · p. 3
4. Preliminaries
The preliminaries collect the system configuration and velocities into vectors over all objects, then describe forces and implicit-Euler time integration. Generalized coordinates differ for rigid bodies and cloth nodes.
4. Preliminaries
- The system configuration q collects the generalized coordinates of all objects into one vector.The corresponding velocity vector stacks the velocities of those coordinates.Source: §4 · p. 3
- Rigid-body generalized coordinates have six degrees of freedom for position and orientation, whereas a cloth node has three Cartesian-coordinate degrees of freedom.For rigid bodies, the velocity coordinates represent linear and angular velocities; cloth-node velocity is a vector.Source: §4 · p. 3
- The dynamics include contact, internal, and external forces, with the mass matrix and generalized force vector defining the system dynamics.External forces include gravity and control input; internal forces include bending and stretching.Source: §4 · p. 3
- Implicit Euler computes coordinate and velocity increments over a time step, which are used to obtain the next state.The method starts from the coordinates and velocities at the current time.Source: §4 · p. 3
5. Scalable Collision Handling
Because collisions are sparse, the method resolves them locally in independent impact zones rather than optimizing across every object. For rigid bodies, it uses generalized coordinates to limit collision optimization variables.
5. Scalable Collision Handling
- Continuous collision detection avoids incorrect gradients from naive discrete-time impulse-based collision response, while a bounding volume hierarchy localizes and accelerates dynamic collision detection.Source: §5 · p. 4
- Localized collision resolution handles contacts among involved objects instead of setting up a global optimization over all objects and gradients.Collisions are sparse in most simulation steps and commonly localized around the scene.Source: §5 · p. 4
- Vertex-face non-penetration constraints express the distance from a mesh vertex to a point interpolated on the colliding face.The interpolation uses barycentric coordinates, and the constraint uses the colliding plane’s normal.Source: §5 · p. 4
- An impact zone groups impacts connected through shared vertices and can be resolved independently.Each impact is a colliding pair of primitives: edge-edge or vertex-face.Source: §5 · p. 4
- Rigid-body collision optimization uses six generalized coordinates per body instead of independently optimizing its many vertices.The coordinates encode three Euler-angle rotation values and three translation values.Source: §5 · p. 4
6. Fast Differentiation
The section accelerates implicit differentiation for collision optimization with nonlinear constraints, where collision handling can dominate simulation runtime. Its QR-based computation reduces the cost of solving the backward system.
6. Fast Differentiation
- Collision handling can consume up to 90% of runtime per simulation step, with repeated optimization iterations for each impact zone contributing to its computational burden.Source: §6 · p. 4
- The method linearizes f around the local solution z* when formulating implicit differentiation.The passage describes the point as a local minimum with Lagrange multiplier λ*.Source: §6 · p. 5
- The acceleration scheme extends QR-based differentiation to nonlinear constraints by incorporating the Jacobian ∇f.The prior method handled quadratic programs with linear constraints only.Source: §6 · p. 5
- For rigid bodies, the Jacobian ∇f_k is evaluated using generalized coordinates consisting of Euler-angle rotation and translation.The exact Jacobian formulation is given in Appendix C.Source: §6 · p. 5
- O(nm^2) QR decomposition reduces computation from O((n + m)^3).Here n is the number of degrees of freedom and m the number of constraints in an impact zone; the original system size is n + m.Source: §6 · p. 5
7. Experiments
Experiments benchmark scalability and generality, ablate localized collision handling and fast differentiation, and present applications to inverse problems and learning control. The case studies also examine two-way coupling, parameter estimation, and simulator interoperability.
7.1. Scalability
- Up to two orders of magnitude more memory and computation are consumed by MPM before memory exhaustion, while our runtime and memory scale linearly with scene complexity.Our method's runtime and memory stay constant as the cloth-to-bunny scale varies from 1:1 to 10:1.Source: Figure 3 · p. 6, §7.1 · p. 6
7.2. Ablation Studies
- Up to 5 times faster backpropagation is achieved by sparse collision handling than by LCP-based handling, with the gap widening as scene complexity increases.The comparison uses a 3D, one-thread implementation against a 2D, four-thread baseline.Source: §7.2 · pp. 6–7, Table 1 · p. 7
- Fast differentiation accelerates backpropagation by up to 16x in the densely stacked-cube scene, with greater impact as scene complexity increases.All contacts form one connected component, requiring the constraints to be solved in one large optimization problem.Source: Table 2 · p. 7, §7.2 · p. 7
7.3. Two-way coupling
- The framework handles two-way rigid-body–cloth effects that prior differentiable simulators cannot model properly, and simulates trampoline contact correctly where MuJoCo's sparse-grid cloth lets the ball penetrate.Source: §7.3 · p. 7, Figure 6 · p. 8
7.4. Applications
- The marble inverse problem reaches a lower objective in 4 iterations than CMA-ES does after two orders of magnitude more iterations.The goal is to drive the marble to a target in 2 seconds while minimizing applied force.Source: Figure 7 · p. 8, §7.4 · p. 8
- Gradient-based controller training quickly converges to a good policy, while DDPG fails to learn the manipulation tasks on a comparable time scale.The tasks use sticks or cloth to move an object to a desired position within 1 second.Source: Figure 8 · p. 8, §7.4 · p. 8
- After 90 gradient steps, mass estimation recovers m1 = 5.4 and achieves the target momentum p = (3, 0, 0).Source: Figure 9 · p. 9, §7.4 · p. 9
- MuJoCo supplies the loss while DiffSim evaluates its gradient, and 10 gradient steps make the three cubes stick together.Source: Figure 10 · p. 9, §7.4 · p. 9
8. Conclusion
The framework scales differentiable simulation with mesh objects, localized collision handling, and accelerated implicit differentiation. Case studies show more effective training than gradient-free and model-free baselines, while broader object and contact support remains future work.
8. Conclusion
- The method has linear complexity in the number of objects and collisions and constant complexity in spatial resolution.Meshes support arbitrary object shapes and scales; unified local collision handling couples different materials, while accelerated implicit differentiation speeds backpropagation.Source: §8 · p. 9
- Training with differentiable simulation was significantly more effective than gradient-free and model-free baselines across the demonstrated case studies.These included end-to-end gradient-based training of neural network controllers.Source: §8 · p. 9
- Deformable solids and articulated bodies are planned extensions, conditional on mesh-based representations with repulsive contact forces.The authors plan to extend the implementation to incorporate these object classes.Source: §8 · p. 9
A. Mass Matrix
The appendix constructs rigid-body mass and inertia in generalized coordinates, then uses Euler-angle rotations to map body-frame vertices into world coordinates.
A. Mass Matrix
- For a rigid body, six generalized coordinates encode rotation and translation, and the mass matrix combines angular and linear inertia.The linear inertia is mI_3×3, where m is the rigid body's total mass.Source: A. Mass Matrix · p. 11
- The particle approximation computes angular inertia from particle masses and their offsets from the center of mass, in the world frame.The angular velocity must be represented through Euler-angle velocities for the generalized-coordinate formulation.Source: A. Mass Matrix · p. 11
- The RPY convention rotates about Z by ψ, then the new Y′ by θ, then the new X′′ by φ; a transformation maps Euler-angle rates to angular velocity.The resulting inertia is expressed in the Euler-angle representation.Source: A. Mass Matrix · p. 11
B. Represent a Vertex using Generalized Coordinates
- A vertex's world coordinates are obtained from its center-of-mass-relative body-frame position and the rotation matrix defined by Euler angles.The rotation matrix is specified by its entries.Source: B. Represent a Vertex using… · p. 11
C. Computation of Derivatives
The section derives vertex-coordinate derivatives with respect to rigid-body generalized coordinates, providing the Jacobian needed to backpropagate gradients to those coordinates.
D. Computation of Derivatives
- The vertex-coordinate Jacobian gives partial derivatives of position as a function of the six generalized coordinates, enabling gradients at a vertex to be backpropagated to those coordinates.The vertex position is expressed as f([φ, θ, ψ, tx, ty, tz]⊤), with entries formed using the initial center-of-mass-relative displacement.Source: C. Computation of Derivatives · p. 11
- For x and y, the Jacobian lists derivatives with respect to ψ, θ, and φ, with terms determined by the vertex's relative position and Euler angles.The supplied entries cover ∂x/∂ψ, ∂x/∂θ, ∂x/∂φ, ∂y/∂ψ, ∂y/∂θ, and ∂y/∂φ.Source: C. Computation of Derivatives · p. 12
- For the z coordinate, the listed Jacobian entries give derivatives with respect to θ and φ using the vertex's center-of-mass-relative position.The entries are ∂z/∂θ and ∂z/∂φ.Source: C. Computation of Derivatives · p. 12
D. Qualitative Comparisons
The qualitative comparison tests two complex rigid bodies interacting with cloth. The authors report that their method produces the most realistic outcome among the compared methods.
D. Qualitative Comparisons
- The scene pairs two complex rigid bodies—the bunny and armadillo—with a cloth surface.The figure compares our method with E2E, ChainQueen, and DiffCloth.Source: D. Qualitative Comparisons · p. 12
- Both the bunny and armadillo are lifted from the table in our simulation, unlike the compared methods.E2E lacks detailed object motion, ChainQueen fails to preserve rigid structure and cloth connectivity, and DiffCloth does not transfer cloth impact to the rigid bodies.Source: D. Qualitative Comparisons · p. 12
- E2E's basic-primitive support limits detailed object motion, while ChainQueen's particle-based treatment does not preserve rigid properties or cloth connectivity.These are the specific failure modes reported for the comparison.Source: D. Qualitative Comparisons · p. 12