Lagrangian Neural Networks
Lagrangian neural networks learn a system's Lagrangian, deriving physically consistent dynamics even in arbitrary or constrained coordinates.
Why a Lagrangian view
The Lagrangian formulation of mechanics is built around a single scalar, the Lagrangian, usually the kinetic minus the potential energy. The equations of motion follow from the Euler-Lagrange equations. A Lagrangian neural network learns this scalar and lets the physics machinery produce the dynamics, so the learned model obeys the structure of mechanics.
Advantage over the Hamiltonian form
A Hamiltonian network needs canonical coordinates, position and conjugate momentum, which are not always available or convenient. A Lagrangian network works directly in generalized coordinates and velocities, which are what sensors and simulations usually provide. This makes it applicable to systems with awkward coordinates or constraints where momenta are hard to define.
Deriving the dynamics
From the learned Lagrangian, the Euler-Lagrange equations give the accelerations. Working these out requires second derivatives of the Lagrangian and the inversion of a mass matrix, all obtainable by automatic differentiation. The network thus predicts accelerations that are guaranteed to arise from some Lagrangian, keeping the dynamics physically consistent.
Properties
- Operates in generalized coordinates without requiring momenta
- Conserves energy for conservative systems by construction
- Handles holonomic constraints naturally through coordinate choice
- Costlier per step because of the required matrix inversion
Use and caveats
Lagrangian networks suit robotics, multibody mechanics, and any setting where coordinates are dictated by geometry rather than convenience. Like Hamiltonian networks, they assume conservative dynamics unless extended with dissipation. Their value is encoding the deep structure of mechanics into a learned model, which pays off in data efficiency and stable long-term prediction.