Numerical Approximation of Port-Hamiltonian Systems for Hyperbolic or Parabolic PDEs with Boundary Control

Show more

1. Introduction

The efficient numerical simulation of complex multiphysics systems is ubiquitous in Computational Science and Engineering. Although a wide range of methods exists to tackle specific problems, they often lack versatility and adaptability, especially when the modelling is of increasing complexity as in real-world applications.

Infinite-dimensional port-Hamiltonian systems (pHs) have been first introduced in [1] using the language of differential geometry. They provide a powerful tool to model complex multiphysics open systems (whether or not being linear) for control purpose. A wide range of physical systems has been written within this formalism, see e.g. [2] [3] [4]. This twenty-year-old framework [5] enjoys nice properties, such as the relevant physical meaning of the variables, a useful underlying linear structure (namely Stokes-Dirac structure) which encodes the power balance satisfied by the Hamiltonian (often chosen as energy), and last but not least: the interconnection of multiple pHs remains a pHs. This allows “modular” modelling of complex multiphysics systems.

Since then, many researchers have developed numerical methods to discretize these systems in a structure-preserving manner, hence keeping the advantages of the infinite-dimensional pHs. Such methods aim at constructing approximate finite-dimensional pHs at the discrete level. Our aim is to show the versatility of PFEM thanks to a new unified framework and to introduce the ongoing project SCRIMP together with companion Jupyter notebooks [6]. Each particular example discussed here has been treated previously [7] [8] [9] [10]. Here, the existence of an underlying common structure for many pHs is highlighted. Obtaining such a general scheme for infinite-dimensional pHs is of major importance for control purposes [11], and for coupling atomic elements into a more complex system with the guarantee of well-preserved energy exchanges between subsystems [12].

The first proposed structure-preserving scheme for pHs dates back to [13], where the authors proposed a mixed finite element spatial discretization for hyperbolic systems of conservation laws. Pseudo-spectral methods relying on higher-order global polynomial approximations were studied in [14]. Unfortunately, this method seems to be limited to the one-dimensional case. A finite difference method with staggered grids was developed in [15] for two-dimensional domains, but complex geometries are then difficult to tackle. Weak formulations leading to Galerkin numerical approximations began to be explored in the past few years. In [16] the prototypical example of hyperbolic systems of two conservation laws has been discretized by a weak formulation. However, the construction of the necessary power-preserving mappings is not straightforward on arbitrary meshes. All these methods require *ad hoc* implementations and are usually restricted to particular cases of pHs. Furthermore, since they do not rely on well-established and versatile numerical libraries, using such techniques remains confined within a small community of experts. We refer the reader for a more complete overview of structure-preserving discretization for pHs to [5] [17] and the references therein.

Thanks to [8] it has become clear that there exists a deep relation between structure-preserving discretization of pHs and Mixed Finite Element Method (MFEM). Indeed velocity-stress formulations for the wave dynamics [18] and elastodynamics problems are of Hamiltonian type and their mixed discretization preserves this structure for *closed* systems. This leads to the intuition that the MFEM may be used to discretize the underlying geometric structure of pHs in a unified way, even for *open* systems, translating the infinite-dimensional Stokes-Dirac structure into a finite Dirac structure. A first successful application has already been achieved in [19] for discretizing the 1-D Navier-Stokes equations for reactive flows formulated in a port-Hamiltonian formulation. The discretization strategy relies on the partitioned structure of the problem and for this reason, goes under the name of Partitioned Finite Element Method (PFEM). This method proves nice convergence properties, see e.g. [20] for a recent proof on the wave equation, that does not require the fulfilment of the usual *inf**-sup* condition for MFEM, generalizing the results cited in ( [21], Remark 6).

It has to be pointed out that the core idea of PFEM, *i.e.* performing integration by parts on a *partition* of the weak formulation of the system of equations, has already been proposed for *closed* hyperbolic systems in [21]. Therein, the formulations are called either *primal-dual* or *dual-primal*, depending on the chosen partition of the system.

The major difference between MFEM and PFEM relies on the choice of the test functions in the weak formulation, hence on the finite element form functions. Indeed, in PFEM, they never carry homogeneous boundary conditions. In e.g. ( [22], Section 7.1), it is shown that for a Dirichlet control, test functions are taken in the kernel of the Dirichlet trace. As already mentioned, in [21], the proposed *primal-dual* and *dual-primal* discretizations are then suitable for the structure-preserving discretization of *closed* systems. Nevertheless, by keeping these homogeneous conditions in the test functions, not only the application of Dirichlet control is difficult, but the definition of the Neumann observation, necessary for the discrete power balance, would be more complex. PFEM aims at easing the mimicking of the continuous power balance at the discrete level, by relaxing the test functions used in [21]. To the best of our knowledge, this relaxation has not been investigated yet in the case of boundary controlled wave-like systems, and this probably comes from the fact that MFEM has been first developed for elliptic systems. Indeed, in this case, such a boundary condition is mandatory for well-posedness (especially to obtain the *ellipticity** in the kernel* condition ( [22], Eq. (5.1.7)), while PFEM is made for evolution systems, and more especially for pHs.

In our opinion, the driving forces of PFEM are threefold: first, PFEM takes collocated boundary controls and observations into account in a simple manner; secondly, PFEM is structure-preserving, meaning in particular that the discrete power balance perfectly mimics the continuous one; thirdly, the implementation of PFEM only relies on existing finite element libraries, such as FEniCS [23], selected in the ongoing project SCRIMP for its robustness and efficiency. Last but not least, the pHs point of view allows us to separate axioms of physics (such as conservation laws) from constitutive laws and equations of state (such as Hooke’s law and ideal gas law). PFEM is based on this separation, providing the possibility to tackle parabolic or nonlinear systems, at the price of solving a finite-dimensional *port-Hamiltonian Differential Algebraic Equation *(pHDAE). In the particular case of linear hyperbolic PDE, as shown in Section 2, the constitutive laws can be easily (*i.e.* without matrix inversions) taken into account in order to recover an *Ordinary Differential Equation *(ODE).

PFEM could also be named e.g. *extended MFEM* or *relaxed MFEM*. Since only evolution systems are considered (not necessarily of hyperbolic type, see e.g. Section 3.4), relaxed conditions for the selection of the test functions hold, hence for the finite elements as well. We choose to follow the terminology introduced in [8] and widely used since then. Furthermore, it emphasizes the pH formulation of the initial system to discretize.

Main contributions

We first aim at presenting the strategy of the structure-preserving discretization PFEM, in a new unified abstract framework, allowing for an easy application to a wide class of boundary controlled partial differential equations. Then, in order to show the versatility of our approach, we successively apply PFEM to the boundary controlled wave equation, the boundary controlled Mindlin plate model, and the boundary controlled heat equation with a thermodynamically well-founded Hamiltonian (namely the *internal energy*, instead of the quadratic functional commonly used). Taking advantage of the strong underlying structure, we finally describe a unified object-oriented implementation of these models *via* PFEM. Companion interactive Jupyter notebooks [6] are discussed to illustrate our methodology. For the purpose of this manuscript, smooth functions are selected for the physical parameters of the problem under considerations. Nothing prevents from choosing less regular coefficients. This will of course affect the global convergence of the underlying finite elements [20].

Structure of the manuscript

The manuscript is organized as follows. In Section 2 the abstract pHs framework is introduced, with a particular focus on both hyperbolic and parabolic linear systems of partial differential equations. In Section 3 the general structure-preserving discretization is presented, and then specialized on the two cases previously mentioned. In Section 4 the ongoing environment SCRIMP is described in detail. In Section 5 the three companion interactive Jupyter notebooks [6] are thoroughly explained. Conclusions and perspectives are finally drawn in Section 6.

2. Definition of the General Framework

In this section, we introduce an abstract class of pHs and their underlying geometric structure: the Dirac structure for the finite-dimensional case and the Stokes-Dirac structure for the infinite-dimensional case. For the infinite-dimensional case it is shown how hyperbolic and parabolic systems easily fit into this framework.

2.1. Finite Dimensional Port-Hamiltonian Systems

State representation

Let us begin with a classical definition of a pHs in finite dimension. Consider the time-invariant dynamical system [24]:

$(\begin{array}{l}\frac{\text{d}x}{\text{d}t}=\left(J\left(x\right)-R\left(x\right)\right)\nabla H\left(x\right)+B\left(x\right)u\mathrm{,}\\ y=B{\left(x\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}\nabla H\left(x\right)\mathrm{,}\end{array}$ (1)

where
$H\left(x\right)\mathrm{:}X\simeq {\mathbb{R}}^{n}\to \mathbb{R}$, the Hamiltonian, is a real-valued function of the vector of *energy variables*
$x$, bounded from below. Matrix-valued functions
$J\left(x\right)$ (the *structure operator*) and
$R\left(x\right)$ (the *dissipative* or *resistive operator*) are skew-symmetric and symmetric positive semi-definite respectively. The control
$u\in {\mathbb{R}}^{m}$ is applied thanks to the matrix-valued control function
$B\left(x\right)$ of size
$n\times m$. Variable
$y\in {\mathbb{R}}^{m}$ is the power conjugated output to the input.

Such a system is called a *port-Hamiltonian system*, as it arises from the Hamiltonian modelling of a physical system and it interacts with the environment *via* the input
$u$ and the output
$y$, included in the formulation. The vector
$\nabla H\left(x\right)$ is made of the *co-energy variables*.

Due to the structural properties of
$J\left(x\right)$ and
$R\left(x\right)$, the port-Hamiltonian system enjoys the nice following *power balance*:

$\frac{\text{d}H}{\text{d}t}=-{\left(\nabla H\left(x\right)\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}R\left(x\right)\nabla H\left(x\right)+{u}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}y\mathrm{\text{\hspace{0.17em}}}\le \mathrm{\text{\hspace{0.17em}}}{u}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}y\mathrm{,}$ (2)

meaning that $R\left(x\right)$ accounts for dissipation, and that the input-output product corresponds to the power supplied to (or taken from) the system, through the control $u$.

Flow-effort representation

Consider two finite-dimensional vector spaces
$E=F\simeq {\mathbb{R}}^{n}$. The elements of *F* are called *flows*, while the elements of *E* are called *efforts*. Those are port variables and their combination gives the power flowing inside the system. The space
$B:=F\times E$ is called the bond space of power variables. Therefore, identifying *E* as the dual of *F*, the power is defined as
$\langle e\mathrm{,}f\rangle \mathrm{:}=e\left(f\right)$.

Definition 1 ( [25], Def. 1.1.1) *Given** the finite-dimensional space **F and its dual E with respect to the inner product
${\langle \cdot \mathrm{,}\cdot \rangle}_{F}\mathrm{:}F\times F\to \mathbb{R}$ *,* consider the symmetric bilinear form*:

$\langle \langle \left({f}_{1}\mathrm{,}{e}_{1}\right)\mathrm{,}\left({f}_{2}\mathrm{,}{e}_{2}\right)\rangle \rangle \mathrm{:}=\langle {e}_{1},{f}_{2}\rangle +\langle {e}_{2},{f}_{1}\rangle \mathrm{,}\text{\hspace{1em}}\text{where}\text{\hspace{0.17em}}\text{\hspace{0.05em}}\left({f}_{i}\mathrm{,}{e}_{i}\right)\in B\mathrm{,}\text{\hspace{0.17em}}i=\mathrm{1,2.}$

A Dirac structure on
$B\mathrm{:}=F\times E$ is a subspace
$D\subset B$, which is maximally isotropic under
$\langle \langle \cdot \mathrm{,}\cdot \rangle \rangle $. Equivalently, a Dirac structure on
$B:=F\times E$ is a subspace
$D\subset B$ which equals its orthogonal companion with respect to
$\langle \langle \cdot \mathrm{,}\cdot \rangle \rangle $, *i.e.*
$D={D}^{\mathrm{[}\perp \mathrm{]}}$, where:

${D}^{\mathrm{[}\perp \mathrm{]}}\mathrm{:}=\left\{\left(f\mathrm{,}e\right)\in B\mathrm{\text{\hspace{0.17em}}}|\mathrm{\text{\hspace{0.17em}}}\langle \langle \left(f\mathrm{,}e\right)\mathrm{,}\left(\stackrel{\u02dc}{f}\mathrm{,}\stackrel{\u02dc}{e}\right)\rangle \rangle =\mathrm{0,\text{\hspace{0.17em}}}\forall \mathrm{\text{\hspace{0.17em}}}\left(\stackrel{\u02dc}{f}\mathrm{,}\stackrel{\u02dc}{e}\right)\in D\right\}\mathrm{.}$

The connection between the concept of Dirac structure and pHs in its canonical form (1) is achieved by considering the following *ports*:

· the *storage ports*
$\left({f}_{x}\mathrm{,}{e}_{x}\right)\mathrm{:}=\left(\frac{\text{d}x}{\text{d}t}\mathrm{,}\nabla H\left(x\right)\right)\in {\mathbb{R}}^{n}\times {\mathbb{R}}^{n}$, made of the *storage flow*
${f}_{x}$ (time-derivative of the energy variables) and *storage effort*
${e}_{x}$ (the co-energy variables);

· the *resistive *(*or dissipative*)* ports*
$\left({f}_{R}\mathrm{,}{e}_{R}\right)\in {\mathbb{R}}^{k}\times {\mathbb{R}}^{k}$, made of the *resistive *(*or dissipative*)* flow*
${f}_{x}$ and *resisitive* (*or dissipative*)* effort*
${e}_{R}$ ;

· the *interconnection ports*
$\left({f}_{u}\mathrm{,}{e}_{u}\right)\mathrm{:}=\left(-y\mathrm{,}u\right)\in {\mathbb{R}}^{m}\times {\mathbb{R}}^{m}$, made of the *interconnection flow*
${f}_{u}$ and *interconnection effort*
${e}_{u}$.

Assuming that the matrix $R\left(x\right)$ has constant rank, from classical matrix factorizations there exist matrices $G$ (not necessarily square, of size $k\times n$ ) and $K$ symmetric positive semi-definite of size $k\times k$ such that $R={G}^{{\rm T}}KG$. These notations at hand, the pHs (1) rewrites:

$\left(\begin{array}{c}{f}_{x}\left(x\right)\\ {f}_{R}\left(x\right)\\ {f}_{u}\left(x\right)\end{array}\right)=\underset{{J}_{e}}{\underset{\ufe38}{\left[\begin{array}{ccc}J\left(x\right)& -G{\left(x\right)}^{{\rm T}}& B\left(x\right)\\ G\left(x\right)& 0& 0\\ -B{\left(x\right)}^{{\rm T}}& 0& 0\end{array}\right]}}\left(\begin{array}{c}{e}_{x}\left(x\right)\\ {e}_{R}\left(x\right)\\ {e}_{u}\left(x\right)\end{array}\right)\mathrm{,}$ (3)

together with the (*dissipative or resistive*)* constitutive relation*:

${e}_{R}\left(x\right)=K\left(x\right){f}_{R}\left(x\right)\mathrm{.}$ (4)

It is clear that the *extended structure operator*
${J}_{e}$ appearing in (3) is skew-symmetric of size
$\left(n+k+m\right)\times \left(n+k+m\right)$. Its graph is a Dirac structure with respect to the Euclidean inner product, as a kernel representation, see [24]. Hence, it comes:

${\langle {e}_{x}\left(x\right)\mathrm{,}{f}_{x}\left(x\right)\rangle}_{{\mathbb{R}}^{n}}+{\langle {e}_{R}\left(x\right)\mathrm{,}{f}_{R}\left(x\right)\rangle}_{{\mathbb{R}}^{k}}+{\langle {e}_{u}\left(x\right)\mathrm{,}{f}_{u}\left(x\right)\rangle}_{{\mathbb{R}}^{m}}=0.$

Noting that $\frac{\text{d}H}{\text{d}t}={\langle {e}_{x}\left(x\right)\mathrm{,}{f}_{x}\left(x\right)\rangle}_{{\mathbb{R}}^{n}}$ (by definition of the storage port) leads to:

$\frac{\text{d}H}{\text{d}t}=-{\langle {e}_{R}\left(x\right)\mathrm{,}{f}_{R}\left(x\right)\rangle}_{{\mathbb{R}}^{k}}-{\langle {e}_{u}\left(x\right)\mathrm{,}{f}_{u}\left(x\right)\rangle}_{{\mathbb{R}}^{m}}\mathrm{,}$

and thanks to the symmetry of $R$, (4) gives:

$\frac{\text{d}H}{\text{d}t}=-{\langle {f}_{R}\left(x\right)\mathrm{,}K\left(x\right){f}_{R}\left(x\right)\rangle}_{{\mathbb{R}}^{m}}-{\langle {e}_{u}\left(x\right)\mathrm{,}{f}_{u}\left(x\right)\rangle}_{{\mathbb{R}}^{m}}\mathrm{.}$

Finally, from (3) and the definition of the storage and interconnection ports, the power balance (2) is recovered.

The relation between (1) and (3)-(4) can be understood as follows: the power balance (2) is *encoded* in the Dirac structure (obtained from the extended structure operator
${J}_{e}$ ) together with the resistive constitutive relation.

Remark 1. *The canonical Euclidean inner product has been used here*,* but other inner products are allowed to take into account mass matrices *(*symmetric positive definite*)* on the left-hand side of *(1), (3),* and *(4)*. This is crucial after the spatial discretization procedure. This corresponds to a kernel representation of Dirac structure* [24].

System 1 is a pHs in canonical form. Recently, finite-dimensional differential algebraic port-Hamiltonian systems (pHDAE) have been introduced both for linear [26] and nonlinear systems [27]. This enriched description shares not only all the crucial features of ordinary pHs, but also easily accounts for algebraic constraints, time-dependent transformations and explicit dependence on time in the Hamiltonian. The application of the proposed discretization method naturally leads to pHDAEs. Indeed, a constitutive relation between ${f}_{x}\mathrm{:}=\frac{\text{d}x}{\text{d}t}$ and ${e}_{x}\mathrm{:}=\nabla H\left(x\right)$ is needed to be well-defined. But PFEM takes into account constitutive relations apart from (3) as constraints. However, as shown later in Sections 3.2 and 3.3, the method simplifies in the case, for instance, of linear hyperbolic systems.

2.2. Infinite-Dimensional Port-Hamiltonian Systems

In this section an infinite-dimensional generalization of pHs is presented. For sake of readability, the (Stokes-) Dirac structure is first defined, and secondly, infinite-dimensional pHs are then described in both hyperbolic and parabolic cases. A more general framework can be designed, but this goes beyond the aim of this present work.

Structure operator

As to avoid functional difficulties, the analogue of the extended structure operator will not be written as in (3). More precisely, the control operator will not be included in an extended structure unbounded operator, but given apart. The Stokes-Dirac will be then obtained thanks to a structure operator related to the boundary control operator through an abstract Green formula. However, like in finite dimension, the aim is to establish a link between flow and effort variables. Most importantly, the underlying Stokes-Dirac structure must encode the power balance of the dynamical system under study.

Consider a Lipschitz domain $\Omega \subset {\mathbb{R}}^{d}\mathrm{,}\text{\hspace{0.17em}}d\in \left\{\mathrm{1,2,3}\right\}$, and the relation:

$\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\begin{array}{l}{e}_{1}\in {H}^{\mathcal{L}}\mathrm{,}\hfill \\ {e}_{2}\in {H}^{-{\mathcal{L}}^{\mathrm{*}}},\hfill \end{array}$ (5)

with:

$\begin{array}{l}{H}^{\mathcal{L}}\mathrm{:}\left\{{e}_{1}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)\mathrm{\text{\hspace{0.17em}}}|\mathrm{\text{\hspace{0.17em}}}\mathcal{L}{e}_{1}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)\right\},\\ {H}^{-{\mathcal{L}}^{\mathrm{*}}}\mathrm{:}\left\{{e}_{2}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)\mathrm{\text{\hspace{0.17em}}}|\mathrm{\text{\hspace{0.17em}}}-{\mathcal{L}}^{\mathrm{*}}{e}_{2}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)\right\}.\end{array}$

