FINDE: Neural Differential Equations for Finding and Preserving Invariant Quantities

Takashi Matsubara, Takaharu Yaguchi

Introduction

Many real-world dynamical systems are governed by strict conservation laws. Whether it is the conservation of energy in a swinging pendulum or the conservation of mass in a chemical reaction, these "invariant quantities" (first integrals) are the bedrock of physical stability.

When standard Neural Ordinary Differential Equations (NODEs) are used to model these systems from data, they often suffer from "drift." Because the neural network lacks intrinsic knowledge of these conservation laws, small numerical errors accumulate over time. This causes the simulated system to artificially gain or lose energy or mass, eventually leading to unphysical behavior.

Existing physics-informed solutions, such as Hamiltonian Neural Networks (HNNs), force the model to conserve energy. However, they come with a significant limitation: the user must know beforehand that the system is Hamiltonian and understand its underlying structure. If the system has unknown constraints or is not strictly Hamiltonian (such as an energy-dissipating circuit), these models fail.

To bridge this gap, researchers have introduced FINDE (First Integral-preserving Neural Differential Equation). FINDE is a novel framework that automatically discovers and preserves invariant quantities directly from dynamical systems data, enabling highly stable, long-term predictions without requiring prior knowledge of the system's underlying physics.

The FINDE Framework

The authors propose two distinct versions of their architecture to handle both continuous theory and discrete computational realities:

  1. cFINDE (Continuous): This version uses an auxiliary neural network, $V(u)$, to represent $K$ potential invariant quantities. It employs a time-derivative projection method. Essentially, it takes the output of a standard "base" neural network (which predicts the system's direction of evolution) and projects it onto a tangent space where the learned invariants $V(u)$ remain strictly constant.
  2. dFINDE (Discrete): Standard numerical integrators (like Runge-Kutta) naturally introduce "discretization errors" that break conservation laws during simulation. dFINDE is a robust version designed specifically for discrete computer simulations. It uses the discrete gradient method and Automatic Discrete Differentiation (ADDA). Instead of just projecting the direction of movement, it constrains the destination of each time step, ensuring invariants are preserved exactly (up to floating-point rounding errors).

The model is trained using a 1-step error loss, where the base network and the invariant-finding network $V(u)$ are optimized jointly. By forcing the model to preserve something while matching real data, the network is naturally incentivized to discover the actual physical invariants of the system.

Experimental Validation and Key Results

The authors evaluated FINDE on four distinct types of dynamical systems to prove its versatility: a classic Two-body gravitational problem, the complex Korteweg–De Vries (KdV) wave equation, a Double Pendulum with holonomic constraints, and the energy-dissipating FitzHugh–Nagumo neuron model.

Long-term Stability

The primary metric for success was Valid Prediction Time (VPT)—how long the model can predict the future before the error exceeds a predefined threshold. FINDE consistently achieved much higher VPTs than standard NODEs. Furthermore, it outperformed HNNs in scenarios where the HNNs did not have access to all system invariants.

Two-body problem trajectories comparing ground truth, HNN, and cFINDE.

As seen in the Two-body problem trajectories above, standard HNNs can drift off course when they lack complete structural priors, whereas cFINDE successfully maintains the correct orbital path by discovering and preserving the necessary invariants.

Exact Preservation

A standout achievement of the framework is its ability to perfectly maintain conserved quantities over massive timescales.

Energy preservation over time comparing analytical, leapfrog, cFINDE, and dFINDE methods.

In mass-spring demonstrations, dFINDE maintained the system energy perfectly over tens of thousands of steps. As the energy preservation plot illustrates, while standard leapfrog integrators and even the continuous cFINDE exhibit slight "energy drift" due to discretization errors, dFINDE remains perfectly flat, matching the analytical ground truth.

Versatility Beyond Hamiltonian Systems

Unlike previous models specialized only for energy or mass, FINDE treats all invariants in a unified mathematical way. It successfully learned to preserve total mass and energy in the complex KdV wave equation, preventing the "numerical melting" of solitons. Remarkably, FINDE also works on energy-dissipating systems (like the FitzHugh-Nagumo model), marking a significant step forward from traditional physics-preserving AI that focuses strictly on ideal, non-dissipative systems.

Insights and Future Directions

Because the auxiliary network $V(u)$ explicitly learns the invariants, the framework offers a unique degree of interpretability. The authors demonstrated that by applying symbolic regression to the learned network, they could "rediscover" the actual mathematical formulas for momentum and energy (e.g., extracting $p = m_1v_1 + m_2v_2$ directly from the weights).

Despite these successes, FINDE has limitations. The user must manually specify the number of invariants ($K$) to look for; setting $K$ too high can over-constrain the model. Additionally, the projection step involves a matrix inversion that scales at $O(K^3)$, which could become a computational bottleneck for systems with a vast number of conserved quantities. Finally, ensuring that the discovered invariants represent globally consistent physical laws across the entire state space remains an open challenge for future research.

Summary updated

BibTeX
@inproceedings{matsubara2023finde,
  author = {Takashi Matsubara and Takaharu Yaguchi},
  title = {{FINDE: Neural Differential Equations for Finding and Preserving Invariant Quantities}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=tLScKVhcCR},
}
Figure