1 Introduction

This paper is concerned with turnpike phenomena. These phenomena were first noticed in the context of economics [1, 2] and have since been observed in many different situations, see, e.g., [3,4,5] and the references therein. Turnpike phenomena are studied in optimal control problems, where the goal is the minimization of a cost functional C(u). Here, the function u acts as the control of a system of interest. In many cases, it can be observed that an optimal control \(u^*\) will, for a majority of the time horizon, steer the associated state trajectory \(x^*\) to a point [6,7,8], a set [4, 5, 9] or, as in our case, a manifold [10]. In other words, optimal solutions depend mainly on the underlying system and the optimization objective and are more or less independent on the choice of the time horizon and other data, such as initial or final values. The behaviour is reminiscent of an observation from daily life: when traveling a long distance by car, it is usually faster to take a detour via a turnpike than to choose a more direct way on slower streets. Also, the chosen turnpike usually does not heavily depend on the start and end of the route. If one would start the journey a few blocks away, then the fastest path would remain more or less the same.

Here, we consider a special class of systems called port-Hamiltonian (pH) systems. Parts of the origins of port-Hamiltonian systems date back to the late 1950s [11], and the interested reader is referred to [12] for an overview on the origins of this system class. Despite their long history, they continue to be the focus of active research [13,14,15,16,17,18]. Arguably, the key feature of pH systems is their modeling perspective: they focus on taking energy as the lingua franca between subsystems. As a consequence, the class of pH systems is a promising class for modeling real-world processes [18]. Benefits of port-Hamiltonian models include inherent stability and passivity, the invariance under Galerkin projection and congruence transformation, and the possibility to interconnect multiple pH systems in a structure-preserving manner.

When pH systems are considered in an optimal control setting, the objective of minimizing the supplied energy is quite natural. This results in a cost term of the form \(\int _0^T y(t)^{{\textsf{T}}}u(t) ~\textrm{d}t\), where y is a collocated observation of the system, and renders the corresponding optimal control problem singular. In [19, 20], the authors have considered this objective for linear time invariant port-Hamiltonian (descriptor) systems. They have shown that the optimal control problem has a measure turnpike property with respect to the part of the state space where dissipation is present, given by the kernel of the matrix corresponding to the non-conservative system dynamics. The infinite-dimensional linear case is discussed in [21]. In this paper, we are concerned with the finite-dimensional nonlinear case. We show that, under smoothness assumptions on the nonlinearities and controllability assumptions on the system, nonlinear pH descriptor systems admit a turnpike phenomenon with respect to a submanifold of \({\mathbb {R}}^n\). This submanifold corresponds, as in the linear case, to the energy dissipating part of the state space.

The structure of this paper is as follows. In Sect. 2, we recall the definition of port-Hamiltonian systems and state the optimal control problem that is considered. After that, a short repetition of results on submanifolds of \({\mathbb {R}}^n\) follows in Sect. 3. In Sect. 4, we define manifold dissipativity and manifold turnpikes following [10] and recall that, under weak assumptions, manifold dissipativity implies a manifold turnpike property. Section 5 contains the main results of this work, where the previously established results are applied to finite-dimensional nonlinear port-Hamiltonian descriptor systems. The theoretical results are then illustrated by a numerical example in Sect. 6. Finally, in Sect. 7 a conclusion is drawn and an outlook on future research is given.

The paper is supplemented by an appendix which collects existence results for the appearing differential algebraic equations and optimization problems.

1.1 Notation

For a set \(Z \subseteq {\mathbb {R}}^n\) we define \(Z^\circ \) as the interior of Z. We denote the Euclidean norm by \(\Vert \cdot \Vert \), other p-norms by \(\Vert \cdot \Vert _p\), and define the distance of a point \(x\in {\mathbb {R}}^n\) to the set \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) as \(\mathop {\textrm{dist}}\limits (x,{\mathcal {M}}):= \inf _{p \in {\mathcal {M}}} \Vert x-p \Vert \). We denote the set of all k-times continuously differentiable functions from U to V by \(C^k(U,V)\) and define \(C(U,V):= C^0(U,V)\). When the spaces U and V are clear from context, we say that \(f\in C^k(U,V)\) is of class \(C^k\). The derivative of a function f at point x is denoted by \(Df_x\). Further, for a matrix \(A\in {\mathbb {R}}^{n,n}\) we write \(A \succeq 0\) if \(x^{{\textsf{T}}}A x \ge 0\) for all \(x\in {\mathbb {R}}^{n}\), and \(A \succ 0\) if \(x^{{\textsf{T}}}A x > 0\) for all \(x\in {\mathbb {R}}^{n}{\setminus }\{0\}\), where \(\cdot ^{{\textsf{T}}}\) denotes the transpose. The kernel and range of the matrix A are denoted by \(\ker (A)\) and \(\mathop {\textrm{ran}}\limits (A)\), respectively. The non-negative square-root of a positive semidefinite matrix A is denoted by \(A^{1/2}\). Often, we suppress the time dependency of functions and write z instead of z(t).

2 Preliminaries and problem setting

Following the definition of [18], we consider nonlinear port-Hamiltonian descriptor systems of the form

figure a

Here, x, u and y are the state, input and output of the system, respectively. We restrict our analysis to pH systems without feedthrough but note that the discussion can be extended to systems with a feedthrough term as introduced in [18]. We consider the state space \({\mathbb {R}}^n\) and a set of admissible controls \({\mathcal {U}}_{\textrm{ad}}\) and require that

$$\begin{aligned} E,J, R \in C({\mathbb {R}}^n, {\mathbb {R}}^{n,n}),~~ \eta \in C({\mathbb {R}}^n,{\mathbb {R}}^n) ~~ \text {and} ~~B \in C({\mathbb {R}}^n,{\mathbb {R}}^{n,m}). \end{aligned}$$

Further, the functions J and R have to satisfy \(J(x) = - J(x)^{{\textsf{T}}}\) and \(R(x) = R(x)^{{\textsf{T}}}\succeq 0\) for all \(x \in {\mathbb {R}}^n\). We assume that the system (pH) is associated with a Hamiltonian \({\mathcal {H}} \in C^1({\mathbb {R}}^n,{\mathbb {R}})\) which is bounded from below along any solution of (pH) and satisfies

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}x}{\mathcal {H}}(x) = E(x)^{{\textsf{T}}}\eta (x) \end{aligned}$$

for each \(x\in {\mathbb {R}}^n\). As in [18], we may assume that \({\mathcal {H}}\) is nonnegative along any solution of (pH), since otherwise we can add its infimum along solutions of (pH). A brief discussion regarding the existence of solutions of (pH) is given in the appendix.

