Source-linked AI summary

Lagrangian and Hamiltonian Neural Networks With a Dissipative System

V. Rayamajhi, J. Singal

arXiv:2609.31988v1cs.LGphysics.class-ph

TL;DR

Prior Lagrangian and Hamiltonian NN studies focused on systems without explicit time dependence, leaving their use in dissipative systems less explored. This paper tests both approaches on simulated damped and undamped oscillators, finding that they can predict damped-system dynamics under specified conditions and recover valid Lagrangians in the Lagrangian models. The study's scope includes oscillator systems, and its hyperparameters were not optimized.

  • Problem

    Earlier foundational Lagrangian and Hamiltonian NN studies considered systems without explicit time dependence, while dissipative systems can lose energy through interactions such as friction.

    Source: §1 · p. 2
  • Method

    The paper applies Lagrangian and Hamiltonian NNs to simulated damped and undamped one-dimensional, one-component harmonic oscillators.

    Source: §1 · p. 3
  • Results

    Lagrangian and Hamiltonian NNs can predict dissipative-system dynamics under stated conditions, and the Lagrangian models can recover valid system Lagrangians that are not always the simplest forms.

    Source: §5 · p. 12
  • Takeaways & Limitations

    The results extend the use of these neural-network approaches to oscillator systems with explicit time dependence, while showing that a learned Lagrangian need not match the simplest system form.

    Source: §5 · p. 12

    The conclusions are demonstrated on simple oscillator systems, with hyperparameters chosen largely by trial and error rather than optimized.

    Source: §2 · p. 4, §3.2 · p. 7

Abstract

from arXiv · show

We investigate the applicability of Lagrangian and Hamiltonian Neural Network models to a dissipative system that has explicit time dependence in its Lagrangian, Hamiltonian, and total energy. To do so we consider these neural network models for simulated systems of a harmonic one-dimensional, one-component oscillator with damping, as well as without damping for comparison. We find that both the Lagrangian and Hamiltonian approaches are able to predict the empirical physical behavior of the damped oscillator systems and to effectively ``learn'' to varying degrees the underlying Lagrangians and Hamiltonians, as has previously been shown to be the case with undamped oscillator systems. These investigations elucidate important properties of Lagrangian and Hamiltonian mechanics, including properties that are not manifest when considering systems without explicit time dependence.

1 Introduction

The paper examines whether Lagrangian and Hamiltonian neural networks can illuminate system properties beyond empirical input-output fitting, in a setting where dissipation makes energy nonconserved and the mechanics explicitly time-dependent. It applies these models to damped and undamped one-dimensional oscillators.

1 Introduction

  • Empirical neural networks fit nonlinear input-output mappings but can act as black boxes, motivating models that can help elucidate underlying system features.Physics-informed networks train to fit data while conforming to known equations; Lagrangian and Hamiltonian functions can reflect system properties such as symmetries despite not being directly observable.Source: §1 · p. 1
  • Lagrangian and Hamiltonian NNs learn their respective functions from dynamical inputs and predict other variables using derivatives of those functions.The learned models can then calculate the functions and dynamical variables for test systems.Source: §1 · pp. 1–2
  • Earlier Lagrangian and Hamiltonian NN studies considered systems without explicit time dependence, whereas many systems of interest are dissipative and lose energy through interactions such as friction.For the velocity-dependent damping studied here, the Hamiltonian is not equal to total energy and is not conserved.Source: §1 · pp. 2–3
  • Earlier neural-network approaches to dissipative systems used either separate Hamiltonian and dissipation subnetworks or a Lagrangian transformation to a space with twice as many generalized coordinates.These approaches are described by Sosanya & Greydanus and Sundararaghavan et al., respectively.Source: §1 · p. 3
  • The study applies Lagrangian and Hamiltonian NNs to damped and undamped one-dimensional, one-component harmonic oscillators, with the damped case explicitly time-dependent.The implementation follows methods similar to Cranmer et al. and Greydanus et al..Source: §1 · p. 3

2 Simulated Oscillator Systems and Network Architectures

The study trains on simulated oscillator trajectories and tests on separate trajectories, varying noise and sampling density across cases. Network hyperparameters were chosen largely by trial and error rather than optimization.

2 Simulated Oscillator Systems and Network Architectures

  • Training used 30–1200 simulated oscillator trajectories over 3140 s, with k = 1 N/m, m = 1 kg, and damped-case b = 0.02 kg/s.Initial total energies were drawn uniformly from 0.1 to 1.0 J.Source: §2 · p. 3
  • Noisy cases added Gaussian noise, while training samples were taken every 2, 10, or 100 time steps depending on the model and convergence.Testing used two additional trajectories with initial energies of 0.2 J and 1 J; the reported results use 0.2 J, and results at 1 J were similar.Source: §2 · p. 3
  • Network hyperparameters were selected largely through trial and error and were not claimed to be optimized.The authors state that optimization was outside the study's scope and unnecessary to demonstrate its conclusions.Source: §2 · p. 4

