Dirac and Lagrange Algebraic Constraints in Nonlinear Port-Hamiltonian Systems

After recalling the definitions of standard port-Hamiltonian systems and their algebraic constraints, called here Dirac algebraic constraints, an extended class of port-Hamiltonian systems is introduced. This is based on replacing the Hamiltonian function by a general Lagrangian submanifold of the cotangent bundle of the state space manifold, motivated by developments in (Barbero-Linan et al., J. Geom. Mech. 11, 487–510, 2019) and extending the linear theory as developed in (van der Schaft and Maschke, Syst. Control Lett. 121, 31–37, 2018) and (Beattie et al., Math. Control Signals Syst. 30, 17, 2018). The resulting new type of algebraic constraints equations are called Lagrange algebraic constraints. It is shown how Dirac algebraic constraints can be converted into Lagrange algebraic constraints by the introduction of extra state variables, and, conversely, how Lagrange algebraic constraints can be converted into Dirac algebraic constraints by the use of Morse families.


Introduction
When modeling dynamical systems, the appearance of algebraic constraint equations is ubiquitous. This is especially clear in network modeling of physical systems, where the interconnections between different dynamical components of the overall system almost inevitably lead to algebraic constraints. On the other hand, the analysis and simulation of such systems of differential-algebraic equations (DAEs) poses delicate problems; especially in the nonlinear case, see e.g. the already classical treatise [9], and the references quoted in there. The situation is even more challenging for control of DAE systems, and, up to now, most of the control literature is confined to systems without algebraic constraints.
On the other hand, the DAE systems as resulting from the modeling of physical systems often have special properties, which makes their analysis, simulation and control potentially more feasible. A prominent framework for network modeling of multiphysics systems is port-based modeling, and the resulting theory of port-Hamiltonian systems; see e.g. [7,8,11,12,[15][16][17]. In [14], see also [15], initial investigations were done about the algebraic constraint equations appearing in standard port-Hamiltonian systems; linear and nonlinear. The two main conclusions are that the algebraic constraints in such systems have index one once the Hamiltonian is non-degenerate in the state variables, and that furthermore elimination of algebraic constraints generally leads to systems that are again in port-Hamiltonian form.
Very recently, see especially [3], another type of algebraic constraint equations in linear physical system models was studied. In [3,18], these were identified as arising from generalized port-based modeling with a state space that has higher dimension than the minimal number of energy variables, corresponding to implicit energy storage relations which can be formulated as Lagrangian subspaces. For linear time-varying systems this formulation has led to various interesting results on their index, regularization and numerical properties [10]; see also [4] for related developments. The formulation of implicit energy storage relations is very similar to an independent line of research initiated in [2], where the Hamiltonian in nonlinear Hamiltonian dynamics is replaced by a general Lagrangian submanifold (motivated, among others, by optimal control).
The precise relation between the algebraic constraints as arising in linear standard port-Hamiltonian systems (called Dirac algebraic constraints) and those in linear generalized port-Hamiltonian systems with implicit storage (called Lagrange algebraic constraints) was studied in [3,18]. In particular, in [18] it was shown how in this linear case Dirac algebraic constraints can be converted into Lagrange algebraic constraints, and conversely. In both cases this is done by extending the state space (by Lagrange multipliers).
In the present paper we will continue on [3,18], by extending the developed theory and constructions to the nonlinear case; inspired by [2].

The Standard Definition of Port-Hamiltonian Systems and Dirac Algebraic Constraints
The standard definition of a port-Hamiltonian system, see e.g. [8,[14][15][16][17] for more details and further ramifications, is depicted in Fig. 1.
The system is modeled by identifying energy-storing elements S and energy-dissipating elements R, which are linked to a central energy-routing structure, geometrically to be defined as a Dirac structure. This linking takes place via pairs (f, e) of equally dimensioned vectors f and e (commonly called flow and effort variables). A pair (f, e) of vectors of flow and effort variables defines a port, and the total set of variables f, e is also called the set of port variables. Figure 1 shows three ports: the port (f S , e S ) linking to energy storage, the port (f R , e R ) corresponding to energy dissipation, and the external port (f P , e P ), by which the system interacts with its environment (including controller action). The scalar quantities e T S f S , e T R f R and e T P f P denote the instantaneous powers transmitted through the links. Any physical system that is represented (modeled) in this way defines a e S e R f S f R e P f P routing storage dissipation Fig. 1 From port-based modeling to port-Hamiltonian system port-Hamiltonian system. Furthermore, experience has shown that even for very complex physical systems port-based modeling leads to satisfactory and insightful models; certainly for control purposes; see e.g. [11,15,16], and the references quoted in there.
The geometric definition of a (constant) Dirac structure starts from a finite-dimensional linear space of flows F and the dual linear space of efforts E := F * . The power P on the total space F × E of port variables is defined by the duality product P = e|f . In the common case F E R k this simply amounts to P = e T f .
The maximal dimension of any subspace D ⊂ F × E satisfying the power-conservation property (i) is easily shown to be equal to dim F. Thus a constant Dirac structure is a maximal power-conserving subspace.
In the nonlinear case, e.g. 3D mechanical systems, the notion of a constant Dirac structure as above needs to be extended to a Dirac structure on a manifold 1 M.
x M is a constant Dirac structure as before.
Note that in the standard definition [5,6] of a Dirac structure on a manifold an additional integrability condition is imposed; generalizing the Jacobi identity for Poisson structures or closedness of symplectic forms. However, for many purposes this integrability condition is not needed, while furthermore there are interesting port-Hamiltonian system classes (like mechanical systems with nonholonomic kinematic constraints) that do not satisfy this integrability condition [8,15,16].
The dynamics of port-Hamiltonian systems derives from the time-integration taking place at the energy storage port. Let f S , e S be the vector of flow and effort variables of the energy storage port. Time-integration of the flow vector f S leads to the equally dimensioned vector of state variables x ∈ X satisfyingẋ = −f S . Energy storage in a standard port-Hamiltonian system is then expressed by a Hamiltonian (total energy) defining the co-tangent vector 2 e S = ∇H (x), with ∇H (x) denoting the column vector of partial derivatives of H . Obviously, this implies i.e., the increase of stored energy is equal to the power delivered to the energy-storing elements through the left link in Fig. 1. Furthermore, energy dissipation is any relation R between the flow and effort variables f R , e R of the energy-dissipating port having the property that Consider now a Dirac structure D on the manifold Then the triple (D, H, R), with energy storage H : X → R, and energy dissipation R ⊂ F R × E R defines a port-Hamiltonian system (sometimes abbreviated as pH system), geometrically defined as the implicit dynamics in the state variables x, with external port-variables f P , e P . A specific class of port-Hamiltonian systems is obtained by considering Dirac structures which are the graph of a skew-symmetric bundle map ⎡ from e S , e R , e P to f S , f R , f P , and a linear energy dissipation relation e R = −Rf R for some matrixR =R T ≥ 0. This yields input-state-output port-Hamiltonian systemṡ where u = e P is the input and y = f P the output vector. This is often taken as the starting point for control purposes [15].
On the other hand, for a general Dirac structure algebraic constraints in the state variables x may easily appear; leading to port-Hamiltonian systems which are not of the form (5). In fact, if the projection ρ ; leading to algebraic constraints [8,14,15]. In the sequel these algebraic constraints, stemming directly from port-based modeling, will be referred to as Dirac algebraic constraints.

Port-Hamiltonian Systems with Implicit Energy Storage and Lagrange Algebraic Constraints
An interesting extension of the standard nonlinear port-Hamiltonian systems as discussed in the previous section is obtained as follows.
For any Hamiltonian H : X → R the submanifold defines a Lagrangian submanifold 4 [1] of the cotangent bundle T * X . Thus, instead of considering energy storage defined by a Hamiltonian H , we may as well consider an implicit energy storage defined by a general Lagrangian submanifold L. In fact [1] a general Lagrangian submanifold L ⊂ T * X will be of the form graph ∇H for a certain H if and only if the projection of L ⊂ T * X to X under the canonical projection π : T * X → X is equal to the whole of X . On the other hand, if the projection π(L) of L ⊂ T * X to X is not equal to the whole of X , then a new class of algebraic constraints arises, namely the constraints x ∈ π(L). These algebraic constraints will be called Lagrange algebraic constraints; extending the terminology of the linear case in [18]. The resulting triple (D, L, R) will be called a generalized port-Hamiltonian system, defining the dynamics (generalizing (4)) (−ẋ(t), f R (t), f P (t), e S (t), e R (t), e P (t)) ∈ D(x(t)), (f R (t), e R (t)) ∈ R, (x(t),e S (t)) ∈ L, t ∈ R in the state variables x, with external port-variables f P , e P . The basic idea of this definition (without the inclusion of an energy dissipation relation and external port) can be already found in [2]. The definition of the generalized port-Hamiltonian system (D, L, R) with dynamics (6) extends the definition in the linear case as recently given in [18] (partly motivated by [3]).

Properties of the Legendre Transform
Before discussing the properties of generalized port-Hamiltonian systems and their Lagrange algebraic constraints, let us recall the basic properties of the Legendre transform.
Consider a smooth function P : X → R, where X is an n-dimensional convex domain contained in R n with linear coordinates x. Furthermore, as before denote the column vector of partial derivatives of P by ∇P (x). The Legendre transform of P is defined as the expression where e are corresponding coordinates for the cotangent space. In the expression (7) it is meant that x is expressed as a function of e through the equation e = ∇P (x); thus obtaining a function P * of e only. This requires the map x → ∇P (x) to be bijective. 5 A well-known property of the Legendre transform is the fact that the Legendre transform of P * is equal to P ; i.e., P * * = P . Furthermore, the inverse of the map x → e = ∇P (x) is given as e → x = ∇P * (e), that is Given the Legendre transform P * of P one may also define the new function P (x) := P * (∇P (x)).
In case of a quadratic function P (x) = x T Mx, for some invertible symmetric matrix M, it is obvious to check that P = P . However for a general P this need not be the case.
Using P * (e) = e T x − P (x), x = ∇P * (e), and the identity ∇P (∇P * (e)) = e, the function P can be alternatively expressed as Furthermore, we note the following remarkable property with ∇ 2 P (x) denoting the Hessian matrix of P . Finally, all of this theory can be extended to partial Legendre transformations as follows.

Explicit Representation of Implicit Storage Relations
In this subsection we will show how generalized port-Hamiltonian systems (D, L, R) with implicit energy storage relations L ⊂ T * X can be locally represented as standard port-Hamiltonian systems (with explicit energy storage). This extends the observations made in the linear case [3,18] in a non-trivial way. The starting point is the fact that any Lagrangian submanifold L ⊂ T * X can be locally written as [1] 5 More generally, i.e., without this assumption, we can still define P * as the restriction of the function e T x − P (x) defined on T * X , but restricted to the submanifold e = ∇P (x). On this submanifold obviously the partial derivatives of e T x − P (x) with respect to x are zero, and thus the function is a function of e only. 6 Here ∂V ∂xI denotes the column vector of partial derivatives of V with respect to x I ; similarly for ∂V ∂eJ .
By (9) the expressions of −f S =ẋ and e S , in terms of the coordinates x I , e J , are given as Consider furthermore any modulated Dirac structure D(x) ⊂ T x X ×T * x X ×F R ×E R ×F P × E P . Since by the power-conservation property of Dirac structures −e T S f S = e T R f R + e T P f P it thus follows that

e J (t)) = e T R (t)f R (t) + e T P (t)f P (t) ≤ e T P (t)f P (t).
Hence H (x I , e J ) serves as the expression of an energy function. (However, not in the original state variables x, but instead in the mixed set of coordinates x I , e J .) Note that if the mapping x J = − ∂V ∂e J from e J to x J is invertible, and hence the Lagrangian submanifold can be also parametrized by x = (x I , x J ), so that L = {(x, ∇H (x)) | x ∈ X } for a certain H , then actually − H (x I , x J ) is the partial Legendre transform of V (x I , e J ) with respect to e J , and equals H .
As another special case, assume I to be empty, implying that e J = e S . Let V * (x) be the Legendre transform of V (e S ). Then in view of (8) it follows that V (e S ) − e T S ∇V (e S ) = − V (e S ).

Transformation of Dirac Algebraic Constraints into Lagrange Algebraic Constraints, and Back
In the previous sections it was discussed how, (1) in standard port-Hamiltonian systems (D, H, R) Dirac algebraic constraints arise whenever the projection of the Dirac structure D on the cotangent space of the state space is not the whole cotangent space, and (2) generalized port-Hamiltonian systems (D, L, R) have Lagrange algebraic constraints whenever the projection of L on the state space manifold X is not surjective (implicit energy storage). Furthermore, Dirac algebraic constraints are favored by port-based modeling, but on the other hand Lagrange algebraic constraints may have advantages from a numerical simulation point of view.
In this section we will show how one can always convert Dirac algebraic constraints into Lagrange algebraic constraints by adding extra state variables. Conversely, Lagrange algebraic constraints can be converted into Dirac algebraic constraints, again by the addition of extra state variables. This extends the constructions detailed in [18] from the linear to the nonlinear case.

From Dirac Algebraic Constraints to Lagrange Algebraic Constraints
The first observation [8] to be made is that any Dirac structure D can be locally written as the graph of a skew-symmetric map on an extended state space as follows. In fact, suppose π * (D(x)) ⊂ T x X * is (n − k)-dimensional. Define := R k . Then there exists a full-rank n × k matrix B(x) : * → T x X and a skew-symmetric n × n matrix J (x) such that locally (11) Conversely, any such equations for a skew-symmetric map J (x) : T * x X → T x X define a Dirac structure. Now, let the energy-storage relation of the port-Hamiltonian system be given in a standard way; i.e., by a Hamiltonian H : X → R. Then with respect to the extended state space X e := X × we may define the implicit energy storage relation given by the Lagrangian submanifold (of the same type as in (9)) corresponding to the Lagrange algebraic constraints 0 = λ( = B T (x)∇H (x)). Hence the Dirac algebraic constraint 0 = B T (x)∇H (x) has been transformed into the Lagrange algebraic constraint λ = 0 on the extended state space X e . The generating function of L e is H , which is independent of λ * , and therefore H (x, λ * ) . This is summarized in the following proposition. (D, H, R) with Dirac algebraic constraints. By representing the Dirac structure as in (11) one obtains a generalized port-Hamiltonian system (D e , L e , R) on the extended state space X e := X × with extended Dirac structure D e being the graph of the skew-symmetric matrix

Proposition 1 Consider a standard port-Hamiltonian system
and thus without Dirac algebraic constraints. Furthermore, the Lagrangian submanifold L e is defined by (12), and induces Lagrange algebraic constraints.

From Lagrange Algebraic Constraints to Dirac Algebraic Constraints
Conversely, Lagrange algebraic constraints can be converted into Dirac algebraic constraints; also by an extension of the state space. This is based on the fact, see e.g. [2] and the references quoted in there, that any Lagrangian submanifold L ⊂ T * X can be locally represented by a parametrized family of generating functions, called a Morse family.
To be precise, given a Lagrangian submanifold L ⊂ T * X , a point p ∈ L and projection π(p) ∈ X , there exists a neighborhood V of π(p), a natural number k, a neighborhood W of 0 ∈ R k , together with a smooth function F : V × W → R, such that the rank of ∂F ∂λ , with λ ∈ := R k , is equal to k on ∂F ∂λ −1 (0), and is a neighborhood of the point p in L. The function F (x, λ), seen as a function of x, parametrized by λ, is called a Morse family for the Lagrangian submanifold L. Furthermore, given any (modulated) Dirac structure D(x) ⊂ T x X × T * x X × F R × E R × F P × E P as before, one may take the direct product with the (trivial) Dirac structure {(f λ , e λ ) | e λ = 0}, so as to obtain an extended Dirac structure D e . This defines an by a Hamiltonian depending on part of the state variables and a complementary part of the co-state variables. Also, by extension of the state space (by Lagrange multipliers) we have shown how Dirac algebraic constraints can be converted into Lagrange algebraic constraints, and conversely.
This work should be seen as a starting point for further study about the numerical properties of the resulting structured classes of nonlinear DAE systems; including their index and regularization [9]. In particular, the possibility of converting Dirac algebraic constraints into Lagrange algebraic constraints could have advantages for numerical simulation. Also it motivates the development of control theory for classes of physical nonlinear DAE systems, as well as extensions to the distributed-parameter case.

Compliance with Ethical Standards
Conflict of interests The authors declare that they have no conflict of interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommonshorg/licenses/by/4.0/.