Using Symplectic Autoencoders for Port-Hamiltonian Systems

Symplectic autoencoders can also be used to reduce port-Hamiltonian systems [73]. Here we focus on linear port-Hamiltonian systems[1]. These are of the form:

\[\Sigma_\mathrm{lpH}(\mathbb{R}^{2N}) = \Sigma_\mathrm{lpH} : \begin{cases} \dot{\hat{z}}(t) & = (\mathbb{J}_{2N} - \hat{R})\nabla{}H(\hat{z}(t)) + \hat{B}u(t) \\ y(t) & = \hat{B}^T\nabla{}H(\hat{z}(t)), \end{cases}\]

where $\mathbb{J}_{2N}$ is the Poisson tensor and $\hat{R}\in\mathbb{R}^{2N\times{}2N}$ is symmetric semi-positive definite (i.e. all its eigenvalues are non-negative). $\hat{z}\in\mathbb{R}^{2N}$ is called the state of the system, $u\in\mathbb{R}^m$ are the system inputs, $y\in\mathbb{R}^m$ are the system outputs, and $\hat{B}\in\mathbb{R}^{2N\times{}m}$ connects the inputs to the state. We also refer to linear port-Hamiltonian systems as lpH systems.

Similar to energy conservation of standard Hamiltonian systems, lpH systems have an associated energy balance equation:

Definition

The energy balance equation of a lpH system is:

\[\frac{d}{dt}H(z(t)) \leq y(t)^Tu(t).\]

If we further have $R = 0,$ then the inequality becomes an equality.

Proof

We evaluate the derivative of $H(z(t))$ with respect to $t$:

\[\begin{aligned} \frac{d}{dt}H(\varphi^t(z_0))& = \nabla{}H(\varphi^t(z_0))\frac{d}{dt}\varphi^t(z_0) \\ & = \nabla{}H(z(t))(\mathbb{J} - R)\nabla{}H(z(t)) + (\nabla{}H(z(t)))^TBu(t) \\ & = (\nabla{}H(z(t)))^TR\nabla{}H(z(t)) + \underbrace{(\nabla{H}(z(t)))^TB}_{y(t)^T}u(t) \\ & \leq y(t)^Tu(t), \end{aligned}\]

where we used that $R$ is symmetric and positive semi-definite in the last step.

The analogue to the Poisson tensor for lpH systems are so-called Dirac structures:

Definition

A Dirac structure for a vector space $\mathbb{R}^{n}$ is a subspace $D\subset\mathbb{R}^n\times(\mathbb{R}^n)^* \simeq \mathbb{R}^{2n}$ such that

\[D^\perp = D,\]

i.e. the orthogonal complement of $D$ is equal to itself. Here the orthogonal complement is taken with respect to the pairing:

\[\langle\langle\cdot,\cdot\rangle\rangle:\mathbb{R}^{2n}\times\mathbb{R}^{2n}\to\mathbb{R}, (e, f)\times(\tilde{e}, \tilde{f}) \mapsto e^T\tilde{f} + \tilde{e}^Tf.\]

Note that $\langle\langle\cdot, \cdot\rangle\rangle$ is a symmetric bilinear form.

Example

The space:

\[ D = \{ (e, f): e\in\mathbb{R}^{2n}, f = \mathbb{J}_{2n}e \}\subset\mathbb{R}^{4n}\]

forms a Dirac structure. Note that we also have:

\[ (\nabla_z{H}, X_H(z)) = (\nabla_zH, \mathbb{J}\nabla_zH) \in D.\]

So every Hamiltonian System has an associated Dirac structure.

Example

For the lpH shown above we have the relation:

\[ \begin{pmatrix} f \\ y \\e \end{pmatrix} = \begin{pmatrix} \mathbb{J}_{2N}^T & -B & -\mathbb{I}_{2N} \\ B^T & \mathbb{O} & \mathbb{O} \\ \mathbb{I}_{2N} & \mathbb{O} & \mathbb{O} \end{pmatrix} \begin{pmatrix} \bar{e} \\ u \\ \bar{\bar{e}} \end{pmatrix},\]

where we further have the constraints and identifications $f = -\dot{z},$ $\bar{e} = \nabla_zH$ and $\bar{\bar{e}} = -Re$ to fully describe the lpH. Note that points $(f, y, e, \bar{e}, u, \bar{\bar{e}})\in\mathbb{R}^{8N + 2m}$ that satisfy the relation shown above form a Dirac structure.