Remark 1

We only consider pH systems which do not explicitly depend on time. The definition given here can be generalized to include explicit time dependence, but these systems can easily be made autonomous [18, Remark 4.2].

When it comes to the optimal control of port-Hamiltonian systems, the cost functional should take into account that pH systems stem from using energy as the lingua franca. Hence, choosing the supplied energy as the optimization objective is quite natural. For this, usually the impedance supply \(y^{{\textsf{T}}}u\) is considered, which is related to the scattering supply \(\Vert u \Vert ^2 - \Vert y \Vert ^2\) via the Cayley transform [22]. We focus on the former and thus consider the optimal control problem

figure b

Here and in the following, we assume \(x_0, x_T \in K\), where \(K \subseteq {\mathbb {R}}^n\) is a compact set. Further, as we are interested in the properties of optimal solutions to (\(\text {pH} \text { OCP}_T\)), throughout the paper we assume that an optimal solution \(u^*\) and a corresponding trajectory \(x^*\) exist. The existence of optimal controls is shortly discussed in the appendix.

It can be shown [18] that the power-balance equation

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}{\mathcal {H}}(x) = -\eta (x)^{{\textsf{T}}}R(x) \eta (x) + y^{{\textsf{T}}}u \end{aligned}$$
(1)

holds along any solution x of (pH). This allows us to rewrite the cost functional \(C_{\text {pH},T}(u)\) as

$$\begin{aligned} C_{\text {pH},T}(u) = {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0) + \int _{0}^{T}\Vert R(x)^{1/2} \eta (x) \Vert ^2 ~\textrm{d}t. \end{aligned}$$

This equation is called the energy-balance equation, and we can interpret each of the terms physically [23]. The term \({\mathcal {H}}(x_T) - {\mathcal {H}}(x_0)\) measures the conserved energy, while the integral term corresponds to the dissipated energy. By rearranging and plugging in the definition of \(C_{\text {pH},T}\), we see that

$$\begin{aligned} {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0) = \int _{0}^{T}y^{{\textsf{T}}}u - \Vert R(x)^{1/2}\eta (x) \Vert ^2 ~\textrm{d}t. \end{aligned}$$

Note that this implies dissipativity in the sense of Willems [24], and as a consequence shows the aforementioned passivity of pH systems. We will use both of these equations in Sect. 5.

3 Submanifolds of \({\mathbb {R}}^n\) and the orthogonal projection

This section repeats mostly well-known results regarding submanifolds of \({\mathbb {R}}^n\), with a focus on manifolds defined as the zero locus of some smooth function. The main result of the section is Lemma 5, which provides an upper bound for the distance of a point to such a manifold.

We begin with recalling the classical definition of submanifolds of \({\mathbb {R}}^n\). Following [25, 26], we distinguish manifolds whose tangent spaces locally satisfy a Lipschitz condition.

Definition 2

(submanifolds of \({\mathbb {R}}^n\))

  • Let \({\mathcal {M}}\) be a subset of \({\mathbb {R}}^n\). We call \({\mathcal {M}}\) an s-dimensional \(C^k\) manifold if for each \(p\in {\mathcal {M}}\) there exists an open neighborhood U of p and a \(C^k\) diffeomorphism \(\phi :U \rightarrow \phi (U)\subseteq {\mathbb {R}}^n\) such that

    $$\begin{aligned} {\mathcal {M}}\cap U = \{ x\in U ~|~ \phi _{s+1}(x) = \dots = \phi _{n}(x) =0 \}. \end{aligned}$$

    The function \(\phi \) is called a local coordinate system of \({\mathcal {M}}\) at p.

  • Let \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) be an s-dimensional manifold, \(p\in {\mathcal {M}}\) and let \(\phi :U \rightarrow {\mathbb {R}}^n\) be a local coordinate system of \({\mathcal {M}}\) at p. We define the tangent space at p relative to \({\mathcal {M}}\) as

    $$\begin{aligned} T_p{\mathcal {M}}:= D\phi _{\phi (p)}^{-1}(\left\{ y\in {\mathbb {R}}^n ~\big |~ y_{s+1} = \dots = y_n = 0 \right\} ). \end{aligned}$$

    The space \(N_p{\mathcal {M}}:= T_p{\mathcal {M}}^\perp \) is called the normal space at p relative to \({\mathcal {M}}\).

  • We call \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) an s-dimensional \(C^{k,1}\) manifold if \({\mathcal {M}}\) is an s-dimensional \(C^k\) manifold and for all \(p \in {\mathcal {M}}\) there exists a set \(V\subseteq {\mathcal {M}}\) that is open relative to \({\mathcal {M}}\) and a positive constant \(L>0\) such that \(p \in V\) and for all \({{\widetilde{p}}} \in V\) it holds that

    $$\begin{aligned} d_{\textrm{H}}(T_p{\mathcal {M}}, T_{{\widetilde{p}}}{\mathcal {M}}) \le L \Vert p - {{\widetilde{p}}} \Vert . \end{aligned}$$

    Here, \(d_{\textrm{H}}\) denotes the Hausdorff distance defined by

    $$\begin{aligned} d_{\textrm{H}}(T_1, T_2):= \sup \left\{ \inf \left\{ \Vert t_2-t_1 \Vert ~\big |~ t_2 \in T_2 \cap S \right\} ~\big |~ t_1 \in T_1 \cap S \right\} , \end{aligned}$$

    where \(S:= \left\{ z \in {\mathbb {R}}^n ~\big |~ \Vert z \Vert = 1 \right\} \) is the unit sphere.

Next, we recall the definition of the orthogonal projection on a manifold from [26]. For this, consider a manifold \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) and define the set of points with the unique nearest points property as

$$\begin{aligned} \mathop {\textrm{unpp}}\limits ({\mathcal {M}}):= \left\{ x\in {\mathbb {R}}^n ~\big |~ \text {there exists a unique}~\xi \in {\mathcal {M}}~\text {with}~ \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) = \Vert x-\xi \Vert \right\} . \end{aligned}$$

Clearly, for each \(x\in \mathop {\textrm{unpp}}\limits ({\mathcal {M}})\) there exists a unique \(p(x)\in {\mathcal {M}}\) with the property

$$\begin{aligned} \Vert x-p(x) \Vert = \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) = \min _{p \in {\mathcal {M}}} \Vert x-p \Vert . \end{aligned}$$

Definition 3

(orthogonal projection on manifold, [26]) Let \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) be a manifold. The function \(p:\mathop {\textrm{unpp}}\limits ({\mathcal {M}}) \rightarrow {\mathcal {M}}, ~ x \mapsto p(x)\) is called the orthogonal projection on \({\mathcal {M}}\).

