Papers
Topics
Authors
Recent
Search
2000 character limit reached

Port-Hamiltonian Neural Networks

Updated 30 January 2026
  • Port-Hamiltonian Neural Networks are physics-informed models that embed energy functions, skew-symmetric interconnections, and dissipative structures to preserve passivity and stability.
  • They use constrained neural architectures (e.g., anti-symmetrized outputs and Cholesky factorizations) to guarantee physical properties like energy balance and positive semi-definiteness.
  • Empirical studies show pHNNs achieve superior long-term predictive accuracy and data efficiency over black-box models in nonlinear, high-dimensional dynamical systems.

Port-Hamiltonian Neural Networks (pHNNs) are a class of machine learning models that embed the geometric and energetic structure of port-Hamiltonian systems (PHS) into neural architectures. By construction, these networks preserve physical system properties such as passivity, stability, and energy balance—essential for reliable modeling, identification, and control of nonlinear, possibly high-dimensional, dynamical systems with inputs, dissipation, and interconnection. Leveraging the universal approximation capacity of neural networks within a structure-preserving framework, pHNNs achieve superior long-term predictive accuracy and physical consistency compared to black-box neural models, and they enable principled extensions to distributed, stochastic, and constrained (DAE) settings (Cherifi et al., 10 Jan 2025, Persio et al., 8 Sep 2025, Roth et al., 4 Feb 2025).

1. Mathematical Structure of Port-Hamiltonian Neural Networks

Port-Hamiltonian systems provide a general framework for modeling open, energy-based dynamical systems by specifying state-dependent Hamiltonian (energy function), skew-symmetric interconnection, and dissipative terms, together with port (input-output) maps:

x˙=[J(x)R(x)]xH(x)+B(x)u,y=B(x)xH(x),\dot x = [J(x) - R(x)] \nabla_x H(x) + B(x) u, \qquad y = B(x)^\top \nabla_x H(x),

where

  • xRnx\in\mathbb{R}^n: state,
  • uRmu\in\mathbb{R}^m: input,
  • yRmy\in\mathbb{R}^m: port output,
  • H(x)H(x): Hamiltonian, continuously differentiable, bounded below,
  • J(x)=J(x)J(x) = -J(x)^\top: skew-symmetric interconnection matrix,
  • R(x)=R(x)0R(x) = R(x)^\top \succeq 0: positive semi-definite dissipation matrix,
  • B(x)B(x): input map.

A port-Hamiltonian neural network parameterizes the unknown functions—Hamiltonian, JJ, RR, and BB—using neural networks with structural constraints reflecting the physics. The neural architectures must guarantee, by construction, the necessary skew-symmetry and positive semi-definiteness properties (Cherifi et al., 10 Jan 2025, Roth et al., 4 Feb 2025, Persio et al., 8 Sep 2025).

The parameterization is typically:

  • Jθ(x)=vtfn,n(θJ(x))vtfn,n(θJ(x))J_\theta(x) = \mathrm{vtf}_{n,n}(\theta_J(x))^\top - \mathrm{vtf}_{n,n}(\theta_J(x)), with θJ\theta_J a neural network,
  • Rθ(x)=1nvtfn,n(θR(x))vtfn,n(θR(x))R_\theta(x) = \frac{1}{\sqrt n}\mathrm{vtf}_{n,n}(\theta_R(x)) \mathrm{vtf}_{n,n}(\theta_R(x))^\top,
  • Bθ(x)=vtfn,m(θB(x))B_\theta(x) = \mathrm{vtf}_{n,m}(\theta_B(x)),
  • Hθ(x)=θH(x)H_\theta(x) = \theta_H(x) (Cherifi et al., 10 Jan 2025).

2. Structure-Preserving Neural Parameterizations

pHNNs enforce exact physical constraints in their architecture:

  • Skew-symmetry: J(x)J(x) via difference of neural network outputs so J(x)=J(x)J(x) = -J(x)^\top.
  • Positive semi-definiteness: R(x)R(x) via Cholesky-like or matrix-square parameterizations so R(x)=A(x)A(x)0R(x) = A(x)A(x)^\top\succeq 0 (Roth et al., 4 Feb 2025).
  • Port maps and Hamiltonians: parameterized as MLPs, KANs, or using basis/ansatz expansions where prior knowledge is available.
  • Hamiltonians: can be enforced convex (e.g., using input-convex neural networks) or quadratic if dictated by prior physics (Roth et al., 4 Feb 2025, Cherifi et al., 10 Jan 2025).