By ${L}^{2}\left(\Omega \mathrm{,}\mathbb{X}\right)$ we denote the space of square integrable $\mathbb{X}$ -valued functions. Symbol $\mathbb{A}\mathrm{,}\mathbb{B}$ denote either the space of scalars $\mathbb{R}$, vectors ${\mathbb{R}}^{d}$, symmetric tensors ${\mathbb{R}}_{\text{sym}}^{d\times d}=\mathrm{:}\mathbb{S}$ or a Cartesian product of those, depending on the particular example. The operator $\mathcal{L}\mathrm{:}{H}^{\mathcal{L}}\to {L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)$ is a generic differential, and therefore linear but unbounded, operator. The notation ${\mathcal{L}}^{\mathrm{*}}\mathrm{:}{H}^{-{\mathcal{L}}^{\mathrm{*}}}\to {L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)$ denotes the formal adjoint of $\mathcal{L}$, defined by the relation:

${\langle \mathcal{L}{e}_{1}\mathrm{,}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}={\langle {e}_{1}\mathrm{,}{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\mathrm{,}\text{\hspace{1em}}{e}_{1}\in {C}_{0}^{\infty}\left(\Omega \mathrm{,}\mathbb{A}\right)\mathrm{,\text{\hspace{0.17em}}}{e}_{2}\in {C}_{0}^{\infty}\left(\Omega \mathrm{,}\mathbb{B}\right)\mathrm{.}$ (6)

Of course, for (5) to be well-defined, constitutive relations are needed. Only physical laws will be taken into account when constructing the above relation on concrete examples. As pointed out in the introduction, PFEM aims at both preserving this relation and discretizing constitutive laws to close the system.

Remark 2. *One can be confused by the lack of evolution in time in *(5)*. However*,* this emphasizes an important paradigm in the proposed point of view*:* this relation translates the time-independent geometric structure of the pHs as an equation with differential operator *(*ill-posed on its own*),* while constitutive relations will bring back the time dependency of the problem. In particular*,* some flows must be the time derivative of the energy variables.*

Throughout the paper,
${\langle \cdot \mathrm{,}\cdot \rangle}_{X}$ denotes the inner product of the Hilbert space *X*. Definition (6) is analogous to Definition 5.80 in [28]. In Section 3.2, the operator
$\mathcal{L}$ is the gradient, denoted by grad, and its formal adjoint is minus the divergence, denoted by -div, from the so-called Green’s formula (integration by parts). In Section 3.3, the operator
$\mathcal{L}$ contains both grad and Grad. This latter corresponds to the symmetric part of the gradient and represents the deformation tensor in continuum mechanics:

$\text{Grad}\left(e\right)\mathrm{:}=\frac{1}{2}\left(\nabla e+{\nabla}^{{\rm T}}e\right)\mathrm{,}\text{\hspace{1em}}e\in {C}^{\infty}\left({\mathbb{R}}^{d}\right)\mathrm{.}$

The formal adjoint of Grad is minus the tensor divergence -Div. For a tensor field $E\mathrm{:}\Omega \to \mathbb{M}\mathrm{:}={\mathbb{R}}^{d\times d}$, with components ${e}_{ij}$, the divergence is a vector, defined columnwise as:

$\text{Div}\left(E\right)\mathrm{:}={\left({\displaystyle \underset{i=1}{\overset{d}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\partial}_{{x}_{i}}{e}_{ij}\right)}_{j=\mathrm{1,}\cdots \mathrm{,}d}\mathrm{.}$

Finally, in Section 3.4, $\mathcal{L}$ is made of the gradient and the identity operator.

Stokes-Dirac structure

Definition 1 still remains valid in infinite dimension. Nevertheless, as stated above, the structure operator in (5) is not extended to include the control operator. Hence an additional assumption has to be made for
$\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]$ to define a Dirac structure in relation with a pHs coming from boundary control of partial differential equations. In other words, a Stokes-Dirac structure requires the specification of boundary variables in order to express a general power conservation property for *open* physical systems. This assumption is based on the so-called Stokes’ theorem (also known as the divergence theorem, Gauss’s theorem or Ostrogradsky’s theorem) and its corollaries, as the Green’s formula.

Assumption 1 (Abstract Green’s formula) *The** operator
$\mathcal{L}$ is assumed to satisfy the abstract Green*’*s formula*:

${\langle \mathcal{L}{e}_{1}\mathrm{,}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}-{\langle {e}_{1}\mathrm{,}{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}={\langle {\Gamma}_{0}{e}_{1},{\Gamma}_{\perp}{e}_{2}\rangle}_{{V}_{\partial}\mathrm{,}{\left({V}_{\partial}\right)}^{\prime}}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\forall \mathrm{}{e}_{1}\in {H}^{\mathcal{L}}\mathrm{,}{e}_{2}\in {H}^{-{\mathcal{L}}^{\mathrm{*}}}\mathrm{,}$ (7)

where the right-hand side is the duality bracket at the boundary, on a well-suited boundary functional space ${V}_{\partial}$ for some trace operators ${\Gamma}_{0}\mathrm{,}\text{\hspace{0.17em}}{\Gamma}_{\perp}$. From now on, this duality bracket will be denoted by ${\langle \cdot \mathrm{,}\cdot \rangle}_{\partial \Omega}$ with a slight abuse of notation.

Remark 3. *This abstract formula is well-known in the boundary control systems theory*,* see *e.g. ( [29], *Chapter *10)*.*

Remark 4. *In practice*,* Equation *(7)* dictates the causalities*,* i.e. the possible choices for the boundary control
${u}_{\partial}$ and the boundary observation
${y}_{\partial}$ *,* via the equality
${\langle {\Gamma}_{0}{e}_{1},{\Gamma}_{\perp}{e}_{2}\rangle}_{\partial \Omega}={\langle {u}_{\partial},{y}_{\partial}\rangle}_{\partial \Omega}$ *(*with a slight abuse of notation for the right-hand side to make sense*)*. Of course*,* the admissible causalities are also related to the well-posedness of the system under study*,* and in particular to the definitions of the boundary functional spaces.*

For sake of simplicity, a focus on the two following causalities will be made. Let the boundary variables associated to system (5) be defined by:

${e}_{\partial}={\Gamma}_{\perp}{e}_{2}\in {\left({V}_{\partial}\right)}^{\prime}\mathrm{,}\text{\hspace{1em}}{f}_{\partial}=-{\Gamma}_{0}{e}_{1}\in {V}_{\partial}\mathrm{,}$ (8)

or the other way:

${e}_{\partial}={\Gamma}_{0}{e}_{1}\in {V}_{\partial}\mathrm{,}\text{\hspace{1em}}{f}_{\partial}=-{\Gamma}_{\perp}{e}_{2}\in {\left({V}_{\partial}\right)}^{\prime}\mathrm{.}$ (9)

In light of (7), systems:

$\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\left(\begin{array}{c}{e}_{\partial}\\ {f}_{\partial}\end{array}\right)=\left[\begin{array}{cc}0& {\Gamma}_{\perp}\\ -{\Gamma}_{0}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}$ (10)

and:

$\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\left(\begin{array}{c}{e}_{\partial}\\ {f}_{\partial}\end{array}\right)=\left[\begin{array}{cc}{\Gamma}_{0}& 0\\ 0& -{\Gamma}_{\perp}\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}$ (11)

define Stokes-Dirac structures with respect to the bilinear pairing:

$\begin{array}{l}\langle \langle \left({f}_{1}^{1}\mathrm{,}{f}_{2}^{1}\mathrm{,}{f}_{\partial}^{1}\mathrm{,}{e}_{1}^{1}\mathrm{,}{e}_{2}^{1}\mathrm{,}{e}_{\partial}^{1}\right)\mathrm{,}\left({f}_{1}^{2}\mathrm{,}{f}_{2}^{2}\mathrm{,}{f}_{\partial}^{2}\mathrm{,}{e}_{1}^{2}\mathrm{,}{e}_{2}^{2}\mathrm{,}{e}_{\partial}^{2}\right)\rangle \rangle \\ ={\langle {f}_{1}^{1},{e}_{1}^{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}+{\langle {f}_{2}^{1},{e}_{2}^{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}+{\langle {f}_{1}^{2},{e}_{1}^{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}+{\langle {f}_{2}^{2},{e}_{2}^{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}+{\langle {f}_{\partial}^{1},{e}_{\partial}^{2}\rangle}_{\partial \Omega}+{\langle {f}_{\partial}^{2},{e}_{\partial}^{1}\rangle}_{\partial \Omega}\mathrm{.}\end{array}$

Obviously, for systems (10) and (11) to be well-defined, constitutive relations are needed.

In the remaining part of this section, only (10) will be treated in details. The other canonical causality (11), figuring in Section 3.4, straightforwardly follows with the same strategy.

Hyperbolic systems

In the hyperbolic case, both flows represent the dynamics of the independent energy variables
${\alpha}_{1}\mathrm{,}{\alpha}_{2}$. The Hamiltonian is a generic functional of these variables
$H=H\left({\alpha}_{1}\mathrm{,}{\alpha}_{2}\right)$. The co-energy variables are by definition the *variational** derivatives* (see e.g. [1] ) of *H* with respect to the energy variables:

${f}_{1}={\partial}_{t}{\alpha}_{1}\mathrm{,}\text{\hspace{1em}}{e}_{1}\mathrm{:}={\delta}_{{\alpha}_{1}}H\mathrm{,}\text{\hspace{1em}}{f}_{2}={\partial}_{t}{\alpha}_{2}\mathrm{,}\text{\hspace{1em}}{e}_{2}\mathrm{:}={\delta}_{{\alpha}_{2}}H\mathrm{.}$ (12)

Then system (10) possesses the equivalent state representation:

$\left(\begin{array}{c}{\partial}_{t}{\alpha}_{1}\\ {\partial}_{t}{\alpha}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{\delta}_{{\alpha}_{1}}H\\ {\delta}_{{\alpha}_{2}}H\end{array}\right)\mathrm{,}\text{\hspace{1em}}\left(\begin{array}{c}{u}_{\partial}\\ {y}_{\partial}\end{array}\right)=\left[\begin{array}{cc}0& {\Gamma}_{\perp}\\ {\Gamma}_{0}& 0\end{array}\right]\left(\begin{array}{c}{\delta}_{{\alpha}_{1}}H\\ {\delta}_{{\alpha}_{2}}H\end{array}\right)\mathrm{.}$ (13)

It holds ${u}_{\partial}={e}_{\partial}\mathrm{,}\text{\hspace{0.17em}}{y}_{\partial}=-{f}_{\partial}$. The power balance is naturally embedded in the Stokes-Dirac structure defined by (10):

$\frac{\text{d}}{\text{d}t}H\left({\alpha}_{1}\mathrm{,}{\alpha}_{2}\right)={\langle {y}_{\partial},{u}_{\partial}\rangle}_{\partial \Omega}\mathrm{.}$ (14)

Linear hyperbolic systems

The system is linear when the Hamiltonian has the form:

$H\left({\alpha}_{1}\mathrm{,}{\alpha}_{2}\right)=\frac{1}{2}{\langle {\alpha}_{1}\mathrm{,}{\mathcal{Q}}_{1}{\alpha}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}+\frac{1}{2}{\langle {\alpha}_{2}\mathrm{,}{\mathcal{Q}}_{2}{\alpha}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}\mathrm{,}$

where ${\mathcal{Q}}_{1}\mathrm{:}{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)\to {L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)$, ${\mathcal{Q}}_{2}\mathrm{:}{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)\to {L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)$ are positive symmetric operators, bounded from below and above:

${m}_{1}{I}_{\mathbb{A}}\preccurlyeq {\mathcal{Q}}_{1}\preccurlyeq {M}_{1}{I}_{\mathbb{A}}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{m}_{2}{I}_{\mathbb{B}}\preccurlyeq {\mathcal{Q}}_{2}\preccurlyeq {M}_{2}{I}_{\mathbb{B}}\mathrm{,}$

${m}_{1}>0,\mathrm{\text{\hspace{0.17em}}}{m}_{2}>0,\mathrm{\text{\hspace{0.17em}}}{M}_{1}>0,\mathrm{\text{\hspace{0.17em}}}{M}_{2}>\mathrm{0,}$

with ${I}_{\mathbb{A}}$ and ${I}_{\mathbb{B}}$ the identity operators in ${L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)$ and ${L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)$ respectively. In this case, the co-energy variables are given by:

${e}_{1}\mathrm{:}={\delta}_{{\alpha}_{1}}H={\mathcal{Q}}_{1}{\alpha}_{1}\mathrm{,}\text{\hspace{1em}}{e}_{2}\mathrm{:}={\delta}_{{\alpha}_{2}}H={\mathcal{Q}}_{2}{\alpha}_{2}\mathrm{.}$ (15)

Since ${\mathcal{Q}}_{1}\mathrm{,}\text{\hspace{0.05em}}{\mathcal{Q}}_{2}$ are positive and bounded from below and above, it is possible to invert them to obtain:

${\alpha}_{1}={\mathcal{Q}}_{1}^{-1}{e}_{1}=\mathrm{:}{\mathcal{M}}_{1}{e}_{1}\mathrm{,}\text{\hspace{1em}}{\alpha}_{2}={\mathcal{Q}}_{2}^{-1}{e}_{2}=\mathrm{:}{\mathcal{M}}_{2}{e}_{2}\mathrm{,}$ (16)

giving rise to the *co-energy formulation*. The Hamiltonian is rewritten as:

$H\left({e}_{1}\mathrm{,}{e}_{2}\right)=\frac{1}{2}{\langle {e}_{1}\mathrm{,}{\mathcal{M}}_{1}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}+\frac{1}{2}{\langle {e}_{2}\mathrm{,}{\mathcal{M}}_{2}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}$ (17)

and a linear hyperbolic pHs (10) can be expressed as:

$\left[\begin{array}{cc}{\mathcal{M}}_{1}& 0\\ 0& {\mathcal{M}}_{2}\end{array}\right]\left(\begin{array}{c}{\partial}_{t}{e}_{1}\\ {\partial}_{t}{e}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\left(\begin{array}{c}{u}_{\partial}\\ {y}_{\partial}\end{array}\right)=\left[\begin{array}{cc}0& {\Gamma}_{\perp}\\ {\Gamma}_{0}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{.}$ (18)

In this particular case, the constitutive relations needed for system (10) to be well-defined are given by (15), and then directly included in (18). In Sections 3.2 and 3.3, it will be shown that PFEM leads directly to a finite-dimensional pHs of the form (1) with $R\left(x\right)=0$. This simplification considerably facilitates the solution in time, as (1) is an Ordinary Differential Equation (ODE). Indeed, some dissipation phenomena will induce a differential-algebraic structure on the problem, for example dissipative effects due to an unbounded (e.g. elliptic) operator (see Remark 5).

Parabolic systems

In this case, the first flow ${f}_{1}$ still represents a dynamics ${\partial}_{t}{\alpha}_{1}$ of the energy variable ${\alpha}_{1}$. The Hamiltonian then reads $H=H\left({\alpha}_{1}\right)$, and its variational derivative gives the co-energy variable ${e}_{1}={\delta}_{{\alpha}_{1}}H$.

The second flow ${f}_{2}$ represents an extra flow related to the effort variable ${e}_{2}$ appearing in the dynamics of the energy variable ${\alpha}_{1}$. The relation is given implicitly by a mapping $\mathcal{G}$ as $\mathcal{G}\left({f}_{2}\mathrm{,}{e}_{2}\right)=0$. Then, pHs (10) of parabolic type is expressed as:

$\left(\begin{array}{c}{\partial}_{t}{\alpha}_{1}\\ {f}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{\mathcal{L}}^{\mathrm{*}}\\ \mathcal{L}& 0\end{array}\right]\left(\begin{array}{c}{\delta}_{{\alpha}_{1}}H\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\left(\begin{array}{c}{u}_{\partial}\\ {y}_{\partial}\end{array}\right)=\left[\begin{array}{cc}0& {\Gamma}_{\perp}\\ {\Gamma}_{0}& 0\end{array}\right]\left(\begin{array}{c}{\delta}_{{\alpha}_{1}}H\\ {e}_{2}\end{array}\right)\mathrm{,}\text{\hspace{1em}}\mathcal{G}\left({f}_{2}\mathrm{,}{e}_{2}\right)=0.$ (19)

In Section 3.4, an example of a parabolic-type pHs (11) is studied. It will be shown that the PFEM structure-preserving discretization of such a system naturally leads to a finite-dimensional pHDAE. Again, the power balance is naturally embedded in the Stokes-Dirac structure defined by (10):

$\frac{\text{d}}{\text{d}t}H\left({\alpha}_{1}\right)=-{\langle {f}_{2},{e}_{2}\rangle}_{{L}^{2}\left(\Omega \right)}+{\langle {y}_{\partial},{u}_{\partial}\rangle}_{\partial \Omega}\mathrm{.}$ (20)

In practice, this becomes explicit with the constitutive relation $\mathcal{G}\left({f}_{2}\mathrm{,}{e}_{2}\right)=0$ as it will be seen in Section 3.4 (and more generally in [9] [10] ). Note that this latter relation has to be accurately discretized to ensure that the discretized power balance mimics the continuous one.

Remark 5. *By adding resistive port*(*s*),* dissipation*(*s*)* can easily be taken into account *(*both internal or at the boundary*),* as done in the finite-dimensional case via
$R\left(x\right)$ playing the role of a output feedback gain matrix. In this case*,* the system becomes a parabolic system*,* the dissipative constitutive relation being represented by
$\mathcal{G}$. See* [30] [31] * for a detailed discussion about struc**ture-preserving discretization of dissipative systems.*

3. The Partitioned Finite Element Method (PFEM)

We are now in a position to introduce a general methodology to discretize infinite-dimensional pHs in a structure-preserving manner. The main contribution in this section is the application of PFEM to a general abstract class of pHs, unifying the previously published results. This generality is notably of particular interest for the development of a well-structured software for the numerical simulations of physics-based models. The power balances (14), (20) are deeply linked to a linear underlying Stokes-Dirac. The main idea of PFEM is to mimic this structure, in order to obtain a discretized copy of these power balances as (2). This systematically translates the Stokes-Dirac structure into a finite-dimensional Dirac structure. The compatible discretization, with respect to this Dirac structure, of the constitutive relations allows to mimic the continuous power-balance. This method goes under the name Partitioned Finite Element Method (PFEM), and was originally presented in [8]. The procedure is a natural extension of MFEM to pHs and boils down to these three simple steps:

1) System (5) is written in weak form;

2) The integration by parts (7) is carried out on a partition of the system (5) to make the appropriate boundary control appear;

3) A Galerkin method is employed to obtain a finite-dimensional system. For the approximation basis, the finite element method is used here but spectral methods can be chosen as well.

This strategy of structured discretization in order to mimic the continuous power balance at the discrete level has been addressed for closed abstract linear hyperbolic systems in [21]. This pioneering work already proposed the key point of PFEM: the integration by parts on a partition of the weak formulation of the system. The author called the obtained systems *primal-dual* or *dual-primal* formulation, depending on which line is integrated by parts. In the port-Hamiltonian formalism, systems are opened with control and observation. It appears that [21] admits PFEM as a generalization for structure-preserving space discretization. The choice of a control in the pHs community is called a *causality*, and *primal-dual* or *dual-primal* correspond in this work to the *canonical* causalities (10) and (11) respectively.

3.1. General Strategy

Consider smooth test functions ${v}_{1}$ and ${v}_{2}$ and the weak form of (5):

$\begin{array}{l}{\langle {v}_{1},{f}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}={\langle {v}_{1}\mathrm{,}-{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\mathrm{,}\\ {\langle {v}_{2},{f}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}={\langle {v}_{2}\mathrm{,}\mathcal{L}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}\mathrm{.}\end{array}$ (21)

Next the integration by parts is performed either on the first or on the second line (the system is *partitioned*), depending on the causality.

Integration by parts of the term ${\langle {v}_{1}\mathrm{,}-{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}$

In this case case, using (7), it is obtained:

$-{\langle {v}_{1},{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}=-{\langle \mathcal{L}{v}_{1}\mathrm{,}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}+{\langle {\Gamma}_{0}{v}_{1},{\Gamma}_{\perp}{e}_{2}\rangle}_{\partial \Omega}\mathrm{.}$

The boundary variable ${e}_{\partial}\mathrm{:}={\Gamma}_{\perp}{e}_{2}$ in (10) explicitly appears. Then the equation defining the corresponding ${f}_{\partial}\mathrm{:}={\Gamma}_{0}{e}_{1}$ is put into weak form to obtain the final system for all smooth test functions ${v}_{1}$, ${v}_{2}$, and ${v}_{\partial}$ :

$\begin{array}{l}{\langle {v}_{1},{f}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}=-{\langle \mathcal{L}{v}_{1}\mathrm{,}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}+{\langle {\Gamma}_{0}{v}_{1},{e}_{\partial}\rangle}_{\partial \Omega}\mathrm{,}\\ {\langle {v}_{2},{f}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}={\langle {v}_{2}\mathrm{,}\mathcal{L}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)},\\ {\langle {v}_{\partial},{f}_{\partial}\rangle}_{\partial \Omega}=-{\langle {v}_{\partial},{\Gamma}_{0}{e}_{1}\rangle}_{\partial \Omega}\mathrm{.}\end{array}$ (22)

Now, a Galerkin discretization is introduced. Test, energy and co-energy functions with the same subscript are discretized using the same basis, for all $t\ge 0$ :

$\begin{array}{l}{\square}_{1}\left(t\mathrm{,}x\right)\approx \text{\hspace{0.17em}}{\square}_{1}^{d}\left(t\mathrm{,}x\right)\mathrm{:}={\displaystyle \underset{i=1}{\overset{{N}_{1}}{\sum}}}\text{\hspace{0.17em}}{\phi}_{1}^{i}\left(x\right)\text{\hspace{0.17em}}{\square}_{1}^{i}\left(t\right)\mathrm{,}\text{\hspace{1em}}\forall x\in \Omega \mathrm{,}\\ {\square}_{2}\left(t\mathrm{,}x\right)\approx \text{\hspace{0.17em}}{\square}_{2}^{d}\left(t\mathrm{,}x\right)\mathrm{:}={\displaystyle \underset{i=1}{\overset{{N}_{2}}{\sum}}}\text{\hspace{0.17em}}{\phi}_{2}^{i}\left(x\right)\text{\hspace{0.17em}}{\square}_{2}^{i}\left(t\right)\mathrm{,}\text{\hspace{1em}}\forall x\in \Omega \mathrm{,}\\ {\square}_{\partial}\left(t\mathrm{,}s\right)\approx \text{\hspace{0.17em}}{\square}_{\partial}^{d}\left(t\mathrm{,}s\right)\mathrm{:}={\displaystyle \underset{i=1}{\overset{{N}_{\partial}}{\sum}}}\text{\hspace{0.17em}}{\psi}_{\partial}^{i}\left(s\right)\text{\hspace{0.17em}}{\square}_{\partial}^{i}\left(t\right)\mathrm{,}\text{\hspace{1em}}\forall s\in \partial \Omega \mathrm{,}\end{array}$ (23)

where
$\square $ stands for *v*, *f*, and *e* and
${\phi}_{1}^{i}\in {H}^{\mathcal{L}}$,
${\phi}_{2}^{i}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)$, and
${\psi}_{\partial}^{i}\in {L}^{2}\left(\partial \Omega \mathrm{,}{\mathbb{R}}^{m}\right)$.

Remark 6. *In general*,* a discretization in the same basis of either
$\left({f}_{1}\mathrm{,}{e}_{1}\right)$ and
$\left({f}_{2}\mathrm{,}{e}_{2}\right)$ or
$\left({f}_{1}\mathrm{,}{f}_{2}\right)$ and
$\left({e}_{1}\mathrm{,}{e}_{2}\right)$ *(*as done in* [16] )* must be performed. The former is our choice since it directly leads to square mass matrices*,* while the latter may be more appropriate when dealing for instance with Maxwell*’*s equations for electromagnetics*,* see* [32] * and references therein for details on the difficulties that may then occur.*

Then plugging the approximations into (22), it is computed:

$\left[\begin{array}{ccc}{M}_{1}& 0& 0\\ 0& {M}_{2}& 0\\ 0& 0& {M}_{\partial}\end{array}\right]\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\\ {f}_{\partial}\end{array}\right)=\left[\begin{array}{ccc}0& -{D}_{\mathcal{L}}^{{\rm T}}& {B}_{\perp}\\ {D}_{\mathcal{L}}& 0& 0\\ -{B}_{\perp}^{{\rm T}}& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\\ {e}_{\partial}\end{array}\right)\mathrm{,}$ (24)

where vectors ${f}_{1}$, ${f}_{2}$, ${e}_{1}$, ${e}_{2}$, ${f}_{\partial}$, and ${e}_{\partial}$ are given by the column-wise concatenation of the respective degrees of freedom of ${f}_{1}^{d}$, ${f}_{2}^{d}$, ${e}_{1}^{d}$, ${e}_{2}^{d}$, ${f}_{\partial}^{d}$, and ${e}_{\partial}^{d}$, and where the matrices are defined as follows:

$\begin{array}{l}{M}_{1}^{ij}={\langle {\phi}_{1}^{i},{\phi}_{1}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\mathrm{,}\hfill \\ {M}_{2}^{mn}={\langle {\phi}_{2}^{m},{\phi}_{2}^{n}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}\mathrm{,}\hfill \\ {M}_{\partial}^{lk}={\langle {\psi}_{\partial}^{l}\mathrm{,}{\psi}_{\partial}^{k}\rangle}_{\partial \Omega}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{D}_{\mathcal{L}}^{mi}={\langle {\phi}_{2}^{m}\mathrm{,}\mathcal{L}{\phi}_{1}^{i}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}\mathrm{,}\hfill \\ {B}_{\perp}^{ik}={\langle {\Gamma}_{0}{\phi}_{1}^{i}\mathrm{,}{\psi}_{\partial}^{k}\rangle}_{\partial \Omega}\mathrm{,}\hfill \end{array}$ (25)

where $1\le i\mathrm{,}j\le {N}_{1}$, $1\le m\mathrm{,}n\le {N}_{2}$, and $1\le l\mathrm{,}k\le {N}_{\partial}$. System (24) is a kernel representation of a Dirac structure as in (3) (see Remark 1).

Remark 7. *Note that matrices
${D}_{\mathcal{L}}$ and
${B}_{\perp}$ are not square.*

The discrete Hamiltonian is naturally defined as the continuous one evaluated in the discrete energy variables. As done in Section 2, it is easier to distinguish the linear hyperbolic from the parabolic case.

Hyperbolic case

In this setting, the flows ${f}_{i}$, $i=\mathrm{1,2}$, are given by the time derivative of the energy variables ${\alpha}_{i}$. Hence, the discretization of these energy variables is given by:

${\alpha}_{i}^{d}\left(t\mathrm{,}x\right)={\alpha}_{i}^{d}\left(\mathrm{0,}x\right)+{\displaystyle {\int}_{0}^{t}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{f}_{i}^{d}\left(s\mathrm{,}x\right)\text{d}s\mathrm{,}\text{\hspace{1em}}i=\mathrm{1,2.}$

The discrete Hamiltonian is then defined by ${H}^{d}\left({\underset{\_}{\alpha}}_{1}\mathrm{,}{\underset{\_}{\alpha}}_{2}\right)\mathrm{:}=H\left({\alpha}_{1}^{d}\mathrm{,}{\alpha}_{2}^{d}\right)$, where ${\underset{\_}{\alpha}}_{1}$ and ${\underset{\_}{\alpha}}_{2}$ are the column-wise concatenation of the time varying coefficients of ${\alpha}_{1}^{d}$ and ${\alpha}_{2}^{d}$ in their respective basis.

Definition 2. *The discretization of the constitutive relations is said to be compatible if and only if*:

$\nabla {H}^{d}=\left(\begin{array}{c}{\nabla}_{{\underset{\_}{\alpha}}_{1}}{H}^{d}\\ {\nabla}_{{\underset{\_}{\alpha}}_{2}}{H}^{d}\end{array}\right)=\left[\begin{array}{cc}{M}_{1}& 0\\ 0& {M}_{2}\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{.}$

Proposition 1. *If the discretisation of the constitutive relations is compatible*,* the discrete power balance reads at the discrete level*:

$\frac{\text{d}}{\text{d}t}{H}^{d}=-{\left({e}_{\partial}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{\partial}{f}_{\partial}\mathrm{,}$

which perfectly mimics the continuous identity.

Proof 1. *A straightforward computation gives*:

$\begin{array}{c}\frac{\text{d}}{\text{d}t}{H}^{d}={\left({\nabla}_{{\underset{\_}{\alpha}}_{1}}{H}^{d}\right)}^{{\rm T}}{\underset{\_}{\stackrel{\dot{}}{\alpha}}}_{1}+{\left({\nabla}_{{\underset{\_}{\alpha}}_{2}}{H}^{d}\right)}^{{\rm T}}{\underset{\_}{\stackrel{\dot{}}{\alpha}}}_{2}\\ ={\left({M}_{1}{e}_{1}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{f}_{1}+{\left({M}_{2}{e}_{2}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{f}_{2}\\ ={\left({e}_{1}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{1}{f}_{1}+{\left({e}_{2}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{2}{f}_{2}\\ =-{\left({e}_{\partial}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{\partial}{f}_{\partial}\mathrm{,}\end{array}$

where the symmetry of the mass matrices and the Dirac structure have been used.

Remark 8. *In the special case of linear hyperbolic systems*,* it has been seen that the co-energy formulation allows to take the constitutive relations into account directly in the differential equations. Applying PFEM to *(18)* then leads to an *ODE,* and the constitutive relations are then automatically discretized in a compatible manner.*

Parabolic case

In this setting, only the flow ${f}_{1}$ is the time derivative of the energy variable ${\alpha}_{1}$. This energy variable is discretized as in the hyperbolic case. The discrete Hamiltonian is then defined by ${H}^{d}\left({\underset{\_}{\alpha}}_{1}\right)\mathrm{:}=H\left({\alpha}_{1}^{d}\right)$.

Definition 3. *The discretization of the constitutive relation is said to be compatible if and only if*:*
$\nabla {H}^{d}={M}_{1}{e}_{1}$.*

Proposition 2. *If the discretisation of the constitutive relations is compatible*,* the discrete power balance reads at the discrete level*:

$\frac{\text{d}}{\text{d}t}{H}^{d}=-{e}_{2}^{{\rm T}}{M}_{2}{f}_{2}-{e}_{\partial}^{{\rm T}}{M}_{\partial}{f}_{\partial}\mathrm{,}$

which perfectly mimics the continuous identity.

Proof 2. *The proof can be derived similarly as in the hyperbolic case.*

Remark 9. *Of course*,* an accurate discretization of the implicit constitutive relation
$\mathcal{G}\left({f}_{2}\mathrm{,}{e}_{2}\right)=0$ is also required to conclude. This will be illustrated in Section *3*.*4*.*

Integration by parts of the term ${\langle {v}_{2},\mathcal{L}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}$

Using (7), it comes:

${\langle {v}_{2},\mathcal{L}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}={\langle {\mathcal{L}}^{\mathrm{*}}{v}_{2},{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}+{\langle {\Gamma}_{\perp}{v}_{2},{\Gamma}_{0}{e}_{1}\rangle}_{\partial \Omega}\mathrm{.}$

Now the boundary variable
${e}_{\partial}\mathrm{:}={\Gamma}_{0}{e}_{1}$ explicitly appears, *i.e.* the causality considered in (11). The weak formulation then reads:

$\begin{array}{l}{\langle {v}_{1}\mathrm{,}{f}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}=-{\langle {v}_{1}\mathrm{,}{\mathcal{L}}^{\mathrm{*}}{e}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\mathrm{,}\\ {\langle {v}_{2}\mathrm{,}{f}_{2}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{B}\right)}={\langle {\mathcal{L}}^{\mathrm{*}}{v}_{2}\mathrm{,}{e}_{1}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}-{\langle {\Gamma}_{\perp}{v}_{2}\mathrm{,}{e}_{\partial}\rangle}_{\partial \Omega}\mathrm{,}\\ {\langle {v}_{\partial}\mathrm{,}{f}_{\partial}\rangle}_{\partial \Omega}={\langle {v}_{\partial}\mathrm{,}{\Gamma}_{\perp}{e}_{2}\rangle}_{\partial \Omega}\mathrm{.}\end{array}$ (26)

Plugging the approximations (23) into (26), this time with ${\phi}_{1}^{i}\in {L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)$, ${\phi}_{2}^{i}\in {H}^{-{\mathcal{L}}^{\mathrm{*}}}$, and ${\psi}_{\partial}^{i}\in {L}^{2}\left(\partial \Omega \mathrm{,}{\mathbb{R}}^{m}\right)$, gives the following kernel representation of a finite-dimensional Dirac structure:

$\left[\begin{array}{ccc}{M}_{1}& 0& 0\\ 0& {M}_{2}& 0\\ 0& 0& {M}_{\partial}\end{array}\right]\left(\begin{array}{c}{f}_{1}\\ {f}_{2}\\ {f}_{\partial}\end{array}\right)=\left[\begin{array}{ccc}0& {D}_{-{\mathcal{L}}^{\mathrm{*}}}& 0\\ -{D}_{-{\mathcal{L}}^{\mathrm{*}}}^{{\rm T}}& 0& {B}_{0}\\ 0& -{B}_{0}^{{\rm T}}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\\ {e}_{\partial}\end{array}\right)\mathrm{,}$ (27)

where the matrices ${D}_{-{\mathcal{L}}^{\mathrm{*}}}$ and ${B}_{0}$ are defined by:

${D}_{-{\mathcal{L}}^{\mathrm{*}}}^{im}={\langle {\phi}_{1}^{i}\mathrm{,}-{\mathcal{L}}^{\ast}{\phi}_{2}^{m}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{A}\right)}\mathrm{,}\text{\hspace{1em}}{B}_{0}^{mk}={\langle {\Gamma}_{\perp}{\phi}_{2}^{m}\mathrm{,}{\psi}_{\partial}^{k}\rangle}_{\partial \Omega}\mathrm{.}$ (28)

The power balances proven above still hold true with this causality, where the role played by ${e}_{\partial}$ and ${f}_{\partial}$ have been switched.

In the sequel, this methodology is applied to the wave equation, the Mindlin-Reissner plate model and the heat equation. These models have been chosen to demonstrate the versatility of our methodology. The wave equation is the prototype of linear hyperbolic systems, and the first example treated by PFEM [8]. The Mindlin model combines wave dynamics and plane elastodynamics, and requires the introduction of tensor-valued variables. Finally, the heat equation is the prototype of parabolic systems, and leads to a pHs with intrinsic algebraic constraint, namely, to a pHDAE.

3.2. The Wave Equation

The wave equation is a well-known model, used as the first example of linear hyperbolic systems in many lecture notes and books. This work is no exception to the rule. However, to account for more realistic physics, let us consider the heterogeneous and anisotropic multidimensional wave equation. The equation reads (see [33] ):

$\rho \frac{{\partial}^{2}w}{\partial {t}^{2}}=\text{div}\left(\mathcal{T}\text{\hspace{0.05em}}\text{grad}\left(w\right)\right)\mathrm{,}\text{\hspace{1em}}\left(x\mathrm{,}t\right)\in \Omega \times \left[\mathrm{0,}{t}_{\text{end}}\right]\mathrm{,}\text{\hspace{1em}}\Omega \subset {\mathbb{R}}^{N}\mathrm{,}$ (29)

where
$\rho $ is the mass density (bounded from above and below),
$\mathcal{T}$ is the *tensorial* Young modulus (symmetric and positive definite) and *w* is the deflection from the equilibrium.

Let us denote ${\alpha}_{p}\mathrm{:}=\rho \frac{\partial w}{\partial t}$ the linear momentum and ${\alpha}_{q}\mathrm{:}=\text{grad}\left(w\right)$ the

strain, as energy variables. Hence the Hamiltonian is given as the total energy (summing kinetic and potential energies) by:

$H=\frac{1}{2}{\displaystyle {\int}_{\Omega}}\left\{\frac{{\alpha}_{p}^{2}}{\rho}+{\alpha}_{q}\cdot \left(\mathcal{T}{\alpha}_{q}\right)\right\}\text{d}\Omega \mathrm{.}$ (30)

The co-energy variables are by definition the variational derivatives of *H* with respect to the energy variables, *i.e.*:

${e}_{p}:={\delta}_{{\alpha}_{p}}H=\frac{{\alpha}_{p}}{\rho}=wt,\text{\hspace{1em}}{e}_{q}:={\delta}_{{\alpha}_{q}}H=\mathcal{T}{\alpha}_{q}=\mathcal{T}\text{\hspace{0.05em}}\text{grad}\left(w\right),$ (31)

the velocity and stress. With these notations, Equation (29) rewrites:

$\frac{\partial}{\partial t}\left(\begin{array}{c}{\alpha}_{p}\\ {\alpha}_{q}\end{array}\right)=\left[\begin{array}{cc}0& \text{div}\\ \text{grad}& 0\end{array}\right]\left(\begin{array}{c}{e}_{p}\\ {e}_{q}\end{array}\right)\mathrm{,}$ (32)

together with the constitutive relations given in (31).

Let us denote:

${e}_{1}\mathrm{:}={e}_{p}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{e}_{2}\mathrm{:}={e}_{q}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\mathcal{M}}_{1}\mathrm{:}=\rho \mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\mathcal{M}}_{2}\mathrm{:}={\mathcal{T}}^{-1}\mathrm{,}$

$\mathcal{L}\mathrm{:}=\text{grad}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\Gamma}_{\perp}\mathrm{:}={\gamma}_{\perp}={\gamma}_{0}\cdot n\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\Gamma}_{0}\mathrm{:}={\gamma}_{0}\mathrm{,}$

where ${\gamma}_{0}$ is the Dirichlet trace operator. Then the Hamiltonian (30) rewrites as (17). The wave equation (29) with Neumann boundary control ${u}_{\partial}={\gamma}_{\perp}\left({e}_{q}\right)$ is given by (18).

The application of PFEM directly gives:

$\begin{array}{l}\left[\begin{array}{cc}{M}_{\rho}& 0\\ 0& {M}_{{\mathcal{T}}^{-1}}\end{array}\right]\frac{\text{d}}{\text{d}t}\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)=\left[\begin{array}{cc}0& -{D}_{\text{grad}}^{{\rm T}}\\ {D}_{\text{grad}}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)+\left[\begin{array}{c}{B}_{\perp}\\ 0\end{array}\right]{u}_{\partial}\\ {M}_{\partial}{y}_{\partial}=\left[\begin{array}{cc}{B}_{\perp}^{{\rm T}}& 0\end{array}\right]\left(\begin{array}{c}{e}_{1}\\ {e}_{2}\end{array}\right)\mathrm{,}\end{array}$ (33)

where:

${M}_{\rho}^{ij}\mathrm{:}={\langle {\phi}_{1}^{i}\mathrm{,}\rho \text{\hspace{0.05em}}{\phi}_{1}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{R}\right)}\mathrm{,}\text{\hspace{1em}}{M}_{{\mathcal{T}}^{-1}}^{kl}\mathrm{:}={\langle {\phi}_{2}^{k}\mathrm{,}{\mathcal{T}}^{-1}{\phi}_{2}^{l}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{N}\right)}\mathrm{,}$

are the discretizations of the operators ${\ufffd}_{1}$ and ${\ufffd}_{2}$ respectively.

3.3. The Mindlin Plate Model

The Mindlin model is a generalization to the 2D case of the Timoshenko beam model and is expressed by a system of two coupled PDEs (see [34] ):

$(\begin{array}{l}\rho b\frac{{\partial}^{2}w}{\partial {t}^{2}}=\text{div}\left(q\right)+f\mathrm{,}\text{\hspace{1em}}\left(x\mathrm{,}t\right)\in \Omega \times \left[\mathrm{0,}{t}_{\text{end}}\right]\mathrm{,}\text{\hspace{1em}}\Omega \subset {\mathbb{R}}^{2}\mathrm{,}\\ \frac{\rho {b}^{3}}{12}\frac{{\partial}^{2}\theta}{\partial {t}^{2}}=q+\text{Div}\left(M\right)+t\mathrm{,}\end{array}$ (34)

where
$\rho $ is the mass density, *b* the plate thickness, *w* the vertical displacement,
$\theta ={\left({\theta}_{x}\mathrm{,}{\theta}_{y}\right)}^{{\rm T}}$ collects the deflection of the cross section along axes *x* and *y* respectively. The fields
$f\mathrm{,}\tau $ represent distributed forces and torques. Variables
$M\mathrm{,}q$ represent the momenta tensor and the shear stress. Hooke’s law relates those to the curvature tensor and shear deformation vector:

$\begin{array}{l}M\mathrm{:}={\mathcal{D}}_{b}K\in \mathbb{S}\mathrm{,}\hfill \\ q\mathrm{:}={D}_{s}\gamma \mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}K\mathrm{:}=\text{Grad}\left(\theta \right)\in \mathbb{S}\mathrm{,}\hfill \\ \gamma \mathrm{:}=\text{grad}\left(w\right)-\theta \mathrm{.}\hfill \end{array}$

${D}_{s}\mathrm{:}=\frac{{E}_{Y}b{K}_{\text{sh}}}{2\left(1+\nu \right)}$ is the shear rigidity coefficient, where ${E}_{Y}$ is the Young modulus, $\nu $ is the Poisson modulus, ${K}_{\text{sh}}$ is the shear correction factor. Tensor ${\mathcal{D}}_{b}$ is the bending stiffness:

${\mathcal{D}}_{b}(\cdot )=\frac{{E}_{Y}{b}^{3}}{12\left(1-{\nu}^{2}\right)}\left[\left(1-\nu \right)(\cdot )+\nu \text{Tr}(\cdot )\right]\mathrm{.}$ (35)

An appropriate selection of the energy variables is the following [7] [35]:

${\alpha}_{w}=\rho b{\partial}_{t}w\mathrm{,}\text{\hspace{1em}}{\alpha}_{\theta}\mathrm{:}=\frac{\rho {b}^{3}}{12}{\partial}_{t}\theta \mathrm{,}\text{\hspace{1em}}{A}_{\kappa}\mathrm{:}=K\mathrm{,}\text{\hspace{1em}}{\alpha}_{\gamma}\mathrm{:}=\gamma \mathrm{.}$ (36)

The Hamiltonian *H* (total energy) is expressed in terms of energy variables as:

$H=\frac{1}{2}{\displaystyle {\int}_{\Omega}}\left\{\frac{1}{\rho b}{\alpha}_{w}^{2}+\frac{12}{\rho {b}^{3}}{\Vert {\alpha}_{\theta}\Vert}^{2}+{A}_{\kappa}:\left({\mathcal{D}}_{b}{A}_{\kappa}\right)+{D}_{s}{\Vert {\alpha}_{\gamma}\Vert}^{2}\right\}\Omega \mathrm{,}$ (37)

where $A:B$ denotes the tensor contraction. The co-energy variables are defined as follows:

$\begin{array}{l}{e}_{w}\mathrm{:}={\delta}_{{\alpha}_{w}}H={\partial}_{t}w\mathrm{,}\text{\hspace{1em}}{e}_{\theta}\mathrm{:}={\delta}_{{\alpha}_{\theta}}H={\partial}_{t}\theta \mathrm{,}\\ {E}_{\kappa}\mathrm{:}={\delta}_{{A}_{\kappa}}H=M\mathrm{,}\text{\hspace{1em}}{e}_{\gamma}\mathrm{:}={\delta}_{{\alpha}_{\gamma}}H=q\mathrm{.}\end{array}$ (38)

System (34) is then expressed in port-Hamiltonian form as [7] (forces and torques have been omitted for simplicity):

$\frac{\partial}{\partial t}\left(\begin{array}{c}{\alpha}_{w}\\ {\alpha}_{\theta}\\ {A}_{\kappa}\\ {\alpha}_{\gamma}\end{array}\right)=\left[\begin{array}{cccc}0& 0& 0& \text{div}\\ 0& 0& \text{Div}& {I}_{2\times 2}\\ 0& \text{Grad}& 0& 0\\ \text{grad}& -{I}_{2\times 2}& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{w}\\ {e}_{\theta}\\ {E}_{\kappa}\\ {e}_{\gamma}\end{array}\right)\mathrm{.}$ (39)

By applying the divergence theorem, the energy rate is expressed as the duality product of the boundary variables:

$\begin{array}{c}\frac{\text{d}H}{\text{d}t}={\langle {\partial}_{t}{\alpha}_{w}\mathrm{,}{e}_{w}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{R}\right)}+{\langle {\partial}_{t}{\alpha}_{\theta}\mathrm{,}{e}_{\theta}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\\ \text{\hspace{0.17em}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}+{\langle {\partial}_{t}{A}_{\kappa}\mathrm{,}{E}_{\kappa}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{S}\right)}+{\langle {\partial}_{t}{\alpha}_{\gamma}\mathrm{,}{e}_{\gamma}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\mathrm{,}\\ ={\langle {\gamma}_{0}{e}_{w}\mathrm{,}{\gamma}_{\perp}{e}_{\gamma}\rangle}_{\partial \Omega}+{\langle {\gamma}_{0}{e}_{\theta}\mathrm{,}{\gamma}_{\perp}{E}_{\kappa}\rangle}_{\partial \Omega}\\ ={\langle {y}_{\partial \mathrm{,1}}\mathrm{,}{u}_{\partial \mathrm{,1}}\rangle}_{\partial \Omega}+{\langle {y}_{\partial \mathrm{,2}}\mathrm{,}{u}_{\partial \mathrm{,2}}\rangle}_{\partial \Omega}\mathrm{,}\end{array}$ (40)

where:

$\begin{array}{l}{u}_{\partial \mathrm{,1}}={\gamma}_{\perp}{e}_{\gamma}\mathrm{,}\hfill \\ {u}_{\partial \mathrm{,2}}={\gamma}_{\perp}{E}_{\kappa}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{y}_{\partial \mathrm{,1}}={\gamma}_{0}{e}_{w}\mathrm{,}\hfill \\ {y}_{\partial \mathrm{,2}}={\gamma}_{0}{e}_{\theta}\mathrm{.}\hfill \end{array}$

The traces ${\gamma}_{0}u={u|}_{\partial \Omega}\mathrm{,}\text{\hspace{0.17em}}{\gamma}_{\perp}U={U\cdot n|}_{\partial \Omega}$ correspond to the Dirichlet trace for ${\mathbb{R}}^{d}$ vectors and to the normal trace for ${\mathbb{R}}^{d\times d}$ tensors. The mass operators are given by:

${\mathcal{M}}_{1}=\left[\begin{array}{cc}\rho b& 0\\ 0& \frac{\rho {b}^{3}}{12}\end{array}\right]\mathrm{,}\text{\hspace{1em}}{\mathcal{M}}_{2}=\left[\begin{array}{cc}{\mathcal{D}}_{b}^{-1}& 0\\ 0& {D}_{s}^{-1}\end{array}\right]\mathrm{.}$ (41)

The $\mathcal{L}$, ${\Gamma}_{0}$, and ${\Gamma}_{\perp}$ operators are:

$\mathcal{L}=\left[\begin{array}{cc}0& \text{Grad}\\ \text{grad}& -{I}_{2\times 2}\end{array}\right]\mathrm{,}\text{\hspace{1em}}{\Gamma}_{0}=\left[\begin{array}{cc}{\gamma}_{0}& 0\\ 0& {\gamma}_{0}\end{array}\right]\mathrm{,}\text{\hspace{1em}}{\Gamma}_{\perp}=\left[\begin{array}{cc}0& {\gamma}_{\perp}\\ {\gamma}_{\perp}& 0\end{array}\right]\mathrm{.}$ (42)

Introducing the approximations for the test and co-energy variables:

$\begin{array}{l}{\Delta}_{w}={\displaystyle \underset{i=1}{\overset{{N}_{w}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\varphi}_{w}^{i}{\Delta}_{w}^{i}\mathrm{,}\text{\hspace{1em}}{\Delta}_{\theta}={\displaystyle \underset{i=1}{\overset{{N}_{\theta}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\varphi}_{\theta}^{i}{\Delta}_{\theta}^{i}\mathrm{,}\\ {\Delta}_{\kappa}={\displaystyle \underset{i=1}{\overset{{N}_{\kappa}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\Phi}_{\kappa}^{i}{\Delta}_{\kappa}^{i}\mathrm{,}\text{\hspace{1em}}{\Delta}_{\gamma}={\displaystyle \underset{i=1}{\overset{{N}_{\gamma}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\varphi}_{\gamma}^{i}{\Delta}_{\gamma}^{i}\mathrm{,}\end{array}$ (43)

where $\Delta =\left\{v\mathrm{,}\text{\hspace{0.05em}}e\right\}$, and for the boundary controls:

$\begin{array}{l}{\square}_{\partial \mathrm{,1}}\text{\hspace{0.17em}}={\displaystyle \underset{i=1}{\overset{{N}_{\partial \mathrm{,1}}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\psi}_{\partial \mathrm{,1}}^{i}{\square}_{\partial \mathrm{,1}}^{i}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\square}_{\partial \mathrm{,2}}\text{\hspace{0.17em}}={\displaystyle \underset{i=1}{\overset{{N}_{\partial \mathrm{,2}}}{\sum}}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}{\psi}_{\partial \mathrm{,2}}^{i}{\square}_{\partial \mathrm{,2}}^{i}\mathrm{,}\\ \square \text{\hspace{0.17em}}=\left\{v\mathrm{,}u\mathrm{,}y\right\}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\psi}_{\partial \mathrm{,1}}^{i}\in \mathbb{R}\mathrm{,}\text{\hspace{0.17em}}\text{\hspace{0.17em}}{\psi}_{\partial \mathrm{,2}}^{i}\in {\mathbb{R}}^{2}\mathrm{,}\end{array}$ (44)

PFEM can be applied to obtain:

$\begin{array}{l}\text{Diag}\left[\begin{array}{c}{M}_{\rho h}\\ {M}_{{I}_{\theta}}\\ {M}_{{\mathcal{D}}_{b}^{-1}}\\ {M}_{{D}_{s}^{-1}}\end{array}\right]\left(\begin{array}{c}{\stackrel{\dot{}}{e}}_{w}\\ {\stackrel{\dot{}}{e}}_{\theta}\\ {\stackrel{\dot{}}{e}}_{\kappa}\\ {\stackrel{\dot{}}{e}}_{\gamma}\end{array}\right)=\left[\begin{array}{cccc}0& 0& 0& -{D}_{\text{grad}}^{{\rm T}}\\ 0& 0& -{D}_{\text{Grad}}^{{\rm T}}& -{D}_{0}^{{\rm T}}\\ 0& {D}_{\text{Grad}}& 0& 0\\ {D}_{\text{grad}}& {D}_{0}& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{w}\\ {e}_{\theta}\\ {e}_{\kappa}\\ {e}_{\gamma}\end{array}\right)\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}+\left[\begin{array}{cc}{B}_{\perp \mathrm{,}w}& 0\\ 0& {B}_{\perp \mathrm{,}\theta}\\ 0& 0\\ 0& 0\end{array}\right]\left(\begin{array}{c}{u}_{\partial \mathrm{,1}}\\ {u}_{\partial \mathrm{,2}}\end{array}\right)\mathrm{,}\\ \text{Diag}\left[\begin{array}{c}{M}_{\partial \mathrm{,1}}\\ {M}_{\partial \mathrm{,2}}\end{array}\right]\left(\begin{array}{c}{y}_{\partial \mathrm{,1}}\\ {y}_{\partial \mathrm{,2}}\end{array}\right)=\left[\begin{array}{cccc}{B}_{\perp \mathrm{,}w}^{{\rm T}}& 0& 0& 0\\ 0& {B}_{\perp \mathrm{,}\theta}^{{\rm T}}& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{w}\\ {e}_{\theta}\\ {e}_{\kappa}\\ {e}_{\gamma}\end{array}\right)\mathrm{.}\end{array}$ (45)

The notation Diag denotes a block diagonal matrix. The mass matrices ${M}_{\rho h}\mathrm{,}{M}_{{I}_{\theta}}\mathrm{,}{M}_{{\mathcal{C}}_{b}}\mathrm{,}{M}_{{C}_{s}}$ are computed as:

$\begin{array}{l}{M}_{\rho h}^{ij}={\langle {\varphi}_{w}^{i}\mathrm{,}\rho h{\varphi}_{w}^{j}\rangle}_{{L}^{2}\left(\Omega \right)}\mathrm{,}\hfill \\ {M}_{{I}_{\theta}}^{mn}={\langle {\varphi}_{\kappa}^{m}\mathrm{,}{I}_{\theta}{\varphi}_{\kappa}^{n}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{M}_{{\mathcal{D}}_{b}^{-1}}^{pq}={\langle {\Phi}_{\kappa}^{p}\mathrm{,}{\mathcal{D}}_{b}^{-1}{\Phi}_{\kappa}^{q}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}_{\text{sym}}^{2\times 2}\right)}\mathrm{,}\hfill \\ {M}_{{D}_{s}^{-1}}^{rs}={\langle {\varphi}_{\gamma}^{r}\mathrm{,}{D}_{s}^{-1}{\varphi}_{\gamma}^{s}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\mathrm{,}\hfill \end{array}$ (46)

where $i\mathrm{,}j\in \left\{\mathrm{1,}{N}_{w}\right\}\mathrm{,}\text{\hspace{0.17em}}m\mathrm{,}n\in \left\{\mathrm{1,}{N}_{\theta}\right\}\mathrm{,}\text{\hspace{0.17em}}p\mathrm{,}q\in \left\{\mathrm{1,}{N}_{\kappa}\right\}\mathrm{,}\text{\hspace{0.17em}}r\mathrm{,}s\in \left\{\mathrm{1,}{N}_{\gamma}\right\}$. Matrices ${D}_{\text{grad}}\mathrm{,}{D}_{\text{Grad}}\mathrm{,}{D}_{0}$ assume the form:

$\begin{array}{l}{D}_{\text{grad}}^{rj}={\langle {\varphi}_{\gamma}^{r}\mathrm{,}\text{grad}{\varphi}_{w}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\mathrm{,}\hfill \\ {D}_{\text{Grad}}^{pn}={\langle {\Phi}_{\kappa}^{p}\mathrm{,}\text{Grad}{\varphi}_{\theta}^{n}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}_{\text{sym}}^{2\times 2}\right)}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}{D}_{0}^{rn}=-{\langle {\varphi}_{\gamma}^{r}\mathrm{,}{\varphi}_{\theta}^{n}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{2}\right)}\mathrm{.}$ (47)

Matrices ${B}_{w}\mathrm{,}{B}_{\theta}\mathrm{,}{M}_{\partial \mathrm{,1}}\mathrm{,}{M}_{\partial \mathrm{,2}}$ are computed as:

$\begin{array}{l}{B}_{\perp \mathrm{,}w}^{ig}={\langle {\gamma}_{0}{\varphi}_{w}^{i}\mathrm{,}{\psi}_{\partial \mathrm{,1}}^{g}\rangle}_{\partial \Omega}\mathrm{,}\hfill \\ {B}_{\perp \mathrm{,}\theta}^{mg}={\langle {\gamma}_{0}{\varphi}_{\theta}^{m}\mathrm{,}{\psi}_{\partial \mathrm{,2}}^{g}\rangle}_{\partial \Omega}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{M}_{\partial \mathrm{,1}}^{fg}={\langle {\psi}_{\partial \mathrm{,1}}^{f}\mathrm{,}{\psi}_{\partial \mathrm{,1}}^{g}\rangle}_{{L}^{2}\left(\partial \Omega \mathrm{,}{\mathbb{R}}^{m}\right)}\mathrm{,}\hfill \\ {M}_{\partial}^{lk}={\langle {\psi}_{\partial \mathrm{,2}}^{l}\mathrm{,}{\psi}_{\partial \mathrm{,2}}^{k}\rangle}_{{L}^{2}\left(\partial \Omega \mathrm{,}{\mathbb{R}}^{m}\right)}\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}f\mathrm{,}g\in \left\{\mathrm{1,}{N}_{\partial \mathrm{,1}}\right\}\mathrm{,}\hfill \\ l\mathrm{,}k\in \left\{\mathrm{1,}{N}_{\partial \mathrm{,2}}\right\}\hfill \end{array}$ (48)

The discrete Hamiltonian is then computed as:

${H}_{d}=\frac{1}{2}{e}_{w}^{{\rm T}}{M}_{\rho h}{e}_{w}+\frac{1}{2}{e}_{\theta}^{{\rm T}}{M}_{{I}_{\theta}}{e}_{\theta}+\frac{1}{2}{e}_{\kappa}^{{\rm T}}{M}_{{\mathcal{D}}_{b}^{-1}}{e}_{\kappa}+\frac{1}{2}{e}_{\gamma}^{{\rm T}}{M}_{{D}_{s}^{-1}}{e}_{\gamma}\mathrm{.}$ (49)

From system (45) the discrete energy rate is readily obtained:

$\frac{\text{d}{H}_{d}}{\text{d}t}={y}_{\partial \mathrm{,1}}^{{\rm T}}{M}_{\partial \mathrm{,1}}{u}_{\partial \mathrm{,1}}+{y}_{\partial \mathrm{,2}}^{{\rm T}}{M}_{\partial \mathrm{,2}}{u}_{\partial \mathrm{,2}}\mathrm{.}$ (50)

The discrete energy rate then mimics its infinite-dimensional counterpart.

Remark 10. *Equivalently a purely mixed formulation can be obtained by integrating by parts the third and fourth lines of *(39)*. In this case*,* the system of equations gathers together a plane elasticity problem * [36] * and a wave equation in mixed form. Conforming finite elements for the plane elasticity system on simplicial meshes have been constructed in* [37].* The simpler PEERS elements based on a weak symmetry formulation have been proposed in* [38].* The PEERS elements have been used in* [39] *to construct a stable locking-free mixed formulation for the static Mindlin problem.*

3.4. The Heat Equation

The heat equation is the simplest example of parabolic system. Instead of rewriting the well-known PDE as a pHs, a direct pHs modelling is presented, as done in [9] [10]. The model is constructed in order to keep apart thermodynamical principles from equations of state. Indeed, the pHs formalism allows to modify the latter, by keeping the structure of the former.

Let
$\Omega \subset {\mathbb{R}}^{N}$ be a bounded open connected set. Assume that this domain models a rigid body: its volume does not change over time and no chemical reaction is to be found. Let us denote:
$\rho $ the mass density, *u* the internal energy density,
${J}_{Q}$ the heat flux, *T* the local temperature,
$\beta \mathrm{:}=\frac{1}{T}$ the reciprocal temperature, *s* the entropy density,
${J}_{S}\mathrm{:}=\beta {J}_{Q}$ the entropy flux,
${C}_{V}\mathrm{:}={\left(\frac{\text{d}u}{\text{d}T}\right)}_{V}$ the isochoric heat capacity.

The first law of thermodynamic reads:

$\rho \frac{\partial u}{\partial t}=-\text{div}\left({J}_{Q}\right)\mathrm{.}$ (51)

Under the hypothesis of an inert rigid solid, Gibbs formula reads $\text{d}u=T\text{d}s$, giving:

$\frac{\partial u}{\partial t}=T\frac{\partial s}{\partial t}\mathrm{.}$ (52)

Defining
$\sigma \mathrm{:}=\text{grad}\left(\beta \right){J}_{Q}$, and seeing*u* as a function of the entropy density *s*, Gibbs formula (52) gives:

$\rho \frac{\partial s}{\partial t}=-\text{div}\left({J}_{S}\right)+\sigma \mathrm{.}$ (53)

Then $\sigma $ is the irreversible entropy production.

In this work, the following constitutive equations of state will be assumed:

· The rigid body is at room temperature: the Dulong-Petit model is supposed to be satisfied, *i.e.*
$u={C}_{V}T$, with time-invariant
${C}_{V}$ ;

· The thermal conduction is given by Fourier’s law, with a symmetric positive tensor $\lambda $ : ${J}_{Q}=-\lambda \text{grad}\left(T\right)$.

Thanks to (51) and the equations of state, we easily recover the classical PDE for the temperature *T*:
$\rho {C}_{V}\frac{\partial T}{\partial t}=\text{div}\left(\lambda \text{grad}\left(T\right)\right)$.

The “*L*^{2}-energy”
${\left({\displaystyle {\int}_{\Omega}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\rho {C}_{V}{T}^{2}\text{d}\Omega \right)}^{\frac{1}{2}}$ is commonly used as Hamiltonian for the heat equation. However, it lacks of a thermodynamical meaning. The internal energy would be more accurate for this physical problem, even though it will rise some difficulties. Nevertheless, the pHs formalism allows dealing with it, and PFEM proves to be powerful enough to discretize the system in a structure-preserving manner even for this choice of Hamiltonian.

Let the internal energy be seen as a functional of the local entropy as energy variable: ${\alpha}_{s}\mathrm{:}=\rho s$, then:

$H\mathrm{:}={\displaystyle {\int}_{\Omega}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\rho u\left({\alpha}_{s}\right)\text{d}\Omega \text{\hspace{0.05em}}\text{\hspace{0.05em}}\mathrm{.}$

The co-energy variable is given by ${e}_{s}\mathrm{:}={\delta}_{{\alpha}_{s}}H=\frac{\text{d}\rho u}{\text{d}\rho s}=T$, the local temperature. Denoting ${e}_{S}\mathrm{:}={J}_{S}$, one can introduce a new flow variable ${f}_{S}$ such that:

$\left(\begin{array}{c}\frac{\partial {\alpha}_{s}}{\partial t}\\ {f}_{S}\end{array}\right)=\left[\begin{array}{cc}0& -\text{div}\\ -\text{grad}& 0\end{array}\right]\left(\begin{array}{c}{e}_{s}\\ {e}_{S}\end{array}\right)+\left(\begin{array}{c}\sigma \\ 0\end{array}\right)\mathrm{.}$

Obviously,
${f}_{S}=-\text{grad}\left({e}_{s}\right)$. In order to get a formally skew-symmetric operator, let us also introduce an *entropy* port
$\left({f}_{\sigma}\mathrm{,}{e}_{\sigma}\right)$, such that
${e}_{\sigma}=-\sigma $. Then:

$\left(\begin{array}{c}\frac{\partial {\alpha}_{s}}{\partial t}\\ {f}_{S}\\ {f}_{\sigma}\end{array}\right)=\left[\begin{array}{ccc}0& -\text{div}& -1\\ -\text{grad}& 0& 0\\ 1& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{s}\\ {e}_{S}\\ {e}_{\sigma}\end{array}\right)\mathrm{.}$ (54)

Remark 11. *As surprising as it can be*,* in this setting*,* Fourier*’*s law appears to be stated in a nonlinear way*:*
${e}_{s}{e}_{S}-\lambda {f}_{S}=0$. This comes from the necessity to express the constitutive relations in function of the flows and efforts appearing in the equation defining the Stokes-Dirac structure.*

Remark 12. *Two variables have been added to obtain *(54),* but only one equation naturally appears*:*
${f}_{\sigma}={e}_{s}$. Thus*,* another equation is needed to close the system*:*
$\mathcal{G}\left({f}_{2}\mathrm{,}{e}_{2}\right)=0$. Here*,* it is given by the definition of the irreversible entropy production
$\sigma \mathrm{:}=\text{grad}\left(\beta \right){J}_{Q}$ *,* rewritten in the flows and efforts variables. This leads to the nonlinear constitutive relation*:*
${f}_{S}{e}_{S}+{f}_{\sigma}{e}_{\sigma}=0$.*

Remark 13. *Usually the system energy is taken to be
${\left({\displaystyle {\int}_{\Omega}}\text{\hspace{0.05em}}\text{\hspace{0.05em}}\rho {C}_{V}{T}^{2}\text{d}\Omega \right)}^{\frac{1}{2}}$, that gives rise to the well-known linear diffusive system. At first glance*,* our approach may be surprising since it leads to a lossless nonlinear differential-algebraic system. There is indeed a major advantage in doing so*,* in view of the modelling and discretization of complex systems by interconnection of several pHs. For instance*,* if one wants to interconnect both thermal and mechanical processes*,* for the energy exchanges to be consistent*,* physics must be coherent. When dissipation occurs*,* through *e.g. *friction or viscosity*,* the kinetic energy is converted into internal energy. Hence*,* for a physically meaningful system*,* the internal energy is indeed the one to consider.*

Let us define:

${f}_{1}\mathrm{:}=\frac{\partial {\alpha}_{s}}{\partial t}\mathrm{,}\text{\hspace{1em}}{f}_{2}\mathrm{:}=\left(\begin{array}{c}{f}_{S}\\ {f}_{\sigma}\end{array}\right)\mathrm{,}\text{\hspace{1em}}{e}_{1}\mathrm{:}={e}_{s}\mathrm{,}\text{\hspace{1em}}{e}_{2}\mathrm{:}=\left(\begin{array}{c}{e}_{S}\\ {e}_{\sigma}\end{array}\right)\mathrm{,}$

and:

$\mathcal{L}\mathrm{:}=\left(\begin{array}{c}-\text{grad}\\ 1\end{array}\right)\mathrm{,}\text{\hspace{1em}}{\Gamma}_{\perp}\mathrm{:}=\left(\begin{array}{cc}-{\gamma}_{\perp}& 0\end{array}\right)\mathrm{,}\text{\hspace{1em}}{\Gamma}_{0}\mathrm{:}={\gamma}_{0}\mathrm{.}$

Then, the heat Equation (54) with boundary control
${e}_{\partial}\mathrm{:}={u}_{\partial}={\Gamma}_{0}{e}_{1}={\gamma}_{0}\left({e}_{s}\right)$ and boundary observation
${f}_{\partial}\mathrm{:}=-{y}_{\partial}={\Gamma}_{\perp}{e}_{2}={\gamma}_{\perp}\left({e}_{S}\right)$ rewrites under the form (11). Thus PFEM will be applied with an *integration** by parts* on the second line in this strategy, leading to (27), which rewrites with the current variables:

$\text{Diag}\left[\begin{array}{c}{M}_{s}\\ {M}_{S}\\ {M}_{\sigma}\\ {M}_{\partial}\end{array}\right]\left(\begin{array}{c}\frac{\text{d}}{\text{d}t}{\underset{\_}{\alpha}}_{s}\\ {f}_{S}\\ {f}_{\sigma}\\ -{y}_{\partial}\end{array}\right)=\left[\begin{array}{cccc}0& {D}_{-\text{div}}& -{M}_{\sigma}& 0\\ -{D}_{-\text{div}}^{{\rm T}}& 0& 0& {B}_{0}\\ {M}_{\sigma}& 0& 0& 0\\ 0& -{B}_{0}^{{\rm T}}& 0& 0\end{array}\right]\left(\begin{array}{c}{e}_{s}\\ {e}_{S}\\ {e}_{\sigma}\\ {u}_{\partial}\end{array}\right)\mathrm{,}$ (55)

where:

$\begin{array}{ll}{M}_{s}^{ij}\mathrm{:}={\langle {\phi}_{1}^{i}\mathrm{,}{\phi}_{1}^{j}\rangle}_{{L}^{2}\left(\partial \Omega \mathrm{,}\mathbb{R}\right)}\mathrm{,}\hfill & {M}_{S}^{kl}\mathrm{:}={\langle {\phi}_{S}^{k}\mathrm{,}{\phi}_{S}^{l}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{N}\right)}\mathrm{,}\hfill \\ {M}_{\sigma}^{\stackrel{\u02dc}{k}\stackrel{\u02dc}{l}}\mathrm{:}={\langle {\phi}_{\sigma}^{\stackrel{\u02dc}{k}}\mathrm{,}{\phi}_{\sigma}^{\stackrel{\u02dc}{l}}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{N}\right)}\mathrm{,}\hfill & {B}_{0}^{km}\mathrm{:}=-{\langle {\Gamma}_{\perp}{\phi}_{S}^{k}\mathrm{,}{\psi}_{\partial}^{m}\rangle}_{{L}^{2}\left(\partial \Omega \mathrm{,}\mathbb{R}\right)}\mathrm{,}\hfill \end{array}$

with ${\phi}_{2}^{k}\mathrm{:}=\left(\begin{array}{c}{\phi}_{S}^{k}\\ 0\end{array}\right)$ if $1\le k\le {N}_{S}$, and ${\phi}_{2}^{k}\mathrm{:}=\left(\begin{array}{c}0\\ {\phi}_{\sigma}^{k-{N}_{S}}\end{array}\right)$ if ${N}_{S}+1\le k\le {N}_{S}+{N}_{\sigma}$.

To be compatible, the discretizations of the constitutive relations are given as follows:

· Dulong-Petit model reads: ${M}_{s}{\underset{\_}{\alpha}}_{s}={M}_{\rho {C}_{V}}{e}_{s}$, with ${M}_{\rho {C}_{V}}^{ij}\mathrm{:}={\langle {\phi}_{1}^{i}\mathrm{,}\rho {C}_{V}{\phi}_{1}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}\mathbb{R}\right)}$ ;

· Following Remark 11, Fourier’s law reads: $\Lambda {f}_{S}={M}_{{e}_{s}}{e}_{S}$ with ${\Lambda}^{ij}\mathrm{:}={\langle {\phi}_{S}^{i}\mathrm{,}\lambda {\phi}_{S}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{N}\right)}$ and ${M}_{{e}_{s}}^{ij}\mathrm{:}={\langle {\phi}_{S}^{i}\mathrm{,}{e}_{s}{\phi}_{S}^{j}\rangle}_{{L}^{2}\left(\Omega \mathrm{,}{\mathbb{R}}^{N}\right)}$ ;

· The constitutive law coming from the introduction of the irreversible entropy production, as explained in Remark 12, is taken into account by:

${\left({e}_{S}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{S}{f}_{S}+{\left({e}_{\sigma}\right)}^{{\rm T}}\mathrm{\text{\hspace{0.17em}}}{M}_{\sigma}{f}_{\sigma}=0.$ (56)

Remark 14. *In Fourier*’*s law*,* the mass matrix
${M}_{{e}_{s}}$ depends on the co-energy variable
${e}_{s}$. This will rise difficulties for the numerical solution in time.*

To conclude, the structure-preserving property can be appreciated in the following result.

Proposition 3. *Let
${H}^{d}\left({\underset{\_}{\alpha}}_{s}\right)\mathrm{:}=H\left({\alpha}_{s}^{d}\right)$ be the discrete Hamiltonian*,* where
${\alpha}_{s}^{d}$ is the discretization of the energy variable in the basis
${\phi}_{1}$. It holds*:

$\frac{\text{d}}{\text{d}t}{H}^{d}={u}_{\partial}^{{\rm T}}{M}_{\partial}{y}_{\partial}\mathrm{,}$

that is the first law of thermodynamics at the discrete level.

Proof 3. *Thanks to the compatible discretization of the Dulong-Petit model*,* Proposition *2* gives*:

$\frac{\text{d}}{\text{d}t}{H}^{d}=-{e}_{2}^{{\rm T}}{M}_{2}{f}_{2}-{e}_{\partial}^{{\rm T}}{M}_{\partial}{f}_{\partial}\mathrm{.}$

By definition of ${f}_{2}$, ${e}_{2}$, ${M}_{2}$, ${e}_{\partial}$, and ${f}_{\partial}$ one computes:

$\begin{array}{c}\frac{\text{d}}{\text{d}t}{H}^{d}=-{e}_{2}^{{\rm T}}{M}_{2}{f}_{2}-{e}_{\partial}^{{\rm T}}{M}_{\partial}{f}_{\partial}\mathrm{,}\\ =-{\left(\begin{array}{c}{e}_{S}\\ {e}_{\sigma}\end{array}\right)}^{{\rm T}}\left[\begin{array}{cc}{M}_{S}& 0\\ 0& {M}_{\sigma}\end{array}\right]\left(\begin{array}{c}{f}_{S}\\ {f}_{\sigma}\end{array}\right)+{u}_{\partial}^{{\rm T}}{M}_{\partial}{y}_{\partial}\mathrm{,}\\ ={u}_{\partial}^{{\rm T}}{M}_{\partial}{y}_{\partial}\mathrm{,}\end{array}$

thanks to the constitutive relation (56) coming from the irreversible entropy production.

Remark 15. *Fourier*’*s law does not contribute to the power balance of the internal energy. Nevertheless*,* such a constitutive relation is needed for the problem to be well-defined.*

Remark 16. *The methodology detailed so far is certainly not limited to the previous three examples. Indeed higher-order differential* [40],* curl operator for Maxwell*’*s equations* [32],* nonlinear system* [41],* and different Hamiltonian choices can be handled as well. For instance*,* in the case of the heat equation*,* the entropy or the classical L*^{2}*-norm of the temperature can be alternatively considered as Hamiltonian functional* [9] [10] *. In addition*,* mixed boundary conditions can be incorporated either by introducing Lagrange multipliers or by employing a virtual domain decomposition method* [42].* As already mentioned*,* dissipation *(*both in the domain and on the boundary*)* can also be considered in this strategy* [30] [31].* Hence a very wide class of *(*nonlinear*)* multiphysics systems can be discretized in a structure-preserving manner *(*with well-represented exchanges of energy between the subsystems*)*.*

In the next section we present an ongoing project which has been initiated to prove the efficiency of the PFEM methodology, leveraging well-established and robust software tools for the finite element discretization of partial differential equations and time integration.

4. SCRIMP: Simulation and Control of Interactions in Multi-Physics

In this section the main features related to the numerical simulation of pHs in the framework of the ongoing project named SCRIMP (Simulation and Control of Interactions in Multi-Physics) are detailed. The aim is to provide a flexible prototype Python code for the numerical simulation of pHs both for research and educational purposes. In addition to numerical experiments proposed later in Section 5, the reader is referred to interactive companion Jupyter notebooks [6] to learn how to numerically solve the model problems introduced in Section 3 with SCRIMP. In the following, the key ideas behind SCRIMP are mentioned and then a specific emphasis on both space and time discretizations is given.

4.1. Key Ideas Behind SCRIMP

In short, the key ideas related to the design of SCRIMP are provided:

· The Python dynamic programming language has been selected due to its expressiveness and the availability of high-level interfaces to scientific computing software libraries [43];

· SCRIMP assumes to rely on open-source, external software for the finite-dimensional discretization of partial differential equations;

· SCRIMP encapsulates the finite-dimensional objects related to the finite element discretization in space (e.g. matrices) to deduce the resulting linear or nonlinear pHs in a generic pHODE/pHDAE form as proposed in [26];

· For multiphysics problems, this design offers the advantage that discretization in space may be handled by different software components depending on the discipline or on the modelling. The modularity and the object-oriented nature of Python thus offer the flexibility to easily combine the different pHs to deduce the global interconnected system. This is much in line with the mathematical theory of pHs [24]. Furthermore we note that interconnections of different systems (with e.g. the transformer or gyrator transformations [24] ) can be easily incorporated.

The design of SCRIMP is based on procedural and object-oriented paradigms and thus follows the standard ideas governing most of the numerical PDE software. Whereas a detailed exposition of the design patterns of SCRIMP and its performance will be published elsewhere, concrete illustrations of most of these key ideas can be found in the companion Jupyter notebooks [6]. The description of the current numerical methods related to space and time discretizations available in SCRIMP is given.

4.2. Semi-Discretization in Space

As outlined in Section 3, PFEM relies on an abstract variational formulation written in appropriate finite element spaces.

To perform the semi-discretization in space, we rely on FEniCS [23], an open-source C++ scientific software library that provides a high-level Python interface. The FEniCS Project is mainly based on a collection of software components targeting the automated solution of partial differential equations via the finite element method. Its core components notably include the Unified Form Language (UFL) [44], the FEniCS Form Compiler (FFC) [45] and the finite element library DOLFIN [46], which contains various types of conforming finite element methods, e.g., nodal Lagrangian finite elements for grad-conforming approximations or non non-nodal finite elements (e.g., Raviart-Thomas spaces for div-conforming approximations) as well. These families of finite elements are notably required to tackle the discretization in space of our core problems.

A key point to facilitate the generic implementation of PFEM is the use of UFL. UFL is indeed an expressive domain-specific language for abstractly representing (finite element) variational formulations of differential equations. In particular, this language defines a syntax for the integration of variational forms over various domains. This simply leads to an expressive implementation that is close to the abstract mathematical formulations presented in Section 3. The FEniCS Form Compiler FFC then generates specialized C++ code from the symbolic UFL representation of variational forms and finite element spaces. The combination of these core elements makes FEniCS a versatile and efficient software for the finite element approximation of partial differential equations as outlined in [47]. Additionally, FEniCS also provides an interface for state-of-the-art linear solvers and preconditioners from freely available third-party libraries such as PETSc [48]. This last feature may be especially useful to handle the numerical simulation of large-scale pHs.

4.3. Time Integration Methods

As outlined in Section 3, the semi-discretization in space of the resulting pHs leads to systems of either ordinary differential equations (ODE) or differential algebraic equations (DAE). Hence reliable and accurate time integration methods must be provided.

To offer a large panel of numerical methods, a high-level interface to well-established time integration libraries is provided in SCRIMP. Concerning the numerical solution of ODEs, we provide light interfaces to the Assimulo library [49] and to the SciPy time integration method scipy.integrate.solve_ivp^{1} that both include standard multistep and one-step methods for stiff and non-stiff ordinary differential equations given in explicit form
${y}^{\prime}=f\left(t\mathrm{,}y\right)$ with
$y\left({t}_{0}\right)={y}_{0}$ where
${t}_{0}$ and
${y}_{0}$ denote the initial time and initial condition, respectively. This formulation requires the solution of linear systems of equations involving sparse finite element mass matrices. State-of-the-art sparse direct solvers based on Gaussian factorization are used for that purpose. Through Assimulo, the popular CVODE^{2} solver from Sundials [50] is also accessible. For nonstiff problems, CVODE relies on the Adams-Moulton formulas, with the order varying between 1 and 12. For stiff problems, CVODE includes schemes based on Backward Differentiation Formulas (BDFs) with order varying between 1 and 5. In addition, we also propose standalone implementations of symplectic time integration methods such as the second order accurate Stormer-Verlet method.

The interface to Assimulo also allows one to handle the numerical solution of linear DAEs through the use of the Sundials IDA solver^{3}. IDA is a package for the solution of differential algebraic equation systems written in the form
$F\left(t\mathrm{,}y\mathrm{,}{y}^{\prime}\right)=0$ with
$y\left({t}_{0}\right)={y}_{0}$. The integration method in IDA is based on variable-order, variable-coefficient BDF in fixed-leading-coefficient form, where the method order varies between 1 and 5. We note that setting the initial conditions properly is of utmost importance for a DAE solver. To do so, we rely on the IDA_YA_YDP_INIT method to find consistent initial conditions for the time integration. We refer the reader to ( [50], Section 2.3] for additional details on IDA. As standalone methods, we have considered the second-order accurate Stormer-Verlet and fourth-order accurate Runge-Kutta (RK4) methods for the solution of linear DAEs.

To the best of our knowledge, open-source libraries for the solution of general nonlinear differential algebraic equations with high-level Python interfaces are not yet available. Hence a simple forward in time integration method for the solution of the nonlinear pHDAE related to the energy formulation of the heat equation problem has been provided; see [51] for illustrations and discussion. As a future direction, we plan to investigate the potential of the PETSc’s time stepping library TS [52] to be able to tackle the solution of large-scale pHDAE systems.

4.4. Model Reduction of Port-Hamiltonian Systems

Structure-preserving model reduction is of significant importance for stability analysis, optimization or control of problems related to pHs. Hence structure-preserving model reduction algorithms have been implemented in SCRIMP. In particular, the structure-preserving model reduction algorithm (Algorithm 1) proposed in [53] has been selected in the pHODE case. We refer the reader to [6] for an illustration, where the model reduction of the pHs related to the wave equation problem is considered. While for linear pHDAE systems consolidated methodologies have been proposed (see, e.g., [54] ), structure-preserving model reduction for general nonlinear differential algebraic systems remains to be explored, to the best of our knowledge. This is a significant research direction to be considered within SCRIMP in a near future.

5. Numerical Simulations

In this section, PFEM is applied to the pHs presented in Section 3. We specifically learn how to define and solve those problems with SCRIMP. These tutorials introduce the methodology step-by-step and are supposed to be self-contained and independent from the others. We refer the reader to the companion Jupyter notebooks [6] for additional information.

5.1. Anisotropic Heterogeneous Wave Equation

We first recall the continuous problem related to the anisotropic heterogeneous wave equation, enriched with internal and boundary damping, and tackle the semi-discretization in space of the port-Hamiltonian system through the PFEM methodology. This discretization leads to a pHODE formulation as explained in Section 3.2. After time discretization, we perform a numerical simulation to obtain an approximation of the space-time solution.

5.1.1. Problem Statement

We consider the two-dimensional heterogeneous anisotropic wave equation with impedance boundary condition defined for all ( $t\ge 0$ ) as:

$\rho \left(x\right)\frac{{\partial}^{2}}{\partial {t}^{2}}w\left(t\mathrm{,}x\right)-\text{div}\left(\mathcal{T}\left(x\right)\cdot grad\text{\hspace{0.05em}}w\left(t\mathrm{,}x\right)\right)=-\epsilon \left(x\right){\partial}_{t}w\left(t\mathrm{,}x\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega \mathrm{,}$

$Z\left(x\right)\left(\mathcal{T}\left(x\right)\cdot grad\text{\hspace{0.05em}}w\left(t\mathrm{,}x\right)\right)\cdot n+{\partial}_{t}w\left(t\mathrm{,}x\right)=\mathrm{0,}\text{\hspace{1em}}x\in \partial \Omega \mathrm{,}$

$w\left(\mathrm{0,}x\right)={w}_{0}\left(x\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega \mathrm{,}t=0$

${\partial}_{t}w\left(\mathrm{0,}x\right)={w}_{1}\left(x\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega \mathrm{,}t=\mathrm{0,}$

with
$\Omega \subset {\mathbb{R}}^{2}$ an open bounded spatial domain with Lipschitz-continuous boundary
$\partial \Omega $. We consider here a rectangular shaped domain for
$\Omega $.
$w\left(t\mathrm{,}x\right)$ denotes the deflection from the equilibrium position at point
$x\in \Omega $ and time *t*.
$\rho \in {C}^{\infty}\left(\Omega \right)$ (positive and bounded from below) denotes the mass density,
$\mathcal{T}\in {C}^{\infty}{\left(\Omega \right)}^{2\times 2}$ (symmetric and coercive) the Young’s elasticity modulus,
$\epsilon $ a positive viscous damping parameter and
$Z\left(x\right)$ is the positive impedance function defined on
$\partial \Omega $, respectively.

5.1.2. Setup

We initialize here the Python object related to the Wave_2D class of SCRIMP. This object will be used throughout this section.

5.1.3. Constants

We define the constants related to the rectangular domain $\Omega $. The coordinates of the bottom left ( ${x}_{0}\mathrm{,}{y}_{0}$ ) and top right ( ${x}_{L}\mathrm{,}{y}_{L}$ ) corners of the rectangle are required.

We then define the time interval related to the time discretization. ${t}_{i}\mathrm{,}{t}_{f}$ denote the initial and final time instants respectively.

We specify that we choose the Assimulo external library to be used later for the time integration of the resulting ODE and provide the value of the time step. This should be considered as a reference value since adaptative methods in time can be used later.

5.1.4. FEniCS Expressions Definition

For the finite element discretization of the pHs, the FEniCS library is used in the Wave_2D class of SCRIMP. Hence to properly use FEniCS expression definition, we provide the definition of the different variables in C++ code given in strings. We first specify the mass density as a function depending on the space coordinates. Hence in this expression, $x\left[0\right]$ corresponds to the first spatial variable and $x\left[1\right]$ to the second one, respectively.

We specify the Young’s elasticity modulus tensor. Three components are only required due to the symmetry property of this tensor.

We finally set the impedance function *Z* defined on the boundary of the domain. Here a constant value is used on
$\partial \Omega $. We also provide the viscous damping parameter (eps).

Finally we specify the initial conditions of the problem related to the energy variables and to the deflection.

5.1.5. Problem at the Continuous Level

We are now able to completely define the problem at the continuous level. We start by specifying that the computational domain $\Omega $ is of rectangular shape. To do so, we provide the coordinates of the bottom left and top right corners to the Wave_2D object.

Remark 17. *General *Gmsh* meshes can be imported by the user. However*,* for the time being*,* the library does not allow the treatment of mixed boundary conditions on generic meshes.*

We provide next the time integration interval.

We then provide the physical parameters related to the wave equation: the mass density, the Young’s elasticity modulus tensor and the impendance function, respectively.

We then specify the complete modelling for the damping and thus provide information related to the impedance function and viscous damping parameter, respectively.

The user has to provide the temporal and spatial parts of the boundary control function (Ub_tm0 and Ub_sp0, respectively).

Finally we provide the initial conditions for the ODE.

5.1.6. Problem at the Discrete Level in Space and Time

We start by selecting the computational mesh which is generated with Gmsh^{4} and saved as a.xml file. Here the parameter *rfn*_*num* corresponds to a mesh refinement parameter.

To perform the discretization in space, we must first specify the conforming finite element approximation spaces to be used (see [20] ). Concerning the energy variables associated with the strain, we select the Raviart-Thomas finite element family known as $R{T}_{k}$ consisting of vector functions with a continuous normal component across the interfaces between the elements of a mesh. For the energy variables associated with the linear momentum and the boundary variables, we choose the classical ${P}_{k}$ finite element approximation. The given combination of parameters rt_order=0, p_order=1, b_order=1 corresponds to the $R{T}_{0}{P}_{1}{P}_{1}$ family.

We then perform the semi-discretization in space of the weak formulation with PFEM. At the end of this stage, the complete formulation of the pHODE is obtained. The different matrices related to the pHODE system are constructed in the Assembly method of the Wave_2D class of SCRIMP and are directly accessible through the object of the Wave_2D class. The finite element assembly relies on the variational formulation of PFEM and exploits the level of abstraction provided by the UFL used in FEniCS, leading to a code that is close to the mathematical formulation. The divergence based formulation is selected leading to a pHODE system. In other words, the integration by parts will be performed on the second line of (32).

To perform the time integration of the pHODE, we first need to interpolate both the control function on the boundary and the initial data on the appropriate finite element spaces.

Then we specify the parameters related to the time discretization.

5.1.7. Numerical Approximation of the Space-Time Solution

We are now able to perform the time integration of the resulting pHODE system and deduce the behaviour of both the energy variables and the Hamiltonian with respect to the time and space variables, respectively. Detailed information from the Assimulo library is included after time integration.

5.1.8. Post-ProcessingWe

represent the two-dimensional mesh with corresponding degrees of freedom for each variable in Figure 1.

We plot the Hamiltonian function versus time in Figure 2. Here *tspan* represents the collection of discrete times due to the possibly adaptative time procedure used in the time integration library.

The behaviour of the deflection is graphically represented at a given time. Here we simply plot the deflection at the final time of the simulation in Figure 3.

The related Jupyter notebook [6] further illustrates how to obtain a structure-

Figure 1. Two-dimensional triangular mesh with corresponding degrees of freedom for each variable for the anisotropic wave problem with damping.

Figure 2. Hamiltonian function versus time for the anisotropic, heterogeneous and boundary controlled wave problem with damping.

preserving reduced model of this port-Hamiltonian system. After application of the model reduction algorithm proposed in [53], a pHODE of reduced size has to be integrated to obtain an approximate solution of the wave propagation problem. This is further illustrated on the simple application detailed in this section. In addition, a supplementary notebook illustrates the numerical simulation of the wave equation problem, when mixed boundary conditions (*i.e.* Dirichlet and Neumann conditions) on the boundary control function are imposed by Lagrange multipliers [42].

Figure 3. Deflection at the final time for the anisotropic, heterogeneous and boundary controlled wave problem with damping.

5.2. The Mindlin Plate Problem

We first recall the considered continuous problem related to the Mindlin plate and tackle the semi-discretization in space of the pHs by PFEM. After transformation and time discretization, we perform a numerical simulation to obtain an approximation of the space-time solution. As in Section 5.1, the procedure is described step-by-step and detailed explanations and numerical illustrations are provided.

5.2.1. Problem Statement

Consider the Mindlin plate problem defined for all $t\ge 0$ as:

$\{\begin{array}{l}\rho b{\partial}_{tt}w=\text{div}\left(q\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega =\left\{\mathrm{0,}{L}_{x}\right\}\times \left\{\mathrm{0,}{L}_{y}\right\}\mathrm{,}\\ \frac{\rho {b}^{3}}{12}{\partial}_{tt}\theta =q+\text{Div}\left(M\right)\end{array}$ (57)

with initial conditions:

$\begin{array}{l}w\left(\mathrm{0,}x\right)=\mathrm{0,}\hfill \\ {\partial}_{t}w\left(\mathrm{0,}x\right)={w}_{1}\left(x\right)\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}\theta \left(\mathrm{0,}x\right)=0,\hfill \\ {\partial}_{t}\theta \left(\mathrm{0,}x\right)=0,\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}x\in \Omega \mathrm{,}t=\mathrm{0,}\hfill \\ x\in \Omega \mathrm{,}t=\mathrm{0,}\hfill \end{array}$ (58)

and boundary conditions:

$\begin{array}{l}{w|}_{{\Gamma}_{D}}={u}_{D}\left(t\right)\mathrm{,}\hfill \\ {q\cdot n|}_{{\Gamma}_{N}}={u}_{N}\left(t\right)\mathrm{,}\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{\theta |}_{{\Gamma}_{D}}=0,\hfill \\ {M\cdot n|}_{{\Gamma}_{N}}=0,\hfill \end{array}\text{\hspace{1em}}\begin{array}{l}{\Gamma}_{D}=\left\{x=0\right\},\hfill \\ {\Gamma}_{N}=\left\{x={L}_{x},y=0,y={L}_{y}\right\}.\hfill \end{array}$ (59)

Mixed boundary conditions are considered in this example. The subsets ${\Gamma}_{N}\mathrm{,}\text{\hspace{0.17em}}{\Gamma}_{D}$ represent the subsets of the boundary where Neumann and Dirichlet conditions hold respectively. The Dirichlet conditions are enforced using Lagrange multipliers. The PFEM discretization then leads to a pHDAE, as explained in [42] for the wave equation. The following expressions have been considered for the initial and boundary conditions:

$\begin{array}{l}{w}_{1}=xy,\text{\hspace{1em}}{u}_{D}=0.01\left(\mathrm{cos}\left(2\pi \frac{t}{{t}_{f}}\right)-1\right),\\ {u}_{N}={10}^{5}\mathrm{sin}\left(2\pi \frac{x}{{L}_{x}}\right)\left(1-{\mathrm{exp}}^{-10\frac{t}{{t}_{f}}}\right).\end{array}$ (60)

5.2.2. Setup

We initialize here the Python object related to the Mindlin class of SCRIMP. This object will be used throughout this section.

5.2.3. Constants

We define the constants related to the rectangular domain $\Omega $. The coordinates of the bottom left $\left({x}_{0}\mathrm{,}{y}_{0}\right)=\left(\mathrm{0,0}\right)$ and the top right $\left({x}_{L},{y}_{L}\right)=\left({L}_{x},{L}_{y}\right)$ corners of the rectangle are required.

As in the previous example, the time interval related to the time discretization is defined as follows:

A Runge-Kutta method for the time integration of the system is prescribed. This method is conditionally stable, so the time-step has to be set accurately to avoid numerical instabilities.

5.2.4. FEniCS Expressions Definition

The FEniCS library is also used in the Mindlin class of SCRIMP. The coefficients related to the physical parameters of the isotropic plate can be provided as either real numbers or FEniCS expressions.

Similarly the initial vertical condition ${w}_{1}$ can be defined as a string. It represents a C++ code that will be compiled by the Dolfin library of FEniCS.

This means that the initial velocity satisfies ${w}_{1}=xy$. Note that the initial condition has to be compatible with the boundary conditions. The other initial conditions will be set to zero.

5.2.5. Problem at the Continuous Level

We are now able to completely define the problem at the continuous level. We start by specifying that the computational domain $\Omega $ is of rectangular shape. To define $\Omega $, we provide the coordinates of the bottom left and top right corners to the Mindlin object.

The time integration interval is then given.

The physical parameters related to the Mindlin plate are set.

Finally the initial conditions in terms of co-energy variables are also set.

5.2.6. Problem at the Discrete Level in Space and Time

We start by selecting the computational mesh which is generated with FEniCS inner mesh utilities. The first parameter corresponds to a mesh refinement parameter.

To perform the discretization in space, the conforming finite element approximation spaces to be used has to be specified. The finite element for the linear and angular velocity are Lagrange polynomials of order *r*. The momenta tensor and shear stress are chosen as Discontinuous Galerkin elements of order
$r-1$ [35]. This choice of finite elements is similar to the one proposed in [55], but a simplicial mesh is used instead of a quadrilateral one. By default, the boundary variables are approximated as Lagrange polynomials of order 1. This can be easily changed through the option family_b for the family, and rb for the degree.

We then perform the semi-discretization in space of the weak formulation with PFEM. At the end of this stage, the complete formulation of the pHDAE is obtained. The different matrices related to the pHDAE system are constructed in the Assembly_Mixed_BC method of the Mindlin class of SCRIMP and are directly accessible through the object of the Mindlin class. The subsets named G1, G2, G3, G4, denote the left, bottom, right and top sides of the rectangle, respectively.

In SCRIMP the boundary control ${u}_{\partial}$ is assumed to take the form:

Its derivative ${\stackrel{\dot{}}{u}}_{\partial}$ is expressed as:

To integrate in time we need to provide the derivative of the boundary condition. This information is provided by the variables Ub_tm0_dir, Ub_tm1_dir, respectively. This is needed to reduce the resulting DAE of index 2 to index 1.

To perform the time integration of the pHDAE, we first need to interpolate the boundary control function and the initial data on the appropriate finite element spaces.

Finally the specification of the parameters related to the time discretization is made.

5.2.7. Numerical Approximation of the Space-Time Solution

For the numerical approximation of the solution of the pHDAE system, the algebraic condition is differentiated. The integrator ‘DAE:RK4_Augmented’ takes as input a pHDAE. Then, it exploits a projection method to express the Lagrange multiplier in terms of the unknown [56], thus reducing the original DAE system into a purely ODE one. This allows employing standard ODE solvers for the time integration, as discussed in Section 5.2.3.

5.2.8. Post-Processing

Post-processing is performed similarly as in Section 5.1.8. Hence we omit the related Python lines of code for sake of brevity. In Figure 4 the evolution of the Hamiltonian function is shown versus time. We note that the Dirichlet condition causes an increase in energy. In Figure 5 snapshots of the vertical deflection at different instants are shown. We remark that the Neumann boundary condition causes the plate to bend asymmetrically.

5.3. Anisotropic Heterogeneous Heat Equation

This third tutorial aims at illustrating PFEM to discretize the pHs presented in Section 3.4, modelling the heat equation. We specifically learn how to define and solve this problem with SCRIMP. We first define the continuous problem by using a specific class of SCRIMP related to the heat equation in two dimensions. Then we tackle the discretization in space of the pHs through PFEM. The discretization of the energy formulation leads to a *nonlinear* pHDAE formulation. After time discretization, we perform a numerical simulation to obtain an approximation of the space-time solution. Finally a simple post-processing is provided.

5.3.1. Problem Statement

We consider the two-dimensional heterogeneous anisotropic heat equation defined for all $t\ge 0$ as

$\rho \left(x\right){C}_{V}\left(x\right)\frac{\partial}{\partial t}T\left(t\mathrm{,}x\right)=\text{div}\left(\lambda \left(x\right)\cdot grad\text{\hspace{0.05em}}T\left(t\mathrm{,}x\right)\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega \mathrm{,}$

$T\left(t\mathrm{,}x\right)={v}_{\partial}\left(t\mathrm{,}x\right)\mathrm{,}\text{\hspace{1em}}x\in \partial \Omega \mathrm{,}$

$T\left(\mathrm{0,}x\right)={T}_{0}\left(x\right)\mathrm{,}\text{\hspace{1em}}x\in \Omega \mathrm{,}t=0$

Figure 4. Hamiltonian versus time for the Mindlin plate problem.

(a) (b) (c) (d)

Figure 5. Snapshots of the vertical deflection of the Mindlin plate at different instants. (a) 0.35 Deflection *w* at
$t={t}_{f}/4$ ; (b) 0.35 Deflection *w* at
$t={t}_{f}/2$ ; (c) 0.35 Deflection *w* at
$t=3{t}_{f}/4$ ; (d) 0.35 Deflection *w* at
$t={t}_{f}$.

with
$\Omega \subset {\mathbb{R}}^{2}$ an open bounded spatial domain with Lipschitz-continuous boundary
$\partial \Omega $.
${v}_{\partial}\left(t\mathrm{,}x\right)$ represents the boundary control function on the temperature (the notation *u* is kept for the internal energy density).
$T\left(t\mathrm{,}x\right)$ denotes the temperature at point
$x\in \Omega $ and time *t*.
$\rho \in {C}^{\infty}\left(\Omega \right)$ (positive and bounded from below) denotes the mass density,
$\lambda \in {C}^{\infty}{\left(\Omega \right)}^{2\times 2}$ (symmetric and coercive) the thermal conductivity. In the following
$\Omega $ is assumed to be of rectangular shape.

5.3.2. Port-Hamiltonian Formulation

We refer to [9] [10] for the modeling and discretization of various port-Hamiltonian formulations of this problem. The authors consider quadratic Lyapunov functional, entropy or internal energy as Hamiltonian, respectively. We will consider the PFEM discretization of the internal energy functional formulation as proposed in Section 3.4, which will lead to a nonlinear pHDAE. Our goal in this tutorial is to show how a pHDAE system can be formulated and solved with SCRIMP.

5.3.3. Setup

We initialize here the Python object related to the energy formulation of the Heat_2D class of SCRIMP, that is assumed to be imported. This object will be used throughout this tutorial.

Energy corresponds to a class inherited from the Heat_2D base class. This base class contains implementations of the Lyapunov and entropy formulations as well.

5.3.4. Constants

The same lines of code as for the Wave_2D and Mindlin classes are used to define the constants related to the rectangular mesh.

The time interval related to the time discretization is specified similarly.

We provide the time step for the time discretization of the pHDAE as well.

5.3.5. FEniCS Expressions Definition

Using FEniCS expressions, the physical parameters related to our model problem are defined.

The initial conditions of the problem related to the temperature and to the flow and effort variables are then given. The temperature follows a Gaussian behaviour for which we specify related parameters.

The spatial part of the boundary control function is defined next.

Finally we define the time-dependent part of the boundary control as a pure Python function. The whole boundary control function is then given as the product of the two quantities (Ub_sp0 and Ub_tm0, respectively).

5.3.6. Problem at the Continuous Level

We are now able to completely define the problem at the continuous level.

5.3.7. Problem at the Discrete Level in Space and Time

The structure-preserving discretization of the infinite-dimensional pHs with PFEM is described in detail in [10]. This leads to the pHDAE given in (55). The definition of the system at the discrete level follows the same steps as for the two previous examples.

To perform the time integration of the pHDAE, we first need to set and interpolate the initial data and the boundary control function on the appropriate finite element spaces. Then, the time step is specified.

5.3.8. Numerical Approximation of the Space-Time Solution

Now we perform the time integration of the resulting pHDAE system and deduce the behaviour of the energy variables, the Hamiltonian with respect to the time and space variables, respectively. For the time discretization, we employ a fully explicit scheme, presented in [51] (Algorithm 2 of Section 4.4) as a first attempt.

5.3.9. Post-Processing

As an illustration, we plot the Hamiltonian function (* i.e**.* the internal energy) versus time. The Hamiltonian function is constant after 2 seconds, when the boundary control is switched off, as expected by the first law of thermodynamics.

Figure 6. Hamiltonian (internal energy) versus time for the heat equation.

6. Conclusions and Perspectives

We have provided a general structure for the theoretical and numerical solution of infinite-dimensional port-Hamiltonian systems. This structure is particularly appealing since PFEM straightforwardly applies. Concerning the numerical solution, PFEM offers the advantage to leverage robust software components for the discretization of boundary controlled PDEs and time integration.

We have applied this strategy to abstract multidimensional linear hyperbolic and parabolic boundary controlled systems. We have notably shown that model problems based on the wave equation, Mindlin equation and heat equation fit within this unified theoretical framework. Numerical simulations of infinite-dimensional pHs have been performed with the ongoing software project SCRIMP that has been briefly introduced. Finally, we have illustrated how to solve three case studies within this framework by carefully explaining the methodology, and have provided companion interactive Jupyter notebooks.

Besides the generalization of the classes related to the heat and wave equation to the three-dimensional case, we plan to propose in SCRIMP more advanced model problems based on the two-dimensional Shallow Water Equation (SWE) [57] [41], the Kirchhoff model for thin plates [40] and Maxwell’s equations [32]. Furthermore, we will investigate both time integration methods that allow structure-preserving time discretization [58] of finite-dimensional pHs and more accurate time integrators for nonlinear pHDAE. In addition, we plan to enrich the panel of structure-preserving model reduction algorithms to facilitate the simulation of large-scale port-Hamiltonian systems. This is an essential prerequisite before first attempts related to control design. Further developments foresee the comparisons with well-established algorithms for multi-physics problems leading to coupled systems of PDEs.

Acknowledgements

This work is supported by the project ANR-16-CE92-0028, entitled *Interconnected Infinite-Dimensional systems for Heterogeneous Media*, INFIDHEM, financed by the French National Research Agency (ANR) and the Deutsche Forschungsgemeinschaft (DFG). Further information is available at https://websites.isae-supaero.fr/infidhem/the-project.

Moreover the authors would like to thank Michel Salaün and Denis Matignon for the fruitful and insightful discussions.

NOTES

^{1}https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html#scipy.integrate.solve_ivp

^{2}https://computing.llnl.gov/sites/default/files/cv_guide-5.7.0.pdf

^{3}https://computing.llnl.gov/projects/sundials/ida

^{4}https://gmsh.info/

References

[1] van der Schaft, A.J. and Maschke, B. (2002) Hamiltonian Formulation of Distributed-Parameter Systems with Boundary Energy Flow. Journal of Geometry and Physics, 42, 166-194.

https://doi.org/10.1016/S0393-0440(01)00083-3

[2] Le Gorrec, Y. and Matignon, D. (2013) Coupling between Hyperbolic and Diffusive Systems: A Port-Hamiltonian Formulation. European Journal of Control, 19, 505-512.

https://doi.org/10.1016/j.ejcon.2013.09.003

[3] van der Schaft, A.J. and Maschke, B. (2018) Geometry of Thermodynamic Processes. Entropy, 20, 1-23.

https://doi.org/10.3390/e20120925

[4] Vu, N.M.T., Lefèvre, L. and Maschke, B. (2016) A Structured Control Model for the Thermo-Magneto-Hydrodynamics of Plasmas in Tokamaks. Mathematical and Computer Modelling of Dynamical Systems, 3954, 1-26.

[5] Rashad, R., Califano, F., Van der Schaft, A.J. and Stramigioli, S. (2020) Twenty Years of Distributed Port-Hamiltonian Systems: A Literature Review. IMA Journal of Mathematical Control and Information, 37, 1400-1422.

https://doi.org/10.1093/imamci/dnaa018

[6] Brugnoli, A., Haine, G., Serhani, A. and Vasseur, X. (2020) Supplementary Material for “Numerical Approximation of Port-Hamiltonian Systems for Hyperbolic or Parabolic PDEs with Boundary Control”. Dataset on Zenodo.

[7] Brugnoli, A., Alazard, D., Pommier-Budinger, V. and Matignon, D. (2019) Port-Hamiltonian Formulation and Symplectic Discretization of Plate Models Part I: Mindlin Model for Thick Plates. Applied Mathematical Modelling, 75, 940-960.

https://doi.org/10.1016/j.apm.2019.04.035

[8] Cardoso-Ribeiro, F.L., Matignon, D. and Lefèvre, L. (2018) A Structure-Preserving Partitioned Finite Element Method for the 2D Wave Equation. IFAC-PapersOnLine, 51, 119-124.

https://doi.org/10.1016/j.ifacol.2018.06.033

[9] Serhani, A., Haine, G. and Matignon, D. (2019) Anisotropic Heterogeneous n-D Heat Equation with Boundary Control and Observation: I. Modeling as Port-Hamiltonian System. IFAC-PapersOnLine, 52, 51-56.

https://doi.org/10.1016/j.ifacol.2019.07.009

[10] Serhani, A., Haine, G. and Matignon, D. (2019) Anisotropic Heterogeneous n-D Heat Equation with Boundary Control and Observation: II. Structure-Preserving Discretization. IFAC-PapersOnLine, 52, 57-62.

https://doi.org/10.1016/j.ifacol.2019.07.010

[11] Toledo, J., Wu, Y., Ramírez, H. and Le Gorrec, Y. (2020) Observer-Based Boundary Control of Distributed Port-Hamiltonian Systems. Automatica, 120, Article ID: 109130.

https://doi.org/10.1016/j.automatica.2020.109130

[12] Krug, R., Mehrmann, V. and Schmidt, M. (2020) Nonlinear Optimization of District Heating Networks. Optimization and Engineering.

https://doi.org/10.1007/s11081-020-09549-0

[13] Golo, G., Talasila, V., Van der Schaft, A.J. and Maschke, B. (2004) Hamiltonian Discretization of Boundary Control Systems. Automatica, 40, 757-771.

https://doi.org/10.1016/j.automatica.2003.12.017

[14] Moulla, R., Lefèvre, L. and Maschke, B. (2012) Pseudo-Spectral Methods for the Spatial Symplectic Reduction of Open Systems of Conservation Laws. Journal of Computational Physics, 231, 1272-1292.

https://doi.org/10.1016/j.jcp.2011.10.008

[15] Trenchant, V., Ramírez, H., Le Gorrec, Y. and Kotyczka, P. (2018) Finite Differences on Staggered Grids Preserving the Port-Hamiltonian Structure with Application to an Acoustic Duct. Journal of Computational Physics, 373, 673-697.

https://doi.org/10.1016/j.jcp.2018.06.051

[16] Kotyczka, P., Maschke, B. and Lefèvre, L. (2018) Weak Form of Stokes-Dirac Structures and Geometric Discretization of Port-Hamiltonian Systems. Journal of Computational Physics, 361, 442-476.

https://doi.org/10.1016/j.jcp.2018.02.006

[17] Kotyczka, P. (2019) Numerical Methods for Distributed Parameter Port-Hamiltonian Systems. TUM University Press, Munich.

[18] Kirby, R.C. and Kieu, T.T. (2015) Symplectic-Mixed Finite Element Approximation of Linear Acoustic Wave Equations. Numerische Mathematik, 130, 257-291.

https://doi.org/10.1007/s00211-014-0667-4

[19] Altmann, R. and Schulze, P. (2017) A Port-Hamiltonian Formulation of the Navier-Stokes Equations for Reactive Flows. Systems & Control Letters, 100, 51-55.

https://doi.org/10.1016/j.sysconle.2016.12.005

[20] Haine, G., Matignon, D. and Serhani, A. (2020) Numerical Analysis of a Structure-Preserving Space-Discretization for an Anisotropic and Heterogeneous Boundary Controlled N-Dimensional Wave Equation as Port-Hamiltonian System.

[21] Joly, P. (2003) Variational Methods for Time-Dependent Wave Propagation Problems. In: Ainsworth, M., Davies, P., Duncan, D., Rynne, B. and Martin, P., Eds., Topics in Computational Wave Propagation: Direct and Inverse Problems, Volume 31 of Lecture Notes in Computational Science and Engineering, Springer, Berlin, 201-264.

[22] Boffi, D., Brezzi, F. and Fortin, M. (2013) Mixed Finite Element Methods and Applications. Volume 44 of Springer Series in Computational Mathematics, Springer-Verlag, Berlin.

https://doi.org/10.1007/978-3-642-36519-5

[23] Alnæs, M.S., Blechta, J., Hake, J., Johansson, A., Kehlet, B., Logg, A., Richardson, C., Ring, J., Rognes, M.E. and Wells, G.N. (2015) The FEniCS Project Version 1.5. Archive of Numerical Software, 3, 9-23.

[24] Van der Schaft, A. and Jeltsema, D. (2014) Port-Hamiltonian Systems Theory: An Introductory Overview. Foundations and Trends^{®} in Systems and Control, 1, 173-378.

https://doi.org/10.1561/2600000002

[25] Courant, T.J. (1990) Dirac Manifolds. Transactions of the American Mathematical Society, 319, 631-661.

https://doi.org/10.1090/S0002-9947-1990-0998124-1

[26] Beattie, C., Mehrmann, V., Xu, H. and Zwart, H. (2018) Linear Port-Hamiltonian Descriptor Systems. Mathematics of Control, Signals, and Systems, 30, 17.

https://doi.org/10.1007/s00498-018-0223-3

[27] Mehrmann, V. and Morandin, R. (2019) Structure-Preserving Discretization for Port-Hamiltonian Descriptor Systems. 2019 IEEE 58th Conference on Decision and Control (CDC), Nice, 11-13 December 2019, 6863-6868.

https://doi.org/10.1109/CDC40024.2019.9030180

[28] Renardy, M. and Rogers, R.C. (2004) An Introduction to Partial Differential Equations. Number 13 in Texts in Applied Mathematics. 2nd Edition, Springer-Verlag, New York.

[29] Tucsnak, M. and Weiss, G. (2009) Observation and Control for Operator Semi-Groups. Birkhäuser Advanced Texts: Basler Lehrbücher. Birkhäuser Verlag, Basel.

[30] Serhani, A., Matignon, D. and Haine, G. (2019) A Partitioned Finite Element Method for the Structure-Preserving Discretization of Damped Infinite-Dimensional Port-Hamiltonian Systems with Boundary Control. In: Nielsen, F. and Barbaresco, F., Eds., Geometric Science of Information, Volume 11712 of Lecture Notes in Computer Science, Springer, Cham, 549-558.

https://doi.org/10.1007/978-3-030-26980-7_57

[31] Serhani, A., Matignon, D. and Haine, G. (2019) Partitioned Finite Element Method for Port-Hamiltonian Systems with Boundary Damping: Anisotropic Heterogeneous 2-D Wave Equations. IFAC-PapersOnLine, 52, 96-101.

https://doi.org/10.1016/j.ifacol.2019.08.017

[32] Payen, G., Matignon, D. and Haine, G. (2020) Modelling and Structure-Preserving Discretization of Maxwell’s Equations as Port-Hamiltonian System. Proceedings of the 21st IFAC World Congress, Volume 53, 7671-7676.

https://doi.org/10.1016/j.ifacol.2020.12.1355

[33] Kurula, M. and Zwart, H. (2015) Linear Wave Systems on n-D Spatial Domains. International Journal of Control, 88, 1063-1077.

[34] Timoshenko, S. and Woinowsky-Krieger, S. (1959) Theory of Plates and Shells. Engineering Societies Monographs. McGraw-Hill, New York.

[35] Brugnoli, A. (2020) A Port-Hamiltonian Formulation of Flexible Structures. Modelling and Structure-Preserving Finite Element Discretization. PhD Thesis, Université de Toulouse, ISAE-SUPAERO, Toulouse.

[36] Arnold, D. and Lee, J. (2014) Mixed Methods for Elastodynamics with Weak Symmetry. SIAM Journal on Numerical Analysis, 52, 2743-2769.

https://doi.org/10.1137/13095032X

[37] Arnold, D. and Winther, R. (2002) Mixed Finite Elements for Elasticity. Numerische Mathematik, 92, 401-419.

https://doi.org/10.1007/s002110100348

[38] Arnold, D., Brezzi, F. and Douglas, J. (1984) Peers: A New Mixed Finite Element for Plane Elasticity. Japan Journal of Applied Mathematics, 1, 347.

https://doi.org/10.1007/BF03167064

[39] Beirão da Veiga, L., Mora, D. and Rodríguez, R. (2013) Numerical Analysis of a Locking-Free Mixed Finite Element Method for a Bending Moment Formulation of Reissner-Mindlin Plate Model. Numerical Methods for Partial Differential Equations, 29, 40-63.

https://doi.org/10.1002/num.21698

[40] Brugnoli, A., Alazard, D., Pommier-Budinger, V. and Matignon, D. (2019) Port-Hamiltonian Formulation and Symplectic Discretization of Plate Models Part II: Kirchhoff Model for Thin Plates. Applied Mathematical Modelling, 75, 961-981.

https://doi.org/10.1016/j.apm.2019.04.036

[41] Cardoso-Ribeiro, F.L., Matignon, D. and Lefèvre, L. (2020) A Partitioned Finite Element Method for Power-Preserving Discretization of Open Systems of Conservation Laws. IMA Journal of Mathematical Control and Information, 1-41.

[42] Brugnoli, A., Cardoso-Ribeiro, F.L., Haine, G. and Kotyczka, P. (2020) Partitioned Finite Element Method for Power-Preserving Structured Discretization with Mixed Boundary Conditions. Proceedings of the 21st IFAC World Congress, Volume 53, 7647-7652.

https://doi.org/10.1016/j.ifacol.2020.12.1351

[43] Linge, S. and Langtangen, H.P. (2020) Programming for Computations Python. Springer, Berlin.

https://doi.org/10.1007/978-3-030-16877-3

[44] Alnæs, M.S., Logg, A., Ølgaard, K.B., Rognes, M.E. and Wells, G.N. (2014) Unified Form Language: A Domain-Specific Language for Weak Formulations of Partial Differential Equations. ACM Transactions on Mathematical Software, 40, Article No. 9.

https://doi.org/10.1145/2566630

[45] Kirby, R.C. and Logg, A. (2007) Efficient Compilation of a Class of Variational Forms. ACM Transactions on Mathematical Software, 33, 17-es.

https://doi.org/10.1145/1268769.1268771

[46] Logg, A. and Wells, G.N. (2010) DOLFIN: Automated Finite Element Computing. ACM Transactions on Mathematical Software, 37, 20.

https://doi.org/10.1145/1731022.1731030

[47] Logg, A., Mardal, K.A., Wells, G.N., et al. (2012) Automated Solution of Differential Equations by the Finite Element Method. Springer, Berlin.

https://doi.org/10.1007/978-3-642-23099-8

[48] Balay, S., Abhyankar, S., Adams, M.F., Brown, J., Brune, P., Buschelman, K., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W.D., Karpeyev, D., Kaushik, D., Knepley, M.G., May, D.A., McInnes, L.C., Mills, R.T., Munson, T., Rupp, K., Sanan, P., Smith, B.F., Zampini, S., Zhang, H. and Zhang, H. (2020) PETSc Users Manual. Technical Report ANL-95/11 Revision 3.13, Argonne National Laboratory.

[49] Andersson, C., Führer, C. and Åkesson, J. (2015) Assimulo: A Unified Framework for ODE Solvers. Mathematics and Computers in Simulation, 116, 26-43.

https://doi.org/10.1016/j.matcom.2015.04.007

[50] Hindmarsh, A.C., Brown, P., Grant, K.E., Lee, S., Serban, R., Shumaker, D. and Woodward, C. (2005) SUNDIALS: Suite of Nonlinear and Differential/Algebraic Equation Solvers. ACM Transactions on Mathematical Software (TOMS), 31, 363-396.

https://doi.org/10.1145/1089014.1089020

[51] Serhani, A. (2020) Systèmes couplés d’EDPs, vus comme des systèmes Hamiltoniens à ports avec dissipation: Analyse théorique et simulation numérique. PhD Thesis, Université de Toulouse, ISAE-SUPAERO, Toulouse.

[52] Abhyankar, S., Brown, J., Constantinescu, E., Ghosh, D., Smith, B. and Zhang, H. (2018) PETSc/TS: A Modern Scalable ODE/DAE Solver Library.

[53] Chaturantabut, S., Beattie, C. and Gugercin, S. (2016) Structure-Preserving Model Reduction for Nonlinear Port-Hamiltonian Systems. SIAM Journal on Scientific Computing, 38, B837-B865.

https://doi.org/10.1137/15M1055085

[54] Egger, H., Kugler, T., Liljegren-Sailer, B., Marheineke, N. and Mehrmann, V. (2018) On Structure-Preserving Model Reduction for Damped Wave Propagation in Transport Networks. SIAM Journal on Scientific Computing, 40, A331-A365.

https://doi.org/10.1137/17M1125303

[55] Cohen, G. and Grob, P. (2007) Mixed Higher Order Spectral Finite Elements for Reissner-Mindlin Equations. SIAM Journal on Scientific Computing, 29, 986-1005.

https://doi.org/10.1137/050642332

[56] Benner, P. and Heiland, J. (2015) Time-Dependent Dirichlet Conditions in Finite Element Discretizations. ScienceOpen Research.

https://doi.org/10.14293/S2199-1006.1.SOR-MATH.AV2JW3.v1

[57] Cardoso-Ribeiro, F., Brugnoli, A., Matignon, D. and Lefèvre, L. (2019) Port-Hamiltonian Modeling, Discretization and Feedback Control of a Circular Water Tank. 2019 IEEE 58th Conference on Decision and Control (CDC), Nice, 11-13 December 2019, 6881-6886.

https://doi.org/10.1109/CDC40024.2019.9030007

[58] Kotyczka, P. and Lefèvre, L. (2018) Discrete-Time Port-Hamiltonian Systems: A Definition Based on Symplectic Integration. Systems and Control Letters, 133, Article ID: 104530.

https://doi.org/10.1016/j.sysconle.2019.104530