Often, we write \(p_x\) instead of p(x). The maximal open set on which the orthogonal projection is defined plays a special role in [26] and also in our setting. We will refer to this set as \({\mathcal {E}}({\mathcal {M}}):= \mathop {\textrm{unpp}}\limits ({\mathcal {M}})^\circ \).

The next proposition collects selected results on submanifolds of \({\mathbb {R}}^n\) defined in a particular manner and will be useful in Sect. 5, where it will allow us to study the optimal control problem (\(\text {pH} \text { OCP}_T\)).

Proposition 4

Suppose \(f:{\mathbb {R}}^n \rightarrow {\mathbb {R}}^n\) is of class \(C^2\), assume that

$$\begin{aligned} {\mathcal {M}}:= \left\{ x\in {\mathbb {R}}^n ~\big |~ f(x) = 0 \right\} \end{aligned}$$

is nonempty and assume that there exists an open neighborhood \(G\subseteq {\mathbb {R}}^n\) of \({\mathcal {M}}\) and a constant s with \(0< s < n\) such that \(\dim (\ker (Df_x)) = s\) for all \(x \in G\). Then

  1. (i)

    the set \({\mathcal {M}}\) is an s-dimensional \(C^2\) submanifold of \({\mathbb {R}}^n\),

  2. (ii)

    the tangent space at \(p \in {\mathcal {M}}\) is given by \(T_p{\mathcal {M}}= \ker (Df_p)\),

  3. (iii)

    the manifold \({\mathcal {M}}\) is a \(C^{2,1}\) manifold, and

  4. (iv)

    it holds that \({\mathcal {M}}\subseteq {\mathcal {E}}({\mathcal {M}})\), and if \(x\in {\mathcal {E}}({\mathcal {M}})\setminus {\mathcal {M}}\) then \(x-p_x \perp T_{p_x}{\mathcal {M}}\).

Proof

  1. (i)

    Let \(p\in {\mathcal {M}}\). It can be shown [27] that there exist open neighborhoods \(U_1\subseteq {\mathbb {R}}^n\) of p and \(U_2\subseteq {\mathbb {R}}^n\) of f(p) and \(C^2\) diffeomorphisms

    $$\begin{aligned} \phi :U_1 \rightarrow \phi (U_1)~~~~ \text {and} ~~~~ \psi :U_2 \rightarrow \psi (U_2) \end{aligned}$$

    such that

    $$\begin{aligned} f(U_1) \subseteq U_2 \end{aligned}$$

    and

    $$\begin{aligned} \psi \circ f \circ \phi ^{-1}(y_{1},\dots ,y_n) = (y_1,\dots ,y_{n-s}, 0,\dots ,0) \end{aligned}$$

    for all \(y\in \phi (U_1)\). Thus, for each \(v \in U_1\) we have

    $$\begin{aligned} v \in {\mathcal {M}}&\Longleftrightarrow f(v) = 0 \\&\Longleftrightarrow (\psi \circ f)(v) = 0 \\&\Longleftrightarrow (\psi \circ f \circ \phi ^{-1}\circ \phi )(v) = 0 \\&\Longleftrightarrow \phi _1(v) = \dots = \phi _{n-s}(v) = 0. \end{aligned}$$
  2. (ii)

    Suppose that \(p\in {\mathcal {M}}\) and that \(\phi :U \rightarrow {\mathbb {R}}^n\) is a local coordinate system of \({\mathcal {M}}\) at p. Since

    $$\begin{aligned} (f\circ \phi ^{-1}) \big (\{ y\in {\mathbb {R}}^n ~|~ y_{s+1} = \dots = y_n = 0 \} \cap \phi (U)\big ) = \{0\}, \end{aligned}$$

    we have

    $$\begin{aligned} Df_p(T_p{\mathcal {M}}) = Df_p\Big (D\phi _{\phi (p)}^{-1}\big (\left\{ y\in {\mathbb {R}}^n ~\big |~ y_{s+1} = \dots = y_n = 0 \right\} \big )\Big ) = 0. \end{aligned}$$

    The claim then follows from the fact that \(\ker (Df_p)\) has dimension s.

  3. (iii)

    In [25, Equations (3.3) and (3.6)], it is shown that a \(C^k\) manifold with \(k\ge 2\) is also a \(C^{k,1}\) manifold, from which the claim follows.

  4. (iv)

    This claim was mentioned in [26, Remark 4] and is a consequence of the results of [25].

\(\square \)

We finish this section with Lemma 5 and a corresponding remark. The lemma establishes an upper bound on the distance to the manifold \({\mathcal {M}}\) defined in Proposition 4 in terms of the function f. This result will be the key in our application to port-Hamiltonian systems, as it will allow us to deduce a dissipativity property for (\(\text {pH} \text { OCP}_T\)).

Lemma 5

Suppose \(f:{\mathbb {R}}^n \rightarrow {\mathbb {R}}^n\) is of class \(C^2\), assume that

$$\begin{aligned} {\mathcal {M}}:= \left\{ x\in {\mathbb {R}}^n ~\big |~ f(x) = 0 \right\} \end{aligned}$$

is nonempty and assume that there exists an open neighborhood \(G\subseteq {\mathbb {R}}^n\) of \({\mathcal {M}}\) such that for all \(x\in G\) it holds that \(\dim (\ker (Df_x)) = s\), where the constant s is independent of x and satisfies \(0< s < n\). Further, assume that for each \(x\in G\) the smallest nonzero singular value of \(Df_x\) is bounded from below by \({\widetilde{c}} > 0\). Then \({\mathcal {M}}\) is a \(C^{2}\) manifold and there exists an open set \(V \subseteq {\mathbb {R}}^n\) and a constant \(c>0\) with \({\mathcal {M}}\subseteq V \subseteq {\mathcal {E}}({\mathcal {M}})\) and

$$\begin{aligned} c \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) \le \Vert f(x) \Vert \end{aligned}$$
(2)

for all \(x\in V\).

Proof

We will first show that (2) is true locally. Fix a point \(p\in {\mathcal {M}}\) and notice that due to \(f\in C^2\), for all \(x \in {\mathbb {R}}^n\) we have

$$\begin{aligned} f(x) = f(p) + Df_{p}(x-p) + g_{p}(x-p), \end{aligned}$$
(3)

where the remainder \(g_p\) satisfies

$$\begin{aligned} \lim _{x\rightarrow p}\frac{\Vert g_p(x-p) \Vert }{\Vert x-p \Vert } = 0. \end{aligned}$$
(4)

To establish (2) locally, our first goal is to show that there exists an open set \(U_p \subseteq {\mathcal {E}}({\mathcal {M}})\) such that for all \(x\in V_p:= U_p \cap N_p{\mathcal {M}}\) we have