Variants utilize Kolmogorov–Arnold Networks (KANs) that represent multivariate functions as sums of univariate neural networks. While KANs offer a compact parameterization, they exhibit slower training and, experimentally, MLP architectures outperform them in accuracy and efficiency for structured pHNNs (Cherifi et al., 10 Jan 2025).

The table below summarizes typical architectural patterns:

Term Parameterization Constraint guaranteed
J(x)J(x) anti-symmetrized NN output Skew-symmetry
R(x)R(x) A(x)A(x)A(x)A(x)^\top (Cholesky/MLP) Positive semi-definiteness
B(x)B(x) MLP output reshaped to matrix None (can be unconstrained)
H(x)H(x) MLP or convex NN Lower bound or convexity

Incorporating priors through ansatz functions enables hybrid models with known linear/quadratic or constant blocks, increasing data efficiency and interpretability (Cherifi et al., 10 Jan 2025).

3. Training Methodologies and Loss Functions

The pHNN framework is generally trained by minimizing a loss that measures prediction error on state-derivatives and/or outputs over sampled trajectories:

L=1B(k,j)B[i(x˙k,i(tj)x˙^k,i(tj))2σx˙i2+γ(yk,(tj)y^k,(tj))2σy2]\mathcal L = \frac{1}{|\mathcal B|} \sum_{(k, j) \in \mathcal B} \left[ \sum_i \frac{(\dot x_{k,i}(t_j) - \widehat{\dot x}_{k,i}(t_j))^2}{\sigma_{\dot x_i}^2} + \gamma \sum_\ell \frac{(y_{k,\ell}(t_j) - \widehat{y}_{k,\ell}(t_j))^2}{\sigma_{y_\ell}^2} \right]

with all gradients (including xH\nabla_x H) computed via autograd frameworks (Cherifi et al., 10 Jan 2025). No additional penalty terms are needed to preserve structure—this is achieved by architecture.

Mini-batch stochastic gradient descent with AdamW or Adam, learning rate schedules, and automatic differentiation are standard. Batch sizes of 128–256 are typical, with learning-rate annealing schemes commonly used.

Long-term rollouts and trajectory-extrapolation are assessed for stability and physical consistency.

Output-error loss structures (e.g., SUBNET) provide robustness against measurement noise, using sub-sequences to efficiently approximate the simulation loss and jointly train state encoders (Moradi et al., 20 Feb 2025). Consistency analyses confirm that, under standard assumptions and for sufficiently expressive neural classes, the minimizer converges to the true system in probability as data volume increases.

4. Physical Structure, Stability, and Theoretical Guarantees

By construction, pHNNs embed the dissipation inequality for any parameter setting:

ddtH(x)=(H(x))R(x)H(x)+yuyu\frac{d}{dt}H(x) = -(\nabla H(x))^\top R(x) \nabla H(x) + y^\top u \leq y^\top u

where equality holds only in the absence of dissipation. This ensures passivity—the system cannot create energy beyond that supplied through ports—guaranteeing physically plausible behavior during (and after) learning (Cherifi et al., 10 Jan 2025, Persio et al., 8 Sep 2025, Roth et al., 4 Feb 2025).

Key mathematical properties include:

  • Lyapunov stability: the Hamiltonian acts as a Lyapunov function. If R(x)R(x) is strictly positive definite except at equilibrium, global asymptotic stability follows (Roth et al., 4 Feb 2025).
  • Passivity and energy dissipation: enforced strictly via network architecture; the model cannot violate conservation or produce artifacts present in unconstrained black-box models.
  • Distributed stability: compositional architectures (block-diagonal J,R,BJ, R, B) preserve system passivity and facilitate scalable modeling of networked multi-physics systems. Passivity and finite L2\mathcal{L}_2-gain can be ensured at the subsystem and network levels (Furieri et al., 2021, Zakwan et al., 2024).