3 Lagrangian Neural Network

The Lagrangian NN predicts oscillator dynamics in both damped and undamped cases, including with simulated noise. The section introduces derivative-based prediction and compares models with and without time as an input for damping.

3 Lagrangian Neural Network

  • The Lagrangian NN uses generalized coordinates and velocities, and can use time as an input; derivatives of its learned Lagrangian predict acceleration for evaluation trajectories.The section describes training against observed acceleration and evaluating on test trajectories.Source: §3 · p. 4

3.1 Lagrangian NN – Undamped case

  • For the undamped oscillator, the section presents actual and predicted acceleration and Lagrangian over time for noise-free and fully noise-affected observed data.The caption notes that a particular function of the generalized coordinates can make predicted and actual Lagrangians appear different.Source: Figure 2 · p. 5, §3.1 · p. 5

3.2 Lagrangian NN – Damped case

  • For the damped oscillator, the study compared Lagrangian NN models with and without time as an input, and presented predicted and actual acceleration and Lagrangian for noisy and noise-free data.The damped system is considered in the weak-damping regime, where oscillations continue for multiple cycles.Source: §3.2 · p. 7

3.3 Lagrangian NN results

  • Lagrangian NNs successfully predicted both damped and undamped oscillator dynamics with and without noise; the damped model also predicted acceleration without time as an input.The no-time damped model's predicted Lagrangians appeared similar to valid system Lagrangians from models given time as an input.Source: §3.3 · p. 7

4 Hamiltonian Neural Network

The Hamiltonian NN uses dynamical variables, and time when needed, to learn a Hamiltonian whose derivatives predict motion. For the damped oscillator, including time and using generalized momentum lets it predict the dynamics and underlying Hamiltonian; omitting time while using linear momentum instead yields an approximation of non-dissipative energy.

4 Hamiltonian Neural Network

  • The Hamiltonian NN learns a Hamiltonian from dynamical-variable inputs by minimizing the difference between observed targets and predictions from Hamiltonian derivatives.In-network gradients provide the derivative-based predictions.Source: §4 · pp. 7–8

4.1 Hamiltonian NN – Undamped case

  • For the undamped oscillator, generalized and linear momentum coincide, and the Hamiltonian equals total energy; Figure 4 compares predicted and actual velocity, momentum derivative, and Hamiltonian with and without noise.The model takes observed position and momentum as inputs.Source: §4.1 · pp. 8–9, Figure 4 · p. 8

4.2 Hamiltonian NN – Damped case

  • For the damped oscillator, the Hamiltonian is non-dissipative kinetic-plus-potential energy modified by the same exponential factor relating generalized and linear momentum.The Hamiltonian is not equal to total energy because the interaction depends on velocity.Source: §4.2 · pp. 10–11
  • Without time, using linear momentum rather than generalized momentum enables convergence and fits the observed damped-oscillator dynamics, while learning an approximation of non-dissipative energy.Using generalized momentum without time did not converge.Source: Figure 6 · p. 10, §4.2 · p. 11, §4.3 · p. 11

4.3 Hamiltonian NN Results

  • With time and generalized momentum as inputs, the Hamiltonian NN predicts the damped oscillator’s dynamics and underlying Hamiltonian.The predicted linear momentum derivative is recovered from the canonical momentum derivative using the stated conversion.Source: Figure 5 · p. 9, §4.3 · p. 11, §4.2 · p. 11

5 Discussion

Lagrangian and Hamiltonian neural networks predicted damped-oscillator dynamics despite explicit time dependence and nonconserved total energy, subject to specific input and system conditions. The learned Lagrangian can differ from the simplest form while remaining correct for the system's dynamics.

  • Both neural-network approaches predicted damped-oscillator dynamics with explicit time dependence and nonconserved total energy under specified conditions.Source: §5 · p. 12
  • An LNN can predict the dynamics when time is an input or when ∂L/∂t is a constant times L, but the latter route hard-codes damping.Source: §5 · p. 12
  • An HNN predicts dynamics with time and generalized momentum as inputs, or under a specified momentum-energy relation using linear momentum; only the former recovers the actual Hamiltonian.Source: §5 · p. 12
  • The LNNs recovered correct but not necessarily simplest Lagrangians, consistent with the invariance of dynamics under the stated transformations.Source: §5 · p. 12
Loading 2609.31988v1…