{'fraction_non_alphanumeric': 0.03864078622471506, 'fraction_numerical': 0.00966428466305823, 'mean_word_length': 4.718533757247054, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Numerical approximation of port-Hamiltonian systems for hyperbolic or parabolic PDEs with boundary control

The present manuscript concerns the design of structure-preserving discretization methods for the solution of systems of boundary controlled Partial Differential Equations (PDEs) thanks to the port- Hamiltonian formalism. We first provide a general structure of infinite-dimensional port-Hamiltonian systems (pHs) for which the Partitioned Finite Element Method (PFEM) straightforwardly applies. The proposed strategy is particularised to abstract multidimensional linear hyperbolic and parabolic systems of PDEs. Then we show that instructional model problems based on the wave equation, Mindlin equation and heat equation fit within this unified framework. Secondly we introduce the ongoing project SCRIMP (Simulation and ContRol of Interactions in Multi-Physics) developed for the numerical simulation of infinite-dimensional pHs. SCRIMP notably relies on the FEniCS open-source computing platform for the finite element spatial discretization. Finally, we illustrate how to solve the considered model problems within this framework by carefully explaining the methodology. As additional support, companion interactive Jupyter notebooks are provided.


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 of versatility and adaptability, especially when the modelling is of increasing complexity as in realworld applications.
Infinite-dimensional port-Hamiltonian systems (pHs) have been first introduced in [52] 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. [34,54,55]. This twenty-year-old framework [41] 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 an energy), and last but not least: the interconnection of multiple pHs remains a pHs. This allows a "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 an approximated finite-dimensional pHs at the discrete level. The first attempt dates back to [24], 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 [39]. Unfortunately this method seems to be limited to the one-dimensional case. A finite difference method with staggered grids was developed in [49] 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 [32] 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 [41,30] and the references therein.
Thanks to [18] it has become clear that there exists a deep relation between structure-preserving discretization of pHs and mixed finite elements. Indeed velocity-stress formulations for the wave dynamics [28] and elastodynamics problems are of Hamiltonian type and their mixed discretization preserves this structure. This leads to the intuition that a mixed finite element technique may be used to discretize the underlying geometric structure of pHs in a unified way, translating the infinite dimensional Stokes-Dirac structure into a finite Dirac structure. 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. [25] for a recent proof on the wave equation, that does not require the fulfilment of the usual inf-sup condition for mixed finite elements. This expresses a possible intrinsic locking free property of PFEM.
It has to be pointed out that the core idea of PFEM, i.e. performing an integration by parts on a partition of the weak formulation of the system of equations, has already been proposed for closed hyperbolic systems in [27]. Therein, the formulations are called either primal-dual or dual-primal, depending on the chosen partition of the system.
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 [2], selected in the ongoing project SCRIMP (Simulation and ContRol of Interactions in Multi-Physics) for its robustness and efficiency.
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 [16] are discussed to illustrate our methodology.
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 [16] are thoroughly explained. Conclusions and perspectives are finally drawn in Section 6.

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.

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 [51]: where H(x) : X R n → R, the Hamiltonian, is a real-valued function of the vector of energy variables x, bounded from below. Matrix-valued functions J(x) (the structure operator ) and R(x) (the dissipative or resistive operator ) are skew-symmetric and symmetric positive semi-definite respectively. The control u ∈ R m is applied thanks to the matrix-valued control function B(x) of size m × n. Variable y ∈ 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 ∇H(x) is made of the co-energy variables.
Due to the structural properties of J(x) and R(x), the port-Hamiltonian system enjoys the nice following power balance: meaning that R(x) accounts for dissipation, and that the input-output product corresponds to the power supplied to (or took from) the system, through the control u.
Flow-effort representation Consider two finite dimensional vector spaces E = F 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 × E is called the bond space of power variables. Therefore, identifying E as the dual of F , the power is defined as e, f := e(f ). 22], Def. 1.1.1). Given the finite-dimensional space F and its dual E with respect to the inner product ·, · F : F × F → R, consider the symmetric bilinear form: A Dirac structure on B := F × E is a subspace D ⊂ B, which is maximally isotropic under ·, · . Equivalently, a Dirac structure on B := F × E is a subspace D ⊂ B which equals its orthogonal companion with respect to ·, · , i.e. D = D [⊥] , where: The connection between the concept of Dirac structure and pHs in its canonical form (1) is achieved by considering the following ports: • the energy ports (f x , e x ) := dx dt , ∇H(x) ∈ R n × R n , made of the energy flow f x (time-derivative of the energy variables) and energy effort e x (the co-energy variables); • the resistive (or dissipative) ports (f R , e R ) ∈ R k × R k , made of the resistive (or dissipative) flow f R and resisitive (or dissipative) effort e R ; • the interconnection ports (f u , e u ) := (−y, u) ∈ R m × R m , made of the interconnection flow f u and interconnection effort e u .
From classical matrix factorizations in linear algebra, there exist matrices G (not necessarily square, of size k × n) and K symmetric positive semi-definite of size k × k such that R = G KG. These notations at hand, the pHs (1) rewrites: together with the (dissipative or resistive) constitutive relation: It is clear that the extended structure operator J e appearing in (3) is skew-symmetric of size (n + k + m) × (n + k + m). Its graph is a Dirac structure with respect to the Euclidean inner product, as a kernel representation, see [51]. Hence, it comes: Noting that dH dt = e x (x), f x (x) R n (by definition of the energy port) leads to: and thanks to the symmetry of R, (4) gives: Finally, from (3) and the definition of the energy 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 2.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 [51].
System 1 is a pHs in canonical form. Recently, finite-dimensional differential algebraic port-Hamiltonian systems (pHDAE) have been introduced both for linear [9] and nonlinear systems [38]. 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 := dx dt and e x := ∇H(x) 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.

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 an open connected set Ω ⊂ R d , d ∈ {1, 2, 3}, and the relation: By L 2 (Ω, X) we denote the space of square integrable X-valued functions. Symbol A, B denote either the space of scalars R, vectors R d , symmetric tensors R d×d sym =: S or a Cartesian product of those, depending on the particular example. The operator L : H L → L 2 (Ω, B) is a generic differential, and therefore linear but unbounded, operator. The notation L * : H −L * → L 2 (Ω, A) denotes the formal adjoint of L, defined by the relation: Throughout the paper, ·, · X denotes the inner product of the Hilbert space X. This definition is analogous to Definition 5.80 in [42]. In Section 3.2, the operator L is the gradient, denoted by grad, and its formal adjoint is the divergence, denoted by div, from the so-called Green's formula (integration by parts). In Section 3.3, the operator L contains both grad and Grad. This latter corresponds to the symmetric part of the gradient and represents the deformation tensor in continuum mechanics: Grad(e) := 1 2 ∇e + ∇ e , e ∈ C ∞ (R d ).
The formal adjoint of Grad is the tensor divergence Div. For a tensor field E : Ω → M := R d×d , with components e ij , the divergence is a vector, defined columnwise as: Finally, in Section 3.4, L is made of the gradient and the identity operator.
Stokes-Dirac structure Definition 2.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 0 −L * L 0 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 L is assumed to satisfy the abstract Green's formula: where the right-hand side is the duality bracket at the boundary, on a well-suited boundary functional space V ∂ for some trace operators Γ 0 , Γ ⊥ . From now on, this duality bracket will be denoted by ·, · ∂Ω with a slight abuse of notation. Remark 2.3. In practice, equation (7) dictates the causalities, i.e. the possible choices for the boundary control u ∂ and the boundary observation y ∂ , via the equality Γ 0 e 1 , Γ ⊥ e 2 ∂Ω = u ∂ , y ∂ ∂Ω (with a slight abuse of notation for the right-hand side to make sense).
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: or the other way: In light of (7), systems: and : define Stokes-Dirac structures with respect to the bilinear pairing: 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 α 1 , α 2 . The Hamiltonian is a generic functional of these variables H = H(α 1 , α 2 ). Its variational derivatives (see e.g. [53]) are by definition the co-energy variables: Then system (10) possesses the equivalent state representation: It holds u ∂ = e ∂ , y ∂ = −f ∂ . The power balance is naturally embedded in the Stokes-Dirac structure defined by (10): Linear hyperbolic systems The system is linear when the Hamiltonian has the form: where Q 1 , Q 2 are positive symmetric operators, bounded from below and above: with I A and I B the identity operators in L 2 (Ω, A) and L 2 (Ω, B) respectively. In this case, the co-energy variables are given by: Since Q 1 , Q 2 are positive and bounded from below and above, it is possible to invert them to obtain: giving rise to the co-energy formulation. The Hamiltonian is rewritten as: and a linear hyperbolic pHs (10) can be expressed as: 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(x) = 0. This simplification considerably facilitates the solution in time, as (1) is an Ordinary Differential Equation (ODE).
Parabolic systems In this case, the first flow f 1 still represents a dynamics ∂ t α 1 of the energy variable α 1 . The Hamiltonian then reads H = H(α 1 ), and its variational derivative gives the co-energy variable The second flow f 2 represents an extra flow related to the effort variable e 2 appearing in the dynamics of the energy variable α 1 . The relation is given implicitly by a mapping G as G(f 2 , e 2 ) = 0. Then, pHs (10) of parabolic type is expressed as: 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): In practice, this becomes explicit with the constitutive relation G(f 2 , e 2 ) = 0 as it will be seen in Section 3.4 (and more generally in [44,45]). Note that this latter relation has to be accurately discretized to ensure that the discretized power balance mimics the continuous one.
Remark 2.4. 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(x) 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 G. See [46,47] for a detailed discussion about structure-preserving discretization of dissipative systems.