$$\begin{aligned} \frac{\Vert g_{p}(x-p) \Vert }{\Vert Df_{p}(x-p) \Vert } < \frac{1}{2}. \end{aligned}$$
(5)

For the sake of simplicity, let us set \(A_p:= Df_{p}^{{\textsf{T}}}Df_{p}\). Then, by the definition of \({\mathcal {M}}\) and Proposition 4, we have \( \ker (A_p) = \ker (Df_{p}) = T_{p}{\mathcal {M}}. \) Now, let us decompose \({\mathbb {R}}^n = \ker (A_p) \oplus \mathop {\textrm{ran}}\limits (A_p) = T_{p}{\mathcal {M}}\oplus N_{p}{\mathcal {M}}\) and accordingly also \(A_p = 0 \oplus \widetilde{A_p}\). Since \(\widetilde{A_p}\) is symmetric positive definite, for any \(x\in N_p{\mathcal {M}}\) we obtain

$$\begin{aligned} \Vert Df_{p}(x-{p}) \Vert ^2 = (x-{p})^{{\textsf{T}}}A_p (x-{p}) = (x-{p})^{{\textsf{T}}}\widetilde{A_p} (x-{p}) \nonumber \\\ge \lambda _{\min }(\widetilde{A_p}) \Vert x-{p} \Vert ^2. \end{aligned}$$
(6)

Now, using (4) and (6), we obtain

$$\begin{aligned} 0 = \lim _{x\rightarrow p}\frac{\Vert g_p(x-p) \Vert }{\Vert x-p \Vert } \ge \lim _{x\rightarrow p} c_p \frac{\Vert g_p(x-p) \Vert }{\Vert Df_p(x-p) \Vert } \ge 0, \end{aligned}$$

where we set \(c_p:=\lambda _{\min }(\widetilde{A_p})^{1/2} > 0\). In particular, we have

$$\begin{aligned} \lim _{x \rightarrow p} \frac{\Vert g_p(x-p) \Vert }{\Vert Df_p(x-p) \Vert } = 0. \end{aligned}$$

Thus, choosing \(x \in N_p{\mathcal {M}}\) sufficiently close to p we obtain the estimate (5), and we can deduce that an open set \(U_p\) with the sought-after properties has to exist. Now, since (3) and \(p\in {\mathcal {M}}\) imply

$$\begin{aligned} \Vert Df_{p}(x-{p}) \Vert \le \Vert f(x) \Vert + \Vert g_{p}(x-{p}) \Vert \quad \text {for all} ~~ x \in {\mathbb {R}}^n, \end{aligned}$$

using (5) we obtain

$$\begin{aligned} \tfrac{1}{2} \Vert Df_{p}(x-p) \Vert \le \Vert f(x) \Vert \quad \text {for all} ~~ x \in V_p = U_p \cap N_p{\mathcal {M}}. \end{aligned}$$
(7)

To finish the local argument, notice that by (6) we have

$$\begin{aligned} c_p \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) = c_p \Vert x-p \Vert \le \Vert Df_p(x-p) \Vert \quad \text {for all} ~~ x \in V_p, \end{aligned}$$

which together with (7) shows that (2) holds for all \(x\in V_p\).

To construct the set V, first notice that the differentiability of f implies that an expression of the form (3) is possible on the set \({\mathcal {E}}({\mathcal {M}})\). In other words, there exists a function \(g_{\cdot }(\cdot )\) such that

$$\begin{aligned} f(x) = f(p_x) + Df_{p_x}(x-p_x) + g_{p_x}(x-p_x) \end{aligned}$$

for all \(x\in {\mathcal {E}}({\mathcal {M}})\). Since the orthogonal projection \(x\mapsto p_x\) is differentiable [26] and \(f\in C^2\), the map \(x \mapsto g_{p_x}(x-p_x)\) is continuous on \({\mathcal {E}}({\mathcal {M}})\). Define the function

$$\begin{aligned} h:{\mathcal {E}}({\mathcal {M}}) \rightarrow {\mathbb {R}}, ~ x \mapsto \frac{\Vert g_{p_x}(x-p_x) \Vert }{\Vert Df_{p_x}(x-p_x) \Vert }. \end{aligned}$$

Then h is continuous and hence the preimage of the open set \((-\infty ,\tfrac{1}{2})\subseteq {\mathbb {R}}\) under h is open. Note that \({\mathcal {M}}\) is a subset of this preimage. Define

$$\begin{aligned} {\mathcal {M}}\subseteq V:= h^{-1}\big ((-\infty ,\tfrac{1}{2})\big ) \subseteq {\mathcal {E}}({\mathcal {M}}). \end{aligned}$$

Then for each \(p\in {\mathcal {M}}\) we have

$$\begin{aligned} V_p \subseteq V \cap N_p{\mathcal {M}}. \end{aligned}$$

The previous arguments can then be used to show that for \(c:= \tfrac{{\widetilde{c}}}{2}\) and \(x \in V\) we have

$$\begin{aligned} 2c \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) \le c_{p_x} \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) \le \Vert Df_{p_x}(x-{p_x}) \Vert \le 2 \Vert f(x) \Vert , \end{aligned}$$

finishing the proof. \(\square \)

Remark 6

The estimate (2) is related to the Łojasiewicz inequality [28, 29], which states that for a real analytic function \(g:U \rightarrow {\mathbb {R}}\) defined on an open set \(U\subseteq {\mathbb {R}}^n\) and a compact set \(K \subseteq U\), the distance of \(x \in K\) to the zero locus \({\mathcal {Z}}:= \{ z \in U ~|~ g(z) = 0 \}\) of g may be estimated by

$$\begin{aligned} \mathop {\textrm{dist}}\limits (x, {\mathcal {Z}})^\alpha \le C~|g(x)|, \end{aligned}$$

where \(\alpha \) and C are positive constants.

4 Manifold dissipativity and manifold turnpikes

In this section, we recall the definition of dissipativity with respect to a manifold and the definition of manifold turnpikes as introduced in [10]. Further, a theorem relating the two properties is stated. Here and in the following, the set \({\mathcal {K}}\) is defined as

$$\begin{aligned} {\mathcal {K}}:= \{ \alpha :[0,\infty ) \rightarrow [0,\infty ) ~|~ \alpha (0)=0, ~ \alpha \text { is continuous and strictly increasing}\}. \end{aligned}$$

We consider the general optimal control problem

figure c

