Table of Contents
Fetching ...

Lagrangian neural ODEs: Measuring the existence of a Lagrangian with Helmholtz metrics

Luca Wolf, Tobias Buck, Bjoern Malte Schaefer

TL;DR

The paper addresses the question of which ODEs arise from a Lagrangian by introducing Helmholtz metrics that quantify proximity to Euler–Lagrange equations. It then couples these metrics with a second-order neural ODE to form a Lagrangian neural ODE, using a differentiable Hessian $g$ learned by a NN and a total loss $\mathcal{L}_{tot}=\mathcal{L}_R+\mathcal{L}_H$ to regularize learning. Empirical results on analytical systems (e.g., Kepler, damped oscillator) show that the Helmholtz metrics recover a Hessian close to the true Lagrangian and distinguish non-Lagrangian dynamics, while data-driven experiments demonstrate that Lagrangian-regularized models can match regression performance and improve alignment with EL structure, suggesting practical benefits for physics-informed learning and extrapolation.

Abstract

Neural ODEs are a widely used, powerful machine learning technique in particular for physics. However, not every solution is physical in that it is an Euler-Lagrange equation. We present Helmholtz metrics to quantify this resemblance for a given ODE and demonstrate their capabilities on several fundamental systems with noise. We combine them with a second order neural ODE to form a Lagrangian neural ODE, which allows to learn Euler-Lagrange equations in a direct fashion and with zero additional inference cost. We demonstrate that, using only positional data, they can distinguish Lagrangian and non-Lagrangian systems and improve the neural ODE solutions.

Lagrangian neural ODEs: Measuring the existence of a Lagrangian with Helmholtz metrics

TL;DR

The paper addresses the question of which ODEs arise from a Lagrangian by introducing Helmholtz metrics that quantify proximity to Euler–Lagrange equations. It then couples these metrics with a second-order neural ODE to form a Lagrangian neural ODE, using a differentiable Hessian learned by a NN and a total loss to regularize learning. Empirical results on analytical systems (e.g., Kepler, damped oscillator) show that the Helmholtz metrics recover a Hessian close to the true Lagrangian and distinguish non-Lagrangian dynamics, while data-driven experiments demonstrate that Lagrangian-regularized models can match regression performance and improve alignment with EL structure, suggesting practical benefits for physics-informed learning and extrapolation.

Abstract

Neural ODEs are a widely used, powerful machine learning technique in particular for physics. However, not every solution is physical in that it is an Euler-Lagrange equation. We present Helmholtz metrics to quantify this resemblance for a given ODE and demonstrate their capabilities on several fundamental systems with noise. We combine them with a second order neural ODE to form a Lagrangian neural ODE, which allows to learn Euler-Lagrange equations in a direct fashion and with zero additional inference cost. We demonstrate that, using only positional data, they can distinguish Lagrangian and non-Lagrangian systems and improve the neural ODE solutions.

Paper Structure

This paper contains 8 sections, 6 equations, 3 figures.

Figures (3)

  • Figure 1: Lagrangian neural ODE model. Gradients are represented by gray arrows.
  • Figure 2: Smoothed loss curves for training Helmholtz metrics on different ODEs for different settings. Left: Oscillator with and without time dependence of $g$. Middle: Kepler problem with different mean eccentricity $\mu_\varepsilon$. Right: non-Lagrangian ODEs. Vertical axes are scaled differently.
  • Figure 3: Results of training a Lagrangian neural ODE on an oscillator.