The Partitioned Finite Element Method (PFEM)
We are now in a position to present 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 finitedimensional 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 [18]. The procedure is a natural extension of mixed finite elements 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 here used 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 [27]. 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 [27] 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.

General strategy
Consider smooth test functions v 1 and v 2 and the weak form of (5): 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 v 1 , −L * e 2 L 2 (Ω,A) In this case case, using (7), it is obtained: The boundary variable e ∂ := Γ ⊥ e 2 in (10) explicitly appears. Then the equation defining the corresponding f ∂ := Γ 0 e 1 is put into weak form to obtain the final system for all smooth test functions v 1 , v 2 , and v ∂ : 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 ≥ 0: where stands for v, f , and e and ϕ i 1 ∈ H L , ϕ i 2 ∈ L 2 (Ω, B), and ψ i ∂ ∈ L 2 (Ω, R m ). Then plugging the approximations into (22), it is computed: where vectors f 1 , f 2 , e 1 , e 2 , f ∂ , and e ∂ are given by the column-wise concatenation of the respective and e d ∂ , and where the matrices are defined as follows: (24) is a kernel representation of a Dirac structure as in (3) (see Remark 2.1).
Remark 3.1. Note that matrices D L and B ⊥ 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 = 1, 2, are given by the time derivative of the energy variables α i . Hence, the discretization of these energy variables is given by: The discrete Hamiltonian is then defined by , where α 1 and α 2 are the columnwise concatenation of the time varying coefficients of α d 1 and α d 2 in their respective basis. Definition 3.1. The discretization of the constitutive relations is said to be compatible if and only if: Proposition 3.1. If the discretisation of the constitutive relations is compatible, the discrete power balance reads at the discrete level: which perfectly mimics the continuous identity.
Proof. A straightforward computation gives: where the symmetry of the mass matrices and the Dirac structure have been used.

