Comparing model representations and fitting methods for port-Hamiltonian system identification
Authors: Sølve Eidnes, Håkon Noren Myhr
Organizations: Department of Mathematics and Cybernetics, SINTEF Digital, Oslo, Norway · Department of Mathematical Sciences, Norwegian University of Science and Technology, Trondheim, Norway
Port-Hamiltonian models describe physical systems by separating stored energy, dissipation and external inputs. Learning such models from data requires a choice of representation and fitting method. We compare using neural networks, analytic expressions and combinations of the two for representing the different components of the port-Hamiltonian system, and compare fitting the models with gradient-based optimisation or sparse regression. Testing on simulations of mechanical and electrical systems, with and without added noise, we present prediction accuracy and computational cost of the different approaches.
Figures & tables
Figure 1: Overview of the model representations and fitting objectives compared in the paper. Here xn is an observed state at time tn , x˙n its estimated derivative, and h=tn+1−tn the sampling interval. For the model field fθ=(J−Rθ)∇Hθ+Gθu , a numerical integration scheme approximates the state change over one step by hΨh,fθ . Regression uses f~θ(x,v) : the analytic model fθ , with ∇pHθ in the damping term replaced by the corresponding components of the observed rate v . For regression, N is the number of samples, d the number of state variables, and α≥0 controls the strength of the ridge penalty.
NRMSE
Mean fitting
Noise-free
1% noise
5% noise
time (min)
Representation
Fitting method
Raw
Raw
Smoothed
Raw
Smoothed
Two-mass system with constant damping and unknown input map
Analytic
Gradient-based/scheme
4.02e-2
4.61e-2
4.26e-2
5.76e-2
4.86e-2
153
Analytic
Gradient-based/roll-out
4.36e-2
4.44e-2
4.49e-2
7.31e-2
5.33e-2
463
Analytic
Regression/derivative
4.13e-2
4.34e-2
3.97e-2
2.63e-1
6.11e-2
3.01
Table 1: Prediction error on t∈[0,20] and mean fitting time for the different methods.
Figure 2: Ground truth and model predictions for the first test trajectory (top) and input gain (bottom), for the first dataset on the two-mass system with constant damping. The predictions are from the models fitted to smoothed data with 5% noise.
Prediction error
Fitting method
Noise-free
1% noise
5% noise
Two-mass system with state-dependent damping
Analytic model w/ true damping widths and centres
Gradient-based/scheme
1.04e-6
4.66e-3
2.70e-2
Gradient-based/roll-out
2.56e-7
4.54e-3
2.56e-2
Regression/derivative
8.56e-3
5.73e-3
8.00e-2
Table 2: Prediction error with alternative candidate-function libraries.
Figure 3: Ground truth and model predictions for the first test trajectory and input gain of the first dataset of the circuit example. All models were fitted to smoothed data with 5% noise using the integration-scheme loss.
This paper investigates the problem of data-driven modeling of port-Hamiltonian systems while preserving their intrinsic Hamiltonian structure and stability properties. We propose a novel neural-network-based port-Hamiltonian modeling technique that relaxes the convexity constraint commonly imposed by neural network-based Hamiltonian approximations, thereby improving the expressiveness and generalization capability of the model. By removing this restriction, the proposed approach enables the use of more general non-convex Hamiltonian representations to enhance modeling flexibility and accuracy. Furthermore, the proposed method incorporates information about stable equilibria into the learning process, allowing the learned model to preserve the stability of multiple isolated equilibria rather than being restricted to a single equilibrium as in conventional methods. Two numerical experiments are conducted to validate the effectiveness of the proposed approach and demonstrate its ability to achieve more accurate structure- and stability-preserving learning of port-Hamiltonian systems compared with a baseline method.
Binh Nguyen, Nam T. Nguyen, Truong X. Nghiem
Department of Electrical and Computer Engineering, College of Engineering and Computer Science, University of Central Florida, Orlando, FL 32816, USA
Data-driven machine learning approaches have become increasingly attractive for nonlinear system identification, but standard models often fail to preserve the underlying physical structure and remain difficult to interpret, especially when no analytical model is available. In this context, port-Hamiltonian (pH) models provide a natural physics-informed representation. However, when these models are parameterized with standard multilayer perceptrons (MLPs), the learned constitutive components often remain poorly interpretable. In this paper, we propose a structure-preserving identification framework for nonlinear port-Hamiltonian systems based on Kolmogorov-Arnold Networks (KANs). The proposed PH-KAN model parameterizes the interconnection matrix, dissipation matrix, Hamiltonian, and input mapping using dedicated KAN blocks, while enforcing the port-Hamiltonian constraints by construction. This yields constitutive representations in which the nonlinear functions defining the identified pH components can be explicitly inspected, leading to a more interpretable model than with standard MLP-based parameterizations.
Achraf El Messaoudi, Karim Cherifi, Yann Le Gorrec +1
UMLP, ENSMM, FEMTO-ST · Université Marie et Louis Pasteur, SUPMICROTECH, CNRS, institut FEMTO-ST, F-25000 Besançon, France
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.
Maximino Linares, Guillaume Doras, Thomas Hélie
IRCAM, 1, place Igor-Stravinsky, 75004, Paris, France