1 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].

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.

Fig. 1
figure 1

From port-based modeling to port-Hamiltonian system

The system is modeled by identifying energy-storing elements \(\mathcal {S}\) and energy-dissipating elements \(\mathcal {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 (fS, eS) linking to energy storage, the port (fR, eR) corresponding to energy dissipation, and the external port (fP, eP), 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 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 \(\mathcal {F}\) and the dual linear space of efforts \(\mathcal {E}:= \mathcal {F}^{\ast }\). The powerP on the total space \(\mathcal {F} \times \mathcal {E}\) of port variables is defined by the duality product P = 〈e|f〉. In the common case \(\mathcal {F} \simeq \mathcal {E} \simeq \mathbb {R}^{k}\) this simply amounts to P = eTf.

Definition 1

[5, 6] Consider a finite-dimensional linear space \(\mathcal {F}\) with \(\mathcal {E} = \mathcal {F}^{\ast }\). A subspace \(\mathcal {D} \subset \mathcal {F} \times \mathcal {E}\) is a Dirac structure if

  1. (i)

    e|f〉 = 0 for all \((f,e) \in \mathcal {D}\),

  2. (ii)

    \(\dim \mathcal {D} = \dim \mathcal {F}\).

The maximal dimension of any subspace \(\mathcal {D} \subset \mathcal {F} \times \mathcal {E}\) satisfying the power-conservation property (i) is easily shown to be equal to \(\dim \mathcal {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 manifoldFootnote 1\({\mathscr{M}}\).

Definition 2

[5, 6] A Dirac structure on a finite-dimensional manifold \({\mathscr{M}}\) is defined as a subbundle \(\mathcal {D} \subset T{\mathscr{M}} \oplus T^{\ast }{\mathscr{M}}\) such that for every \(x \in {\mathscr{M}}\) the subspace \(\mathcal {D}(x) \subset T_{x}{\mathscr{M}} \times T^{\ast }_{x}{\mathscr{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 fS, eS be the vector of flow and effort variables of the energy storage port. Time-integration of the flow vector fS leads to the equally dimensioned vector of state variables \(x \in \mathcal {X}\) satisfying \(\dot {x}=-f_{S}\). Energy storage in a standard port-Hamiltonian system is then expressed by a Hamiltonian (total energy)

$$ H: \mathcal{X} \to \mathbb{R}, $$
(1)

defining the co-tangent vectorFootnote 2eS = ∇H(x), with ∇H(x) denoting the column vector of partial derivatives of H. Obviously, this implies

$$ \frac{d}{dt}H(x(t))= \left( \nabla H(x(t))\right)^{T} \dot{x}(t)= - {e_{S}^{T}}(t)f_{S}(t), $$
(2)

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 \(\mathcal {R}\) between the flow and effort variables fR, eR of the energy-dissipating port having the property that

$$ {e_{R}^{T}}f_{R} \leq 0, \quad (f_{R},e_{R}) \in \mathcal{R}. $$
(3)

Consider now a Dirac structure \(\mathcal {D}\) on the manifold \(\mathcal {X} \times \mathcal {F}_{R} \times \mathcal {F}_{P}\), which is independentFootnote 3 of the point in \(\mathcal {F}_{R} \times \mathcal {F}_{P}\); i.e., for every \(x \in \mathcal {X}\)

$$ \mathcal{D}(x) \subset T_{x} \mathcal{X} \times \mathcal{F}_{R} \times \mathcal{F}_{P} \times T_{x}^{\ast} \mathcal{X} \times \mathcal{E}_{R} \times \mathcal{E}_{P} $$

is a Dirac structure as in Definition 1.

Then the triple \((\mathcal {D},H,\mathcal {R})\), with energy storage \(H: \mathcal {X} \to \mathbb {R}\), and energy dissipation \(\mathcal {R} \subset \mathcal {F}_{R} \times \mathcal {E}_{R}\) defines a port-Hamiltonian system (sometimes abbreviated as pH system), geometrically defined as the implicit dynamics

$$ \begin{array}{c} \left( -\dot{x}(t),f_{R}(t),f_{P}(t), \nabla H(x(t)), e_{R}(t), e_{P}(t)\right) \in \mathcal{D}(x(t)),\\ \left( f_{R}(t),e_{R}(t)\right) \in \mathcal{R}, \quad t \in \mathbb{R} \end{array} $$
(4)

in the state variables x, with external port-variables fP, eP.

A specific class of port-Hamiltonian systems is obtained by considering Dirac structures which are the graph of a skew-symmetric bundle map

$$ \left[\begin{array}{ccc} - J(x) & -G_{R}(x) & -G(x) \\ {G_{R}^{T}}(x) & 0 & 0 \\ G^{T}(x) & 0 & 0 \end{array}\right], \quad J(x)=-J^{T}(x), \quad x \in \mathcal{X}, $$

from eS, eR, eP to fS, fR, fP, and a linear energy dissipation relation \(e_{R}=-\bar {R}f_{R}\) for some matrix \(\bar {R}=\bar {R}^{T}\geq 0\). This yields input-state-output port-Hamiltonian systems

$$ \begin{array}{@{}rcl@{}} \dot{x} & = & [J(x) - R(x)] \nabla H(x) + G(x)u, \\ y & = & G^{T}(x) \nabla H(x), \end{array} $$
(5)

with \(R(x):=G_{R}(x)\bar {R}{G_{R}^{T}}(x)\), where u = eP is the input and y = fP 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 \(\rho ^{\ast }(x)(\mathcal {D}(x))\) of \(\mathcal {D}(x)\) to \(T^{\ast }_{x}\mathcal {X}\) under the canonical projection \(\rho ^{\ast }(x): T_{x} \mathcal {X} \times T_{x}^{\ast }\mathcal {X} \to T_{x}^{\ast }\mathcal {X}\) is a strict subspace of \(T^{\ast }_{x} \mathcal {X}\), then necessarily x should be such that \(\nabla H(x) \in \rho ^{\ast }(x)(\mathcal {D}(x))\); 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.

3 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: \mathcal {X} \to \mathbb {R}\) the submanifold

$$ \text{graph}\nabla H := \{(x,\nabla H(x) ) \mid x \in \mathcal{X} \} $$

defines a Lagrangian submanifoldFootnote 4 [1] of the cotangent bundle \(T^{\ast }\mathcal {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 \({\mathscr{L}}\). In fact [1] a general Lagrangian submanifold \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\) will be of the form graph∇H for a certain H if and only if the projection of \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\) to \(\mathcal {X}\) under the canonical projection \(\pi : T^{\ast }\mathcal {X} \to \mathcal {X}\) is equal to the whole of \(\mathcal {X}\). On the other hand, if the projection \(\pi ({\mathscr{L}})\) of \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\) to \(\mathcal {X}\) is not equal to the whole of \(\mathcal {X}\), then a new class of algebraic constraints arises, namely the constraints \(x \in \pi ({\mathscr{L}})\). These algebraic constraints will be called Lagrange algebraic constraints; extending the terminology of the linear case in [18].

The resulting triple \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) will be called a generalized port-Hamiltonian system, defining the dynamics (generalizing (4))

$$ \begin{array}{@{}rcl@{}} \left( -\dot{x}(t),f_{R}(t),f_{P}(t), e_{S}(t), e_{R}(t), e_{P}(t)\right) \in \mathcal{D}(x(t)) ,\\ (f_{R}(t),e_{R}(t)) \in \mathcal{R}, \quad (x(t),e_{S}(t)) \in \mathcal{L}, \quad t \in \mathbb{R} \end{array} $$
(6)

in the state variables x, with external port-variables fP, eP.

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 \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) with dynamics (6) extends the definition in the linear case as recently given in [18] (partly motivated by [3]).

3.1 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: \mathcal {X} \to \mathbb {R}\), where \(\mathcal {X}\) is an n-dimensional convex domain contained in \(\mathbb {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

$$ P^{\ast}(e)= e^{T}x - P(x), \quad e = \nabla P(x), $$
(7)

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.Footnote 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 xe = ∇P(x) is given as ex = ∇P(e), that is

$$ \nabla P^{\ast} (\nabla P(x))=x, \quad \nabla P(\nabla P^{\ast}(e))=e. $$

Given the Legendre transform P of P one may also define the new function

$$ \widetilde{P}(x) := P^{\ast}(\nabla P(x)). $$

In case of a quadratic function P(x) = xTMx, for some invertible symmetric matrix M, it is obvious to check that \(\widetilde {P}=P\). However for a general P this need not be the case.

Using P(e) = eTxP(x), x = ∇P(e), and the identity ∇P(∇P(e)) = e, the function \(\widetilde {P}\) can be alternatively expressed as

$$ \widetilde{P}(x) = (\nabla P(x))^{T} \nabla P^{\ast}(\nabla P(x)) - P(\nabla P^{\ast}(\nabla P(x))) = x^{T} \nabla P(x) - P(x). $$
(8)

Furthermore, we note the following remarkable property

$$ \nabla \widetilde{P}(x) = \nabla^{2} P(x) \nabla P^{\ast}(\nabla P(x)) = \nabla^{2} P(x)x, $$

with ∇2P(x) denoting the Hessian matrix of P.

Finally, all of this theory can be extended to partial Legendre transformations as follows. Consider a partitioning \(I \cup J= \{1,\dots ,n\}\), and the corresponding splitting x = (xI, xJ), e = (eI, eJ). The partial Legendre transform of P(xI, xJ) with respect to xJ is defined as

$$ P^{\ast}(x_{I},e_{J}) = {e_{J}^{T}}x_{J} - P(x_{I},x_{J}), \quad e_{J}= \frac{\partial P}{\partial x_{J}}(x_{I},x_{J}), $$

where xJ is solved from \(e_{J}= \frac {\partial P}{\partial x_{J}}(x_{I},x_{J})\).

3.2 Explicit Representation of Implicit Storage Relations

In this subsection we will show how generalized port-Hamiltonian systems \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) with implicit energy storage relations \({\mathscr{L}} \subset T^{\ast }\mathcal {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 \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\) can be locally written as [1]

$$ \mathcal{L} = \left\{(x,e_{S})=(x_{I},x_{J},e_{I},e_{J}) \in T^{\ast}\mathcal{X} ~|~ e_{I} = \frac{\partial V}{\partial x_{I}}, x_{J}=-\frac{\partial V}{\partial e_{J}} \right\} , $$
(9)

for some splitting \(\{1, \dots ,n\}=I \cup J\) of the index set, and a functionFootnote 6V (xI, eJ), called the generating function of the Lagrangian submanifold \({\mathscr{L}}\). In particular, xI, eJ define local coordinates for \({\mathscr{L}}\). Now define the Hamiltonian \(\widetilde {H} (x_{I},e_{J})\) as

$$ \widetilde{H} (x_{I},e_{J}):= V(x_{I},e_{J}) - {e^{T}_{J}} \frac{\partial V}{\partial e_{J}}(x_{I},e_{J}). $$

By (9) the expressions of \(-f_{S}=\dot {x}\) and eS, in terms of the coordinates xI, eJ, are given as

$$ -f_{S}= \left[\begin{array}{cc} I & 0 \\ -\frac{\partial^{2} V}{\partial e_{J} \partial x_{I}} & -\frac{\partial^{2} V}{\partial {e^{2}_{J}}} \end{array}\right] \left[\begin{array}{c} \dot{x}_{I} \\ \dot{e}_{J} \end{array}\right], \quad e_{S} = \left[\begin{array}{c} \frac{\partial V}{\partial x_{I}} \\ e_{J} \end{array}\right] . $$
(10)

Since

$$ \frac{d}{dt} \left( V(x_{I},e_{J}) - {e^{T}_{J}} \frac{\partial V}{\partial e_{J}}(x_{I},e_{J})\right) = \dot{x}^{T}_{I}\frac{\partial V}{\partial x_{I}} + \dot{e}^{T}_{J}\frac{\partial V}{\partial e_{J}} - \dot{e}^{T}_{J}\frac{\partial V}{\partial e_{J}} - {e_{J}^{T}}\left( \frac{\partial^{2} V}{\partial e_{J} \partial x_{I}}\dot{x}_{I} + \frac{\partial^{2} V}{\partial {e^{2}_{J}}}\dot{e}_{J}\right) $$

this yields, in view of (10),

$$ \frac{d}{dt} \widetilde{H}(x_{I}(t),e_{J}(t))= -{e_{S}^{T}}(t)f_{S}(t). $$

Consider furthermore any modulated Dirac structure \(\mathcal {D}(x) \subset T_{x}\mathcal {X} \times T_{x}^{\ast }\mathcal {X} \times \mathcal {F}_{R} \times \mathcal {E}_{R} \times \mathcal {F}_{P} \times \mathcal {E}_{P}\). Since by the power-conservation property of Dirac structures \(-{e_{S}^{T}}f_{S} = {e_{R}^{T}}f_{R} + {e_{P}^{T}}f_{P}\) it thus follows that

$$ \frac{d}{dt} \widetilde{H}(x_{I}(t),e_{J}(t))= {e_{R}^{T}}(t)f_{R}(t) + {e_{P}^{T}}(t)f_{P}(t) \leq {e_{P}^{T}}(t)f_{P}(t). $$

Hence \(\widetilde {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 xI, eJ.)

Note that if the mapping \(x_{J}=-\frac {\partial V}{\partial e_{J}}\) from eJ to xJ is invertible, and hence the Lagrangian submanifold can be also parametrized by x = (xI, xJ), so that \({\mathscr{L}}=\{(x,\nabla H(x)) ~|~ x \in \mathcal {X}\}\) for a certain H, then actually \(- \widetilde {H}(x_{I},x_{J})\) is the partial Legendre transform of V (xI, eJ) with respect to eJ, and equals H.

As another special case, assume I to be empty, implying that eJ = eS. Let V(x) be the Legendre transform of V (eS). Then in view of (8) it follows that

$$ V(e_{S}) - {e_{S}^{T}} \nabla V(e_{S}) = - \widetilde{V}(e_{S}). $$

4 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 \((\mathcal {D},H,\mathcal {R})\) Dirac algebraic constraints arise whenever the projection of the Dirac structure \(\mathcal {D}\) on the cotangent space of the state space is not the whole cotangent space, and (2) generalized port-Hamiltonian systems \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) have Lagrange algebraic constraints whenever the projection of \({\mathscr{L}}\) on the state space manifold \(\mathcal {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.

4.1 From Dirac Algebraic Constraints to Lagrange Algebraic Constraints

The first observation [8] to be made is that any Dirac structure \(\mathcal {D}\) can be locally written as the graph of a skew-symmetric map on an extended state space as follows. In fact, suppose \(\pi ^{\ast }(\mathcal {D}(x)) \subset T_{x}\mathcal {X}^{\ast }\) is (nk)-dimensional. Define \({\Lambda }:= \mathbb {R}^{k}\). Then there exists a full-rank n × k matrix \(B(x): {\Lambda }^{\ast } \to T_{x}\mathcal {X}\) and a skew-symmetric n × n matrix J(x) such that locally

$$ \mathcal{D}(x) = \{(f,e) \in T_{x}\mathcal{X} \times T_{x}^{\ast}\mathcal{X} ~|~ \exists \lambda^{\ast} \in {\Lambda}^{\ast} \text{ s.t. }-f = J(x)e + B(x)\lambda^{\ast}, 0 = B^{T}(x)e \}. $$
(11)

Conversely, any such equations for a skew-symmetric map \(J(x): T_{x}^{\ast }\mathcal {X} \to T_{x}\mathcal {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: \mathcal {X} \to \mathbb {R}\). Then with respect to the extended state space \(\mathcal {X}_{e}:= \mathcal {X} \times {\Lambda }\) we may define the implicit energy storage relation given by the Lagrangian submanifold (of the same type as in (9))

$$ \mathcal{L}_{e} := \{(x,\lambda, e, \lambda^{\ast}) \in T^{\ast} \mathcal{X}_{e} ~|~ e= \nabla H(x), \lambda = 0 \}, $$
(12)

corresponding to the Lagrange algebraic constraints 0 = λ(= BT(x)∇H(x)). Hence the Dirac algebraic constraint 0 = BT(x)∇H(x) has been transformed into the Lagrange algebraic constraint λ = 0 on the extended state space \(\mathcal {X}_{e}\). The generating function of \({\mathscr{L}}_{e}\) is H, which is independent of λ, and therefore \(\widetilde {H}(x, \lambda ^{\ast }):= H(x) - \lambda ^{\ast T}\frac {\partial H}{\partial \lambda ^{\ast }}(x)=H(x)\).

This is summarized in the following proposition.

Proposition 1

Consider a standard port-Hamiltonian system \((\mathcal {D},H,\mathcal {R})\) with Dirac algebraic constraints. By representing the Dirac structure as in (11) one obtains a generalized port-Hamiltonian system \((\mathcal {D}_{e},{\mathscr{L}}_{e},\mathcal {R})\) on the extended state space \(\mathcal {X}_{e}:= \mathcal {X} \times {\Lambda }\) with extended Dirac structure \(\mathcal {D}_{e}\) being the graph of the skew-symmetric matrix

$$ J_{e} = \left[\begin{array}{cc} -J(x) & -B(x) \\ B^{T}(x) & 0 \end{array}\right], $$

and thus without Dirac algebraic constraints. Furthermore, the Lagrangian submanifold \({\mathscr{L}}_{e}\) is defined by (12), and induces Lagrange algebraic constraints.

4.2 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 \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\) can be locally represented by a parametrized family of generating functions, called a Morse family.

To be precise, given a Lagrangian submanifold \({\mathscr{L}} \subset T^{\ast }\mathcal {X}\), a point \(p \in {\mathscr{L}}\) and projection \(\pi (p) \in \mathcal {X}\), there exists a neighborhood V of π(p), a natural number k, a neighborhood W of \(0 \in \mathbb {R}^{k}\), together with a smooth function \(F: V \times W \to \mathbb {R}\), such that the rank of \(\frac {\partial F}{\partial \lambda }\), with \(\lambda \in {\Lambda }:=\mathbb {R}^{k}\), is equal to k on \(\left (\frac {\partial F}{\partial \lambda }\right )^{-1}(0)\), and

$$ \left\{\left( x, \frac{\partial F}{\partial x}(x, \lambda) \right) ~\Big|~ \frac{\partial F}{\partial \lambda}(x, \lambda)=0 \right\} $$
(13)

is a neighborhood of the point p in \({\mathscr{L}}\). The function F(x, λ), seen as a function of x, parametrized by λ, is called a Morse family for the Lagrangian submanifold \({\mathscr{L}}\).

Furthermore, given any (modulated) Dirac structure \(\mathcal {D}(x) \subset T_{x} \mathcal {X} \times T_{x}^{\ast }\mathcal {X} \times \mathcal {F}_{R} \times \mathcal {E}_{R} \times \mathcal {F}_{P} \times \mathcal {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 \(\mathcal {D}_{e}\). This defines an extended port-Hamiltonian system \((\mathcal {D}_{e},F, \mathcal {R})\) with explicit energy function F(x, λ), and thus without Lagrange algebraic constraints.

This is summarized in the following proposition.

Proposition 2

Consider a generalized port-Hamiltonian system \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) with Lagrange algebraic constraints. Represent \({\mathscr{L}}\) by a Morse family F(x, λ) on \(\mathcal {X}_{e}:= \mathcal {X} \times {\Lambda }\) as in (13), and define the extended Dirac structure \(\mathcal {D}_{e}\) as the product of \(\mathcal {D}\) with the trivial Dirac structure {(fλ, eλ) | eλ = 0}. Then \((\mathcal {D},{\mathscr{L}},\mathcal {R})\) has been transformed into the standard port-Hamiltonian system \((\mathcal {D}_{e},F,\mathcal {R})\) with state space \(\mathcal {X}_{e}\).

Example 1 (Optimal control [2])

Consider the optimal control problem of minimizing a cost functional \({\int \limits } L(q,u) dt\) for the control system \(\dot {q}=f(q,u)\), with \(q \in \mathbb {R}^{n}, u \in \mathbb {R}^{m}\). Define the optimal control Hamiltonian

$$ K(q,p,u)= p^{T} f(q,u) + L(q,u) , $$

with \(p \in \mathbb {R}^{n}\) the co-state vector. Application of Pontryagin’s Minimum principle leads to the consideration of the standard port-Hamiltonian system (without inputs and outputs) on the space with coordinates (q, p, u), given as

$$ \left[\begin{array}{ccc} \dot{q} \\ \dot{p} \\ 0 \end{array}\right] = \left[\begin{array}{ccc} 0 & I_{n} & 0 \\ -I_{n} & 0 & 0 \\ 0 & 0 & I_{m} \end{array}\right] \left[\begin{array}{ccc} \frac{\partial K}{\partial q}(q,p,u) \\ \frac{\partial K}{\partial p}(q,p,u) \\ \frac{\partial K}{\partial u}(q,p,u) \end{array}\right]. $$
(14)

The underlying Dirac structure is given as

$$ \mathcal{D} =\left\{ \left( \left[\begin{array}{l} f_{q} \\ f_{p} \\ f_{u} \end{array}\right] , \left[\begin{array}{l} e_{q} \\ e_{p} \\ e_{u} \end{array}\right]\right) ~\Big|~ f_{q} = - e_{p}, f_{p} = e_{q}, e_{u}=0\right\} , $$

i.e., the direct product of the Dirac structure on the (q, p) space given by the graph of the canonical skew-symmetric map \(\left [\begin {array}{cc} 0 & -I \\ I & 0 \end {array}\right ]\) from \(\left [\begin {array}{l} f_{q} \\ f_{p} \end {array}\right ]\) to \(\left [\begin {array}{l} e_{q} \\ e_{p} \end {array}\right ]\), with the trivial Dirac structure {(fu, eu)∣eu = 0}. The resulting Dirac algebraic constraints are \(\frac {\partial K}{\partial u}(q,p,u) =0\).

System (14) can be equivalently rewritten as a port-Hamiltonian system only involving the (q, p) variables, with implicit energy storage relation given by the Lagrangian submanifold

$$ \mathcal{L} = \left\{\left( \left[\begin{array}{l} q \\ p \end{array}\right], \left[\begin{array}{l} e_{q} \\ e_{p} \end{array}\right] \right) ~\Big|~ \exists u ~\text{ s.t. } \left[\begin{array}{l} e_{q} \\ e_{p} \end{array}\right] = \left[\begin{array}{l} \frac{\partial K}{\partial q}(q,p,u) \\ \frac{\partial K}{\partial p}(q,p,u) \end{array}\right] , \frac{\partial K}{\partial u}(q,p,u)=0 \right\}. $$
(15)

Thus the function K(q, p, u) defines a Morse family (function of (q, p) parametrized by u) for \({\mathscr{L}}\), and the conversion of (15) into (14) is an example of conversion of a Lagrange algebraic constraint into a Dirac algebraic constraint. See for the linear case [18].

5 Conclusions

A framework has been laid down for studying Dirac and Lagrange algebraic constraint equations as arising in (generalized) port-Hamiltonian systems, extending the linear results of [3, 18]. In particular, a definition is provided of a nonlinear generalized port-Hamiltonian system, extending the one in [2] by including energy dissipation and external ports. Furthermore, we have shown how implicit energy storage relations locally can be represented 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.