Remark 3.2.
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 α 1 . This energy variable is discretized as in the hyperbolic case. The discrete Hamiltonian is then defined by Definition 3.2. The discretization of the constitutive relation is said to be compatible if and only if: Proposition 3.2. If the discretisation of the constitutive relations is compatible, the discrete power balance reads at the discrete level: which perfectly mimics the continuous identity.
Proof. The proof can be derived similarly as in the hyperbolic case.
Remark 3.3. Of course, an accurate discretization of the implicit constitutive relation G(f 2 , e 2 ) = 0 is also required to conclude. This will be illustrated in Section 3.4.
Integration by parts of the term v 2 , Le 1 L 2 (Ω,B) Using (7), it comes: Now the boundary variable e ∂ := Γ 0 e 1 explicitly appears, i.e. the causality considered in (11). The weak formulation then reads: Plugging the approximations (23) into (26), this time with ϕ i 1 ∈ L 2 (Ω, A), ϕ i 2 ∈ H −L * , and ψ i ∂ ∈ L 2 (Ω, R m ), gives the following kernel representation of a finite-dimensional Dirac structure: where the matrices D −L * and B 0 are defined by: The power balances proven above still hold true with this causality, where the role played by e ∂ and f ∂ 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 [18]. 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.

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]): where ρ is the mass density (bounded from above and below), T is the tensorial Young modulus (symmetric and positive definite) and w is the deflection from the equilibrium. The field f accounts for distributed force, such as gravity.
Let us denote α p := ρ ∂w ∂t the linear momentum and α q := grad(w) the strain, as energy variables. Hence the Hamiltonian is given as the total energy (summing kinetic and potential energies) by: The co-energy variables are by definition the variational derivatives of H with respect to the energy variables, i.e.: the velocity and stress. With these notations, equation (29) rewrites: together with the constitutive relations given in (31). Let us denote: where γ 0 is the Dirichlet trace operator. Then the Hamiltonian (30) rewrites as (17). The wave equation (29) with Neumann boundary control u ∂ = γ ⊥ (e q ) is given by (18). The application of PFEM directly gives: where: are the discretizations of the operators M 1 and M 2 respectively.

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 [48]): where ρ is the mass density, b the plate thickness, w the vertical displacement, θ = (θ x , θ y ) collects the deflection of the cross section along axes x and y respectively. The fields f, τ represent distributed forces and torques. Variables M , q represent the momenta tensor and the shear stress. Hooke's law relates those to the curvature tensor and shear deformation vector: is the shear rigidity coefficient, where E Y is the Young modulus, ν is the Poisson modulus, K sh is the shear correction factor. Tensor D b is the bending stiffness: An appropriate selection of the energy variables is the following [13,12]: The Hamiltonian H (total energy) is expressed in terms of energy variables as: where A . . B denotes the tensor contraction. The co-energy variables are defined as follows: System (34) is then expressed in port-Hamiltonian form as [13] (forces and torques have been omitted for simplicity): By applying the divergence theorem, the energy rate is expressed as the duality product of the boundary variables: where: The traces γ 0 u = u| ∂Ω , γ ⊥ U = U · n| ∂Ω correspond to the Dirichlet trace for R d vectors and to the normal trace for R d×d tensors. The mass operators are given by: The L, Γ 0 , and Γ ⊥ operators are: Introducing the approximations for the test and co-energy variables: where = {v, e}, and for the boundary controls: PFEM can be applied to obtain: The notation Diag denotes a block diagonal matrix. The mass matrices M ρh , M I θ , M C b , M Cs are computed as: Matrices B w , B θ , M ∂,1 , M ∂,2 are computed as: The discrete Hamiltonian is then computed as: From system (45) the discrete energy rate is readily obtained: The discrete energy rate then mimics its infinite dimensional counterpart.
Remark 3.4. 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 [6] and a wave equation in mixed form. Conforming finite elements for the plane elasticity system on simplicial meshes have been constructed in [7]. The simpler PEERS elements based on a weak symmetry formulation have been proposed in [5]. The PEERS elements have been used in [10] to construct a stable locking-free mixed formulation for the static Mindlin problem.