As before, we assume \(x_0, x_T \in K\), where \(K \subseteq {\mathbb {R}}^n\) is a compact set. Here, the function g defines the dynamics of the system and the function h corresponds to possible algebraic constraints. We refrain from further specification of these functions as (\(\text {OCP}_T\)) is only used for general definitions. Throughout this section, we assume that an optimal control \(u^*\) of (\(\text {OCP}_T\)) and an associated trajectory \(x^*\) exist.

We begin with the definition of manifold dissipativity. The definition is related to Willems’ notion of dissipativity [24] and is also found in [10].

Definition 7

(manifold dissipativity) Consider the optimal control problem (\(\text {OCP}_T\)) together with the manifold \({\mathcal {M}}\subseteq {\mathbb {R}}^n\). We say that (\(\text {OCP}_T\)) is dissipative with respect to the manifold \({\mathcal {M}}\) if there exists a function \({\mathcal {S}}:{\mathbb {R}}^n \rightarrow [0,\infty )\) that is bounded on compact sets and a function \(\alpha \in {\mathcal {K}}\) such that all optimal controls \(u^*\) and associated trajectories \(x^*\) satisfy the dissipation inequality

$$\begin{aligned} {\mathcal {S}}(x_T) - {\mathcal {S}}(x_0) \le \int _{0}^{T} \ell (x^*,u^*) - \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}})) ~\textrm{d}t\end{aligned}$$
(8)

for all \(T >0\).

The function \({\mathcal {S}}\) from Definition 7 is also called storage function. Note that we require the dissipation inequality (8) only to hold along optimal solutions of (\(\text {OCP}_T\)). This is not a severe restriction when turnpike phenomena are studied, as we are only interested in properties of optimal solutions.

Next, we define a manifold turnpike property, again following [10]. The property is essentially a notion of measure turnpikes, see, e.g., [3,4,5, 30].

Definition 8

(manifold turnpike) Consider the optimal control problem (\(\text {OCP}_T\)) together with the manifold \({\mathcal {M}}\subseteq {\mathbb {R}}^n\). We say that (\(\text {OCP}_T\)) has the manifold turnpike property with respect to the manifold \({\mathcal {M}}\) if for all compact sets \(K\subseteq {\mathbb {R}}^n\) and all \(\varepsilon >0\) there exists a constant \(C_{K,\varepsilon } > 0\) such that for all \(T>0\) all optimal trajectories \(x^*\) of (\(\text {OCP}_T\)) satisfy

$$\begin{aligned} \lambda \big (\{ t\in [0,T] ~|~ \mathop {\textrm{dist}}\limits (x^*(t),{\mathcal {M}}) > \varepsilon \}\big ) \le C_{K,\varepsilon } \end{aligned}$$

for all \(x_0,x_T \in K\). Here, \(\lambda \) denotes the Lebesgue-measure.

The next theorem can be found similarly in [10, 30, 31]. The theorem shows that manifold dissipativity implies a manifold turnpike property.

Theorem 9

(manifold dissipativity implies manifold turnpike) Consider the optimal control problem (\(\text {OCP}_T\)) together with a submanifold \({\mathcal {M}}\subseteq {\mathbb {R}}^n\) and assume that

  1. (i)

    there exists a constant \(C_\ell (K)>0\) such that for all optimal controls \(u^*\) of (\(\text {OCP}_T\)) and the associated trajectories \(x^*\) we have

    $$\begin{aligned} \int _0^T \ell (x^*,u^*) ~\textrm{d}t< C_\ell (K) \end{aligned}$$

    for all \(T > 0\), and

  2. (ii)

    the optimal control problem is dissipative with respect to the manifold \({\mathcal {M}}\).

Then the optimal control problem (\(\text {OCP}_T\)) has the manifold turnpike property.

Proof

Rearranging (8), we see that

$$\begin{aligned} \int _0^T \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}))~\textrm{d}t\le S(x_0) - S(x_T) + \int _{0}^{T} \ell (x^*,u^*) ~\textrm{d}t. \end{aligned}$$

Since the set K is compact and S is bounded on compact sets, there exists a constant \(C_S(K) > 0\) independent of T such that

$$\begin{aligned} \int _0^T \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}))~\textrm{d}t\le C_S(K) + C_\ell (K) < \infty . \end{aligned}$$

Now define

$$\begin{aligned} M_\varepsilon (T):= \left\{ t \in [0,T] ~\big |~ \mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}) > \varepsilon \right\} \end{aligned}$$

and notice that

$$\begin{aligned} \int _0^T \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}))~\textrm{d}t&= \int _{M_\varepsilon (T)} \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}))~\textrm{d}t+ \int _{[0,T]\setminus M_\varepsilon (T)}\alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}))~\textrm{d}t\\&\ge \lambda (M_\varepsilon (T)) \alpha (\varepsilon ). \end{aligned}$$

Thus, for all \(T > 0\) we have

$$\begin{aligned} \lambda \big (\left\{ t \in [0,T] ~\big |~ \mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}}) > \varepsilon \right\} \big ) \le \frac{C_S(K) + C_\ell (K)}{\alpha (\varepsilon )} =: C_{K,\varepsilon }, \end{aligned}$$

finishing the proof. \(\square \)

Remark 10

Denote the optimal value function of (\(\text {pH} \text { OCP}_T\)) by \(V_T(x_0)\), that is

$$\begin{aligned} V_T(x_0):= \inf _{u\in {\mathcal {U}}_{\textrm{ad}}} \int _{0}^{T} \ell (x(x_0,u), u) ~\textrm{d}t. \end{aligned}$$

Then, assumption (i) of Theorem 9 is equivalent to

$$\begin{aligned} V_T(x_0) \le C_\ell (K). \end{aligned}$$
(9)

In [10], assumption (i) is replaced by the assumption that (\(\text {pH} \text { OCP}_T\)) is cost controllable. The latter takes \({\mathcal {U}}_{\textrm{ad}}= L^\infty ([0,T], {\mathbb {R}}^m)\) and bounds the growth of the optimal value function by

$$\begin{aligned} V_T(x_0) \le b_K(T) \, \ell ^*(x_0), \end{aligned}$$
(10)

where the growth function \(b_K:[0,\infty ) \rightarrow [0,\infty )\) is assumed to be bounded and increasing and \(\ell ^*(x_0):= \inf _{u\in {\mathbb {R}}^m} \ell (x_0,u)\) is assumed to be real for all \(x_0 \in K\). Provided that \(\ell \) is bounded on compact sets, [10] shows that (10) implies (9) as we can bound \(b_K(T)\,\ell ^*(x_0) \le C_\ell (K)\) in this case.

5 Application to port-Hamiltonian systems

Finally, we are ready to apply the previous results to port-Hamiltonian systems and the optimal control problem (\(\text {pH} \text { OCP}_T\)). First, recall that we can rewrite the cost functional \(C_{\text {pH},T}(u)\) as

