The port-Hamiltonian framework is a structure-preserving modeling approach that preserves key physical properties such as energy conservation and dissipation. When subsystems are modeled as port-Hamiltonian systems (pHS) with linearly related inputs and outputs, their interconnection remains port-Hamiltonian. This paper introduces a systematic method for transforming coupled port Hamiltonian ordinary differential equations systems (pHODE) into a single monolithic formulation, and for decomposing a monolithic system into weakly coupled subsystems. The monolithic representation ensures stability and structural integrity, whereas the decoupled form enables efficient distributed simulation via operator splitting or dynamic iteration.
Introduction
In today’s rapidly evolving technological landscape, the ability to model and analyze complex systems is more crucial than ever. Port-Hamiltonian Systems (pHS) integrate Hamiltonian mechanics with network theory to provide unparalleled insight into multi-component systems. First, pHS exhibit a Hamiltonian structure, i.e., pHS provide an energy-based modeling approach, essential for understanding the dynamics of modern systems (see related papers [4], [5], [10], [11] and book [9]). Next, they allow for dissipation in the system. This accurately models energy losses, ensuring realistic simulations and designs. They have ports that allow for input/output connections to the outside world, i.e. this approach facilitates energy exchange with the external environment. Finally, pHS have an interconnection property: multiple subsystems can be coupled to a monolithic joint pH system, preserving the overall energy structure and increasing reliability of the system.
In this work, we investigate a) how coupled port-Hamiltonian ordinary differential equation (pHODE) systems can be formulated as a single joint pHODE and b) vice-versa, how a single joint pHODE system can be decoupled into subsystems of pHODE, and generalize some ideas mentioned in [3]. While a) allows for monolithic simulation with excellent stability properties, b) is the starting point for an efficient distributed simulation via operator splitting and/or dynamic iteration.
The paper is organized as follows: after an introduction, in § 2 we define the setting of port-Hamiltonian ODE systems. § 3 deals with the coupling of pHODE subsystems into a joint pHODE, and § 4 discusses the decoupling of a single pHODE system into pHODE subsystems. Section 5 discusses briefly the advantages and disadvantages of both approaches. We conclude with final remarks in § 6.
Port-Hamiltonian ODE systems
Following the lines of [13 Definition 1], we define the general setting of port-Hamiltonian ordinary differential equations (pHODEs). Consider a time interval I⊂R, a state space X⊂Rn. A pHODE is a (possibly implicit) system of ordinary differential equations (ODEs) of the form:
E(x)x˙=(J(x)−R(x))z(x)+(B(x)−P(x))u,(1)
y=(B(x)+P(x))Tz(x)+(S(x)−N(x))u,(2)
associated with a Hamiltonian function H∈C1(X,R), where x(t)∈X is the state, u(t),y(t)∈Rm are the input and output functions, r,z∈X(S,R] are the time-flow and effort functions, E∈C(X,Rn×n) is the regular flow matrix, J,R∈X(S,Rn×n) are the structure and dissipation matrices, B,P∈C(X,Rn×p) are the port matrices and S,N∈C(X,Rp×p) are the feed-through matrices. Furthermore, the following property must hold:
Γ:=[J−BTBN]=−ΓT,W:=[RPTPS]⪰0,
i.e. Γ is a skew-symmetric matrix and W is a positive semidefinite matrix. The gradient of the Hamiltonian function satisfies ∇H=E(x)Tz. The key property of such pHODE systems (1) is the following dissipation inequality
dtdH(x)=−(zu)TW(zu)+uTy,(3)
for the Hamiltonian (we refer to [13 Section 2.2.1] for a proof).
Remark 1.In many engineering applications, the feed-through matrices S and N may vanish. In this case, one has to also set the port matrix P to zero because otherwise
W:=[RPTP0]
will become indefinite for P=0. Therefore, we will often consider the special case of port-Hamiltonian ODE systems
E(x)x˙=(J(x)−R(x))z(x)+B(x)u,(4)
y=B(x)Tz(x).(5)
Coupling Port-Hamiltonian ODE Systems
To define coupled port-Hamiltonian ODE systems, we consider s subsystems of pHODEs (3)
i=1,…,s, with Ji=−Ji⊤ and Ri≥0 and a Hamiltonian Hi(xi), which fulfills the compatibility conditions Ei⊤zi=∇xiHi, i=1,…,s. Here, we distinguish inputs u^i and outputs y^i, which arise in the coupling between the subsystems, and inputs uˉi and outputs yˉi, which couple the single system with the outer world.
The subsystems are coupled via external inputs and outputs by
These s systems can be condensed into a large monolithic port-Hamiltonian descriptor system (pHDAE) consisting of differential-algebraic equations of the type (3) (cf. [3] for the linear case)
E(x)x˙=(J(x)−R(x))z(x)+Bˉ(x)uˉ,(7)
yˉ=Bˉ(x)⊤z(x),(8)
with J(x):=diag(J1(x1),…,Js(xs))−B^C^B^⊤, F=diag(F1,…,Fs) for Fi∈{E,R,Bˉ} and H(x):=∑i=1sHi(xi).
The Schur complement BCB⊤ defines the off-diagonal block entries of J.
Remark 2. If the matrix C^ in the input-output coupling (6) is not skew-symmetric, then one can split C^=C^symm+C^skew−symm into its symmetric and skew-symmetric parts, and one gets an equivalence with the pHODE system (5) by replacing J(x) and R(x) by
J(x):=diag(J1(x1),…,Js(xs))−B^C^skew−symmB^⊤
and
R(x):=diag(R1(x1),…,Rs(xs))+B^C^symmB^⊤,
provided that R(x)≥0 is still positive semidefinite. If not, one must use (6) to follow the approach discussed in the following Remark 3.
Remark 3. In many engineering applications, the inputs and outputs of the subsystems are coupled via a skew-symmetric coupling condition. In general, if an arbitrary linear relation Mu+Ny=0 exists, then the coupled system of pHODEs is equivalent to a pHDAE system (cf. [13 Section 2.2.4]), but this comes at the cost of introducing additional dummy variables u^ and y^ that copy u and y:
Provided that Jii, Rii and Bi depend only on wi (for i=1,…,s), and the transformed flow matrix is block-diagonal of the form E=diag(E11(w1),…,Ess(ws)), we can decouple the pHODE system into s coupled pHODE systems as follows:
Case 1:Roffdiag=0.
If we define B=I and C=−Joffdiag, then the pHODE system (7) is analytically equivalent to the s pHODE subsystems
and fulfilling the compatibility conditions EiiTzi=∇wiHwi.
Case 2:R~offdiag=0.
Here we define B^=I and C^=−J~offdiag+R^offdiag to obtain the decoupled system (8). However, the coupling condition is no longer skew-symmetric, but a general linear one with M=I and N=C^ (see Remark 2).
Case 3: General coupling.
We can use s different port matrices B^i to define the equivalent pHODE system
holds with C^symm and C^skew-symm corresponding to the symmetric and skew-symmetric part of C^, respectively, and and b) the port matrices B^i depend only on wi. The latter can always be achieved by defining B^i=I and
C^ij:=−(J~ij−Rij).
Remark 4. In the case of a block-diagonal matrix R~, i.e., R~ij=0 for i=j, we obtain a skew-symmetric coupling with
For this case, the obvious choice in the last section was B^i=B^j=I, C^ij=−J~ij.
Remark 5. Since R is positive semidefinite, all Rii are also positive semidefinite. Additionally, if J is skew-symmetric, then the block-diagonal matrices Jii are also skew-symmetric, which defines s pHODE systems.
Example 1. Consider the dissipative Hamiltonian system (pHODE system without external input, see Figure 1)
This splitting is in accordance with the modeling of a two-mass and three-spring system with damping, as described in [3]. This is achieved by setting x1=[p1,q1,q1−q]T and x2=[p2,q2]T.
Remark 6. Properly choosing the port matrices minimizes the dimension of the coupling condition, i.e., the coupling matrix C^. With the former, we need only one scalar input for each subsystem. However, choosing B1 and B2 as identities requires as many inputs as there are state variables.
Another splitting splits with respect to components 1,4 and components 2,3,5. In this case we have
where w, v, p are the discretized velocity, displacement and pressure fields, f, g are the discretized volume-distributed forces and the external injection, μ and λ are the Lame coefficients, α is the Biot-Willis fluid-solid coupling coefficient, κ is the permeability and ρ is the density. Mu and Mp are mass matrices with respect to u and p, Ku is a stiffness matrix with respect to u and D is a damping matrix, see [14] for more details. We can easily split this implicit pHODE system with respect to the first two and the third block and obtain
Because the first subsystem lacks a dissipative part and the second lacks a skew-symmetric part, symplectic time integration can be used for the first part and dissipative time integration can be used for the second part in a dynamic iteration procedure.
Example 3 (Discretized full set of Maxwell’s equations). The full set of Maxwell’s equations formulated with electrodynamic potentials and discretized forms a pHDAE system with
where C, G are discrete curl and gradient matrices, Mκ, Mε, Mμ are discrete material matrices for electric conductivity κ, permittivity ε and permeability μ, respectively, a, φ, h are the degree of freedom vectors and u=js is the input vector of source currents and the output vector y=dta+Gφ(=−e) is the negated vector of electric grid voltages. The Hamiltonian associated with (20) is the discrete electromagnetic grid energy is given by
Numerical Aspects of Monolithic and Decoupled Formulations
In numerical simulations, the monolithic and decoupled formulations of port-Hamiltonian ODE systems offer distinct advantages. The monolithic formulation preserves the full system structure and typically exhibits superior stability properties, particularly when integrated with structure-preserving or symplectic time-stepping schemes. This makes it ideal for stiff or highly coupled systems where global energy conservation is crucial. Nevertheless, one may reduce computational time by applying operator splitting techniques to the general systems which preserve the port-Hamiltonian structure, for example, J−R coupling [2] or diagonal/off-diagonal coupling [12], jointly with multirate approaches.
In contrast, the decoupled formulation offers greater flexibility and computational efficiency in multiphysics or large-scale contexts. It allows for the use of specialized numerical solvers, such as mimetic or energy-consistent methods, which are tailored to individual subsystems and respect local conservation laws. This partitioned approach also enables parallel or distributed computation via dynamic iteration [8], although with potentially weaker global stability. The monolithic formulation favors global stability, whereas the decoupled approach provides modularity and solver flexibility, at the cost of potentially reduced overall stability.
Conclusion
We have presented a unified framework for coupling and decoupling nonlinear port-Hamiltonian ordinary differential equation systems. The analysis demonstrates how multiple pH subsystems can be reformulated as a single monolithic system, and conversely, how a monolithic pHODE can be decomposed into weakly coupled subsystems without losing the underlying Hamiltonian structure. The results provide a theoretical basis for structure-preserving simulation strategies that balance stability and flexibility. Future research will address adaptive coupling strategies, structure-preserving time discretizations, and extensions to port-Hamiltonian differential-algebraic [7] and stochastic systems [6].
Acknowledgements
M. Ehrhardt and M. Günther acknowledge funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 531152215 – CRC 1701. D Ševčovič was supported by Slovak research grant VEGA 1-0493-24.
Data availability
No data was used for the research described in the article.
References
[1]R. Altmann, V. Mehrmann, and B. Unger, Port-Hamiltonian formulations of poroelastic network models, Math. Comput. Model. Dyn. Syst. 27(1), (2021), 429–452.arxiv.org/abs/2012.01949
[2]A. Bartel, M. Diab, A. Frommer, M. Günther, and N. Marheineke, Splitting techniques for DAEs with port-Hamiltonian applications, Appl. Numer. Math. 214 (2025), 28-53.arxiv.org/abs/2404.13531
[3]A. Bartel, M. Günther, B. Jacob, and T. Reis, Operator splitting based dynamic iteration for linear differential-algebraic port-Hamiltonian systems, Numer. Math. 155 (2023), 1–34.DOI
[4]P. Buchfink, S. Glas, and H. Zwart, Energy-stable Port-Hamiltonian Systems, Applied Mathematics Letters 173 (2026), 109784arxiv.org/abs/2506.06471
[5]J. Cervera, A.J. van der Schaft, and A. Baños, Interconnection of port-Hamiltonian systems and composition of Dirac structures, Automatica 43(2) (2007), 212–225.DOI
[6]L. Di Persio, M. Ehrhardt, Y. Outaleb, and S. Rizzotto, Port-Hamiltonian Neural Networks: From Theory to Simulation of Interconnected Stochastic Systems, arXiv: 2509.06674v1, 2025.arxiv.org/abs/2509.06674
[7]M. Günther, A. Bartel, B. Jacob, and T. Reis, Dynamic iteration schemes and port-Hamiltonian formulation in coupled DAE circuit simulation, Int. J. Circuit Theory Appl. 49 (2021), 430–452.arxiv.org/abs/2004.12951
[8]M. Günther, A. Bartel, M. Clemens, B. Jacob, and T. Reis, Port-Hamiltonian Systems: A useful approach in electrical engineering?, 14th Int. Conf. on Scientific Computing in Electrical Engineering (SCEE 2022), July 11-14, 2022, Amsterdam, The Netherlands, Springer, 2022.arxiv.org/abs/2301.02024
[9]B. Jacob and H.J. Zwart, Linear Port-Hamiltonian Systems on Infinite-dimensional Spaces, Springer, 2012.DOI
[10]J. Jäschke, M. Ehrhardt, M. Günther, and B. Jacob, A port-Hamiltonian formulation of coupled heat transfer, Math. Comput. Model. Dyn. Syst. 28(1) (2022), 78-94.
[11]J. Jäschke, M. Ehrhardt, M. Günther, and B. Jacob, A two-dimensional port-Hamiltonian model for coupled heat transfer, Mathematics 10(24) (2022).
[12]J. Lorenz, T. Zwerschke, M. Günther, and K. Schäfers, Operator splitting for coupled linear port-Hamiltonian systems, Appl. Math. Lett. 160 (2025), 109309.DOI
[13]V. Mehrmann and R. Morandin, Structure-preserving discretization for port-Hamiltonian descriptor systems, in: 2019 IEEE 58th Conference on Decision and Control (CDC), Nice, France, 2019, pp. 6863-6868.arxiv.org/abs/1903.10451
[14]P. Schwerdtner, BenchmarkPortHamiltonianSystems for Julia, https://algopaul.github.io/PortHamiltonianBenchmarkSystems/.