Controlled oscillation modeling using port-Hamiltonian neural networks

Reading time: 5 minute
...

📝 Original Info

  • Title: Controlled oscillation modeling using port-Hamiltonian neural networks
  • ArXiv ID: 2602.15704
  • Date: 2026-02-17
  • Authors: ** 저자 정보가 논문 본문에 명시되지 않아 확인할 수 없습니다. (ArXiv 제출 번호: arXiv:2602.15704v1, 제출일: 2026‑02‑17) — **

📝 Abstract

Learning dynamical systems through purely data-driven methods is challenging as they do not learn the underlying conservation laws that enable them to correctly generalize. Existing port-Hamiltonian neural network methods have recently been successfully applied for modeling mechanical systems. However, even though these methods are designed on power-balance principles, they usually do not consider power-preserving discretizations and often rely on Runge-Kutta numerical methods. In this work, we propose to use a second-order discrete gradient method embedded in the learning of dynamical systems with port-Hamiltonian neural networks. Numerical results are provided for three systems deliberately selected to span different ranges of dynamical behavior under control: a baseline harmonic oscillator with quadratic energy storage; a Duffing oscillator, with a non-quadratic Hamiltonian offering amplitude-dependent effects; and a self-sustained oscillator, which can stabilize in a controlled limit cycle through the incorporation of a nonlinear dissipation. We show how the use of this discrete gradient method outperforms the performance of a Runge-Kutta method of the same order. Experiments are also carried out to compare two theoretically equivalent port-Hamiltonian systems formulations and to analyze the impact of regularizing the Jacobian of port-Hamiltonian neural networks during training.

💡 Deep Analysis

📄 Full Content

Purely data-driven methods for dynamical systems pose several challenges: the volume of useful data is generally limited, they produce accurate-but-wrong predictions, they are not capable of dealing with uncertainty and their predictions are not explainable nor interpretable [1]. At the same time, it is natural to leverage the prior knowledge obtained through centuries of scientific study in the form of inductive bias [2] when designing predictive models [3]. In this direction, a successful data-driven physical model is one whose inductive bias better captures the true dynamics and is able to predict a correct outcome for data not observed during training. These inductive bias are incorporated through soft and hard constraints [4]. Soft constraints add penalty terms to the training loss function, discouraging violations of physical laws. This approach is widely applicable, but the model must balance adherence to the constraints against fitting the observed data, without providing any formal guarantee. The seminal Physics-Informed Neural Networks (PINNs) [5] is an example of soft-constraining the model. In contrast, hard constraints ensure strict compliance with specified physical laws by embedding them directly into the model's structure, independently of the available data. In this sense, hard constraints can be used to incorporate energy conservation laws, symmetry, numerical methods for PDEs or Koopman theory [6]. However, imposing hard constraints reduces the space of possible solutions and generally limits the model's expressiveness. As a result, hard constraints are difficult to apply in practice: incorrect assumptions about the physical system can lead to overly biased models with a poor generalization performance.

In this paper, we consider dynamical systems whose state x is governed by the following ODE:

and analyze how hard constraints based on energy conservation and power balance principles are incorporated into neural networks based on physically consistent port-Hamiltonian systems formulations. By physically consistent, we refer, in this work, to the combination of powerbalanced state-space models with discrete gradient numerical methods, which preserve the system’s energy during discretization. The central hypothesis is that enforcing this physical structure as a hard constraint improves interpretability and generalization with respect to a vanilla NeuralODE. To substantiate this claim, we conduct a systematic study on three controlled oscillatory systems of arXiv:2602.15704v1 [cs.LG] 17 Feb 2026 increasing modeling complexity: a harmonic oscillator, a Duffing oscillator and a self-sustained oscillator. These systems are deliberately selected to include linear and nonlinear Hamiltonian dynamics as well as nonlinear dissipation mechanisms. The harmonic oscillator serves as the simplest baseline example with quadratic energy storage; the Duffing oscillator offers nonlinearities in the Hamiltonian, capturing amplitude-dependent effects; and the self-sustained oscillator incorporates a nonlinear dissipation which can stabilize the system in a controlled-limit cycle.

The main contributions of this paper are

• a comparison of two theoretically equivalent port-Hamiltonian systems (PHS) formulations: the semiexplicit PH-Differential-Algebraic-Equations (PH-DAE) and the input-state-output PHS with feedthrough; when they are implemented as port-Hamiltonian neural networks (PHNNs).

• a performance comparison between the Gonzalez discrete gradient method, which is a second-order energypreserving numerical method, and a second-order explicit Runge-Kutta method when used to discretize the PHNN model during learning.

• an empirical study of the impact of regularizing the Jacobian of PHNN through two methods already applied to NeuralODEs and a new one tackling the stiffness of the learned ODE solutions.

The rest of this paper is organized as follows. Section 2 introduces the necessary preliminaries on dynamical systems, port-Hamiltonian systems, numerical methods, neural ordinary differential equations, and port-Hamiltonian neural networks. Section 3 presents the port-Hamiltonian formulations considered in this work, the enforced physical constraints, and the oscillatory examples used throughout the paper. Section 4 focuses on port-Hamitonian neural networks, detailing how physical constraints are incorporated into the learning process, the comparison between continuous-and discrete-time models, and the Jacobian regularization in the port-Hamiltonian neural networks. Section 5 formulates the key research questions addressed by the experimental study. Section 6 reports and discusses the results of the experiments. Finally, Section 7 concludes the paper and outlines directions for future work. The code is publicly available: https://github. com/mlinaresv/ControlledOscillationPHNNs [will be released after paper acceptance].

2.1. Dynamical systems 2.1.1. Dynamical system ODE Consider a dynamical system g

Reference

This content is AI-processed based on open access ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut