Table of Contents
Fetching ...

Lagrangian Neural Networks

Miles Cranmer, Sam Greydanus, Stephan Hoyer, Peter Battaglia, David Spergel, Shirley Ho

TL;DR

The paper tackles learning physical dynamics with energy conservation when canonical coordinates are unavailable by introducing Lagrangian Neural Networks (LNNs) that learn a neural Lagrangian and derive dynamics via the Euler–Lagrange equation. It extends the approach to Lagrangian Graph Networks to handle graph-structured and PDE-like systems, such as the 1D wave equation. Across experiments, LNNs achieve superior energy conservation on a double pendulum, succeed in modeling a relativistic particle from noncanonical coordinates where Hamiltonian methods fail, and effectively model PDE-like dynamics in graphs. The work broadens the scope of physics-informed neural modeling by removing canonical-coordinate constraints and enabling energy-preserving dynamics in complex systems, with public code support.

Abstract

Accurate models of the world are built upon notions of its underlying symmetries. In physics, these symmetries correspond to conservation laws, such as for energy and momentum. Yet even though neural network models see increasing use in the physical sciences, they struggle to learn these symmetries. In this paper, we propose Lagrangian Neural Networks (LNNs), which can parameterize arbitrary Lagrangians using neural networks. In contrast to models that learn Hamiltonians, LNNs do not require canonical coordinates, and thus perform well in situations where canonical momenta are unknown or difficult to compute. Unlike previous approaches, our method does not restrict the functional form of learned energies and will produce energy-conserving models for a variety of tasks. We test our approach on a double pendulum and a relativistic particle, demonstrating energy conservation where a baseline approach incurs dissipation and modeling relativity without canonical coordinates where a Hamiltonian approach fails. Finally, we show how this model can be applied to graphs and continuous systems using a Lagrangian Graph Network, and demonstrate it on the 1D wave equation.

Lagrangian Neural Networks

TL;DR

The paper tackles learning physical dynamics with energy conservation when canonical coordinates are unavailable by introducing Lagrangian Neural Networks (LNNs) that learn a neural Lagrangian and derive dynamics via the Euler–Lagrange equation. It extends the approach to Lagrangian Graph Networks to handle graph-structured and PDE-like systems, such as the 1D wave equation. Across experiments, LNNs achieve superior energy conservation on a double pendulum, succeed in modeling a relativistic particle from noncanonical coordinates where Hamiltonian methods fail, and effectively model PDE-like dynamics in graphs. The work broadens the scope of physics-informed neural modeling by removing canonical-coordinate constraints and enabling energy-preserving dynamics in complex systems, with public code support.

Abstract

Accurate models of the world are built upon notions of its underlying symmetries. In physics, these symmetries correspond to conservation laws, such as for energy and momentum. Yet even though neural network models see increasing use in the physical sciences, they struggle to learn these symmetries. In this paper, we propose Lagrangian Neural Networks (LNNs), which can parameterize arbitrary Lagrangians using neural networks. In contrast to models that learn Hamiltonians, LNNs do not require canonical coordinates, and thus perform well in situations where canonical momenta are unknown or difficult to compute. Unlike previous approaches, our method does not restrict the functional form of learned energies and will produce energy-conserving models for a variety of tasks. We test our approach on a double pendulum and a relativistic particle, demonstrating energy conservation where a baseline approach incurs dissipation and modeling relativity without canonical coordinates where a Hamiltonian approach fails. Finally, we show how this model can be applied to graphs and continuous systems using a Lagrangian Graph Network, and demonstrate it on the 1D wave equation.

Paper Structure

This paper contains 9 sections, 11 equations, 4 figures, 1 table.

Figures (4)

  • Figure 1: Physicists use Lagrangians to describe the dynamics of physical systems like the double pendulum (black). Neural networks struggle to model these dynamics over long time periods due to their inability to conserve energy (red). In this paper, we show how to learn arbitrary Lagrangians with neural networks, inducing a strong physical prior on the learned dynamics (blue).
  • Figure 2: Results on the double pendulum task. In (a), we see that the LNN and baseline model perform similarly in modelling the dynamics of the pendulum over short time periods. However, if we plot out the energy over a very long time period in (b) we can see that the LNN model conserves the total energy of the system significantly better than the baseline.
  • Figure 3: Results on the relativistic particle task. In (a) an HNN model fails to learn dynamics from non-canonical coordinates. In (b) the HNN succeeds when given canonical coordinates. Finally in (c) the LNN learns accurate dynamics even from non-canonical coordinates.
  • Figure 4: Results on the 1D wave equation task, using a Lagrangian Graph Network. Here, the LNN models the Lagrangian density over three adjacent gridpoints along the wave, and this density is summed. Here, the waves make approximately three and a half passes across the 100 grid points over the time plotted. A movie can be viewed by clicking on the plot or by going to https://github.com/MilesCranmer/gifs/blob/master/wave_equation.gif.