The heat equation
The heat equation is the simplest example of parabolic system. Instead of rewriting the well-known PDE under a pHs, a direct pHs modelling is presented, as done in [44,45]. 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 Ω ⊂ 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: ρ the mass density, u the internal energy density, J Q the heat flux, T the local temperature, β := 1 T the reciprocal temperature, s the entropy density, J S := βJ Q the entropy flux, C V := du dT V the isochoric heat capacity.
The first law of thermodynamic reads: Under the hypothesis of an inert rigid solid, Gibbs formula reads dU = T dS, giving: Defining σ := grad (β) J Q , and seeing u as a function of the entropy density s, Gibbs formula (52) gives: Then σ 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 λ: J Q = −λ grad(T ).
Thanks to (51) and the equations of state, we easily recover the classical PDE for the temperature T : ρC V ∂T ∂t = div(λ grad(T )). The "L 2 -energy" Ω ρC V T 2 dΩ 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: α s := ρs, then: The co-energy variable is given by e s := δ αs H = dρu dρs = T , the local temperature. Denoting e S := J S , one can introduce a new flow variable f S such that: Obviously, f S = − grad(e s ). In order to get a formally skew-symmetric operator, let us also introduce an entropy port (f σ , e σ ), such that e σ = −σ. Then:  Let us define: Then, the heat equation (54) with boundary control e ∂ := u ∂ = Γ 0 e 1 = γ 0 (e s ) and boundary observation f ∂ := −y ∂ = Γ ⊥ e 2 = γ ⊥ (e S ) 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: where: To be compatible, the discretizations of the constitutive relations are given as follows: • Dulong-Petit model reads: ; • The constitutive law coming from the introduction of the irreversible entropy production, as explained in Remark 3.6, is taken into account by: Remark 3.7. In Fourier's law, the mass matrix M es 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.
that is the first law of thermodynamics at the discrete level.
Proof. Thanks to the compatible discretization of the Dulong-Petit model, Proposition 3.2 gives: By definition of f 2 , e 2 , M 2 , e ∂ , and f ∂ one computes: thanks to the constitutive relation (56) coming from the irreversible entropy production.
Remark 3.8. 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 3.9. The methodology detailed so far is certainly not limited to the previous three examples. Indeed higher-order differential [14], curl operator for Maxwell's equations [40], nonlinear system [19], 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 [44,45]. In addition, mixed boundary conditions can be incorporated either by introducing Lagrange multipliers or by employing a virtual domain decomposition method [15]. As already mentioned, dissipation (both in the domain and on the boundary) can also be considered in this strategy [47,46]. 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.

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 [16] 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.

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 [35]; • 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 [9]; • 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 [51]. Furthermore we note that interconnections of different systems (with e.g. the transformer or gyrator transformations [51]) 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 [16]. The description of the current numerical methods related to space and time discretizations available in SCRIMP is given.

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 [2], 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) [3], the FEniCS Form Compiler (FFC) [29] and the finite element library DOLFIN [37], 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 divconforming 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 [36]. Additionally, FEniCS also provides an interface for state-of-the-art linear solvers and preconditioners from freely available third-party libraries such as PETSc [8]. This last feature may be especially useful to handle the numerical simulation of large-scale pHs.