In numerically solving lpH systems the Dirac structure takes a similar role to the symplectic structure of canonical Hamiltonian systems [77] and the energy-balance equation takes a similar role to energy conservation for canonical Hamiltonian systems. Structure-preserving discretization of lpH systems discretize the Dirac structure with collocation methods [78]. A one-step update can be written as

\[\begin{aligned} z_f & = z_0 + h\sum_{i=1}^s\beta_if_i, \\ z_i & = z_0 + h\sum_{j=1}^s\alpha_{ij}f_j, \\ e_i & = \bar{e}_i = \nabla_{z_i}H, \\ \bar{\bar{e}}_i & = -Re_i, \\ f_i & = \mathbb{J}_{2N}^T\bar{e}_i - Bu_i - \bar{\bar{e}}_i, \\ y_i & = B^T\bar{e}_i. \end{aligned}\]

Model order reduction of port-Hamiltonian systems can be divided into two approaches: projection-based methods and interpolations of the transfer function [79]. The first approach is equivalent to Galerkin projection and we limit the discussion here to this approach. Similar to the case of canonical Hamiltonian systems, we reduce the system with a symplectic autoencoder.

When discussing symplectic model order reduciton we showed that a Hamiltonian system on the reduced space $\mathbb{R}^{2n}$ is equivalent to a Hamiltonian system on $\mathcal{M} = \mathcal{R}(\mathbb{R}^{2n}),$ where $\mathcal{R}$ is the reconstruction in a reduced order modeling framework. Similar statements are also true for lpH systems.

We will now demonstrate how to obtain a reduced-order lpH system from a full-order lpH system and vice-versa:

The figure above indicates that we can derive a full system $\tilde{\Sigma}_\mathrm{lpH}(\mathbb{R}^{2N}) := \Sigma_\mathrm{lpH}(\mathcal{M})$ from a reduced one $\Sigma_\mathrm{lpH}(\mathbb{R}^{2n}).$ If we have $R = 0,$ i.e. if the dissipative part of the system is zero, then we can also derive a reduced system $\Sigma^{R=0}_\mathrm{lpH}(\mathbb{R}^{2n})$ from a full one $\tilde{\Sigma}^{R=0}_\mathrm{lpH}(\mathbb{R}^{2N}) = \Sigma^{R=0}_\mathrm{lpH}(\mathcal{M}).$ If and when this is true for $R\neq0$ is an open question[2]. We now proceed with showing this equivalence, first for the special case $R = 0.$

The Special Case $R = 0$

We first focus on the case where $R = 0.$ This case was also discussed in [77].

Theorem

For $R = 0,$ model reduction of a lpH system with a symplectic autoencoder $(\Psi^e, \Psi^d)$ yields a lpH system in reduced dimension of the form:

\[ \bar{\Sigma}_\mathrm{lpH} : \begin{cases} \dot{z}(t) & = \mathbb{J}_{2n}\bar{H}(z(t)) + Bu(t) \\ y(t) & = B^T\nabla\bar{H}(z(t)) \end{cases},\]

where $B := (\nabla\Psi^d)^+\hat{B}$ and $\bar{H}(z(t)) := H(\Psi^d(z(t))).$

$(\nabla\Psi^d)^+ = \mathbb{J}_{2n}^T(\nabla\Psi^d)^T\mathbb{J}_{2N}$ is the symplectic inverse.

Proof

We have to proof that the dynamics of $\Psi^d(z)$, that approximate $\hat{z}$, are described by a lpH system. We first insert $\bar{z}(t) \approx \Psi^d(z(t))$ into the first equation of $\Sigma_{lpH}$:

\[(\nabla\Psi^d)\dot{z}(t) = \mathbb{J}_{2N}\nabla{}H(\Psi^d(z(t))) + Bu(t).\]

We then multiply the equation above with the symplectic inverse $(\nabla\Psi^d)^+$:

\[\begin{aligned} \dot{z}(t) & = (\nabla\Psi^d)^+\mathbb{J}_{2N}\nabla{}H(\Psi^d(z(t))) + (\nabla\Psi^d)^+\hat{B}u(t) \\ & = \mathbb{J}_{2n}(\nabla\Psi^d)^T\nabla{}H(\Psi^d(z(t))) + (\nabla\Psi^d)^+\hat{B}u(t) \\ & = \mathbb{J}_{2n}\nabla(H\circ\Psi^d(z(t))) + Bu(t), \end{aligned}\]

thus proving our assertion.

From the Reduced Space to the Full Space for $R\neq0$