$$\begin{aligned} C_{\text {pH},T}(u) = \int _{0}^{T} y^{{\textsf{T}}}u ~\textrm{d}t= {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0) + \int _{0}^{T}\Vert R(x)^{1/2} \eta (x) \Vert ^2 ~\textrm{d}t, \end{aligned}$$
(11)

and that rearranging gives

$$\begin{aligned} {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0) = \int _{0}^{T}y^{{\textsf{T}}}u - \Vert R(x)^{1/2}\eta (x) \Vert ^2 ~\textrm{d}t. \end{aligned}$$
(12)

Equation (11) hints that any optimal trajectory will have to spend most of the time close to the set

$$\begin{aligned} {\mathcal {M}}:=&\big \{ x\in {\mathbb {R}}^n ~\big |~ R(x)^{1/2}\eta (x) = 0 \big \}, \end{aligned}$$

and that \({\mathcal {H}}\) can be used as a storage function to derive dissipativity notions with respect to \({\mathcal {M}}\). Our aim will be to formalize these ideas. The first step will be to ensure that \({\mathcal {M}}\) has the necessary manifold structure. For that, we make the following assumptions. See also Remark 16.

Assumption 11

  1. (A1)

    The map \(x\mapsto R(x)^{1/2} \eta (x)\) is of class \(C^2\).

  2. (A2)

    The set \({\mathcal {M}}\) is nonempty and there exists an open neighborhood \(G\subseteq {\mathbb {R}}^n\) of \({\mathcal {M}}\) such that for all \(x\in G\) it holds that \(\dim (\ker (D(R^{1/2}\eta )_x)) = s\), where the constant s is independent of x and satisfies \(0< s < n\).

  3. (A3)

    For each \(x\in G\), the smallest nonzero singular value of \(D(R^{1/2}\eta )_x\) is bounded from below by a positive constant \({\widetilde{c}} > 0\).

  4. (A4)

    Let V be the open set from Lemma 5. Any optimal trajectory \(x^*\) of (\(\text {pH} \text { OCP}_T\)) remains in V for all times.

With assumptions (A1) and (A2), Proposition 4 ensures that \({\mathcal {M}}\) is an s-dimensional \(C^{2,1}\) submanifold of \({\mathbb {R}}^n\) and that \({\mathcal {M}}\subseteq {\mathcal {E}}({\mathcal {M}})\).

The next step is to show that the problem is dissipative. As we will see shortly, this is ensured by assumptions (A3) and (A4), which allow us to use Lemma 5 to conclude that the optimal control problem (\(\text {pH} \text { OCP}_T\)) is dissipative with respect to the manifold \({\mathcal {M}}\). Notice that (A4) implies \(x_0,x_T \in V\).

Theorem 12

((\(\text {pH} \text { OCP}_T\)) is dissipative) Under assumption 11, the optimal control problem (\(\text {pH} \text { OCP}_T\)) is dissipative with respect to the manifold \({\mathcal {M}}\) with storage function \({\mathcal {H}}\).

Proof

The proof is essentially an application of Lemma 5. Since all assumptions of Lemma 5 are satisfied under assumption 11, there exists an open set \(V\subseteq {\mathbb {R}}^n\) and constant \(c>0\) such that \({\mathcal {M}}\subseteq V \subseteq {\mathcal {E}}({\mathcal {M}})\) and

$$\begin{aligned} c \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) \le \Vert R(x)^{1/2} \eta (x) \Vert \end{aligned}$$
(13)

holds for all \(x\in V\). In particular, assumption (A4) ensures that the estimate holds along any optimal trajectory \(x^*\) of (\(\text {pH} \text { OCP}_T\)). With this and (12), we see that for any optimal control \(u^*\) and the associated trajectory \(x^*\) and output \(y^*\), we have

$$\begin{aligned} {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0)&= \int _{0}^{T}{y^*}^{{\textsf{T}}}u^* - \Vert R(x^*)^{1/2}\eta (x^*) \Vert ^2 ~\textrm{d}t\\&\le \int _{0}^{T}{y^*}^{{\textsf{T}}}u^* - c^2 \mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}})^2 ~\textrm{d}t\\&= \int _{0}^{T}{y^*}^{{\textsf{T}}}u^* - \alpha (\mathop {\textrm{dist}}\limits (x^*,{\mathcal {M}})) ~\textrm{d}t, \end{aligned}$$

where \(\alpha :s \mapsto c^2 s^2 \in {\mathcal {K}}\). Finally, note that the Hamiltonian \({\mathcal {H}}\), acting as a storage function here, is bounded on compact sets since it is differentiable. \(\square \)

Remark 13

Let us emphasize that the estimate (2) from Lemma 5 was the key to conclude the dissipativity property of (\(\text {pH} \text { OCP}_T\)). As we have mentioned in Remark 6, the estimate is related to Łojasiewicz’ inequality [28, 29]. In fact, if the map \(g:x \mapsto \Vert R^{1/2}(x)\eta (x) \Vert ^2\) is real analytic, then we may use the Łojasiewicz inequality to derive dissipativity without Lemma 5, as long as any optimal trajectory stays in some compact set \(D\subseteq {\mathbb {R}}^n\).

Now, an application of Theorem 9 yields the following result, showing that the optimal control problem (\(\text {pH} \text { OCP}_T\)) has the manifold turnpike property with respect to \({\mathcal {M}}\).

Theorem 14

((\(\text {pH} \text { OCP}_T\)) has a manifold turnpike) In addition to assumption 11, assume that

  1. (A5)

    there exists a trajectory \(x_1\) that starts in \(x_0\) and reaches the manifold \({\mathcal {M}}\) in time \(T_1\ge 0\), and

  2. (A6)

    for any \(p\in {\mathcal {M}}\), there exists a trajectory \(x_2\) that starts in p and reaches \(x_T\) in time \(T_2 \ge 0\).

Then the optimal control problem (\(\text {pH} \text { OCP}_T\)) has a manifold turnpike at the manifold \({\mathcal {M}}\).

Proof

Since the port-Hamiltonian system (pH) is autonomous and there is no control cost on the manifold \({\mathcal {M}}\), the conditions (A5) and (A6) ensure that the total cost of the optimal control \(u^*\) is bounded by