Time integration methods
As outlined in Section 3, after semi-discretization in space, the time integration 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 [4] 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 = f (t, y) with y(t 0 ) = 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 [26] 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 (t, y, y ) = 0 with y(t 0 ) = 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 [26, 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 [43] for illustrations and discussion. As a future direction, we plan to investigate the potential of the PETSc's time stepping library TS [1] to be able to tackle the solution of large-scale pHDAE systems.

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 [20] has been selected in the pHODE case. We refer the reader to [16] 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., [23]), 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.

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 [16] for additional information.

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.

Problem statement
We consider the two-dimensional heterogeneous anisotropic wave equation with impedance boundary condition defined for all (t ≥ 0) as: with Ω ⊂ R 2 an open bounded spatial domain with Lipschitz-continuous boundary ∂Ω. We consider here a rectangular shaped domain for Ω. w(t, x) denotes the deflection from the equilibrium position at point x ∈ Ω and time t. ρ ∈ L ∞ (Ω) (positive and bounded from below) denotes the mass density, T ∈ L ∞ (Ω) 2×2 (symmetric and coercive) the Young's elasticity modulus, a positive viscous damping parameter and Z(x) is the positive impedance function defined on ∂Ω, respectively.

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

Constants
We define the constants related to the rectangular domain Ω. The coordinates of the bottom left (x 0 , y 0 ) and top right (x L , y L ) corners of the rectangle are required.
We then define the time interval related to the time discretization. t i , 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. dt = 1.e-3 ode_library = 'ODE:Assimulo'

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[0] corresponds to the first spatial variable and x[1] 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 ∂Ω. 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.

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 Ω is of rectangular shape. To do so, we provide the coordinates of the bottom left and top right corners to the Wave_2D object.
W.Set_Rectangular_Domain(x0, xL, y0, yL); Remark 5.1. 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.