Here we show that we can construct a lpH system on the full space from a lpH system on the reduced space; this holds for both $R=0$ and $R\neq0.$ The corresponding proof was already introduced in similar form by [80].

Theorem

A lpH system on the reduced space induces a lpH system on the full space.

Proof

Consider a reduced lpH system:

\[\Sigma_\mathrm{lpH} : \begin{cases} \dot{z}(t) & = (\mathbb{J}_{2n} - R)\nabla{}H(z(t)) + Bu(t) \\ y(t) & = B^T\nabla{}H(z(t)), \end{cases}\]

where $R\in\mathbb{R}^{2n\times2n}$ and $B\in\mathbb{R}^{2n\times{}m}.$ After multiplying the first equation with $\nabla_z\mathcal{R}$ from the left we get:

\[\frac{d}{dt} \mathcal{R}(z(t)) = \nabla_z\mathcal{R}(\mathbb{J}_{2n} - R)\nabla_zH + (\nabla_z\mathcal{R})Bu(t).\]

From now on we call $\tilde{B} := (\nabla_z\mathcal{R})B.$ We then look at the terms (i) $(\nabla_z\mathcal{R})\mathbb{J}_{2n}\nabla_zH$ and (ii) $(\nabla_z\mathcal{R})R\nabla_zH.$ The first one (i) becomes:

\[\begin{aligned} (\nabla_z\mathcal{R})\mathbb{J}_{2n}\nabla_zH & = \mathbb{J}_{2N}\mathbb{J}_{2N}^T(\nabla_z\mathcal{R})\mathbb{J}_{2n}\nabla_zH \\ & = \mathbb{J}_{2N}((\nabla_z\mathcal{R})^+)^T\nabla_zH \\ & = \mathbb{J}_{2N}\nabla_{\mathcal{R}(z)}(H\circ\psi) \end{aligned}\]

And the second one (ii) becomes:

\[\begin{aligned} (\nabla_z\mathcal{R})R\nabla_zH & = (\nabla_z\mathcal{R})R\nabla_z(H\circ\psi\circ\mathcal{R}) \\ & = (\nabla_z\mathcal{R})R(\nabla_z\mathcal{R})^T\nabla_{\mathcal{R}(z)}(H\circ\psi) \\ & =: \tilde{R}\nabla_{\mathcal{R}(z)}\bar{H}. \end{aligned}\]

We then have in total:

\[\tilde{\Sigma}_\mathrm{lpH}:\begin{cases} \frac{d}{dt}\mathcal{R}(z(t)) & = (\mathbb{J}_{2N} - \tilde{B})\nabla_{\mathcal{R}(z)}\bar{H} + \tilde{B}u(t) \\ \tilde{y}(t) & = \tilde{B}^Tu(t) \end{cases}\]

where $\tilde{R}|_{\mathcal{R}(z)} = (\nabla_z\mathcal{R})^TR(\nabla_z\mathcal{R}),$ $\tilde{B} := (\nabla_z\mathcal{R})B$ and $\bar{H} = H\circ\psi$.

As was already discussed in the section on Hamiltonian model order reduction the encoder $\Psi^e$ can be constructed such that it is exactly the local inverse $\psi.$ This was done in e.g. [81]. Enforcing this for symplectic autoencoders is also straightforward.

References

[73]
A. Van Der Schaft, D. Jeltsema and others. Port-Hamiltonian systems theory: An introductory overview. Foundations and Trends in Systems and Control 1, 173–378 (2014).
[77]
P. Kotyczka and L. Lefevre. Discrete-time port-Hamiltonian systems: A definition based on symplectic integration. Systems & Control Letters 133, 104530 (2019).
[78]
V. Mehrmann and R. Morandin. Structure-preserving discretization for port-Hamiltonian descriptor systems. In: 2019 IEEE 58th Conference on Decision and Control (CDC) (IEEE, 2019); pp. 6863–6868.
[74]
R. Morandin. Modeling and numerical treatment of port-Hamiltonian descriptor systems. Ph.D. Thesis, Technische Universität Berlin (2023).
[80]
J. Rettberg, J. Kneifl, J. Herb, P. Buchfink, J. Fehr and B. Haasdonk. Data-driven identification of latent port-Hamiltonian systems, arXiv preprint arXiv:2408.08185 (2024).
  • 1For a broader class of such systems see [74]. A generalization to manifolds of such systems is also possible [75, 76].
  • 2We indicate this with a dashed arrow.