$$\begin{aligned} C_{\text {pH},T}(u^*)&= \int _{0}^{T}{y^*}^{{\textsf{T}}}u^* ~\textrm{d}t\\&= {\mathcal {H}}(x_T) - {\mathcal {H}}(x_0) + \int _{0}^{T}\Vert R(x^*)^{1/2} \eta (x^*) \Vert ^2 ~\textrm{d}t\\&\le C_{{\mathcal {H}}}(K) + \int _{0}^{T_1} \Vert R(x_1)^{1/2} \eta (x_1) \Vert ^2 ~\textrm{d}t+ \int _{0}^{T_2} \Vert R(x_2)^{1/2} \eta (x_2) \Vert ^2 ~\textrm{d}t\\&\le C_{{\mathcal {H}}}(K) + C_1(K) + C_2(K) < \infty . \end{aligned}$$

Notice that the constants \(C_{{\mathcal {H}}}(K), ~C_1(K)\) and \(C_2(K)\) are independent of the final time T. Thus, using the results of Theorem 12, we may apply Theorem 9 to conclude that the optimal control problem (\(\text {pH} \text { OCP}_T\)) has the manifold turnpike property at \({\mathcal {M}}\). \(\square \)

In Theorem 14, in order to show that a turnpike property holds true, we needed to make the controllability assumptions (A5) and (A6). This is a common pattern in turnpike results, similar controllability assumptions are made in [3, 10] and [19].

Remark 15

In [19], the authors considered linear pH systems of the form

$$\begin{aligned} {\dot{x}}&= (J-R)Qx + Bu, \\ y&= B^{{\textsf{T}}}Q x, \end{aligned}$$

where \(J=-J^{{\textsf{T}}}\), \(R=R^{{\textsf{T}}}\succeq 0\) and \(Q=Q^{{\textsf{T}}}\succ 0\). They have shown that in this case the optimal control problem (\(\text {pH} \text { OCP}_T\)) admits a subspace turnpike property with respect to \(\ker (R^{1/2} Q)\). We can interpret Theorem 14 as a generalization of this result to the nonlinear case. In the linear case, assumption (A1) is immediately satisfied. Further, the set \({\mathcal {M}}\) is the kernel of \(R^{1/2} Q\), and if the dimension of \(\ker (R^{1/2} Q)\) is \(0<s<n\), then assumptions (A2) and (A3) are also satisfied. Since the distance estimate (13) can be shown to hold true globally [19, Lemma 13], the set V from Lemma 5 is \(V={\mathbb {R}}^n\) and thus assumption (A4) is also satisfied.

Remark 16

In many real-world examples, such as, for example, port-Hamiltonian formulations of the isothermal Euler equations arising from gas network modeling [32], the function R has additional structural properties. One example is block structure, where the manifold \({\mathcal {M}}\) often is a linear subspace. In this case, assumption (A2) usually does not pose a problem. On the other hand, even in this situation, assumption (A3) can be difficult to ensure.

If \(x_0, x_T \in V\) and the controllability assumptions of Theorem 14 are satisfied, then assumption (A4) is not critical in many cases. Examining (11), we observe that leaving the manifold \({\mathcal {M}}\) is connected to a higher cost. Hence, any optimal trajectory should approach the manifold \({\mathcal {M}}\), and thus, unless the set V is fairly irregular and \(x_0\) and \(x_T\) are chosen poorly, optimal trajectories will stay within V.

We finish this section with a simple example illustrating Theorem 14.

Example 17

Consider the functions \(E,J,R,\eta \) and B defined by

$$\begin{aligned} E(x)= & {} \begin{bmatrix} 1 &{} 0 \\ 0 &{} 1 \end{bmatrix}, ~~ J(x) = \begin{bmatrix} 0 &{} 1 \\ -1 &{} 0 \end{bmatrix}, ~~ B(x) = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \\ R(x)= & {} \begin{bmatrix} \tfrac{1}{4} (4\Vert x \Vert ^2 + 1)^2 &{} 0 \\ 0 &{} 0 \end{bmatrix}, ~~ \eta (x) = \begin{bmatrix} 2 &{} 0 \\ 0 &{} 1 \end{bmatrix}x \end{aligned}$$

for all \(x\in {\mathbb {R}}^2\), which together with the Hamiltonian

$$\begin{aligned} {\mathcal {H}}(x) = \frac{1}{2} ~x^{{\textsf{T}}}\!\begin{bmatrix} 2 &{} 0 \\ 0 &{} 1 \end{bmatrix} x \end{aligned}$$

form the port-Hamiltonian system

figure d

For the system (pH-1), the function \(R^{1/2}\eta \) is given by

$$\begin{aligned} R(x)^{1/2} \eta (x) = \begin{bmatrix} 4 \Vert x \Vert ^2 + 1 &{} 0 \\ 0 &{} 0 \end{bmatrix}x = \begin{bmatrix} 4(x_1^3 + x_2^2x_1) + x_1 \\ 0 \end{bmatrix}, \end{aligned}$$

where we take \(x=\begin{bmatrix} x_1&x_2 \end{bmatrix}^{{\textsf{T}}}\). Thus, the derivative \(D(R^{1/2}\eta )\) reads as

$$\begin{aligned} D(R^{1/2}\eta )(x)= \begin{bmatrix} 12 x_1^2+ 4 x_2^2 + 1 &{} 8 x_2 x_1 \\ 0 &{} 0 \end{bmatrix} \ne 0 \end{aligned}$$

and the subspace \(\ker (D(R^{1/2}\eta )(x))\) is one-dimensional for all \(x\in {\mathbb {R}}^2\). A simple calculation shows that the nonzero singular value of \(D(R^{1/2}\eta )(x)\) is given by

$$\begin{aligned} \sigma (x) = 144 x_1^4 + 160 x_1^2 x_2^2 + 24 x_1^2 + 16 x_2^4 + 8 x_2^2 + 1 \ge 1. \end{aligned}$$

The zero locus \({\mathcal {M}}\) of \(R^{1/2}\eta \) is given by

$$\begin{aligned} {\mathcal {M}}= \bigg \{ \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \in {\mathbb {R}}^2 ~\bigg |~ (4 x_1^2 + 4x_2^2 + 1) x_1 = 0\bigg \} = \bigg \{ \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} \in {\mathbb {R}}^2 ~\bigg |~ x_1 = 0\bigg \}. \end{aligned}$$

Hence, assumptions (A1), (A2) and (A3) are satisfied for (pH-1). As \({\mathcal {M}}\) is a linear subspace, the orthogonal projection on \({\mathcal {M}}\) is well defined globally and we have \({\mathcal {E}}({\mathcal {M}})={\mathbb {R}}^2\). Further, for the set V from Lemma 5 it holds that \(V={\mathbb {R}}^2\) since

$$\begin{aligned} \mathop {\textrm{dist}}\limits (x,{\mathcal {M}}) = |x_1| \le | x_1 (4x_1^2 + 4x_2^2 + 1)| = \Vert f(x) \Vert \end{aligned}$$

