Physics-Informed Learning Using Hamiltonian Neural Networks with Output Error Noise Models

Sarvin Moradi, Nick O. Jaensson, Roland Tóth, Maarten Schoukens

TL;DR

This paper introduces the Output Error Hamiltonian Neural Network (OE-HNN), a novel deep learning approach that makes physics-informed modeling more practical by handling noisy measurements and system inputs. By integrating an ODE solver into the training process, OE-HNNs can learn complex system dynamics from imperfect data, outperforming traditional methods in simulations.

What Problem Does This Paper Address?

Building accurate models of physical systems is crucial, but it's a tough challenge. Traditional "white-box" physics-based models require deep prior knowledge, which is often scarce or hard to obtain. On the other hand, "black-box" data-driven models can learn from data but often lack interpretability and generalizability.

Hamiltonian Neural Networks (HNNs) offer a middle ground, embedding the principles of Hamiltonian mechanics (a framework for energy-conservative systems) into neural networks. This makes them interpretable and good at capturing system behavior. However, classical HNNs have significant limitations for real-world applications: they can't handle external inputs, require perfectly clean (noiseless) measurements, and crucially, need to know the derivatives of the system's states, which are rarely available in practice. This paper aims to overcome these limitations, making HNNs more robust and applicable to a wider range of engineering problems.

Methods

The core innovation here is the Output Error Hamiltonian Neural Network (OE-HNN). Here's how it works:

  • Output Error Framework: Instead of trying to predict the exact state or its derivative (which is difficult with noisy data), OE-HNNs focus on minimizing the simulation error. This means they try to make the model's simulated output match the measured output as closely as possible. This is a standard technique in system identification for handling noisy measurements.
  • ODE Solver Integration: A key challenge is that classical HNNs require state derivatives for training. OE-HNNs circumvent this by embedding an Ordinary Differential Equation (ODE) solver directly into the training loop. The neural network predicts the system's dynamics, and the ODE solver uses these predictions to simulate the system's state evolution over time. The error between these simulated states and the actual measurements is then used to update the network.
  • Generalized Hamiltonian Theory: The paper extends the HNN framework to handle systems with external inputs. This is achieved by leveraging generalized Hamiltonian theory, which allows for energy to be added or removed from the system via these inputs.
  • Multisine Inputs: For data generation, the authors propose using "multisine" inputs. These are carefully constructed signals that allow for systematic exploration of a system's response across various frequencies, providing richer data for training.

Datasets

The paper uses simulated data for its experiments.

  • Duffing-type Oscillator: This is a classic nonlinear system used to demonstrate the OE-HNN's ability to model a single system with inputs and noisy measurements. Data was generated by numerically solving the oscillator's equations of motion with multisine inputs and then adding independent white noise to the state measurements.
  • Connected Two Mass-Spring System: This is used to test the OE-HNN's generalizability to systems with higher degrees of freedom and more complex dynamics. Similar to the oscillator, data was generated with inputs and added noise.

Key Insights and Ideas

  • Noiseless Derivatives No More: The most significant breakthrough is eliminating the need for noiseless state derivatives. By using an ODE solver within the training loop and focusing on output error, the OE-HNN can learn from readily available, albeit noisy, state measurements.
  • Robustness to Noise: The "output error" approach, combined with the inherent structure of Hamiltonian dynamics, makes the OE-HNN remarkably robust to measurement noise. The simulation error objective function strongly penalizes the accumulation of errors over time, leading to more stable and accurate long-term predictions.
  • Bridging Physics and Data: OE-HNNs represent a powerful step towards truly "physics-informed" machine learning that is practical for real-world engineering. They combine the interpretability and structure of physical laws with the flexibility of neural networks to learn from imperfect data.
  • Generalizability: The successful application to both a single Duffing oscillator and a two mass-spring system suggests that the OE-HNN framework can be extended to a wide range of complex, multi-degree-of-freedom systems.

Key Results

  • Superior Accuracy: In simulations, the OE-HNN consistently outperformed both a standard Multilayer Perceptron (MLP) and a classical HNN in terms of Root Mean Square Error (RMSE) for both position (q) and momenta (p) predictions. For the Duffing oscillator, OE-HNN achieved RMSEs of 0.025 for q and 0.047 for p, significantly lower than MLP (0.071, 0.135) and HNN (0.048, 0.084).
  • Improved Performance on Complex Systems: The OE-HNN also showed superior accuracy on the connected two mass-spring system, outperforming MLP and HNN across all state variables (q1, q2, p1, p2).
  • Handling Inputs: The OE-HNN successfully incorporated external inputs into the modeling process, a capability lacking in classical HNNs.

Limitations and Future Work

  • Computational Cost: The paper notes that while OE-HNNs are more accurate, their training process requires more computation time compared to MLPs, largely due to the embedded ODE solver.
  • System Assumptions: The current OE-HNN formulation is primarily for energy-conservative systems (though generalized to include inputs). Extending it to explicitly model dissipation (energy loss) in a more integrated way remains an area for future research.
  • Real-World Data: The current evaluation is based on simulated data. Future work should focus on validating the OE-HNN approach on real-world experimental data to assess its performance in practice.
  • Input Signal Design: While multisines are proposed, further research into optimal input signal design for OE-HNN training could enhance performance.

Summary updated

BibTeX
@inproceedings{moradi2023physics,
  author = {Sarvin Moradi and Nick O. Jaensson and Roland Tóth and Maarten Schoukens},
  title = {{Physics-Informed Learning Using Hamiltonian Neural Networks with Output Error Noise Models}},
  booktitle = {IFAC-PapersOnLine},
  year = {2023},
  doi = {10.1016/j.ifacol.2023.10.108},
}
Figure