In the stochastic regime, enforcing the so-called coisotropy condition (H(x)Σ(x)=0\nabla H(x)^\top \Sigma(x) = 0) for learned diffusion blocks ensures that injected noise is energy-conserving in expectation, and the system remains passive on average (Persio et al., 8 Sep 2025).

5. Applications, Empirical Results, and Advantages

pHNNs have demonstrated substantial empirical advantages:

  • Superior long-term prediction and drift-resistance: In mass-spring, levitated ball, and permanent-magnet synchronous motor systems, physics-informed pHNNs yield normalized MAE an order of magnitude below that of black-box MLPs for moderate or large datasets. Long-term rollouts remain stable; black-box models rapidly diverge (Cherifi et al., 10 Jan 2025).
  • Parameter recovery and interpretability: Scatter plots of true vs. learned parameters (e.g., H\nabla H, RR) show near-linear correlation, especially when prior structure is enforced.
  • Data efficiency: Partial priors (constant J,BJ, B, quadratic HH) allow pHNNs to reach black-box accuracy with an order of magnitude fewer trajectories.
  • Robustness to noise: Accurate long-term extrapolation persists under significant measurement noise, with error proportional to noise amplitude (Moradi et al., 20 Feb 2025).
  • Extension to DAEs and constrained systems: Each component (including algebraic constraints) can be parameterized by neural networks, with training leveraging index reduction and differentiable solvers (Neary et al., 2024, Hagelaars et al., 23 Jan 2026).
  • Scalability and compositionality: Modular training of submodels—each a pHNN—enables re-use via block-diagonal composition to build large networks with preservation of physical properties (Neary et al., 2022, Rettberg et al., 2024, Otterdijk et al., 2024).
  • Numerical studies confirm robustness across a range of systems: nonlinear oscillators, power networks, robotic arms, stochastic systems with environmental noise, and high-dimensional disc-brake thermoelastic models (Persio et al., 8 Sep 2025, Rettberg et al., 2024).

6. Extensions: Distributed, Stochastic, and Initialization Strategies

Distributed pHNNs

  • Distributed control policies for networked systems can be built by endowing each agent with a local pHNN controller, interconnected via a sparse communication graph. Passivity and stability extend to the entire network irrespective of individual controller parameterizations (Zakwan et al., 2024, Zakwan et al., 2024).

Stochastic pHNNs

  • Stochastic extensions add state-dependent diffusion through Σ(x)dWt\Sigma(x) dW_t while preserving the Dirac structure and passivity “in expectation”. Coisotropy constraints enforce that noise is tangent to the Hamiltonian level sets, preventing unphysical energy injection. Energy dissipation properties, Lyapunov stability, and expectation inequalities (via generators) support model robustness under stochasticity (Persio et al., 8 Sep 2025, Persio et al., 2024).

Initialization and Training Stability

  • Improved training reliability is achieved by initializing neural pH components with a linear port-Hamiltonian model estimated from data (using subspace or KYP methods). Neural network blocks are initialized to zero so the pHNN exactly reproduces the linear model at onset, then learns nonlinear corrections. This strategy reduces variance, accelerates convergence, and avoids poor local minima (Otterdijk et al., 27 Jan 2026).

7. Limitations and Open Problems

Despite their strong empirical and theoretical advantages, pHNNs have several limitations:

  • Training overhead: Enforcing structure, especially in high-dimensional systems or stochastic settings with coisotropy projection, increases computational burden.
  • Model flexibility: Restricting noise to be energy-conserving (coisotropy) may exclude some physical stochastic effects.
  • Identifiability and scalability: Learning in large-scale networks with many subsystems or partial observability remains challenging.
  • High-index DAE extension: Most neural DAE approaches assume index-1; higher-index constraints (e.g., in electrical grids) require further advances in index reduction and solver design (Neary et al., 2024).
  • Data requirements: pHNNs outpace black-box models with moderate data but do not outperform in the extreme small-data regime unless strong priors are available (Cherifi et al., 10 Jan 2025).

Further research is focused on Bayesian uncertainty quantification, extension to field-theoretic (PDE) port-Hamiltonian systems, incorporation of graph/topology learning, and combining pHNNs with reinforcement learning for autonomous control under uncertainty (Neary et al., 2024, Persio et al., 8 Sep 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Port-Hamiltonian Neural Networks (pHNNs).