for all \(x\in {\mathbb {R}}^2\). Thus, also assumption (A4) is satisfied for (pH-1).

Now, for \(\xi = \begin{bmatrix} \xi _1&\xi _2&\xi _3 \end{bmatrix}^{{\textsf{T}}}\in {\mathbb {R}}^3\), let us define the functions \({\widetilde{E}},{\widetilde{J}},{\widetilde{R}},{\widetilde{\eta }}\) and \({\widetilde{B}}\) by

$$\begin{aligned} {\widetilde{E}}(\xi ):= \begin{bmatrix} 1 &{} 0 &{} 0 \\ 0 &{} 0 &{} 1 \\ 0 &{} 0 &{} 0 \end{bmatrix}, ~~ {\widetilde{J}}(\xi ):= \begin{bmatrix} 0 &{} 1 &{} 0 \\ -1 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 \end{bmatrix}, ~~ {\widetilde{B}}(\xi ):= \begin{bmatrix} 1 \\ 2 \\ 0 \end{bmatrix}, \\ {\widetilde{R}}(\xi ):= \begin{bmatrix} \tfrac{1}{4} (4\xi _1^2 + 4\xi _2^2 + 1)^2 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 \end{bmatrix}, ~~ {\widetilde{\eta }}(\xi ):= \begin{bmatrix} 2\xi _1 \\ \xi _2 \\ \xi _3 \end{bmatrix}. \end{aligned}$$

It is easy to see that also the system

figure e

satisfies assumptions (A1) – (A4). The zero locus of the map \(\xi \mapsto {\widetilde{R}}(\xi )^{1/2}{\widetilde{\eta }}(\xi )\) is

$$\begin{aligned} {\widetilde{{\mathcal {M}}}} = \left\{ \begin{bmatrix} \xi _1&\xi _2&\xi _3 \end{bmatrix}^{{\textsf{T}}}\in {\mathbb {R}}^3 ~\big |~ \xi _1 = 0 \right\} . \end{aligned}$$

6 Numerical example

As an example, we consider the optimal control problem (\(\text {pH} \text { OCP}_T\)) together with the pH systems (pH-1) and (pH-2) from Example 17. For the implementation, we use the open-source software package CasADi [33].

In order to use CasADi, the optimal control problem (\(\text {pH} \text { OCP}_T\)) is formulated as a minimization problem of the form

$$\begin{aligned} \begin{gathered} \min _{w} ~J(w) \\ \text {subject to }~ w_{\text {lb}} \le w \le w_{\text {ub}} ~~ \text {and} ~~G(w) = 0. \end{gathered} \end{aligned}$$
(14)

We follow a similar procedure as [33, Sect. 5.4]. In our implementation, w contains the values \(x(t_i)\) for the discretization points \(t_i \in [0,T]\), and the values \(u(t_i)\) for the discretization points \(t_i \in [0,T], ~ i \ne 0\). The initial condition and possible control constraints are incorporated in \(w_{\text {lb}}\) and \(w_{\text {ub}}\). The function G is used to enforce the final condition and a continuity condition on x by using an integrator scheme to determine the value \(x(t_{i+1})\) given the values \(x(t_i)\) and \(u(t_i)\). This integrator scheme is also used to calculate the cost J via the quad option in CasADi’s integrator function. For the solution of the nonlinear optimization problem (14), Ipopt [34] is used.

In Fig. 1, the solution of the optimal control problem (\(\text {pH} \text { OCP}_T\)) with the system (pH-1) under the control constraint \(-50 \le u(t) \le 50\) is shown. The turnpike behaviour is clearly visible; the first component \(x_1\) of the optimal trajectory \(x^*\) approaches the manifold \({\mathcal {M}}= \{ x \in {\mathbb {R}}^2 ~|~ x_1 = 0 \}\) very quickly and remains there for the majority of the time horizon. The same observation can be made for larger time horizons, which is not shown in Fig. 1.

In Fig. 2, the solution of the optimal control problem (\(\text {pH} \text { OCP}_T\)) with the system (pH-2) under the control constraint \(-200 \le u(t) \le 200\) is shown. Again, the turnpike phenomenon can be observed.

Fig. 1
figure 1

Minimal energy control for (pH-1). As initial and final values \(x_0 = [{\begin{matrix} 2 \\ 1 \end{matrix}}]\) and \(x_T = [{\begin{matrix} 1 \\ 1 \end{matrix}}]\) are chosen. The considered time horizon is [0, T] with final time \(T = 10\), and the control is constrained via \(-50\le u(t) \le 50\). We used 100 discretization steps

Fig. 2
figure 2

Minimal energy control for (pH-2). As initial and final values \(x_0 = [{\begin{matrix} 2&1&10 \end{matrix}}]^{{\textsf{T}}}\) and \(x_T = [{\begin{matrix} 1&2&20 \end{matrix}}]^{{\textsf{T}}}\) are chosen. The considered time horizon is [0, T] with final time \(T = 20\), and the control is constrained via \(-200\le u(t) \le 200\). We used 400 discretization steps

7 Conclusion

In this paper, we have considered the optimal control of port-Hamiltonian systems under minimal energy supply with fixed initial and final values. We have seen that the map \(R^{1/2}\eta \), corresponding to the energy dissipating portion of the right-hand side, and its zero locus \({\mathcal {M}}= \{x ~|~ R^{1/2}(x)\eta (x) = 0 \}\), which corresponds to the dissipative part of the state space, play an important role. It was shown that under smoothness assumptions on \(R^{1/2}\eta \), the set \({\mathcal {M}}\) forms a \(C^2\) submanifold of \({\mathbb {R}}^n\). In particular, using results from [26], we observed that the orthogonal projection onto \({\mathcal {M}}\) is well-defined in an open set \({\mathcal {E}}({\mathcal {M}})\). Further, we have shown that under these assumptions the distance of a point x to \({\mathcal {M}}\) can essentially be bounded by \(\Vert R^{1/2}(x)\eta (x) \Vert \) from above. This fact allowed us to deduce that the considered optimal control problem is dissipative with respect to the manifold \({\mathcal {M}}\). Our main result was a consequence of this dissipativity property. Under additional controllability assumptions, we have seen that the problem has a manifold turnpike property with respect to \({\mathcal {M}}\). This theoretical observation was confirmed in a simple numerical example.

An open question from a theoretical perspective is whether the problem (\(\text {pH} \text { OCP}_T\)) exhibits hidden regularities as in the linear case [35]. Another open topic is the study of stronger turnpike properties, such as exponential turnpikes [31, 36]. Applications of the theoretical results to specific port-Hamiltonian systems such as gas networks [32] will be studied in future works.