Identifying the nonlinear string dynamics with port-Hamiltonian neural networks
Summary
This paper extends Port-Hamiltonian Neural Networks (PHNNs) to partial differential equations (PDEs) for learning nonlinear string dynamics from data. The approach recovers both the Hamiltonian and dissipation, outperforming non-physics-informed baselines in accuracy and interpretability.
View Cached Full Text
Cached at: 05/14/26, 06:18 AM
# Identifying the nonlinear string dynamics with port-Hamiltonian neural networks
Source: [https://arxiv.org/html/2605.12785](https://arxiv.org/html/2605.12785)
Maximino Linares1,2, Guillaume Doras1, Thomas Hélie1,3 1IRCAM, 1, place Igor\-Stravinsky, 75004, Paris, France 2Sorbonne Université, 4, place Jussieu, 75005, Paris, France 3CNRS, 3 rue Michel\-Ange, 75016, Paris, France
###### Abstract
Hybrid machine learning combines physical knowledge with data\-driven models to enhance interpretability and performance\. In this context, Port\-Hamiltonian Systems \(PHS\), which generalize Hamiltonian mechanics to describe open, non\-autonomous dynamical systems, have been successfully integrated with neural networks under the name Port\-Hamiltonian Neural Networks \(PHNNs\)\. While the ability of PHNNs to identify Hamiltonian ordinary differential equation \(ODE\) systems has already been demonstrated, their application to learning Hamiltonian partial differential equation \(PDE\) systems remains largely unexplored\. This limitation restricts their use in musical acoustics, where instruments are typically modeled as distributed parameter systems governed by PDEs\. In this work, we demonstrate how to learn the nonlinear string dynamics from data in a physically\-consistent framework through a PHNN extension to PDEs\. By constructing structured neural network architectures based on PHS, we can recover both the Hamiltonian governing the string and the dissipation affecting it\. This approach outperforms baseline, non\-physics\-informed methods in terms of both accuracy and interpretability\. Numerical experiments using synthetic data demonstrate the ability of the proposed PHNN model to identify and emulate the nonlinear dynamics of the system\.
## 1\.Introduction
Estimation, identification, and learning all describe similar notions, even though different disciplines use different terms\[[6](https://arxiv.org/html/2605.12785#bib.bib76)\]\. In machine learning, the goal is to learn models from data that can predict the output given an unseen input\[[26](https://arxiv.org/html/2605.12785#bib.bib82)\]\. In control theory, system identification experiments with a system and uses its responses to build a model that agrees with the observations\[[22](https://arxiv.org/html/2605.12785#bib.bib71)\]\. Both fields share the same objective: creating models that capture the underlying patterns in data\. Determine which model to use is complex and is normally driven by the specific goals of the application\. Linear models are especially useful for systems operating near an operating point, as the behavior of a nonlinear system can often be approximated locally by a linear model\[[16](https://arxiv.org/html/2605.12785#bib.bib77)\]\. When linear models fail, gray\-box models use known structure to fit the unknown parameters to data\[[19](https://arxiv.org/html/2605.12785#bib.bib79)\]\. They require domain knowledge and can be hard to build, but offer deeper understanding when successful\. On the other hand, black\-box models are flexible and can fit almost any data\[[18](https://arxiv.org/html/2605.12785#bib.bib81)\]\. However, they lack interpretability and usually risk overfitting issues\[[26](https://arxiv.org/html/2605.12785#bib.bib82)\]\.
In this paper, we consider a gray\-box identification framework, relying on a port\-Hamiltonian system \(PHS\) state\-space representation and neural networks, known as port\-Hamiltonian neural networks \(PHNN\) to identify the dynamics of a plucked nonlinear guitar string\. PHS\[[24](https://arxiv.org/html/2605.12785#bib.bib3),[33](https://arxiv.org/html/2605.12785#bib.bib2)\]generalizes Hamiltonian mechanics to multi\-physics open systems by explicitly modeling energy exchange with the environment through ports \(inputs/outputs\) and dissipation\. While the PHS approach can be applied to simulate a wide range of physical domains, including acoustics, fluid mechanics, quantum physics and others\[[15](https://arxiv.org/html/2605.12785#bib.bib83),[1](https://arxiv.org/html/2605.12785#bib.bib36),[5](https://arxiv.org/html/2605.12785#bib.bib35),[30](https://arxiv.org/html/2605.12785#bib.bib37)\], nonlinear PHS identification is still little explored \(see e\.g\. Cherifi et al\.\[[9](https://arxiv.org/html/2605.12785#bib.bib84)\]for an overview\), and only a few examples applied to audio exist in the literature\[[27](https://arxiv.org/html/2605.12785#bib.bib85)\]\. PHNN leverage the PHS formulation and approximate each component of the system with multilayer perceptrons \(MLPs\), guaranteeing physical consistency and structure at both training and inference stages\[[10](https://arxiv.org/html/2605.12785#bib.bib9),[8](https://arxiv.org/html/2605.12785#bib.bib18),[29](https://arxiv.org/html/2605.12785#bib.bib16),[25](https://arxiv.org/html/2605.12785#bib.bib86),[14](https://arxiv.org/html/2605.12785#bib.bib87)\]\. Although some works use PHNN to model the well\-known acoustic phenomena of self\-oscillation\[[21](https://arxiv.org/html/2605.12785#bib.bib88)\], the use of this framework to identify distributed audio systems, to the best of our knowledge, has not yet been described in the literature, where existing works are based on neural operators\[[31](https://arxiv.org/html/2605.12785#bib.bib89),[23](https://arxiv.org/html/2605.12785#bib.bib94)\], Koopman theory\[[11](https://arxiv.org/html/2605.12785#bib.bib90)\], differentiable digital signal processing\[[20](https://arxiv.org/html/2605.12785#bib.bib91)\]or modal synthesis methods\[[34](https://arxiv.org/html/2605.12785#bib.bib74),[35](https://arxiv.org/html/2605.12785#bib.bib92),[12](https://arxiv.org/html/2605.12785#bib.bib93)\]\.
This work follows the ideas from Eidnes et al\.\[[13](https://arxiv.org/html/2605.12785#bib.bib24)\], where they presented a general framework to learn Hamiltonian partial differential equations as finite\-difference discretizations and is closely related to Zhelenov et al\.\[[34](https://arxiv.org/html/2605.12785#bib.bib74),[35](https://arxiv.org/html/2605.12785#bib.bib92)\], where they learn the nonlinear string dynamics through a differentiable modal synthesis method\. Lastly, we consider a time discretization method which provides an efficient, explicit, passivity\-preserving solver by combining the scalar auxiliary variable \(SAV\) method\[[32](https://arxiv.org/html/2605.12785#bib.bib73)\], a non\-iterative solver\[[3](https://arxiv.org/html/2605.12785#bib.bib96)\], and a drift\-rejection control\[[28](https://arxiv.org/html/2605.12785#bib.bib72)\]\. This paper is organized as follows\. Section[2](https://arxiv.org/html/2605.12785#S2)introduces the nonlinear string model under a continuous and semi\-discrete port\-Hamiltonian formulation, Section[3](https://arxiv.org/html/2605.12785#S3)presents the PHNN model used to identify the nonlinear string, Section[4](https://arxiv.org/html/2605.12785#S4)describes the numerical experiments, Section[5](https://arxiv.org/html/2605.12785#S5)discusses the results, and Section[6](https://arxiv.org/html/2605.12785#S6)concludes the paper\.
## 2\.Nonlinear string model
Consider the dynamics of a string under geometrically nonlinear conditions\. The transverse displacementq\(x,t\)q\(x,t\)of a string subject to large deformations is governed by the following PDE
∂t2q=1μ\[\(T∂x2−EI∂x4\)q−2μ\(η0−η1∂x2\)∂tq\+EA−T2∂x\(∂xq\)3\+δ\(x−xe\)fe\],\\partial\_\{t\}^\{2\}q=\\frac\{1\}\{\\mu\}\[\(T\\partial\_\{x\}^\{2\}\-EI\\partial\_\{x\}^\{4\}\)q\-2\\mu\(\\eta\_\{0\}\-\\eta\_\{1\}\\partial\_\{x\}^\{2\}\)\\partial\_\{t\}q\+\\frac\{EA\-T\}\{2\}\\partial\_\{x\}\(\\partial\_\{x\}q\)^\{3\}\+\\delta\(x\-x\_\{e\}\)f\_\{e\}\],\(1\)whereq∈\[0,l0\]∈ℝq\\in\[0,l\_\{0\}\]\\in\\mathbb\{R\}, for some string lengthl0l\_\{0\}\[m\], andt∈ℝ\+t\\in\\mathbb\{R\}^\{\+\}\. The various constant parameters are the string tensionTT\[N\], Young’s modulusEE\[Pa\], radiusRR\[m\], cross sectionA=πR2A=\\pi R^\{2\}\[m2\\text\{m\}^\{2\}\], moment of inertiaI=πR4/4I=\\pi R^\{4\}/4\[m4\\text\{m\}^\{4\}\], densityρ\\rho\[kg⋅m−3\\text\{kg\}\\cdot\\text\{m\}^\{\-3\}\], linear mass densityμ=ρA\\mu=\\rho A\[kg⋅m−1\\text\{kg\}\\cdot\\text\{m\}^\{\-1\}\], and dissipation coefficientsη0\\eta\_\{0\}andη1\\eta\_\{1\}\. The control termf\(x,t\)=δ\(x−xe\)fe\(t\)f\(x,t\)=\\delta\(x\-x\_\{e\}\)f\_\{e\}\(t\)\[N\] is applied at positionx=xex=x\_\{e\}, whereδ\\deltadenotes a Diract delta function andfef\_\{e\}simulates a pluck of a string\[[2](https://arxiv.org/html/2605.12785#bib.bib75)\]:fe\(t\)=12famp\[1−cos\(πtTe\)\],t∈\[0,Te\];0,otherwisef\_\{e\}\(t\)=\\frac\{1\}\{2\}f\_\{amp\}\\left\[1\-\\cos\\left\(\\frac\{\\pi t\}\{T\_\{e\}\}\\right\)\\right\],~t\\in\[0,T\_\{e\}\];~0,~\\text\{otherwise\}, withfamp\[N\]f\_\{amp\}~\[N\]the excitation amplitude andTe\[sec\]T\_\{e\}~\[\\text\{sec\}\]the excitation duration\. Simply\-supported boundary conditionsq\(0,t\)=0q\(0,t\)=0and∂x2q\(0,t\)=0\\partial\_\{x\}^\{2\}q\(0,t\)=0are employed at the domain endpointsx=0x=0andx=l0x=l\_\{0\}\. Zero initial conditions are assumed \(so thatq\(x,0\)=∂tq\(x,0\)=0q\(x,0\)=\\partial\_\{t\}q\(x,0\)=0forx∈\[0,l0\]\)x\\in\[0,l\_\{0\}\]\)\. This simple model contains some key elements of musical string modeling \(large deformations, frequency dependent losses\)\. For a more complete overview concerning musical string models, see Bilbao et Ducceschi\[[4](https://arxiv.org/html/2605.12785#bib.bib95)\]\. Table[1](https://arxiv.org/html/2605.12785#S2.T1)shows the nonlinear string model written in the continuous and semi\-discrete port\-Hamiltonian PDE form\. The \(semi\-\)discrete formulation is obtained using structure preserving finite differences, with𝐪≡\[q1,⋯,qN−1\]\\mathbf\{q\}\\equiv\[q\_\{1\},\\cdots,q\_\{N\-1\}\]transverse displacement and𝐩≡\[p1,⋯,pN−1\]\\mathbf\{p\}\\equiv\[p\_\{1\},\\cdots,p\_\{N\-1\}\]momenta at theN−1N\-1nodes of a spatial grid, whereq\(xs\)=qsq\(x\_\{s\}\)=q\_\{s\},p\(xs\)=psp\(x\_\{s\}\)=p\_\{s\}, and a grid spacinghhsuch thatl0=Nhl\_\{0\}=Nh\.
Table 1:Nonlinear String Model: Continuous vs Semi\-Discrete Port\-Hamiltonian \(PH\) Formulation
## 3\.String\-PHNN model
We parameterize the discrete HamiltonianHHand the dissipation matrix𝐑0\\mathbf\{R\}\_\{0\}as
Hθ,θnl\(𝐪,𝐩\)=‖𝐩‖22ρπR2\+T2‖𝐃−𝐪‖2\+EπR48‖𝐃2𝐪‖2\+Hθnl\(𝐪\)\.H\_\{\\theta,\\theta\_\{nl\}\}\(\\mathbf\{q\},\\mathbf\{p\}\)=\\frac\{\\\|\\mathbf\{p\}\\\|^\{2\}\}\{2\\rho\\pi R^\{2\}\}\+\\frac\{T\}\{2\}\\\|\\mathbf\{D^\{\-\}q\}\\\|^\{2\}\+\\frac\{E\\pi R^\{4\}\}\{8\}\\\|\\mathbf\{D\}^\{2\}\\mathbf\{q\}\\\|^\{2\}\+H\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\)\.\(2\)and
𝐑0,θ=−2ρπR2hη1𝐃2\+2ρπR2hη0𝕀,\\mathbf\{R\}\_\{0,\\theta\}=\-\\frac\{2\\rho\\pi R^\{2\}\}\{h\}\\eta\_\{1\}\\mathbf\{D\}^\{2\}\+\\frac\{2\\rho\\pi R^\{2\}\}\{h\}\\eta\_\{0\}\\mathbb\{I\},\(3\)whereθ=\(ρ,R,T,E,η0,η1\)\\theta=\(\\rho,R,T,E,\\eta\_\{0\},\\eta\_\{1\}\)are positive learnable parameters andHθnl\(𝐪\):ℝN−1→ℝH\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\):\\mathbb\{R\}^\{N\-1\}\\rightarrow\\mathbb\{R\}is a neural network that approximates the non\-quadratic part of the Hamiltonian\. Note that learningHθnl\(𝐪\)H\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\)poses the problem of how to approximate spatial derivatives by neural networks\. In order to solve this, we follow the existing work in literature\[[7](https://arxiv.org/html/2605.12785#bib.bib97)\]where they highlight the connection between finite difference schemes and convolutional neural networks\. For example, the first order backward finite difference operator
\[𝐃−𝐪\]s=qs−qs−1h=\(𝐤∗𝐪\)s,\[\\mathbf\{D\}^\{\-\}\\mathbf\{q\}\]\_\{s\}=\\frac\{q\_\{s\}\-q\_\{s\-1\}\}\{h\}=\(\\mathbf\{k\}\*\\mathbf\{q\}\)\_\{s\},\(4\)where𝐤=1h\[1,−1\]\\mathbf\{k\}=\\frac\{1\}\{h\}\[1,\-1\]is a kernel of size 2\. In our case, it is natural to introduce this learning method to approximate the non\-quadratic part of our target HamiltonianHnl\(𝐪\)H\_\{nl\}\(\\mathbf\{q\}\)as it can be written as
Hnl\(q\)=EA−T8‖\(D−q\)∘2‖2=h∑s=1N−1EA−T8\(qs−qs−1h\)4\.H\_\{nl\}\(\\textbf\{q\}\)=\\frac\{EA\-T\}\{8\}\\\|\(\\textbf\{D\}^\{\-\}\\textbf\{q\}\)^\{\\circ 2\}\\\|^\{2\}=h\\sum\_\{s=1\}^\{N\-1\}\\frac\{EA\-T\}\{8\}\\left\(\\frac\{q\_\{s\}\-q\_\{s\-1\}\}\{h\}\\right\)^\{4\}\.\(5\)Thus, we structure the networkHθnl\(𝐪\)H\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\)such that, for a given fixedhh,
Hθnl\(𝐪\)=h∑s=1N−1\(fθMLP\(𝐤θk∗𝐪\)\)2,H\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\)=h\\sum\_\{s=1\}^\{N\-1\}\\left\(f\_\{\\theta\_\{\\text\{MLP\}\}\}\(\\mathbf\{k\}\_\{\\theta\_\{k\}\}\*\\mathbf\{q\}\)\\right\)^\{2\},\(6\)which takes inputs of dimensionN−1N\-1, the number of spatial discretizations points, and consists of one convolutional layer𝐤θk=\[kθk,1,kθk,2\]\\mathbf\{k\}\_\{\\theta\_\{k\}\}=\[k\_\{\\theta\_\{k,1\}\},k\_\{\\theta\_\{k,2\}\}\]with kernel size two followed by an MLPfθMLPf\_\{\\theta\_\{\\text\{MLP\}\}\}identically applied to each of the outputs of the first convolutional layer\. Finally, the last layer performs a summation of theN−1N\-1inputs to one scalar \(see Figure[1](https://arxiv.org/html/2605.12785#S3.F1)\)\. The structure ofHθnl\(𝐪\)H\_\{\\theta\_\{nl\}\}\(\\mathbf\{q\}\), inspired from the work done in Eidnes et al\.\[[13](https://arxiv.org/html/2605.12785#bib.bib24)\], is physically motivated by the structure of Hamiltonian PDEs: the spatial discretization of a Hamiltonian functional gives a Riemann sum over the spatial grid, the application of the homogeneity assumption allows the use of a shared convolutional operator combined with an MLP to model the local nonlinear energy density, and squaring the output guarantees non\-negative local energy contributions\. In the following, we refer to the combination ofHθ,θnlH\_\{\\theta,\\theta\_\{nl\}\}andθ\\thetaas StringPHNN\.
Figure 1:The networkHθnlH\_\{\\theta\_\{nl\}\}has one convolutional layer with kernel size two and a MLP with five hidden layers of 100 units and LeakyReLU activation\.
Table 2:Dataset generation parameters\.
## 4\.Numerical experiments
### A\.Problem statement
Given a discrete reference trajectory𝒯\\mathcal\{T\}, the objective is to design a PHNN model capable of accurately generating a trajectory𝒯~\\tilde\{\\mathcal\{T\}\}that approximates𝒯\\mathcal\{T\}as closely as possible\. The use of the modified SAV method requires to discretize the trajectories in time using staggered grids\[[17](https://arxiv.org/html/2605.12785#bib.bib19)\]so that𝒯=\{𝐪st−1/2,𝐩st,fet\+1/2,xe\}\\mathcal\{T\}=\\\{\\mathbf\{q\}\_\{s\}^\{t\-1/2\},\\mathbf\{p\}\_\{s\}^\{t\},f\_\{e\}^\{t\+1/2\},x\_\{e\}\\\}, fors∈\{1,⋯,N−1\}s\\in\\\{1,\\cdots,N\-1\\\}andt∈\{0,⋯,Ts/dt\}t\\in\\\{0,\\cdots,T\_\{s\}/dt\\\}\.
Figure 2:Representation of a staggered\-in\-time scheme, with variables defined at offset time instants\.
### B\.Implementation details
#### i\.Data generation
We consider a nonlinear string with the fixed configuration detailed in Table[2](https://arxiv.org/html/2605.12785#S3.T2), which guarantees numerical stability for our choice of sampling frequencyfs=88\.2kHzf\_\{s\}=88\.2\\text\{kHz\}\. A more detailed explanation on how to choose these parameters is given in Risse et al\.\[[28](https://arxiv.org/html/2605.12785#bib.bib72)\]\. The data generation procedure is similar to the one detailed in Zhelenov et al\.\[[34](https://arxiv.org/html/2605.12785#bib.bib74)\]The simulation parameters used for the generation of the training, validation and testing datasets are outlined in Table[2](https://arxiv.org/html/2605.12785#S3.T2), whereNtrajN\_\{traj\}is the number of trajectories andTsT\_\{s\}the duration of the simulation\. Each trajectory consists of both the displacementqsq\_\{s\}and momentumpsp\_\{s\}information for each nodess\. The physical parameters correspond to a natural frequencyf0≈55\.5Hzf\_\{0\}\\approx 55\.5\\text\{Hz\}\. This string is excited by randomly\-generated excitation functionsfe\(t\)f\_\{e\}\(t\)at randomised excitation positionsxex\_\{e\}using a uniform distribution for the specified parameter ranges\.
#### ii\.Training and test details
Thebaselinemodel consists of a MLP whose forward method directly approximates the discrete flow at the next time stept\+1t\+1\(see Figure[4](https://arxiv.org/html/2605.12785#S4.F4)\), whereas the StringPHNN model implements the discrete PHS formulation in Table[1](https://arxiv.org/html/2605.12785#S2.T1), with the networkHθnlH\_\{\\theta\_\{nl\}\}, learnable parametersθ=\(ρ,R,T,E,η0,η1\)\\theta=\(\\rho,R,T,E,\\eta\_\{0\},\\eta\_\{1\}\)and performs one time discretization step using the modified SAV method\[[28](https://arxiv.org/html/2605.12785#bib.bib72)\]\(see Figure[4](https://arxiv.org/html/2605.12785#S4.F4)\)\. In both cases, the model takes as an input𝐲t=\(𝐪t−1/2,𝐩t\),ft\+1/2,xe\\mathbf\{y\}^\{t\}=\(\\mathbf\{q\}^\{t\-1/2\},\\mathbf\{p\}^\{t\}\),~f^\{t\+1/2\},~x\_\{e\}and returns as an output𝐲~t\+1=\(𝐪~t\+1/2,𝐩~t\+1\)\\mathbf\{\\tilde\{y\}\}^\{t\+1\}=\(\\mathbf\{\\tilde\{q\}\}^\{t\+1/2\},\\mathbf\{\\tilde\{p\}\}^\{t\+1\}\)\. The training lossℒtrain\(𝐲t\+1,𝐲~t\+1\)\\mathcal\{L\}\_\{\\text\{train\}\}\(\\mathbf\{y\}^\{t\+1\},\\mathbf\{\\tilde\{y\}\}^\{t\+1\}\)is the mean absolute error \(MAE\) divided by the time stepdtdtand, in the case of the StringPHNN, backpropagation is performed through the internal operations of the numerical method\. We train all models using the Adam optimizer for10610^\{6\}optimization steps and repeat each experiment with 5 independent model initializations\. All the experiments are carried out in the PyTorch frameworkaaaThe code is publicly available in the GitHub repository:https://github\.com/mlinaresv/LearningTheString\. During testing, the models recursively generate the full trajectory from the 60 initial conditions provided in the dataset\. The performance is evaluated using the relative mean squared error \(MSE\)ℒtest\(𝐲t\+1,𝐲~t\+1\)\\mathcal\{L\}\_\{test\}\(\\mathbf\{y\}^\{t\+1\},\\mathbf\{\\tilde\{y\}\}^\{t\+1\}\)computed over the entire trajectory\.
Figure 3:Computation graph of the baseline
Figure 4:Computation graph of the StringPHNN
## 5\.Results and discussion
Figure[6](https://arxiv.org/html/2605.12785#S5.F6)compares the test RMSE obtained by the baseline model and the proposed StringPHNN\. The baseline exhibits errors on the order of10010^\{0\}, whereas the StringPHNN achieves errors around10−410^\{\-4\}, outperforming the baseline by several orders of magnitude\. Figure[6](https://arxiv.org/html/2605.12785#S5.F6)reports relative absolute error associated with the physical parameters identified by the StringPHNN\. The results show that several parameters, such as the linear densityμ\\mu, the tensionTT, or the damping coefficientsη0,η1\\eta\_\{0\},\\eta\_\{1\}are recovered with very high accuracy\. However, the mode struggles to identify parameters such asρ,R\\rho,RorEE\. These differences suggest that the way these physical quantities appeared in \([2](https://arxiv.org/html/2605.12785#S3.E2)\) affects their identifiability from the observed dynamics\. For example,μ=ρπR2\\mu=\\rho\\pi R^\{2\}is very well estimated even thoughρ\\rhoandRRare not\. A study on the non\-dimensionalization rescaling could be carried out to mitigate this lack of uniqueness in terms of dynamical representation\.
Figure 5:Relative mean squared error \(RMSE\) of the baseline and StringPHNN model over the test dataset\.
Figure 6:Relative absolute error of the parameters learned by the StringPHNN\. Legend:\{rho:ρ,Ra:R,rhol:πR2,E:E,T:T,I:πR4/4,EnlGC=\(EA−T\)/8\},eta0:η0,eta1:η1\}\\\{\\text\{rho\}:\\rho,~\\text\{Ra\}:R,~\\text\{rhol\}:\\pi R^\{2\},~\\text\{E\}:E,~\\text\{T\}:T,~\\text\{I\}:\\pi R^\{4\}/4,~\\text\{EnlGC\}=\(EA\-T\)/8\\\},~\\text\{eta0\}:\\eta\_\{0\},~\\text\{eta1\}:\\eta\_\{1\}\\\}
The ability of the model to capture the spatio\-temporal propagation patterns is shown in Figure[7](https://arxiv.org/html/2605.12785#S5.F7), where a reference displacement trajectory from the test dataset is compared with the prediction obtained using the PHNNString model\. The predicted trajectory captures the wave dynamics and amplitude evolution along the string, with an error distribution remaining under10−610^\{\-6\}\. This is also reflected in terms of the spectral content as shown in Figure[8](https://arxiv.org/html/2605.12785#S5.F8), which presents a comparison between the reference and predicted spectrograms for a momentum test trajectory evaluated at the positionx0x\_\{0\},
Figure 7:A reference displacement test trajectory compared with the PHNNString prediction \(the initialization with the lowest test error is considered\)\.\(a\)Reference spectrogram
\(b\)Predicted spectrogram
\(c\)Error spectrogram
Figure 8:Spectrogram of a momentum test trajectory at the positionx0x\_\{0\}\(the initialization with the lowest test error is considered\)\.
## 6\.Conclusion
In this work, we introduced a neural network identification framework based on a energy\-conserving numerical method for a port\-Hamiltonian finite\-difference discretization of a nonlinear string and compared it with a non\-physics\-informed baseline\. Through our experiments, we showed that our StringPHNN outperformed the non\-physics\-informed baseline from the perspectives of accuracy and interpretability, as we do not only recover the reference dynamics but also its different components\. Future research directions involve the identification of the nonlinear string dynamics from partial observations or measurements as well as from real audio recordings\.
## Acknowledgments
This project is co\-funded by the European Union’s Horizon Europe research and innovation program Cofund SOUND\.AI under the Marie Sklodowska\-Curie Grant Agreement No 101081674, and provided with computing HPC and storage resources by GENCI at IDRIS thanks to the grant 2026\-105408 on the supercomputer Jean Zay’s V100 partition\. The authors are grateful to Sølve Eidnes and Benjamin Tapley for early insightful discussions on the model architecture, to Victor Zheleznov and Stefan Bilbao for their guidance and experience on string synthesis; and to Thomas Risse, for his very helpful SAV implementation code\.
## References
- \[1\]\(2017\)Modeling and control of a rotating flexible spacecraft: a port\-hamiltonian approach\.IEEE Transactions on Control Systems Technology27\(1\),pp\. 355–362\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[2\]S\. Bilbao, M\. Ducceschi, and C\. Webb\(2019\)Large\-scale real\-time modular physical modeling sound synthesis\.InProceedings of the 22nd International Conference on Digital Audio Effects,pp\. 22\.Cited by:[§2](https://arxiv.org/html/2605.12785#S2.p1.37)\.
- \[3\]S\. Bilbao, M\. Ducceschi, and F\. Zama\(2023\)Explicit exactly energy\-conserving methods for hamiltonian systems\.Journal of Computational Physics472,pp\. 111697\.External Links:ISSN 0021\-9991,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.jcp.2022.111697)Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p3.1)\.
- \[4\]S\. Bilbao and M\. Ducceschi\(2023\)Models of musical string vibration\.Acoustical Science and Technology44\(3\),pp\. 194–209\.Cited by:[§2](https://arxiv.org/html/2605.12785#S2.p1.37)\.
- \[5\]F\. L\. Cardoso\-Ribeiro, G\. Haine, Y\. Le Gorrec, D\. Matignon, and H\. Ramirez\(2024\)Port\-hamiltonian formulations for the modeling, simulation and control of fluids\.Computers & Fluids,pp\. 106407\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[6\]F\. B\. Carlson\(2019\)Machine learning and system identification for estimation in physical systems\.arXiv preprint arXiv:1906\.02003\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[7\]E\. Celledoni, J\. Jackaman, D\. Murari, and B\. Owren\(2025\)Predictions based on pixel data: insights from pdes and finite differences\.Journal of Computational Physics538,pp\. 114166\.Cited by:[§3](https://arxiv.org/html/2605.12785#S3.p1.5)\.
- \[8\]K\. Cherifi, A\. E\. Messaoudi, H\. Gernandt, and M\. Roschkowski\(2025\)Nonlinear port\-hamiltonian system identification from input\-state\-output data\.External Links:2501\.06118Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[9\]K\. Cherifi\(2020\)An overview on recent machine learning techniques for port hamiltonian systems\.Physica D: Nonlinear Phenomena411,pp\. 132620\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[10\]S\. Desai, M\. Mattheakis, D\. Sondak, P\. Protopapas, and S\. J\. Roberts\(2021\)Port\-hamiltonian neural networks for learning explicit time\-dependent dynamical systems\.CoRR\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[11\]R\. Diaz, C\. D\. L\. V\. Martin, and M\. Sandler\(2024\)Towards efficient modelling of string dynamics: a comparison of state space and koopman based deep learning methods\.arXiv preprint arXiv:2408\.16650\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[12\]R\. Diaz and M\. Sandler\(2025\)Fast differentiable modal simulation of non\-linear strings, membranes, and plates\.arXiv preprint arXiv:2505\.05940\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[13\]S\. Eidnes and K\. O\. Lye\(2024\)Pseudo\-hamiltonian neural networks for learning partial differential equations\.Journal of Computational Physics500,pp\. 112738\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p3.1),[§3](https://arxiv.org/html/2605.12785#S3.p1.16)\.
- \[14\]A\. El Messaoudi, K\. Cherifi, Y\. Le Gorrec, and Y\. Wu\(2026\)PH\-KAN: Port\-Hamiltonian Kolmogorov\-Arnold Network\.Note:working paper or preprintCited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[15\]A\. Falaize and T\. Hélie\(2016\)Passive guaranteed simulation of analog audio circuits: a port\-hamiltonian approach\.Applied Sciences6\(10\),pp\. 273\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[16\]T\. Glad and L\. Ljung\(2018\)Control theory\.CRC press\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[17\]E\. Hairer, C\. Lubich, and G\. Wanner\(2006\)Geometric numerical integration\.Second edition,Springer Series in Computational Mathematics, Vol\.31,Springer\-Verlag, Berlin\.Cited by:[§4\.A](https://arxiv.org/html/2605.12785#S4.SS1.p1.6)\.
- \[18\]K\. Hornik, M\. Stinchcombe, and H\. White\(1989\)Multilayer feedforward networks are universal approximators\.Neural networks2\(5\),pp\. 359–366\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[19\]R\. Johansson\(1993\)System modeling and identification\.Prentice\-hall\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[20\]J\. W\. Lee, J\. Park, M\. J\. Choi, and K\. Lee\(2024\)Differentiable modal synthesis for physical modeling of planar string sound and motion simulation\.Advances in Neural Information Processing Systems37,pp\. 1058–1081\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[21\]M\. Linares, G\. Doras, and T\. Hélie\(2026\)Controlled oscillation modeling using port\-hamiltonian neural networks\.arXiv preprint arXiv:2602\.15704\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[22\]L\. Ljung\(1999\)System identification: theory for the user\.Prentice Hall information and system sciences series,Prentice Hall PTR\.External Links:ISBN 9780136566953,LCCN 98018554Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[23\]X\. Luan and G\. Scavone\(2025\)Physics\-informed deep learning for nonlinear friction model of bow\-string interaction\.arXiv preprint arXiv:2505\.18950\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[24\]B\.M\. Maschke, A\.J\. Van Der Schaft, and P\.C\. Breedveld\(1992\)An intrinsic hamiltonian formulation of network dynamics: non\-standard poisson structures and gyrators\.Journal of the Franklin Institute329\(5\),pp\. 923–966\.External Links:ISSN 0016\-0032,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/S0016-0032%2892%2990049-M)Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[25\]S\. Moradi, G\. I\. Beintema, N\. O\. Jaensson, R\. Tóth, and M\. Schoukens\(2026\)Port\-hamiltonian neural networks with output error noise models\.Automatica187,pp\. 112892\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[26\]K\. P\. Murphy\(2012\)Machine learning: a probabilistic perspective\.MIT press\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p1.1)\.
- \[27\]J\. Najnudel, R\. Müller, T\. Hélie, and D\. Roze\(2021\)Identification of nonlinear circuits as port\-hamiltonian systems\.In2021 24th International Conference on Digital Audio Effects \(DAFx\),pp\. 1–8\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[28\]T\. Risse, T\. Hélie, and S\. Bilbao\(2025\-09\)Power\-balanced drift regulation for scalar auxiliary variable methods: application to real\-time simulation of nonlinear string vibrations\.InDAFx25,Ancona, Italy\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p3.1),[§4\.B\.i](https://arxiv.org/html/2605.12785#S4.SS2.SSS1.p1.9),[§4\.B\.ii](https://arxiv.org/html/2605.12785#S4.SS2.SSS2.p1.9)\.
- \[29\]F\. J\. Roth, D\. K\. Klein, M\. Kannapinn, J\. Peters, and O\. Weeger\(2025\)Stable port\-hamiltonian neural networks\.External Links:2502\.02480Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[30\]D\. Roze, T\. Hélie, and E\. Rouhaud\(2024\)Time\-space formulation of a conservative string subject to finite transformations\.IFAC\-PapersOnLine58\(6\),pp\. 232–237\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[31\]S\. Schlecht, J\. Parker, M\. Schäfer, and R\. Rabenstein\(2022\)Physical modeling using recurrent neural networks with fast convolutional layers\.InInternational Conference on Digital Audio Effects,pp\. 138–145\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[32\]J\. Shen, J\. Xu, and J\. Yang\(2018\)The scalar auxiliary variable \(sav\) approach for gradient flows\.Journal of Computational Physics353,pp\. 407–416\.External Links:ISSN 0021\-9991,[Document](https://dx.doi.org/https%3A//doi.org/10.1016/j.jcp.2017.10.021)Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p3.1)\.
- \[33\]A\. Van Der Schaft, D\. Jeltsema,et al\.\(2014\)Port\-hamiltonian systems theory: an introductory overview\.Foundations and Trends® in Systems and Control1\(2\-3\),pp\. 173–378\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1)\.
- \[34\]V\. Zheleznov, S\. Bilbao, A\. Wright, and S\. King\(2025\-09\)Learning nonlinear dynamics in physical modelling synthesis using neural ordinary differential equations\.InDAFx25,Ancona, Italy\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1),[§1](https://arxiv.org/html/2605.12785#S1.p3.1),[§4\.B\.i](https://arxiv.org/html/2605.12785#S4.SS2.SSS1.p1.9)\.
- \[35\]V\. Zheleznov, S\. Bilbao, A\. Wright, and S\. King\(2026\)Stable differentiable modal synthesis for learning nonlinear dynamics\.arXiv preprint arXiv:2601\.10453\.Cited by:[§1](https://arxiv.org/html/2605.12785#S1.p2.1),[§1](https://arxiv.org/html/2605.12785#S1.p3.1)\.Similar Articles
Physics-Modeled Neural Networks
This paper introduces Dynamical Physics-Modeled Neural Networks (DynPMNNs), a continuous-time deep learning architecture where hidden layers are defined by ordinary differential equations. It presents a biologically inspired approach grounded in Reproducing Kernel Banach Spaces, demonstrating competitive performance on the California Housing dataset with fewer parameters than standard Neural ODEs.
Equilibrium Propagation and Hamiltonian Inference in the Diffusive Fitzhugh-Nagumo Model
This paper extends Equilibrium Propagation to skew-gradient systems and demonstrates an equivalence between deep Energy-Based Models and Hamiltonian neural networks, focusing on diffusively coupled Fitzhugh-Nagumo neurons. It derives a layer-wise Hamiltonian recurrence relation for inference in such networks.
Sequential Physics-Constrained Neural Operator Forward Modeling for the $\textit{Norne}$ Reservoir System
This paper presents a comprehensive mathematical framework for sequential surrogate modeling of three-phase black-oil reservoir dynamics using Fourier Neural Operators (FNO) and physics-informed variants (PINO), applied to the Norne benchmark reservoir. Theoretical contributions include functional-analytic formulation, covariate shift analysis, physics-constrained spectral stability, and truncated backpropagation gradient analysis.
The Hamilton-Jacobi Theory of Deep Learning
This paper identifies neural network training as a search through Hamilton-Jacobi initial-value problems, showing that residual networks, transformers, and RNNs discretize the same class of viscous Hamilton-Jacobi equations. It derives quantitative consequences including minimax optimal generalization rates, adversarial robustness bounds, and a closed-form influence function.
Physics-Informed Neural Networks with Learnable Loss Balancing and Transfer Learning
This paper proposes a self-supervised physics-informed neural network (PINN) framework with a learnable blending neuron to adaptively balance physics-based and data-driven losses, and integrates transfer learning to improve efficiency under data scarcity. It is validated on liquid-metal miniature heat sink CFD data with only 87 datapoints, achieving under 8% error.