Differentiable Physics
- Differentiable physics is a computational paradigm where simulation components are implemented as differentiable maps, enabling end-to-end gradient-based optimization.
- It integrates classical simulation methods with modern automatic differentiation frameworks to optimize physical parameters and handle complex dynamics such as contact and deformation.
- Recent implementations show substantial speedups and improved data efficiency in robotics, fluid dynamics, and inverse problems, marking its significance in advanced optimization and control.
Differentiable physics is a computational paradigm in which every numerical operation involved in simulating physical systems—forces, integrators, constraints, and boundary conditions—is implemented as a differentiable map. This paradigm enables the computation of exact gradients of simulation outputs with respect to both physical parameters and initial conditions using automatic differentiation (AD). Differentiable physics thus unifies classical simulation techniques with modern AD frameworks, supporting end-to-end optimization, learning, and inverse problems across a broad range of physical domains, from molecular dynamics and soft-body manipulation to turbulent flow closure modeling and articulated rigid-body contact.
1. Mathematical and Algorithmic Foundations
The core mathematical structure of differentiable physics is the time-evolution map
where denotes the system state at time and denotes a set of physical or learned parameters such as masses, force field coefficients, or neural network weights. Over a full trajectory,
and any loss is a differentiable function of via the chain rule or, in continuous time, via the adjoint-state method
The gradient with respect to parameters is then: as articulated in (Ramsundar et al., 2021).
Differentiable physics requires that each elemental kernel—be it finite-difference, finite-element assembly, nonlinear force, or contact solver—be implemented with differentiable operations. Common discretizations include finite difference, finite volume, and finite element methods, all realized in frameworks supporting forward- and reverse-mode AD such as JAX, PyTorch, Julia/Zygote, or Taichi (Schoenholz et al., 2019, Holl et al., 2020).
2. Rigid Body, Articulated, and Contact Dynamics
For rigid and articulated systems, differentiable physics must accurately handle Lagrangian dynamics, contact, and friction. Modern engines such as Nimble (Werling et al., 2021), Jade (Yang et al., 2023), Dojo (Howell et al., 2022), and DiffSDFSim (Strecke et al., 2021) realize full differentiability through contact events by either linear complementarity problem (LCP) or nonlinear complementarity problem (NCP) formulations. For example, Nimble and Jade use LCPs: with analytical gradients computed via implicit differentiation, exploiting the partition of active (clamping), separating, and tied contacts for local differentiability. Dojo extends to NCPs with second-order cones to model friction and employs custom primal-dual interior-point methods for smooth gradients through hard contacts.
Key aspects include:
- Differentiation through complementarity solvers is made efficient via active-set implicit differentiation, reducing complexity to 0 in the number of active constraints (Werling et al., 2021, Yang et al., 2023).
- Continuous collision detection (CCD) and backtracking enable intersection-free, differentiable time-of-impact handling (Yang et al., 2023).
- Variational integrators conserve energy and momentum to machine precision and provide stable gradients at large timesteps (Howell et al., 2022).
- Analytically derived gradients demonstrate orders-of-magnitude speedup over finite-difference approaches: e.g., Nimble achieves an 87x speedup for articulated robots (Werling et al., 2021).
- Contact model correctness (with or without time-of-impact, spring-penalty, or projection) fundamentally impacts gradient direction and optimization outcome (Zhong et al., 2022).
3. Differentiable Physics for Deformables and Soft Matter
Soft-body and continuum systems require scalable, high-dimensional, and robust differentiable solvers:
- The Material Point Method (MPM), as used in PlasticineLab and DiffVL, supports differentiable simulation of soft solids, enabling trajectory optimization, system identification, and contact-rich manipulation (Huang et al., 2023, Li et al., 2022).
- Differentiable collision and contact handling for deformables exploits either local quadratic programs per contact "impact zone" or penalty-based methods with smoothness ensured via AD (Qiao et al., 2020).
- Fine-grained yarn-level models for fabrics represent crossing points as coupled Lagrangian/Eulerian variables and formulate all inter-yarn forces (stretch, bend, shear, static-kinetic friction, normal contact) as smooth, differentiable functions, solved by implicit Euler and adjoint linear systems; this supports high-fidelity parameter learning and inverse design at fine and coarse scales (Gong et al., 2022, Huang et al., 2023).
- Soft-body differentiable physics has enabled manipulation strategies combining optimal transport-based contact discovery with differentiable simulation, outperforming model-free RL and handcrafted heuristics on multi-stage deformable tasks (Li et al., 2022).
The resulting frameworks are efficient enough to perform gradient-based optimization over thousands of degrees of freedom, supporting direct policy optimization, system identification, and even vision-language-driven task specification with LLMs translating naturalistic goals into physics-aligned optimization programs (Huang et al., 2023).
4. PDEs, Turbulence, and Scientific Modeling
Differentiable physics has extended into simulation domains governed by partial differential equations (PDEs), including turbulent fluid dynamics, scalar transport, and wave propagation:
- Hybrid frameworks couple end-to-end differentiable PDE solvers (finite-volume or spectral) with neural closure parameterizations, training both physical model parameters (e.g., diffusivity tensor) and closure terms jointly by backpropagating through the entire solver rollout (Xue et al., 26 Nov 2025, Shankar et al., 2022).
- Differentiable solvers for PDE-constrained optimal control problems enable learning of planning and control policies for nonlinear systems such as incompressible Navier-Stokes, using semi-Lagrangian and projection schemes, with gradients propagated via the analytic adjoint of linear (e.g. Poisson) solvers (Holl et al., 2020).
- Differentiable hybrid models trained in-loop (solver-in-the-loop) can achieve 100x speedup over full-resolution CFD, learn data-efficient non-Markovian neural closures, and generalize to out-of-distribution scenarios (e.g., moving sources), with stable long-horizon rollouts (Xue et al., 26 Nov 2025).
- Differentiable physics-enabled closure modeling with embedded inductive biases (e.g., transport equations, eddy viscosity, Boussinesq forms) dramatically reduces sample complexity and yields closure terms that generalize across grid resolutions, viscosity, and time, as demonstrated in Burgers' turbulence (Shankar et al., 2022).
- Differentiable physics approaches have extended to sound field reconstruction, where purely "hard-coded" numerical solvers in AD frameworks, coupled with a neural initial condition and a sparsity-promoting constraint, outperform PINN-style residual losses in data-scarce regimes (Verburg et al., 6 Oct 2025).
5. Machine Learning Integration: Imitation, Control, and Data Efficiency
Differentiable physics provides strong priors and physically consistent gradients within learning pipelines, supporting:
- Direct backpropagation through temporally unrolled simulators for imitation learning by minimizing trajectory-matching losses (e.g., Chamfer 1 set distances), achieving faster convergence and higher performance with single-loop training (Chen et al., 2022).
- Embedding simulator-in-the-loop for reinforcement learning, planning, and control, supporting meta-optimization, policy search, and system identification with physics-compatible parameter gradients.
- Differentiable programming brings composability: physics-based layers, neural surrogates, closure models, and even scientific foundation models can be chained into unified pipelines (Ramsundar et al., 2021).
- Empirical results demonstrate that direct gradient-based optimization via differentiable simulators outperforms both derivative-free and model-free RL baselines in data efficiency, convergence, stability, and final performance across molecular, robotic, and scientific domains (Schoenholz et al., 2019, Chen et al., 2022, Qiao et al., 2020, Roussel et al., 2022).
6. Scalability, Performance, and Algorithmic Techniques
Differentiable physics frameworks have addressed challenges of scalability, computational cost, and solver-integration:
- Array-based compositional primitives, vectorized over particles or mesh nodes, enable simulation of tens to hundreds of thousands of bodies on single GPUs/TPUs; e.g., JAX MD is within 2 of HOOMD-Blue/LAMMPS up to 3 particles (Schoenholz et al., 2019).
- Partitioned or local collision resolution (impact zones, QP/local KKT, block-diagonal mass matrices) yields linear time and memory scaling with object count, as shown in mesh-based rigid/cloth frameworks (Qiao et al., 2020).
- Progressively refined differentiable physics (PRDP) leverages bilevel optimization to schedule solver-tolerance adaptively during learning, attaining up to 86% inner-iteration savings and more than 60% training time reduction without loss of accuracy in inverse problems and neural-hybrid solvers (Bhatia et al., 26 Feb 2025).
- Specialized acceleration, such as QR-based adjoint solvers for KKT systems, mode-warmstarting in contact partitioning, and vectorized AD over trajectories, further reduce the overheads of backpropagation (Werling et al., 2021, Qiao et al., 2020).
7. Open Challenges and Future Directions
Despite significant progress, several technical frontiers remain:
- Non-smoothness and active-set variation in contact-rich scenarios still challenge gradient correctness, especially for position derivatives; hybrid compliant–impulse models, time-of-impact correction, and smoothed complementarity approximations are active research areas (Zhong et al., 2022).
- High computational and memory costs of reverse-mode AD through long trajectories and large-scale PDEs require advances in checkpointing, adjoint integration, and solver-integration (Shankar et al., 2022).
- Integration of uncertainty quantification, stability guarantees for long-horizon learning, and composable multiscale modeling across physical regimes (quantum to continuum) are in early stages (Ramsundar et al., 2021).
- Embedding differentiable physics with LLMs, scientific foundation models, or vision-centric simulators for broader inductive reasoning and control remains an emerging area (Huang et al., 2023, Ding et al., 2021).
- Differentiable frameworks for non-smooth geometric variations (e.g., topology changes, crack propagation) and high-fidelity viscoelastic or multicomponent material systems remain an open field (Strecke et al., 2021, Gong et al., 2022).
A plausible implication is that the continued development of fast, scalable, and accurate differentiable physics engines will play a central role not only in simulation-based science, but also in data-efficient learning, control, foundation modeling, and a broad class of hybrid scientific computing tasks.