Computing Library › Scientific Ml
Scientific Ml

Differentiable Physics

Differentiable physics embeds known physical laws as differentiable program components so learning and simulation share one gradient path.

Physics as a differentiable layer

Differentiable physics treats a physical model, a fluid solver, a contact model, an optics propagator, as a differentiable layer that can be inserted anywhere in a machine-learning pipeline. Because the layer passes gradients, a network placed before or after it can be trained end to end, with the physics enforcing correctness and the network handling whatever the physics leaves open.

Why not learn everything

Kronos motion — learning physics

A pure neural network must rediscover conservation laws, symmetries, and dynamics from data, which is wasteful when those laws are already known exactly. Differentiable physics hard-codes the known part and learns only the unknown part, such as a subgrid closure or an uncertain material parameter. The learned component is small and interpretable, and the model respects physics by construction.

Typical arrangements

Solver-in-the-loop training

A key advantage is training the network against the actual solver rather than against pre-computed snapshots. The network sees how its outputs propagate through the physics over many steps and is corrected for errors that only appear after long rollouts. This solver-in-the-loop scheme produces models that stay stable far longer than those trained on single-step targets.

Limits

The physics component must be implemented differentiably, which excludes many legacy solvers and non-smooth operations without special handling. Chaotic dynamics limit how far gradients remain useful. Where these constraints are met, differentiable physics offers accuracy from known laws with the flexibility of learning for the rest.