W.Set_Initial_Final_Time(ti, tf);
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.
W.Set_Physical_Parameters (Rho, T11, T12, T22); We then specify the complete modelling for the damping and thus provide information related to the impedance function and viscous damping parameter, respectively.

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 rf n_num corresponds to a mesh refinement parameter.
W.Set_Gmsh_Mesh('rectangle.xml', rfn_num=2); To perform the discretization in space, we must first specify the conforming finite element approximation spaces to be used (see [25]). Concerning the energy variables associated with the strain, we select the Raviart-Thomas finite element family known as RT 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 RT 0 P 1 P 1 family.
W.Set_Finite_Element_Spaces(family_q='RT', family_p='P', family_b='P',rq=0, rp=1,␣ →rb=1); 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).

W.Assembly(formulation='Div');
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.

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. Simulation interval : 0.0 -5.0 seconds. Elapsed simulation time: 0.9727537930002654 seconds.

Post-processing
We represent the two-dimensional mesh with corresponding degrees of freedom for each variable in Figure  1.
W.notebook = True W.Plot_Mesh_with_DOFs() The related Jupyter notebook [16] further illustrates how to obtain a structure-preserving reduced model of this port-Hamiltonian system. After application of the model reduction algorithm proposed in [20], 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 [15].

The Mindlin plate problem
We first recall the considered continuous problem related to the Mindlin plate and tackle the semidiscretization 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.

Problem statement
Consider the Mindlin plate problem defined for all t ≥ 0 as: with initial conditions: and boundary conditions: Mixed boundary conditions are considered in this example. The subsets Γ N , Γ 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 [15] for the wave equation. The following expressions have been considered for the initial and boundary conditions:

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

Constants
We define the constants related to the rectangular domain Ω. The coordinates of the bottom left (x 0 , y 0 ) = (0, 0) and the top right (x L , y L ) = (L x , L y ) corners of the rectangle are required.
As in the previous example, the time interval related to the time discretization is defined as follows: ti, tf = 0., 0.01 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. dt = 1.e-6 dae_library = 'DAE:RK4_Augmented'

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.

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 Ω is of rectangular shape. To define Ω, we provide the coordinates of the bottom left and top right corners to the Mindlin object.
Min.Set_Initial_Final_Time(ti, tf); The physical parameters related to the Mindlin plate are set.
Min.Set_Physical_Parameters(rho, h, E, nu, k, init_by_value=True); Finally the initial conditions in terms of co-energy variables are also set.

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.
Min.Generate_Mesh(10, structured_mesh=True); 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 [12]. This choice of finite elements is consistent with the one proposed in [21] for the elastodynamics problem. 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.

Min.Set_Finite_Elements_Spaces(r=1);
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 ∂ is assumed to take the form: Its derivativeu ∂ 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.

Min.Project_Boundary_Control() Min.Project_Initial_Data();
Finally the specification of the parameters related to the time discretization is made. Min.Set_Time_Setting(dt);

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 [11], 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.

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.

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 postprocessing is provided.

Problem statement
We consider the two-dimensional heterogeneous anisotropic heat equation defined for all t ≥ 0 as ρ(x) C V (x) ∂ ∂t T (t, x) = div λ(x) · grad T (t, x) , x ∈ Ω, T (0, x) = T 0 (x), x ∈ Ω, t = 0 with Ω ⊂ R 2 an open bounded spatial domain with Lipschitz-continuous boundary ∂Ω. v ∂ (t, x) represents the boundary control function on the temperature (the notation u is kept for the internal energy density). T (t, x) denotes the temperature at point x ∈ Ω and time t. ρ ∈ L ∞ (Ω) (positive and bounded from below) denotes the mass density, λ ∈ L ∞ (Ω) 2×2 (symmetric and coercive) the thermal conductivity. In the following Ω is assumed to be of rectangular shape.

Port-Hamiltonian formulation
We refer to [44,45] 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.

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.

H = Energy()
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.

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. dt = 1.e-3

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.

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 on 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.
Beside 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) [19,17], the Kirchhoff model for thin plates [14] and Maxwell's equations [40]. Furthermore we will investigate both time integration methods that allow structure-preserving time discretization [31] 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.