1 Introduction

The minimum principle (MP), also called the maximum principle in the pioneering work of Pontryagin et al. [1], is a milestone of systems and control theory that led to the emergence of optimal control as a distinct field of research. This principle states that any optimal control along with the optimal state trajectory must solve a two-point boundary value problem in the form of an extended Hamiltonian canonical system, as well as satisfying an extremization condition of the Hamiltonian function. Whether the extreme value is maximum or minimum depends on the sign convention used for the Hamiltonian definition.

The main objective of this paper is the presentation and proof of the minimum principle for hybrid systems, i.e., the generalization of the MP for control systems with both continuous and discrete states and dynamics. It should be remarked that due to the development of hybrid systems theory in different scientific communities which are motivated by various applications, the domains of definition of hybrid systems do not necessarily intersect in a general class of systems. For instance, in computer science hybrid systems are viewed as finite automata interacting with an analogue environment, and therefore the emphasis is often on the discrete event dynamics [2,3,4,5,6,7,8,9], while in the control systems community, the continuous dynamics is more dominant in the discussion. Even in hybrid systems stability theory (see, e.g., [10,11,12,13,14,15,16,17]) the considered structures for hybrid control inputs are different from the admissible set of input values considered for optimal control purposes. Moreover, the definitions and the underlying assumptions for the class of hybrid optimal control problems in hybrid dynamic programming (HDP) [18,19,20,21,22,23,24,25,26] differ from those of the hybrid minimum principle (HMP) literature.

The formulation of the HMP by Clarke and Vinter [27, 28], referred to by them as “optimal multiprocesses,” provides a minimum principle for hybrid systems of a very general nature in which switching conditions are regarded as constraints in the form of set inclusions and the dynamics of the constituent processes are governed by (possibly nonsmooth) differential inclusions. A similar philosophy is followed by Sussmann [29, 30] where a nonsmooth MP is presented for hybrid systems possessing a general class of switching structures. Due to the generality of the considered structures in [27,28,29,30] degeneracy is not precluded, therefore additional hypotheses (typically of a controllabilty nature) need to be imposed to make the HMP results significantly informative (see, e.g., [31] for more discussion).

An alternative philosophy, followed by Shaikh and Caines [32], Garavello and Piccoli [33], Taringoo and Caines [34], and Pakniyat and Caines [35] is to ensure the validity of the HMP in a non-degenerate form by introducing hypotheses on the dynamics, transitions and switching events. Then by performing first-order variational analysis via the needle variation methodology, the necessary optimality conditions are established in the form of the HMP, with the emphasis of theoretical developments on generalization of the class of hybrid systems and on relaxation of regularity assumptions (see, e.g., [36] for a discussion on regulatory requirements in control theory). Moreover, non-degeneracy provided by this approach is advantageous in the development of numerical algorithms (see, e.g., [37,38,39,40,41,42,43,44,45,46]). Other, prior, versions of the HMP which appeared in its development within hybrid system theory are to be found in the work of Riedinger and Kratz [47], Xu and Antsaklis [48], Azhmyakov, Boltyanski and Poznyak [49], and Dmitruk and Kaganovich [50,51,52].

In past work of the authors (see [35, 53, 54]), a unified general framework for hybrid optimal control problems is presented within which the HMP, HDP, and their mutual relationship are valid. Distinctive aspects in this work are the presence of state dependent switching costs, the consideration of both autonomous and controlled switchings and jumps, and the possibility of state space and control space dimension changes. The latter aspect is of particular importance for systems with hybrid dynamics induced by restrictions of certain degrees of freedom (e.g., single- and double-support modes in legged locomotion [55] and fixed gear modes and transitioning phases in automotive systems [56, 57]). Within this general framework, it is proved that along optimal trajectories of a hybrid system, the adjoint process in the HMP, and the gradient of the value function in HDP are equal almost everywhere (see [53] for a proof method based on variations over optimal trajectories, and [35] for variations over general (i.e., not necessarily optimal) trajectories). Illustrative analytic examples are provided in [58,59,60].

In this paper, we further extend this framework to permit time-varying vector fields, switching manifolds, switching costs and jump transition maps and we present the statement and the proof of the hybrid minimum principle within this general framework. Distinctive aspects of this work are the explicit presentation of the boundary conditions on the Hamiltonians and adjoint processes (in contrast to their implicit expressions in [27,28,29,30, 33]), the relaxation of the regularity requirements (relative to, e.g., [32, 34]) and the presence of both autonomous and controlled switchings and jumps with switching costs and the possibility of state space dimension change (where only subsets of these features have been considered for the presentation of other versions of the HMP). Moreover, the explicit derivation of the boundary conditions in the HMP is presented within the general class of hybrid optimal control problems with time-varying vector fields, running and switching costs, jump transition maps and switching manifolds.

The organization of the paper is as follows: In Sect. 2, a definition of hybrid systems is presented that covers a general class of nonlinear systems on Euclidean spaces with autonomous and controlled switchings and jumps allowed at the switching states and times. Section 3 presents a general class of hybrid optimal control problems with a large range of running, terminal and switching costs. The regularity assumptions in Sects. 2 and 3 are attempted to be minimal, and they are imposed primarily to ensure the existence and uniqueness of solutions as well as continuous dependence on initial conditions. Further generalizations such as the lying of the system’s vector fields in Riemannian spaces [34, 61], nonsmooth assumptions [18, 19, 27,28,29,30], state-dependence of the control value sets [33], and stochastic hybrid systems [62], as well as restrictions to certain subclasses, such as those with regional dynamics [23, 24], and with specified families of jumps [18,19,20,21], become possible through variations and extensions of the framework presented here. The main result which is the statement and the proof of the hybrid minimum principle (HMP) is presented in Sect. 4 where first-order variational analysis is performed via the needle variation methodology and the necessary optimality conditions are established in the form of the HMP. To illustrate the results, four analytic and numerical examples are provided in Sect. 5. Concluding remarks are presented in Sect. 6.

2 Hybrid systems

Definition 1

A (deterministic) hybrid system (structure) \({\mathbb {H}}\) is a septuple

$$\begin{aligned} {\mathbb {H}}=\left\{ H,I,\Gamma ,A,F,\Xi ,{\mathcal {M}}\right\} , \end{aligned}$$
(1)

where the symbols in the expression and their governing assumptions are defined as below.

A0 \(H:=\coprod _{q\in Q}{\mathbb {R}}^{n_{q}}\) is called the (hybrid) state space of the hybrid system \({\mathbb {H}}\), where \(\coprod \) denotes disjoint union, i.e., \(\coprod _{q\in Q}{\mathbb {R}}^{n_{q}} = \bigcup _{q\in Q}\big \{ (q,x): x \in {\mathbb {R}}^{n_{q}} \big \}\), where

\(Q=\big \{ 1,2,...,\vert Q\vert \big \} \equiv \big \{ q_{1},q_{2},...,q_{\vert Q\vert }\big \},\vert Q\vert <\infty \), is a finite set of discrete states (components), and

\(\left\{ {\mathbb {R}}^{n_{q}}\right\} _{q\in Q}\) is a family of finite-dimensional continuous valued state spaces, where \(n_{q}\le n<\infty \) for all \(q\in Q\).

\(I:=\Sigma \times U\) is the set of system input values, where

\( \Sigma \) with \( \vert \Sigma \vert < \infty \) is the set of discrete state transition and continuous state jump events extended with the identity element,

\(U=\left\{ U_{q}\right\} _{q\in Q}\) is the set of admissible input control values, where each \(U_q \subset {\mathbb {R}}^{m_q}\) is a compact set in \({\mathbb {R}}^{m_q}\).

The set of admissible (continuous) control inputs \({\mathcal {U}}\left( U\right) :=L_{\infty }\left( \left[ t_{0},T_{*}\right) ,U\right) \), is defined to be the set of all measurable functions that are bounded up to a set of measure zero on \(\left[ t_{0},T_{*}\right) ,T_{*}<\infty \). The boundedness property necessarily holds since admissible inputs take values in the compact set U.

\(\Gamma :H\times \Sigma \rightarrow H\) is a time-dependent (partially defined) discrete state transition map.

\(A:Q\times \Sigma \rightarrow Q\) denotes both a deterministic finite automaton and the automaton’s associated transition function on the state space Q and event set \(\Sigma \), such that for a discrete state \(q\in Q\) only the discrete controlled and uncontrolled transitions into the q-dependent subset \(\left\{ A\left( q,\sigma \right) ,\sigma \in \Sigma \right\} \subset Q\) occur under the projection of \(\Gamma \) on its Q components: \(\Gamma :{\mathbb {R}}\times Q\times {\mathbb {R}}^{n}\times \Sigma \rightarrow H\vert _{Q}\). In other words, \(\Gamma \) can only make a discrete state transition in a hybrid state \(\left( q,x\right) \) if the automaton A can make the corresponding transition in q.

\(\Xi :H\times \Sigma \rightarrow H\) is a time-dependent (partially defined) continuous state jump transition map. For all \(\xi \in \Xi \), the functions \(\xi _{\sigma } \equiv \xi (\cdot , \cdot , \sigma ): [t_{0},t_{f}] \times {\mathbb {R}}^{n_q} \rightarrow {\mathbb {R}}^{n_p}\), \(p\in A\left( q,\sigma \right) \) are assumed to be jointly continuously differentiable in both the time \(t \in [t_{0},t_{f}]\) and the continuous state \(x \in {\mathbb {R}}^{n_q}\).

F is an indexed collection of vector fields \(\left\{ f_{q}\right\} _{q\in Q}\) such that there exist \(k_{f_q}\ge 1\) for which \(f_{q}\in C^{k_{f_q}} \left( [t_{0},t_{f}] \times {\mathbb {R}}^{n_q}\times U_q\rightarrow {\mathbb {R}}^{n_q}\right) \) satisfies a joint uniform Lipschitz condition, i.e., there exists \(L_{f}<\infty \) such that \(\left\| f_{q}\left( t_{1}, x_{1},u_{1}\right) -f_{q}\left( t_{2}, x_{2},u_{2}\right) \right\| \le L_{f}\left( \vert t_{1} - t_{2} \vert + \left\| x_{1}-x_{2}\right\| + \left\| u_{1}-u_{2}\right\| \right) \) for all \(q\in Q\), \(t_{1}, t_{2} \in [t_{0},t_{f}]\), \(x_{1},x_{2}\in {\mathbb {R}}^{n_q}\), \(u_1, u_2\in U_q\).

\({\mathcal {M}}=\left\{ m_{\alpha }:\alpha \in Q\times Q\right\} \) denotes a collection of switching manifolds such that, for any ordered pair \(\alpha \equiv \left( \alpha _1,\alpha _2\right) =\left( q,r\right) \), \(m_{\alpha }\) is a smooth, i.e., \(C^{\infty }\) codimension 1 sub-manifold of \([t_{0},t_{f}] \times {\mathbb {R}}^{n_q}\), described locally by \(m^{t}_{\alpha }=\left\{ x \in {\mathbb {R}}^{n_{\alpha _{1}}}: m_{\alpha }\left( t,x\right) =0 \right\} \), and possibly with boundary \(\partial m^{t}_{\alpha }\). It is assumed that \(m^{t}_{\alpha }\cap m^{t}_{\beta }=\emptyset \), whenever \(\alpha _1 = \beta _1\) but \(\alpha _2 \ne \beta _2\), for all \(\alpha ,\beta \in Q\times Q\), \(t \in [t_{0},t_{f}]\). \(\square \)

We note that the case where \(m^{t}_{\alpha }\) is identified with its reverse ordered version \(m^{t}_{{\bar{\alpha }}}\) giving \(m^{t}_{\alpha }=m^{t}_{{\bar{\alpha }}}\), is not ruled out by this definition, even in the non-trivial case \(m^{t}_{p,p}\) where \(\alpha _1 = \alpha _2 = p\). The former case corresponds to the common situation where the switching of vector fields at the passage of the continuous trajectory in one direction through a switching manifold is reversed if a reverse passage is performed by the continuous trajectory, while the latter case corresponds to the standard example of the bouncing ball.

Switching manifolds will function in such a way that whenever a trajectory governed by the controlled vector field meets the switching manifold transversally there is an autonomous switching to another controlled vector field or there is a jump transition in the continuous state component, or both. A transversal arrival on a switching manifold \(m^{t}_{q,r}\), at state \(x_q \in m^{t}_{q,r}=\left\{ x \in {\mathbb {R}}^{n_{q}}: m_{q,r}\left( t,x\right) =0 \right\} \) occurs whenever

$$\begin{aligned} {\nabla m_{q,r} \left( t,x_q\right) }^{\top } f_q \left( t,x_q,u_q\right) \ne 0, \end{aligned}$$
(2)

for \(u_q\in U_q\), and \(q,r \in Q\). It is assumed that:

A1 The initial state \(h_{0}:=\left( q_{0},x(t_{0})\right) \in H\) is such that \(m_{q_{0},q_{j}}\left( t_{0}, x_{0}\right) \ne 0\), for all \(q_{j}\in Q\). \(\square \)

Definition 2

A hybrid input process is a pair \(I_{L}\equiv I_{L}^{\left[ t_{0},t_{f}\right) }:= \left( S_L,u\right) \) defined on a half open interval \(\left[ t_{0},t_{f}\right) \), \(t_{f}<\infty \), where \(u\in {{{\mathcal {U}}}}\) and \(S_L = \big (\left( t_{0},\sigma _{0}\right) , \left( t_{1},\sigma _{1}\right) , \cdots ,\) \(\left( t_{L},\sigma _{L}\right) \big )\), \(L<\infty \), is a finite hybrid sequence of switching events consisting of a strictly increasing sequence of times \(\tau _L:= \left\{ t_{0},t_{1},t_{2},\ldots ,t_{L}\right\} \) and a discrete event sequence \(\sigma \) with \(\sigma _0 = id\) and \(\sigma _i \in \Sigma \), \(i \in \left\{ 1,2,\cdots ,L\right\} \). \(\square \)

Definition 3

A hybrid state process (or trajectory) is a triple \(\left( \tau _L,q,x\right) \) consisting of the sequence of switching times \(\tau _L = \left\{ t_{0},t_{1},\ldots ,t_{L}\right\} \), \(L<\infty \), the associated sequence of discrete states \(q=\left\{ q_{0},q_{1},\ldots ,q_{L}\right\} \), and the sequence \(x(\cdot )=\left\{ x_{q_{0}}(\cdot ),x_{q_{1}}(\cdot ),\ldots ,x_{q_{L}}(\cdot )\right\} \) of piece-wise differentiable functions \(x_{q_{i}}(\cdot ):\left[ t_{i},t_{i+1}\right) \rightarrow {\mathbb {R}}^{n}\).\(\square \)

Definition 4

The input-state trajectory for the hybrid system \({\mathbb {H}}\) satisfying A0 and A1 is a hybrid input \(I_L = \left( S_L,u\right) \) together with its corresponding hybrid state trajectory \(\left( \tau _L,q,x\right) \) defined over \(\left[ t_{0},t_{f}\right) ,t_{f}<\infty \), such that it satisfies:

  1. (i)

    Continuous State Dynamics The continuous state component \(x(\cdot ) =\big \{ x_{q_{0}}(\cdot ), \) \( x_{q_{1}}(\cdot ),\ldots ,x_{q_{L}}(\cdot )\big \}\) is a piecewise continuous function which is almost everywhere differentiable and on each time segment specified by \(\tau _L\) satisfies the dynamics equation

    $$\begin{aligned} {{\dot{x}}_{q_{i}}(t) = f_{q_{i}}\big (t,x_{q_{i}}(t),u(t)\big )}, \hspace{1 cm} {a.e.\; t\in \left[ t_{i},t_{i+1}\right) }, \end{aligned}$$
    (3)

    with the initial conditions

    $$\begin{aligned} x_{q_{0}}(t_{0})&=x_{0} , \end{aligned}$$
    (4)
    $$\begin{aligned} x_{q_{i}}(t_{i})&= \xi _{\sigma _{i}}\big (t_{i},x_{q_{i-1}}(t_{i}-)\big ) := \xi _{\sigma _{i}}\bigg (\lim _{t\uparrow t_{i}} t , \lim _{t\uparrow t_{i}}x_{q_{i-1}}(t)\bigg ) , \end{aligned}$$
    (5)

    for \(\left( t_{i},\sigma _{i}\right) \in S_L\). In other words, \(x(\cdot )=\left\{ x_{q_{0}}(\cdot ),x_{q_{1}}(\cdot ),\ldots ,x_{q_{L}}(\cdot )\right\} \) is a piecewise continuous function which is almost everywhere differentiable and is such that each \(x_{q_{i}}(\cdot )\) satisfies

    $$\begin{aligned} x_{q_{i}}(t)=x_{q_{i}}(t_{i})+\int _{t_{i}}^{t}f_{q_{i}}\left( s,x_{q_{i}}(s),u(s)\right) \textrm{d}s, \end{aligned}$$
    (6)

    for \(t \in \left[ t_{i},t_{i+1}\right) \).

  2. (ii)

    Autonomous Discrete Transition Dynamics An autonomous (uncontrolled) discrete state transition from \(q_{i-1}\) to \(q_i\) together with a continuous state jump \(\xi _{\sigma _i}\) occurs at the autonomous switching time \(t_i\) if \(x_{q_{i-1}}(t_{i}-):=\lim _{t\uparrow t_{i}}x_{q_{i-1}}(t)\) satisfies a switching manifold condition of the form

    $$\begin{aligned} m_{q_{i-1}q_i}\left( t_{i}, x_{q_{i-1}}(t_{i}-)\right) = 0, \end{aligned}$$
    (7)

    for \(q_i\in Q\), where \(m_{q_{i-1}q_i}\left( t,x\right) = 0\) defines a \(\left( q_{i-1},q_i\right) \) switching manifold and it is not the case that either \(\left( i\right) \) \(x(t_{i}-)\in \partial m_{q_{i-1}q_i}\) or \(\left( ii\right) \) \(f_{q_{i-1}}\left( t_{i}, x(t_{i}-),u(t_{i}-)\right) \perp \nabla m_{q_{i-1}q_i}\left( t_{i}, x(t_{i}-)\right) \), i.e., \(t_i\) is not a manifold termination instant (see [63]). With the assumptions A0 and A1 in force, such a transition is well defined and labels the event \(\sigma _{i} \equiv \sigma _{q_{i-1}q_i} \in \Sigma \), that corresponds to the hybrid state transition

    $$\begin{aligned} h(t_{i}) \equiv \left( q_{i},x_{q_{i}}(t_{i})\right) = \left( \Gamma \left( t_{i},q_{i-1}, x_{q_{i-1}}(t_{i}-),\sigma _{i}\right) ,\xi _{\sigma _{i}} \left( t_{i}, x_{q_{i-1}}(t_{i}-)\right) \right) . \end{aligned}$$
    (8)
  3. (iii)

    Controlled Discrete Transition Dynamics A controlled discrete state transition together with a controlled continuous state jump \(\xi _{\sigma _i}\) occurs at the controlled discrete event time \(t_i\) if \(t_i\) is not an autonomous discrete event time and if there exists a controlled discrete input event \(\sigma _{i} \in \Sigma \) for which

    $$\begin{aligned} h(t_{i}) \equiv \left( q_{i},x_{q_{i}}(t_{i})\right) = \left( \Gamma \left( t_{i},q_{i-1}, x_{q_{i-1}}(t_{i}-),\sigma _{i}\right) ,\xi _{\sigma _{i}} \left( t_{i}, x_{q_{i-1}}(t_{i}-)\right) \right) , \end{aligned}$$
    (9)

    with \(\left( t_{i},\sigma _{i}\right) \in S_L\) and \(q_{i}\in A\left( q_{i-1}\right) \). \(\square \)

Fig. 1
figure 1

An example hybrid automata with both autonomous (displayed in red arrows) and controlled (displayed in green arrows) switchings (color figure online)

To illustrate the notation, Fig. 1 provides an example hybrid automata with both autonomous and controlled switchings. In this example, the discrete component of the state takes values from \(Q = \{p,q,r\}\), i.e., \(|Q |= 3\) \(|Q |= 3\) within each mode the evolution of the continuous component of the state is governed by a controlled differential equation. Transitions from q to r and from r to p are autonomous (displayed in red arrows) whereas transitions from p to q, from q to p and from q to r are controlled switchings (displayed in green arrows). In this example, there is no direct transition from p to r. The indexed vector fields, the underlying spaces for the state and input values, as well as switching manifold and jump maps are displayed in this figured.

A2 For a specified sequence of discrete states \(\left\{ q_i\right\} _{i=0}^{L}\), the class of input-state trajectories is non-empty. In other words, there exist \(S_L = \big (\left( t_{0},\sigma _{0}\right) , \left( t_{1},\sigma _{1}\right) , \cdots , \left( t_{L},\sigma _{L}\right) \big ) \equiv \big (\left( t_{0},q_{0}\right) , \left( t_{1},q_{1}\right) , \cdots , \left( t_{L},q_{L}\right) \big )\) and \(u_{q_i} \in L_{\infty }\left( \left[ t_{i},t_{i+1}\right) , U_{q_i}\right) \) that together with its corresponding hybrid state process form an input-state trajectory in Definition 4. \(\square \)

Theorem 1

[63] A hybrid system \({\mathbb {H}}\) with an initial hybrid state \(\left( q_{0},x_{0}\right) \) satisfying assumptions A0 and A1 possesses a unique hybrid input-state trajectory on \(\left[ t_{0},T_{**}\right) \), where \(T_{**}\) is the least of

  1. (i)

    \(T_{*} \le \infty \), where \(\left[ t_{0},T_{*}\right) \) is the temporal domain of the definition of the hybrid system,

  2. (ii)

    A manifold termination instant \(T_{*}\) of the trajectory \(h(t) = h\left( t,\left( q_0,x_0\right) ,\left( S_L,u\right) \right) \), \(t\ge t_0\), at which either \(x\left( T_{*}-\right) \in \partial m_{q\left( T_*-\right) q\left( T_*\right) }\) or \(f_{q\left( T_*-\right) }\left( x\left( T_*-\right) ,u\left( T_*-\right) \right) \perp \nabla m_{q\left( T_*-\right) q\left( T_*\right) }\left( x\left( T_{*}-\right) \right) \). \(\square \)

We note that Zeno times, i.e., accumulation points of discrete transition times, are ruled out by A2.

Lemma 1

State processes of a hybrid system satisfying Assumptions A0-A2 are continuously dependent on their initial conditions. In other words, for a given \(\left\{ q_i\right\} _{i=0}^{L}\) and an initial continuous state \(x_0 \in {\mathbb {R}}^{n_{q_0}}\), there exist a neighborhood \(N\left( x_0\right) \) and a constant \(0<K<\infty \) such that

$$\begin{aligned} \big \Vert x(t_{f};s,x_{s}) - x(t_{f};t_0,x_{0}) \big \Vert \le K\Big (\big \Vert x_{s}-x_{0}\big \Vert ^{2}+\vert s-t_0\vert ^{2}\Big )^{\frac{1}{2}}, \end{aligned}$$
(10)

for \(s \ge t_0\) and \(x_s \in N\left( x_0\right) \). \(\square \)

Proof

See Appendix A. \(\square \)

3 Hybrid optimal control problems

A3 Let \(\left\{ l_{q}\right\} _{q\in Q},l_{q}\in C^{n_{l}}\left( {\mathbb {R}}^{n}\times U\rightarrow {\mathbb {R}}_{+}\right) ,n_{l}\ge 1\), be a family of cost functions with \(n_l = 2\) unless otherwise stated; \(\left\{ c_{\sigma }\right\} _{\sigma \in \Sigma }\in C^{n_{c}}\left( {\mathbb {R}}^{n}\times \Sigma \rightarrow {\mathbb {R}}_{+}\right) ,n_{c}\ge 1\), be a family of switching cost functions; and \(g\in C^{n_{g}}\left( {\mathbb {R}}^{n}\rightarrow {\mathbb {R}}_{+}\right) ,n_{g}\ge 1\), be a terminal cost function satisfying the following assumptions:

  1. (i)

    There exists \(K_{l}<\infty \) and \(1\le \gamma _{l}<\infty \) such that \(\vert l_{q}(x,u)\vert \le K_{l}\big ( 1+\Vert x\Vert ^{\gamma _{l}}\big )\) and \(\vert l_{q}(x_{1},u_{1})-l_{q}(x_{2},u_{2}) \vert \le K_{l}\big (\Vert x_{1}-x_{2}\Vert +\Vert u_{1}-u_{2}\Vert \big )\), for all \(x\in {\mathbb {R}}^{n},u\in U,q\in Q\).

  2. (ii)

    There exists \(K_{c}<\infty \) and \(1\le \gamma _{c}<\infty \) such that \(\vert c_{\sigma }\left( x\right) \vert \le K_{c}\left( 1+\left\| x\right\| ^{\gamma _{c}}\right) \), \(x\in {\mathbb {R}}^{n},\sigma \in \Sigma \).

  3. (iii)

    There exists \(K_{g}<\infty \) and \(1\le \gamma _{g}<\infty \) such that \(\vert g\left( x\right) \vert \le K_{g}\left( 1+\left\| x\right\| ^{\gamma _{g}}\right) \), \(x\in {\mathbb {R}}^{n}\). \(\square \)

Consider the initial time \(t_{0}\), final time \(t_{f}<\infty \), and initial hybrid state \(h_{0}=\left( q_{0},x_{0}\right) \). With the number of switchings L held fixed, the set of all hybrid input trajectories in Definition 2 with exactly L switchings is denoted by \(\varvec{I_{L}}\), and for all \(I_{L}:=\left( S_{L},u\right) \in \varvec{I_{L}}\) the hybrid switching sequences take the form \(S_{L}= \left\{ \left( t_{0},id\right) ,\left( t_{1},\sigma _{q_{0}q_{1}}\right) , \ldots , \left( t_{L},\sigma _{q_{L-1}q_{L}}\right) \right\} \equiv \left\{ \left( t_{0},q_{0}\right) ,\left( t_{1},q_{1}\right) ,\ldots ,\left( t_{L},q_{L}\right) \right\} \) and the corresponding continuous control inputs are of the form \(u\in {\mathcal {U}} = \bigcup _{i=0}^{L} L_{\infty }\left( \left[ t_i,t_{i+1}\right) ,U\right) \), where \(t_{L+1}=t_f\).

Let \(I_{L}\) be a hybrid input trajectory that by Theorem 1 results in a unique hybrid state process. Then hybrid performance functions for the corresponding hybrid input-state trajectory are defined as

$$\begin{aligned}{} & {} J\left( t_{0},t_{f},h_{0},L;I_{L}\right) := \sum _{i=0}^{L}\int _{t_{i}}^{t_{i+1}}l_{q_{i}}\left( x_{q_{i}}(s),u(s)\right) \textrm{d}s\nonumber \\{} & {} \quad +\sum _{j=1}^{L}c_{\sigma _{j}}\left( t_{j},x_{q_{j-1}}(t_{j}-)\right) +g\left( x_{q_{L}}(t_{f})\right) \end{aligned}$$
(11)

Definition 5

The (Bolza) Hybrid Optimal Control Problem (HOCP) is defined as

$$\begin{aligned} J^{o}\left( t_{0},t_{f},h_{0},L\right) =\inf _{I_{L} \in \varvec{I_{L}}}J\left( t_{0},t_{f},h_{0},L;I_{L}\right) \end{aligned}$$
(12)

that is, the infimization of the hybrid cost (11) over the family of hybrid input trajectories \(\varvec{I_{L}}\). \(\square \)

4 The hybrid minimum principle (HMP)

Theorem 2

Consider the hybrid system \({\mathbb {H}}\) subject to assumptions A0-A3, and the HOCP (12) for the hybrid performance function (11). Define the family of system Hamiltonians by

$$\begin{aligned} H_{q}\left( t,x_q,\lambda _q,u_q\right) =\lambda _q^{\top }f_{q}\left( t,x_q,u_q\right) +l_{q}\left( t,x_q,u_q\right) , \end{aligned}$$
(13)

\(x_q, \lambda _q \in {\mathbb {R}}^{n_{q}}\), \(u_q \in U_{q}\), \(q\in Q\), and let \(\left\{ q_i\right\} _{i=0}^{L}\) be a specified sequence of discrete states with its associated set of switchings. Then for an optimal input \(u^{o}\) and along the corresponding optimal trajectory \(x^{o}\), there exists an adjoint process \(\lambda ^{o}\) such that

$$\begin{aligned} H_{q}\left( t,x^{o}_{q}(t),\lambda ^{o}_{q}(t),u^{o}_{q}(t)\right) \le H_{q}\left( t,x^{o}_{q}(t),\lambda ^{o}_{q}(t),v\right) , \end{aligned}$$
(14)

for all \(v\in U_{q}\), and at almost every \(t \in [t_{0},t_{f}]\), where \((x^{o},\lambda ^{o})\) satisfy

$$\begin{aligned} {\dot{x}}^{o}_{q}&=\frac{\partial H_{q}}{\partial \lambda _q}(t,x_q^{o},\lambda _q^{o},u_q^{o})= & {} \; f_{q}(t,x_{q}^o,u_{q}^o), \end{aligned}$$
(15)
$$\begin{aligned} {\dot{\lambda }}^{o}_{q}&=-\frac{\partial H_{q}}{\partial x_q}(t,x_q^{o},\lambda _q^{o},u_q^{o})= & {} - \frac{\partial l_{q}(t,x_{q}^o,u_{q}^o)}{\partial x} - \bigg [ \frac{\partial f_{q}(t,x_{q}^o,u_{q}^o)}{\partial x}\bigg ]^{\top } \lambda _{q}^{o} , \end{aligned}$$
(16)

almost everywhere \(\; t\in \left[ t_{0},t_{f}\right] \), subject to

$$\begin{aligned} x^o_{q_0}\left( t_0\right)&=x_0, \end{aligned}$$
(17)
$$\begin{aligned} x^o_{q_j}\left( t_{j}^{o}\right)&=\xi _{\sigma _j}\big (x^o_{q_{j-1}}(t_{j}^{o}-)\big ), \end{aligned}$$
(18)
$$\begin{aligned} \lambda ^{o}_{q_L}(t_{f})&=\nabla g\big (x^{o}_{q_L}(t_{f})\big ), \end{aligned}$$
(19)
$$\begin{aligned} \lambda ^{o}_{q_{j-1}}(t_{j}^{o}-)\equiv \lambda ^{o}_{q_{j-1}}(t_{j}^{o})&=\nabla \xi _{\sigma _j}^{\top } \lambda ^{o}_{q_j}(t_{j}^{o}+) + \nabla c_{\sigma _j} +p_j \nabla m_{q_{j-1}q_j}, \end{aligned}$$
(20)

where \(p_j \in {\mathbb {R}}\) when \(t_{j}\) indicates the time of an autonomous switching, subject to the switching manifold condition \(m_{q_{j-1}q_j}\big (x^o_{q_{j-1}}(t_{j}-)\big ) = 0\), and \(p_j=0\) when \(t_{j}\) indicates the time of a controlled switching. Moreover, the Hamiltonian satisfies

$$\begin{aligned}{} & {} H_{q_{j-1}}\left( t_{j}^{o}-, x_{q_{j-1}}^{o},\lambda _{q_{j-1}}^{o},u_{q_{j-1}}^{o}\right) \nonumber \\{} & {} \quad =H_{q_{j}}\left( t_{j}^{o}+, x_{q_{j}}^{o},\lambda _{q_{j}}^{o},u_{q_{j}}^{o}\right) -\frac{\partial c_{\sigma _{j}}}{\partial t}-p_{j}\frac{\partial m_{q_{j-1}q_{j}}}{\partial t} - \bigg [\frac{\partial \xi _{\sigma _{j}}}{\partial t}\bigg ]^{\top } \lambda ^{o}_{q_j}(t_{j}^{o}+). \nonumber \\ \end{aligned}$$
(21)

which, with the expansion of the Hamiltonians from (13), is expressed as

$$\begin{aligned}{} & {} l_{q_{j-1}}\left( t_{j}^{o}, x_{q_{j-1}}^{o}(t_{j}^{o}-),u_{q_{j-1}}^{o}(t_{j}^{o}-)\right) + \lambda ^{o}_{q_{j-1}}(t_{j}^{o})^{\top } f_{q_{j-1}}\nonumber \\{} & {} \quad \left( t_{j}^{o}, x_{q_{j-1}}^{o}(t_{j}^{o}-),u_{q_{j-1}}^{o}(t_{j}^{o}-)\right) \nonumber \\{} & {} \quad =l_{q_{j}}\left( t_{j}^{o}, x_{q_{j}}^{o}(t_{j}^{o}),u_{q_{j}}^{o}(t_{j}^{o})\right) + \lambda _{q_{j}}^{o}(t_{j}^{o}+)^{\top } f_{q_{j}}\left( t_{j}^{o}, x_{q_{j}}^{o}(t_{j}^{o}),u_{q_{j}}^{o}(t_{j}^{o})\right) \nonumber \\{} & {} \qquad -\frac{\partial c_{\sigma _{j}}\big (t_{j}^{o},x^o_{q_{j-1}}(t_{j}-)\big )}{\partial t} \nonumber \\{} & {} \qquad -p_{j}\frac{\partial m_{q_{j-1}q_{j}}\big (t_{j}^{o},x^o_{q_{j-1}}(t_{j}-)\big )}{\partial t} - \bigg [\frac{\partial \xi _{\sigma _{j}}\big (t_{j}^{o},x^o_{q_{j-1}}(t_{j}-)\big )}{\partial t}\bigg ]^{\top } \lambda ^{o}_{q_j}(t_{j}^{o}+). \nonumber \\ \end{aligned}$$
(22)

\(\square \)

Proof

First, in the first part of the proof (Sect. 4.1), we study a needle variation to the optimal input at the last location \(u^o_{q_L}\) at a Lebesgue instantFootnote 1\(t \in \left( t_L,t_{L+1}\right] \equiv \left( t_L,t_f\right] \) to derive the Hamiltonian canonical equations (15) and (16), the adjoint terminal condition (19), and the Hamiltonian minimization condition (14) in that location. This part of the proof is similar to the proof of the classical Pontryagin minimum principle.

Next, in the second part of the proof in Sect. 4.2, we perform a variation in the penultimate, \(L-1{\text {st}}\), location in order to obtain \(\left( i\right) \) Hamiltonian canonical equations (15) and (16), and \(\left( ii\right) \) the Hamiltonian minimization condition (14) at the location \(q_{L-1}\), as well as \(\left( iii\right) \) the boundary conditions (18) and (20), and \(\left( iv\right) \) the Hamiltonian boundary condition (21) at time \(t_L\).

Then, in the last part of the proof (Sect. 4.3), we extend the analysis for a general switching instant \(t_j\) and prove that \(\left( i\right) \) to \(\left( iv\right) \) above hold for all locations.

In order to provide the simplest derivation of the main result we define

$$\begin{aligned} {\tilde{x}}_{q}:=\Bigg [\begin{array}{c} \theta \\ z_{q}\\ x_{q} \end{array}\Bigg ] \in {\mathbb {R}}^{n_{q}+2}, \end{aligned}$$
(23)

such that \(\theta \) gives the current time and z provide the incurred cost, i.e., at \(t \in [t_{0},t_{f}]\), we have \(\theta (t) = t\) and \(z_{q}(t) = \int _{t_{N_\textrm{sw}(t)}}^{t} l_{q}\left( x_{q}(s),u(s)\right) \textrm{d}s + \sum _{i=0}^{N_\textrm{sw}(t)-1}\int _{t_{i}}^{t_{i+1}}l_{q_{i}}\left( x_{q_{i}}(s),u(s)\right) \textrm{d}s+\sum _{j=1}^{N_\textrm{sw}(t)-1}c_{\sigma _{j}}\left( t_{j},x_{q_{j-1}}(t_{j}-)\right) \) with \(N_\textrm{sw}(t)\) denoting the number of incurred switchings over the interval \([t_{0},t)\). This yields the augmented vector fields as

$$\begin{aligned} \dot{{\tilde{x}}}_{q}={\tilde{f}}_{q}\left( {\tilde{x}}_{q},u_{q}\right) := \Bigg [\begin{array}{c} 1\\ l_{q}\left( \theta ,x,u\right) \\ f_{q}\left( \theta ,x,u\right) \end{array}\Bigg ], \end{aligned}$$
(24)

subject to the initial condition

$$\begin{aligned} {\tilde{h}}_{0}=\Big (q_{0},{\tilde{x}}_{q_{0}}(t_{0})\Big )=\Bigg (q_{0},\Bigg [\begin{array}{c} t_{0}\\ 0\\ x_{0} \end{array}\Bigg ]\Bigg ), \end{aligned}$$
(25)

with the switching manifold

$$\begin{aligned} {\tilde{m}}\left( {\tilde{x}}\right) := m\left( \theta ,x\right) , \end{aligned}$$
(26)

and the extended jump function defined as

$$\begin{aligned} {\tilde{x}}_{q_{j}}(t_{j})={\tilde{\xi }}_{\sigma _{j}}\big ({\tilde{x}}_{q_{j-1}}(t_{j}{-})\big ):=\Bigg [\begin{array}{c} \theta (t_{j}{-})\\ z(t_{j}{-})+c\big (\theta ,x(t_{j}{-})\big )\\ \xi _{\sigma _{j}}\big (x(t_{j}{-})\big ) \end{array}\Bigg ]. \end{aligned}$$
(27)

This transform the problem into a time invariant, Mayer (without running or switching cost) HOCP in the form of

$$\begin{aligned} J\left( t_{0},t_{f},{\tilde{h}}_{0},L;I_{L}\right) ={\tilde{g}}\left( {\tilde{x}}_{q_{L}}(t_{f})\right) := z(t_{f})+g\left( x(t_{f})\right) . \end{aligned}$$
(28)

4.1 The last discrete state location

First, consider a Lebesgue time \(t \in \left( t_L,t_{L+1}\right] \equiv \left( t_L,t_f\right] \) and the evolution of the optimal state \({\tilde{x}}^{o}(\tau )\), \(\tau \in \left[ t_0,t_f\right] \), governed by the set of differential equations

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d} \tau }{\tilde{x}}_{q_{L}}^o = {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(\tau ),u_{q_{L}}^{o}(\tau )\right) , \hspace{10pt} \tau \in \left( t_{L},t_{f}\right] . \end{aligned}$$
(29)

We perform a needle variation at a Lebesgue time t in the form of

$$\begin{aligned} u^{\epsilon }(\tau )={\left\{ \begin{array}{ll} \begin{array}{lccclcc} u_{q_{j-1}}^{o}(\tau ) &{} &{} \text {if} &{} &{} \tau \in \left[ t_{j-1},t_{j}\right) &{} &{} 1\le j\le L\\ u_{q_{L}}^{o}(\tau ) &{} &{} \text {if} &{} &{} \tau \in \left[ t_{L},t-\epsilon \right) \\ v &{} &{} \text {if} &{} &{} \tau \in \left[ t-\epsilon ,t\right) \\ u_{q_{L}}^{o}(\tau ) &{} &{} \text {if} &{} &{} \tau \in \left[ t,t_{f}\right] \end{array}\end{array}\right. }. \end{aligned}$$
(30)

This corresponds to a perturbed trajectory \({\tilde{x}}^{\epsilon }\left( \tau \right) , \tau \in \left[ t_0,t_f\right] \) which coincides with the optimal trajectory \({\tilde{x}}^{o}\left( \tau \right) , \tau \in \left[ t_0,t_f\right] \) over the interval \([t_{0},t-\epsilon )\) but differs over \([t-\epsilon ,t_{f}]\). Denoting \(\delta {\tilde{x}}_{q_{L}}^{\epsilon }(\tau ):={\tilde{x}}_{q_{L}}^{\epsilon }(\tau )-{\tilde{x}}_{q_{L}}^{o}(\tau )\), it necessarily satisfies \(\delta {\tilde{x}}_{q_{i}}^{\epsilon }(\tau ) = 0\) for \(\tau \in \left[ t_0,t-\epsilon \right) \), \(0 \le i \le L\), and for \(\tau \in \left[ t-\epsilon ,t_f\right] \) it satisfies

$$\begin{aligned} \delta {\tilde{x}}_{q_{L}}^{\epsilon }(\tau )= & {} \int _{t-\epsilon }^{t}\left[ {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{\epsilon }(s),v\right) -{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(s),u_{q_{L}}^{o}(s)\right) \right] \textrm{d}s\nonumber \\{} & {} \quad +\int _{t}^{\tau }\left[ {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{\epsilon }(s),u_{q_{L}}^{o}(s)\right) -{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(s),u_{q_{L}}^{o}(s)\right) \right] \textrm{d}s,\nonumber \\ \end{aligned}$$
(31)

Defining the first-order sensitivity of the (augmented) state as

$$\begin{aligned} y(\tau ):=\left. \frac{\textrm{d}}{\textrm{d}\epsilon }{\tilde{x}}^{\epsilon }(\tau )\right| _{\epsilon =0}\equiv \underset{\epsilon \rightarrow 0}{\lim }\frac{1}{\epsilon }\delta {\tilde{x}}^{\epsilon }(\tau ), \end{aligned}$$
(32)

the dynamics and boundary conditions of the first-order sensitivity are derived as

$$\begin{aligned}&\frac{\textrm{d}}{\textrm{d}\tau }y_{q_{L}}(\tau )=\frac{\partial {\tilde{f}}_{q_{L}}}{\partial {\tilde{x}}_{q_{L}}}\left( {\tilde{x}}_{q_{L}}^{o}(\tau ),u_{q_{L}}^{o}(\tau )\right) y_{q_{L}}(\tau ), \end{aligned}$$
(33)
$$\begin{aligned}&y_{q_{L}}(t)={\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),v\right) -{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),u_{q_{L}}^{o}(t)\right) . \end{aligned}$$
(34)

Denoting the state transition matrix corresponding to (33) by \(\Phi _{q_{L}}\), it is shown by linearization theory (see, e.g., [63, 66]) that

$$\begin{aligned} y_{q_{L}}(t_{f})=\Phi _{q_{L}}\left( t_{f},t\right) \left[ {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),v\right) -{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),u_{q_{L}}^{o}(t)\right) \right] . \end{aligned}$$
(35)

The optimality of \({\tilde{x}}^o\) implies that

$$\begin{aligned} {\tilde{g}}\left( {\tilde{x}}_{q_{L}}^{\epsilon }(t_{f})\right) \ge {\tilde{g}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{f})\right) , \end{aligned}$$
(36)

which, using (28) and employing first-order Taylor expansion, it is equivalent to

$$\begin{aligned} \left. \frac{\textrm{d}}{\textrm{d}\epsilon }J\left( u^{\epsilon }\right) \right| _{\epsilon =0}=\left[ \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{f})\right) \right] ^{\top }y_{q_{L}}(t_{f}) \ge 0. \end{aligned}$$
(37)

Substitution of (35) into (37) results in

$$\begin{aligned}{} & {} \frac{\partial {\tilde{g}}({\tilde{x}}_{q_{L}}^{o}(t_{f}))}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}\left( t_{f},t\right) {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),v\right) \nonumber \\{} & {} \quad \ge \frac{\partial {\tilde{g}}({\tilde{x}}_{q_{L}}^{o}(t_{f}))}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}\left( t_{f},t\right) {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t),u_{q_{L}}^{o}(t)\right) . \end{aligned}$$
(38)

Defining the (augmented) adjoint variable (process) as

$$\begin{aligned} {\left. {{\tilde{\lambda }}_{q_{L}}^{o}}\right. }^{\top }(t)\equiv \left[ \lambda _{\theta ,q_{L}}^{o}(t),\lambda _{z,q_{L}}^{o}(t),{\lambda _{q_{L}}^{o}}^{\top }(t)\right] :=\frac{\partial {\tilde{g}}({\tilde{x}}_{q_{L}}^{o}(t_{f}))}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}\left( t_{f},t\right) , \end{aligned}$$
(39)

for \(t\in \left( t_L,t_f\right] \) and evaluating it at \(t=t_f\) we obtain

$$\begin{aligned} {\tilde{\lambda }}_{q_{L}}^{o}(t_{f})=\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{f})\right) , \end{aligned}$$
(40)

where by the definition (28) for \({\tilde{g}}\), this is equivalent to

$$\begin{aligned} \lambda _{\theta ,q_{L}}^{o}(t_{f})&=0, \end{aligned}$$
(41)
$$\begin{aligned} \lambda _{z,q_{L}}^{o}(t_{f})&=1, \end{aligned}$$
(42)
$$\begin{aligned} \lambda _{q_{L}}^{o}(t_{f})&=\frac{\partial g (x_{q_{L}}^{o}(t_{f}))}{\partial x_{q_{L}}}\equiv \nabla g\left( x_{q_{L}}^{o}(t_{f})\right) . \end{aligned}$$
(43)

Also by differentiation of (39) with respect to t we obtain the dynamics of the augmented adjoint process as

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}{\tilde{\lambda }}_{q_{L}}^{o}(t)=-\frac{\partial {\tilde{f}}_{q_{L}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\big [\Phi _{q_{L}}(t_{f},t)\big ]^{\top }\frac{\partial {\tilde{g}} ({\tilde{x}}_{q_{L}}^{o}(t_{f}))}{\partial {\tilde{x}}_{q_{L}}} =-\frac{\partial {\tilde{f}}_{q_{L}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }{\tilde{\lambda }}_{q_{L}}^{o}(t), \end{aligned}$$
(44)

which is equivalent to

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{\theta ,q_{L}}^{o}(t)&= \;0, \end{aligned}$$
(45)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{z,q_{L}}^{o} (t)&= \; 0, \end{aligned}$$
(46)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{L}}^{o} (t)&= -\bigg (\frac{\partial l_{q_{L}}\big (t,x_{q_{L}}^{o}(t),u_{q_{L}}^{o}(t)\big )}{\partial x_{q_{L}}}\bigg )\lambda _{z,q_{L}}^{o}(t) \nonumber \\&\quad -\bigg (\frac{\partial f_{q_{L}}\big (t,x_{q_{L}}^{o}(t),u_{q_{L}}^{o}(t)\big )}{\partial x_{q_{L}}}\bigg )^{\top }\lambda _{q_{L}}^{o}(t). \end{aligned}$$
(47)

The zero dynamics (45) and (46) with the terminal conditions (41) and (42) give \(\lambda _{\theta ,q_{L}}^{o}(t) = 0\) and \(\lambda _{z,q_{L}}^{o}(t) = 1\), for all \(t\in \left( t_L,t_f\right) \), and equation (47) is equivalent to

$$\begin{aligned} {\dot{\lambda }}_{q_{L}}^{o}=-\frac{\partial H_{q_{L}}\left( t,x_{q_{L}}^{o},\lambda _{q_{L}}^{o},u_{q_{L}}^{o}\right) }{\partial x_{q_{L}}}, \end{aligned}$$
(48)

which is valid on \(\left( t_L,t_f\right) \) and where by definition

$$\begin{aligned} H_{q_{L}}\left( t,x_{q_{L}},\lambda _{q_{L}},u_{q_{L}}\right) =l_{q_{L}}\left( t,x_{q_{L}},u_{q_{L}}\right) +\lambda _{q_{L}}^{\top }f_{q_{L}}\left( t,x_{q_{L}},u_{q_{L}}\right) . \end{aligned}$$
(49)

From the definition of Hamiltonian (49) and through a simple differentiation, the Hamiltonian canonical equation (15) for the state is also verified.

Also from (38) and (49) the Hamiltonian minimization

$$\begin{aligned} H_{q_{L}}\left( t,x_{q_{L}}^{o},\lambda _{q_{L}}^{o},u_{q_{L}}^{o}\right) \le H_{q_{L}}\left( t,x_{q_{L}}^{o},\lambda _{q_{L}}^{o},v\right) , \end{aligned}$$
(50)

is obtained for all \(v\in U_{q_{L}}\).

4.2 The penultimate location

Now consider a needle variation at time \(t \in \left( t_{L-1},t_L\right] \) in the form of

$$\begin{aligned} u^{\epsilon }(\tau )=\left\{ \begin{array}{lclc} u_{q_{j-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{j-1},t_{j}\right) , &{} 1\le j\le L-1,\\ u_{q_{L-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{L},t-\epsilon \right) ,\\ v, &{} &{} \tau \in \left[ t-\epsilon ,t\right) ,\\ u_{q_{L-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t,t_{L}-\delta ^{\epsilon }\right) ,\\ u_{q_{L}}^{o}\left( t_{L}\right) , &{} &{} \tau \in \left[ t_{L}-\delta ^{\epsilon },t_{L}\right) ,\\ u_{q_{L}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{L},t_{f}\right] , \end{array}\right. , \end{aligned}$$
(51)

where \(\delta ^{\epsilon } \ge 0\) corresponds to the case when the perturbed trajectory arrives on the switching manifold \({\tilde{m}} \left( {\tilde{x}}\right) := m_{q_{L-1}q_L}\left( x\right) = 0\) at an earlier instant. The case with a later arrival time, i.e., \(\delta ^{\epsilon } \le 0\) is handled in a similar fashion, and the case of a controlled switching, i.e., with no switching manifold, can be derived similarly by setting \(\delta ^{\epsilon } = 0\).

For \(\tau \in \left[ t,t_L-\delta ^\epsilon \right) \) we may write

$$\begin{aligned}{} & {} \delta {\tilde{x}}_{q_{L-1}}^{\epsilon }(\tau ):={\tilde{x}}_{q_{L-1}}^{\epsilon }(\tau )-{\tilde{x}}_{q_{L-1}}^{o}(\tau ) \nonumber \\{} & {} \quad =\int _{t-\epsilon }^{t}\left[ {\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{\epsilon }(s),v\right) -{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(s),u_{q_{L-1}}^{o}(s)\right) \right] \textrm{d}s \nonumber \\{} & {} \qquad +\int _{t}^{\tau }\Big [{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{\epsilon }(s),u_{q_{L-1}}^{o}(s)\right) -{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(s),u_{q_{L-1}}^{o}(s)\right) \Big ]\textrm{d}s,\nonumber \\ \end{aligned}$$
(52)

At the last switching time \(t_L\), the state of the optimal trajectory is determined (see also Fig. 2 with the consider of \(n=L\)) by

$$\begin{aligned} {\tilde{x}}_{q_{L}}^{o}\left( t_{L}\right)= & {} {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) \nonumber \\= & {} {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\delta ^{\epsilon }\right) +\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(\tau ),u_{q_{L-1}}^{o}(\tau )\right) \textrm{d}\tau \right) ,\nonumber \\ \end{aligned}$$
(53)

and the state of the perturbed trajectory is calculated as

$$\begin{aligned} {\tilde{x}}_{q_{L}}^{\epsilon }\left( t_{L}\right) ={\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{\epsilon }\left( t_{L}-\delta ^{\epsilon }-\right) \right) +\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{\epsilon }(\tau ),u_{q_{L}}^{o}\left( t_{L}\right) \right) \textrm{d}\tau . \end{aligned}$$
(54)

Thus (see also Fig. 2),

$$\begin{aligned}{} & {} \delta {\tilde{x}}_{q_{L}}^{\epsilon }\left( t_{L}\right) ={\tilde{x}}_{q_{L}}^{\epsilon }\left( t_{L}\right) -{\tilde{x}}_{q_{L}}^{o}\left( t_{L}\right) \nonumber \\{} & {} \quad ={\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{\epsilon }\left( t_{L}-\delta ^{\epsilon }-\right) \right) +\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{\epsilon }(\tau ),u_{q_{L}}^{o}\left( t_{L}\right) \right) \textrm{d}\tau \nonumber \\{} & {} \quad \quad -{\tilde{\xi }}\bigg ({\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\delta ^{\epsilon }\right) +\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(\tau ),u_{q_{L-1}}^{o}(\tau )\right) \textrm{d}\tau \bigg ). \nonumber \\ \end{aligned}$$
(55)

Now, let us define \(\mu _L:=\epsilon {\rightarrow _0}{\lim }\frac{\delta ^{\epsilon }}{\epsilon }\). If \(t_L\) is the time of a controlled switching then \(\mu _L = 0\) since \(\delta ^{\epsilon } = 0\) for every \(\epsilon \). In order to determine \(\mu _L\) for the case of an autonomous switching, we note that by the switching manifold conditions (7) it must be the case for both \(x^o\) and \(x^{\epsilon }\) that

$$\begin{aligned} {\tilde{m}}\big ({\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \big ) = {\tilde{m}}\big ({\tilde{x}}_{q_{L-1}}^{\epsilon }\left( t_{L}-\delta ^{\epsilon }-\right) \big ) = 0, \end{aligned}$$
(56)

since \({\tilde{x}}_{q_{L-1}}^{o}\) arrives on the switching manifold at \(t_{L}-\), and \({\tilde{x}}_{q_{L-1}}^{\epsilon }\) arrives at \(t_{L}-\delta ^{\epsilon }-\). Moreover, from the Taylor expansion of \({\tilde{m}}\), we have

(57)

which yields

$$\begin{aligned} \lim _{\epsilon \rightarrow 0}\frac{1}{\epsilon }\left[ \delta {\tilde{x}}_{q_{L-1}}^{\epsilon }\left( t_{L}-\right) -\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L-1}}{\left( {\tilde{x}}^{o},{\tilde{u}}^{o}\right) }\textrm{d}\tau \right] ^{\top }\frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}}=0. \end{aligned}$$
(58)

Noting that, by definition, \(y_{q_{L-1}}(t_{L}-)=\lim _{\epsilon \rightarrow 0}\frac{1}{\epsilon }\delta {\tilde{x}}_{q_{L-1}}^{\epsilon }(t_{L}-)\) and that

$$\begin{aligned} \lim _{\epsilon \rightarrow 0}\frac{1}{\epsilon }\int _{t_{L}-\delta ^{\epsilon }}^{t_{L}}{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}^{o},{\tilde{u}}^{o}\right) \textrm{d}\tau ={\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) \cdot \lim _{\epsilon \rightarrow 0}\frac{\delta ^{\epsilon }}{\epsilon },\nonumber \\ \end{aligned}$$
(59)

we obtain a closed-form expression for \(\mu _L\) from (58) in the form of

$$\begin{aligned} \mu _L=\frac{\left[ \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }y_{q_{L-1}}\left( t_{L}-\right) }{\left[ \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) ,u_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }. \end{aligned}$$
(60)

Hence, by diving both sides of (55) by \(\epsilon \), using a similar Taylor expansion of \({\tilde{\xi }}\) and then taking the limit as \(\epsilon \rightarrow 0\), we obtain the relationship between the values before and after the switching of the first-order sensitivity of the (augmented) state as

$$\begin{aligned} y_{q_{L}}\left( t_{L}\right) =\frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}}y_{q_{L-1}}\left( t_{L}-\right) +\mu _{L}{\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}, \end{aligned}$$
(61)

where

$$\begin{aligned}{} & {} {\tilde{f}}_{q_L,{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}:= {\tilde{f}}_{q_{L}}\left( {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) ,u_{q_{L}}^{o}\left( t_{L}\right) \right) \nonumber \\{} & {} \quad -\frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}} {\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) ,u_{q_{L-1}}^{o}\left( t_{L}-\right) \right) . \end{aligned}$$
(62)

Similar to part A, the dynamics and boundary conditions of the first-order state sensitivity are derived as

$$\begin{aligned} y_{q_{L-1}}(t)&={\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t),v\right) -{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\right) , \end{aligned}$$
(63)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}\tau }y_{q_{L-1}}(\tau )&=\frac{\partial {\tilde{f}}_{q_{L-1}}\big ({\tilde{x}}_{q_{L-1}}^{o}(\tau ),u_{q_{L-1}}^{o}(\tau )\big )}{\partial {\tilde{x}}_{q_{L-1}}}y_{q_{L-1}}(\tau ), \end{aligned}$$
(64)
$$\begin{aligned} y_{q_{L}}\left( t_{L}\right)&=\frac{\partial {\tilde{\xi }}\big ({\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\big )}{\partial {\tilde{x}}_{q_{L-1}}}y_{q_{L-1}}\left( t_{L}-\right) +\mu _{L}{\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}, \end{aligned}$$
(65)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}\tau }y_{q_{L}}(\tau )&=\frac{\partial {\tilde{f}}_{q_{L}}\big ({\tilde{x}}_{q_{L}}^{o}(\tau ),u_{q_{L}}^{o}(\tau )\big )}{\partial {\tilde{x}}_{q_{L}}}y_{q_{L}}(\tau ), \end{aligned}$$
(66)

and, hence,

$$\begin{aligned} y_{q_{L}}(t_{f})= & {} \mu _{L}\Phi _{q_{L}}\left( t_{f},t_{L}\right) {\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}} \nonumber \\{} & {} \quad +\Phi _{q_{L}}{(t_{f},t_{L})}\frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}\Phi _{q_{L-1}}{(t_{L},t)}\nonumber \\{} & {} \quad \left[ {\tilde{f}}_{q_{L-1}}{\big ({\tilde{x}}_{q_{L-1}}^{o}(t),v\big )}-{\tilde{f}}_{q_{L-1}}{\big ({\tilde{x}}_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\big )}\right] . \end{aligned}$$
(67)

Therefore, the optimality condition (37) is expressed as

$$\begin{aligned}{} & {} \Bigg [\bigg [\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\bigg ]^{\top }\Phi _{q_{L}}{(t_{f},t_{L})}\frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}+p\bigg [\frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}\bigg ]^{\top }\Bigg ] \Phi _{q_{L-1}}\left( t_{L},t\right) {\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t),v\right) \nonumber \\{} & {} \quad \ge \Bigg [\bigg [\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\bigg ]^{\top }\Phi _{q_{L}}{(t_{f},t_{L})}\frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}+p\bigg [\frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}\bigg ]^{\top }\Bigg ] \Phi _{q_{L-1}}(t_{L},t) \nonumber \\{} & {} \quad \quad {\tilde{f}}_{q_{L-1}}\big ({\tilde{x}}_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\big ), \end{aligned}$$
(68)

with

$$\begin{aligned} p_{L-1}=\frac{\Bigg [\frac{\partial {\tilde{g}}\big ({\tilde{x}}_{q_{L}}^{o}(t_{f})\big )}{\partial {\tilde{x}}_{q_{L}}}\Bigg ]^{\top }\Phi _{q_{L}}\left( t_{f},t_{L}\right) {\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}}{\left[ \frac{\partial {\tilde{m}}\big ({\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\big )}{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) } . \end{aligned}$$
(69)

Defining the (augmented) adjoint process in the interval \(t\in \left( t_{L-1},t_L\right] \) as

$$\begin{aligned} {\left. {\tilde{\lambda }}_{q_{L-1}}^{o}\right. }^{\top }(t):= & {} \left[ \Bigg [\frac{\partial {\tilde{g}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{f})\right) }{\partial {\tilde{x}}_{q_{L}}}\Bigg ]^{\top }\Phi _{q_{L}}\left( t_{f},t_{L}\right) \frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right. \nonumber \\{} & {} \left. +p_{L-1}\left[ \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top } \right] \Phi _{q_{L-1}}\left( t_{L},t\right) , \end{aligned}$$
(70)

and evaluating it at \(t=t_L\) we obtain

$$\begin{aligned} \left[ {\tilde{\lambda }}_{q_{L-1}}^{o} (t_{L})\right] ^{\top }= & {} \Bigg [\frac{\partial {\tilde{g}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{f})\right) }{\partial {\tilde{x}}_{q_{L}}}\Bigg ]^{\top }\Phi _{q_{L}}\left( t_{f},t_{L}\right) \frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}} \nonumber \\{} & {} +p_{L-1}\left[ \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top } \nonumber \\= & {} \left[ {\tilde{\lambda }}_{q_{L}}^{o}(t_{L}+)\right] ^{\top }\frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}+p_{L-1}\left[ \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top } \nonumber \\ \end{aligned}$$
(71)

By the definition of \({\tilde{\xi }}\) in (27), we have

$$\begin{aligned}{} & {} \frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}=\left[ \begin{array}{c} \frac{\partial {\tilde{\xi }}}{\partial \theta }\\ \frac{\partial {\tilde{\xi }}}{\partial z}\\ \frac{\partial {\tilde{\xi }}}{\partial x} \end{array}\right] =\left[ \begin{array}{ccccc} \frac{\partial \theta }{\partial \theta } &{} \frac{\partial \theta }{\partial z} &{} \frac{\partial \theta }{\partial x_{1}} &{} \cdots &{} \frac{\partial \theta }{\partial x_{n}}\\ \frac{\partial \left[ z+c\right] }{\partial \theta } &{} \frac{\partial \left[ z+c\right] }{\partial z} &{} \frac{\partial \left[ z+c\right] }{\partial x_{1}} &{} \cdots &{} \frac{\partial \left[ z+c\right] }{\partial x_{n}}\\ \frac{\partial \xi _{1}}{\partial \theta } &{} \frac{\partial \xi _{1}}{\partial z} &{} \frac{\partial \xi _{1}}{\partial x_{1}} &{} \cdots &{} \frac{\partial \xi _{1}}{\partial x_{n}}\\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ \frac{\partial \xi _{n}}{\partial \theta } &{} \frac{\partial \xi _{n}}{\partial z} &{} \frac{\partial \xi _{n}}{\partial x_{1}} &{} \cdots &{} \frac{\partial \xi _{n}}{\partial x_{n}} \end{array}\right] \hspace{14pt} \nonumber \\{} & {} \quad =\left[ \begin{array}{ccccc} 1 &{} 0 &{} 0 &{} \cdots &{} 0\\ \frac{\partial c}{\partial \theta } &{} 1 &{} \frac{\partial c}{\partial x_{1}} &{} \cdots &{} \frac{\partial c}{\partial x_{n}}\\ \frac{\partial \xi _{1}}{\partial \theta } &{} 0 &{} \frac{\partial \xi _{1}}{\partial x_{1}} &{} \cdots &{} \frac{\partial \xi _{1}}{\partial x_{n}}\\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots \\ \frac{\partial \xi _{n}}{\partial \theta } &{} 0 &{} \frac{\partial \xi _{n}}{\partial x_{1}} &{} \cdots &{} \frac{\partial \xi _{n}}{\partial x_{n}} \end{array}\right] =\left[ \begin{array}{ccc} 1 &{} \hspace{8pt}0 &{} 0\\ \dfrac{\partial c}{\partial t} &{} \hspace{8pt}1 &{} \hspace{8pt}\left[ \dfrac{\partial c}{\partial x}\right] ^{\top }\\ \dfrac{\partial \xi }{\partial t} &{} \hspace{8pt}0 &{} \dfrac{\partial \xi }{\partial x} \end{array}\right] \end{aligned}$$
(72)

and since also \(\frac{\partial m}{\partial z} = 0\) we have

$$\begin{aligned} \frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}=\left[ \begin{array}{c} \frac{\partial {\tilde{m}}}{\partial \theta }\\ \frac{\partial {\tilde{m}}}{\partial z}\\ \frac{\partial {\tilde{m}}}{\partial x} \end{array}\right] =\left[ \begin{array}{c} \dfrac{\partial m}{\partial t}\\ 0\\ \dfrac{\partial m}{\partial x} \end{array}\right] \end{aligned}$$
(73)

Hence, (71) is equivalent to

$$\begin{aligned}{} & {} {\tilde{\lambda }}_{q_{L-1}}^{o}\left( t_{L}\right) \equiv \left[ \begin{array}{c} \lambda _{q_{L-1},\theta }^{o}(t_{L})\\ \lambda _{q_{L-1},z}^{o}(t_{L})\\ \lambda _{q_{L-1}}^{o}(t_{L}) \end{array}\right] \nonumber \\{} & {} \quad =\left[ \frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }{\tilde{\lambda }}_{q_{L}}^{o}\left( t_{L}+\right) +p_{L-1}\frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}\left( t_{L}-\right) \right) }{\partial {\tilde{x}}_{q_{L-1}}} \nonumber \\{} & {} \quad =\left[ \begin{array}{ccc} 1 &{} \dfrac{\partial c}{\partial t} &{} \left[ \dfrac{\partial \xi }{\partial t}\right] ^{\top }\\ 0 &{} 1 &{} 0\\ 0 &{} \dfrac{\partial c}{\partial x} &{} \left[ \dfrac{\partial \xi }{\partial x}\right] ^{\top } \end{array}\right] \left[ \begin{array}{c} \lambda _{q_{L},\theta }^{o}(t_{L}+)\\ \lambda _{q_{L},z}^{o}(t_{L}+)\\ \lambda _{q_{L}}^{o}(t_{L}+) \end{array}\right] +p_{L-1}\left[ \begin{array}{c} \dfrac{\partial m}{\partial t}\\ 0\\ \dfrac{\partial m}{\partial x} \end{array}\right] \nonumber \\{} & {} \quad =\left[ \begin{array}{c} \lambda _{q_{L},\theta }^{o}(t_{L}+)+\dfrac{\partial c}{\partial t}\lambda _{q_{L},z}^{o}(t_{L}+)+\left[ \dfrac{\partial \xi }{\partial t}\right] ^{\top }\lambda _{q_{L}}^{o}(t_{L}+)+ p_{L-1} \dfrac{\partial m}{\partial t}\\ 1\\ \nabla \xi ^{\top }\lambda _{q_{L}}^{o}\left( t_{L}+\right) +\nabla c+p_{L-1}\nabla m \end{array}\right] , \end{aligned}$$
(74)

which, for each of the primary components of the augmented adjoint process, it is written as

$$\begin{aligned} \lambda _{q_{L-1},\theta }^{o}(t_{L})&= \lambda _{q_{L},\theta }^{o}(t_{L}+)+\dfrac{\partial c}{\partial t}+\left[ \dfrac{\partial \xi }{\partial t}\right] ^{\top }\lambda _{q_{L}}^{o}(t_{L}+) + p_{L-1} \dfrac{\partial m}{\partial t} , \end{aligned}$$
(75)
$$\begin{aligned} \lambda _{q_{L-1},0}^{o}\left( t_{L}\right)&=1, \end{aligned}$$
(76)
$$\begin{aligned} \lambda _{q_{L-1}}^{o}\left( t_{L}\right)&=\nabla \xi ^{\top }\lambda _{q_{L}}^{o}\left( t_{L}+\right) +\nabla c+p_{L-1}\nabla m\,. \end{aligned}$$
(77)

Differentiating (70) with respect to t leads to

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}{\tilde{\lambda }}_{q_{L-1}}^{o}(t)=-\left( \frac{\partial {\tilde{f}}_{q_{L-1}}}{\partial {\tilde{x}}_{q_{L-1}}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\right) \right) ^{\top }{\tilde{\lambda }}_{q_{L-1}}^{o}(t), \end{aligned}$$
(78)

which is equivalent to

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{L-1},\theta }^{o}(t)&=0, \end{aligned}$$
(79)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{L-1},z}^{o}(t)&=0, \end{aligned}$$
(80)
$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{L-1}}^{o}(t)&=-\left( \frac{\partial l_{q_{L-1}}\left( t,x_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\right) }{\partial x_{q_{L-1}}}\right) \lambda _{0}^{o}(t) \nonumber \\&-\left( \frac{\partial f_{q_{L-1}}\left( t,x_{q_{L-1}}^{o}(t),u_{q_{L-1}}^{o}(t)\right) }{\partial x_{q_{L-1}}}\right) ^{\top }\lambda _{q_{L-1}}^{o}(t). \end{aligned}$$
(81)

Therefore, \(\lambda _{q_{L-1},0}^{o}(t)=1\) for \(t\in \left( t_{L-1},t_L\right) \) is obtained as before and

$$\begin{aligned} {\dot{\lambda }}_{q_{L-1}}^o = - \frac{\partial H_{q_{L-1}} \left( x_{q_{L-1}}^o,\lambda _{q_{L-1}}^o,u_{q_{L-1}}^o\right) }{\partial x_{q_{L-1}}}, \end{aligned}$$
(82)

holds for \(t\in \left( t_{L-1},t_L\right) \) with the Hamiltonian defined as

$$\begin{aligned}{} & {} H_{q_{L-1}}\left( t,x_{q_{L-1}},\lambda _{q_{L-1}},u_{q_{L-1}}\right) \nonumber \\{} & {} \quad =l_{q_{L-1}}\left( t,x_{q_{L-1}},u_{q_{L-1}}\right) +\lambda _{q_{L-1}}^{\top }f_{q_{L-1}}\left( t,x_{q_{L-1}},u_{q_{L-1}}\right) . \end{aligned}$$
(83)

Also from (68) the minimization of the Hamiltonian is concluded as

$$\begin{aligned} H_{q_{L-1}}\left( t,x_{q_{L-1}}^{o},\lambda _{q_{L-1}}^{o},u_{q_{L-1}}^{o}\right) \le H_{q_{L-1}}\left( t,x_{q_{L-1}}^{o},\lambda _{q_{L-1}}^{o},v\right) , \end{aligned}$$
(84)

for all \(v\in U_{q_{L-1}}\), a.e. \(t\in \left( t_{L-1},t_L\right) \). It shall be remarked that the Hamiltonian for the time-invariant system with the augmented states (23) includes an additional constant term, i.e.,

$$\begin{aligned} {\tilde{H}}_{q}\left( {\tilde{x}}_{q},{\tilde{\lambda }}_{q},u_{q}\right) = \lambda _{q,\theta } + H_{q}\left( t,x_{q},\lambda _{q},u_{q}\right) \end{aligned}$$
(85)

but \(\lambda _{q,\theta }\) does not play a role in the adjoint dynamics (82) or in the Hamiltonian minimization (84).

In order to obtain the Hamiltonian boundary condition (21) (equivalently, (22)) at \(t_L\), we evaluate both \(H_{q_{L-1}}\) and \(H_{q_L}\) at \(t_L\) and invoke the previously established relations (as referenced therein) to arrive at

$$\begin{aligned}{} & {} H_{q_{L-1}}(t_{L}-)\nonumber \\{} & {} = l_{q_{L-1}}\left( t_{L},x_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) +\lambda _{q_{L-1}}^{o}(t_{L}-)^{\top }\nonumber \\{} & {} f_{q_{L-1}}\left( t_{L},x_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) \nonumber \\{} & {} \quad \underset{(85)}{=}{\tilde{\lambda }}_{q_{L-1}}^{o}(t_{L}-)^{\top }{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) -\lambda _{q_{L-1},\theta }^{o}(t_{L}-)\nonumber \\{} & {} \underset{(71)}{=}\left[ \frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}}^{\top }{\tilde{\lambda }}_{q_{L}}^{o}(t_{L}+)+p_{L-1}\frac{\partial {\tilde{m}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }\nonumber \\{} & {} \quad {\tilde{f}}_{q_{L-1}}\big ({\tilde{x}}_{q_{L-1}}^{_{(t_{L}-)}},u_{q_{L-1}}^{o_{(t_{L}-)}}\big ) -\lambda _{q_{L-1},\theta }^{o}(t_{L}-)\nonumber \\{} & {} \underset{(69)}{=} -\lambda _{q_{L-1},\theta }^{o}(t_{L}-) + \left[ {\tilde{\lambda }}_{q_{L}}^{o}(t_{L}+)^{\top }\frac{\partial {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) }{\partial {\tilde{x}}_{q_{L-1}}} \right. \nonumber \\{} & {} \quad \left. +\frac{\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}(t_{f},t_{L}){\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}}{\frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}^{\top }{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) }\left[ \frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top } \right] {\tilde{f}}_{q_{L-1}} \big ({\tilde{x}}_{q_{L-1}}^{_{(t_{L}-)}},u_{q_{L-1}}^{o_{(t_{L}-)}}\big )\nonumber \\{} & {} \underset{(39)}{=}-\lambda _{q_{L-1},\theta }^{o}(t_{L}-)+ \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}(t_{f},t_{L})\frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}\nonumber \\{} & {} \quad {\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) +\frac{\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}(t_{f},t_{L}){\tilde{f}}_{q_{L},{\tilde{\xi }}}^{{\tilde{\xi }},q_{L-1}}}{\frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}^{\top }{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) }\nonumber \\{} & {} \quad \left[ \frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{L-1}}}\right] ^{\top }{\tilde{f}}_{q_{L-1}}\big ({\tilde{x}}_{q_{L-1}}^{_{(t_{L}-)}},u_{q_{L-1}}^{o_{(t_{L}-)}}\big )\nonumber \\{} & {} \underset{(61)}{=}-\lambda _{q_{L-1},\theta }^{o}(t_{L}-) + \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}{(t_{f},t_{L})} \frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) \nonumber \\{} & {} \quad +\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}(t_{f},t_{L})\left[ {\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{L}),u_{q_{L}}^{o}(t_{L})\right) \right. \nonumber \\{} & {} \quad \left. -\frac{\partial {\tilde{\xi }}}{\partial {\tilde{x}}_{q_{L-1}}}{\tilde{f}}_{q_{L-1}}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-),u_{q_{L-1}}^{o}(t_{L}-)\right) \right] \nonumber \\{} & {} =\frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}^{\top }\Phi _{q_{L}}(t_{f},t_{L}){\tilde{f}}_{q_{L}}\left( {\tilde{\xi }}\left( {\tilde{x}}_{q_{L-1}}^{o}(t_{L}-)\right) ,u_{q_{L}}^{o}(t_{L})\right) -\lambda _{q_{L-1},\theta }^{o}(t_{L}-)\nonumber \\{} & {} \underset{(39)}{=}{\tilde{\lambda }}_{q_{L}}^{o}\left( t_{L}+\right) ^{\top }{\tilde{f}}_{q_{L}}\left( {\tilde{x}}_{q_{L}}^{o}(t_{L}),u_{q_{L}}^{o}(t_{L})\right) -\lambda _{q_{L-1},\theta }^{o}(t_{L}-) \nonumber \\{} & {} = -\lambda _{q_{L-1},\theta }^{o}(t_{L}-) + \lambda _{q_{L}, \theta }^{o}\left( t_{L}+\right) + l_{q_{L}}\left( x_{q_{L}}^{o}\left( t_{L}\right) ,u_{q_{L}}^{o}\left( t_{L}\right) \right) \nonumber \\{} & {} \quad +\lambda _{q_{L}}^{o}\left( t_{L}+\right) ^{\top }f_{q_{L}}\left( x_{q_{L}}^{o}\left( t_{L}\right) ,u_{q_{L}}^{o}\left( t_{L}\right) \right) \nonumber \\{} & {} \underset{(75)}{=} H_{q_{L}}\left( t_{L}+\right) -\dfrac{\partial c}{\partial t} -\left[ \dfrac{\partial \xi }{\partial t}\right] ^{\top }\lambda _{q_{L}}^{o}(t_{L}+) - p_{L-1} \dfrac{\partial m}{\partial t}, \end{aligned}$$
(86)

which is equivalent to (21).

Fig. 2
figure 2

The evolution of the original augmented trajectory \({\tilde{x}}^{o}\) arriving on the (augmented) switching manifold at \(t_n^o\) and a perturbed trajectory \({\tilde{x}}^{\epsilon }\) arriving at an earlier time \(t_n^o - \delta _n^{\epsilon }\)

4.3 Other locations

We now consider a needle variation at a general Lebesgue time \(t \in \left( t_{n-1},t_n\right) \) in the form of

$$\begin{aligned} u^{\epsilon }(\tau )=\left\{ \begin{array}{lcll} u_{q_{j-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{j-1},t_{j}\right) , &{} \hspace{-17pt} 1\le j\le n-1,\\ u_{q_{n-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{n-1},t-\epsilon \right) ,\\ v, &{} &{} \tau \in \left[ t-\epsilon ,t\right) ,\\ u_{q_{n-1}}^{o}(\tau ), &{} &{} \tau \in \left[ t,t_{n}-\delta _{n}^{\epsilon }\right) ,\\ u_{q_{n}}^{o}\left( t_{n}\right) , &{} &{} \tau \in \left[ t_{n}-\delta _{n}^{\epsilon },t_{n}\right) ,\\ u_{q_{k}}^{o}(\tau ), &{} &{} \tau \in \left[ t_{k},t_{k+1}-\delta _{k+1}^{\epsilon }\right) , &{} n\le k\le L,\\ u_{q_{k+1}}^{o}\left( t_{k+1}\right) , \hspace{-5pt} &{} &{} \tau \in \left[ t_{k+1}-\delta _{k+1}^{\epsilon },t_{k+1}\right) , &{} n\le k<L. \end{array}\right. \end{aligned}$$
(87)

As before (see also Fig. 2), the first-order sensitivity of the augmented state before the switching is derived as

$$\begin{aligned} y_{q_{n-1}}(t_{n}-)=\Phi _{q_{n-1}}(t_{n},t)\left[ {\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),v\right) -{\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) \right] ,\nonumber \\ \end{aligned}$$
(88)

and its value after the switching is derived as

$$\begin{aligned} y_{q_{n}}\left( t_{n}\right) ={\Bigg [}\frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}} +\frac{1}{\left[ \frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top }{\tilde{f}}_{q_{n-1}}^{\left( t_{n}^{-}\right) }}\,{\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}},q_{n-1}}\left[ \frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top }{\Bigg ]}y_{q_{n-1}}(t_{n}-). \hspace{-8pt}\nonumber \\ \end{aligned}$$
(89)

Therefore, its propagation until the terminal time is written as

$$\begin{aligned}{} & {} y_{q_{\text {L}}}(t_{f}) =\prod _{k=L}^{n}\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}+\gamma _{k}\,{\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\left[ \frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\right] \nonumber \\{} & {} \quad \Phi _{q_{n-1}}\left( t_{n},t\right) \left[ {\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),v\right) -{\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) \right] , \end{aligned}$$
(90)

where

$$\begin{aligned} {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}:= & {} {\tilde{f}}_{q_{k}}\left( {\tilde{\xi }}_{\sigma _{k}}\left( {\tilde{x}}_{q_{k-1}}^{o}(t_{k}-)\right) ,u_{q_{k}}^{o}(t_{k})\right) \nonumber \\{} & {} -\frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left( {\tilde{x}}_{q_{k-1}}^{o}(t_{k}-)\right) {\tilde{f}}_{q_{k-1}}\left( {\tilde{x}}_{q_{k-1}}^{o}(t_{k}-),u_{q_{k-1}}^{o}(t_{k}-)\right) \end{aligned}$$
(91)

and

$$\begin{aligned} \gamma _{k}:={\left\{ \begin{array}{ll} 0, &{} \text {controlled switching,}\\ \frac{1}{\left[ \frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }{\tilde{f}}_{q_{k-1}}\left( {\tilde{x}}_{q_{k-1}}^{o}(t_{k}-),u_{q_{k-1}}^{o}(t_{k}-)\right) }, &{} \text {autonomous switching.} \end{array}\right. } \end{aligned}$$
(92)

The optimality condition (37) is expressed as

$$\begin{aligned}{} & {} \left[ \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\right] ^{\top }\prod _{k=L}^{n}\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}+\gamma _{k}\,{\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\left[ \frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\right] \nonumber \\{} & {} \quad \Phi _{q_{n-1}}\left( t_{n},t\right) \left[ {\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),v\right) -{\tilde{f}}_{q_{n-1}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) \right] \ge 0. \end{aligned}$$
(93)

Defining the augmented adjoint process within the interval \(\left( t_{n-1},t_n\right] \) by

$$\begin{aligned} {\tilde{\lambda }}_{q_{n-1}}^{o}(t)^{\top }:= & {} \left[ \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}\right] ^{\top }\prod _{k=L}^{n}\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right. \nonumber \\{} & {} \left. +\gamma _{k}\,{\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\left[ \frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\right] \Phi _{q_{n-1}}\left( t_{n},t\right) ,\nonumber \\ \end{aligned}$$
(94)

which is, after the implementation of the transpose, equivalent to

$$\begin{aligned} {\tilde{\lambda }}_{q_{n-1}}^{o}(t)= & {} \left[ \Phi _{q_{n-1}}\left( t_{n},t\right) \right] ^{\top }\prod _{k=n}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }\right. \nonumber \\{} & {} \left. +\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}} \nonumber \\= & {} \left[ \Phi _{q_{n-1}}\left( t_{n},t\right) \right] ^{\top }\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top }\left[ \Phi _{q_{n}}\left( t_{n+1},t_{n}\right) \right] ^{\top }\right. \nonumber \\{} & {} \left. +\gamma _{n}\frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\left[ {\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}},q_{n-1}}\right] ^{\top }\right] \prod _{k=n+1}^{L} \left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }\right. \nonumber \\{} & {} \left. +\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}, \end{aligned}$$
(95)

we may evaluate (95) at \(t=t_n\) to obtain

$$\begin{aligned}{} & {} {\tilde{\lambda }}_{q_{n-1}}^{o}\left( t_{n}\right) =\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top }\left[ \Phi _{q_{n}}\left( t_{n+1},t_{n}\right) \right] ^{\top }+\gamma _{n}\frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\left[ {\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}},q_{n-1}}\right] ^{\top }\right] \nonumber \\{} & {} \quad \prod _{k=n+1}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }+\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}},\nonumber \\ \end{aligned}$$
(96)

or

$$\begin{aligned}{} & {} {\tilde{\lambda }}_{q_{n-1}}^{o}\left( t_{n}\right) =\left[ \frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top }\left[ \Phi _{q_{n}}\left( t_{n+1},t_{n}\right) \right] ^{\top }\prod _{k=n+1}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }\right. \nonumber \\{} & {} \quad \left. +\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}+\gamma _{n}\frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\left[ {\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}},q_{n-1}}\right] ^{\top } \nonumber \\{} & {} \quad \prod _{k=n+1}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }+\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}. \nonumber \\ \end{aligned}$$
(97)

Having established (71), we take the (backward) induction hypothesis as

$$\begin{aligned} {\tilde{\lambda }}_{q_{n}}^{o}(\tau )= & {} \Big [\Phi _{q_{n}}\left( t_{n+1},\tau \right) \Big ]^{\top }\prod _{k=n+1}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\Big [\Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \Big ]^{\top }\right. \nonumber \\{} & {} \quad \left. +\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}, \end{aligned}$$
(98)

and denote the scalar product

$$\begin{aligned} p_{n}:= & {} \gamma _{n}\left[ {\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}},q_{n-1}}\right] ^{\top }\prod _{k=n+1}^{L}\left[ \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\right] ^{\top }\left[ \Phi _{q_{k}}\left( t_{k+1},t_{k}\right) \right] ^{\top }\right. \nonumber \\{} & {} \left. +\gamma _{k}\frac{\partial {\tilde{m}}_{q_{k-1}q_{k}}}{\partial {\tilde{x}}_{q_{k-1}}}\left[ {\tilde{f}}_{q_{k},{\tilde{\xi }}_{\sigma _{k}}}^{{\tilde{\xi }}_{\sigma _{k}},q_{k-1}}\right] ^{\top }\right] \frac{\partial {\tilde{g}}}{\partial {\tilde{x}}_{q_{L}}}. \end{aligned}$$
(99)

Then equation (97) becomes

$$\begin{aligned} {\tilde{\lambda }}_{q_{n-1}}^{o}\left( t_{n}\right) = \left[ \frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}\right] ^{\top } {\tilde{\lambda }}_{q_{n}}^{o}\left( t_{n}+\right) +p_{n}\frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}. \end{aligned}$$
(100)

Since the induction hypothesis (98) is proved to hold as (71) for \(n=L-1\), and since (98) for n implies (100), the boundary condition (20) is deduced from (100) in a similar way as shown in (72) to (77), i.e., (100) is equivalent to

$$\begin{aligned}{} & {} {\tilde{\lambda }}_{q_{n-1}}^{o}(t_{n})\equiv \left[ \begin{array}{c} \lambda _{q_{n-1},\theta }^{o}(t_{n})\\ \lambda _{q_{n-1},z}^{o}(t_{n})\\ \lambda _{q_{n-1}}^{o}(t_{n}) \end{array}\right] \nonumber \\{} & {} \quad =\left[ \begin{array}{ccc} 1 &{} \dfrac{\partial c}{\partial t} &{} \left[ \dfrac{\partial \xi }{\partial t}\right] ^{\top }\\ 0 &{} 1 &{} 0\\ 0 &{} \dfrac{\partial c}{\partial x} &{} \left[ \dfrac{\partial \xi }{\partial x}\right] ^{\top } \end{array}\right] \left[ \begin{array}{c} \lambda _{q_{n},\theta }^{o}\left( t_{n}+\right) \\ \lambda _{q_{n},z}^{o}\left( t_{n}+\right) \\ \lambda _{q_{n}}^{o}\left( t_{n}+\right) \end{array}\right] +p\left[ \begin{array}{c} \dfrac{\partial m}{\partial t}\\ 0\\ \nabla m \end{array}\right] . \end{aligned}$$
(101)

This gives

$$\begin{aligned} \lambda _{q_{n-1},\theta }^{o}(t_{n})&=\lambda _{q_{n},\theta }^{o}(t_{n}+)+\dfrac{\partial c_{\sigma _{n}}}{\partial t}+\left[ \dfrac{\partial \xi _{\sigma _{n}}}{\partial t}\right] ^{\top }\lambda _{q_{n}}^{o}(t_{n}+)+p\dfrac{\partial m_{q_{n-1}q_{n}}}{\partial t}, \end{aligned}$$
(102)
$$\begin{aligned} \lambda _{q_{n-1},z}^{o}\left( t_{n}\right)&=1, \end{aligned}$$
(103)
$$\begin{aligned} \lambda _{q_{n-1}}^{o}\left( t_{n}\right)&=\nabla \xi ^{\top }\lambda _{q_{n}}^{o}\left( t_{n}+\right) +\nabla c_{\sigma _{n}}+p\nabla m_{q_{n-1}q_{n}}\,. \end{aligned}$$
(104)

Differentiating (95) with respect to t leads to

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}{\tilde{\lambda }}_{q_{n-1}}^{o}(t)=-\left( \frac{\partial {\tilde{f}}_{q_{n-1}}}{\partial {\tilde{x}}_{q_{n-1}}}\left( {\tilde{x}}_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) \right) ^{\top }{\tilde{\lambda }}_{q_{n-1}}^{o}(t), \end{aligned}$$
(105)

which is equivalent to

$$\begin{aligned}&\frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{n-1},\theta }^{o}(t)=0, \end{aligned}$$
(106)
$$\begin{aligned}&\frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{n-1},z}^{o}(t)=0, \end{aligned}$$
(107)
$$\begin{aligned}&\frac{\textrm{d}}{\textrm{d}t}\lambda _{q_{n-1}}^{o}(t)=-\left( \frac{\partial l_{q_{n-1}}\left( t,x_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) }{\partial x_{q_{n-1}}}\right) \lambda _{0}^{o}(t) \nonumber \\&\quad -\left( \frac{\partial f_{q_{n-1}}\left( t,x_{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) }{\partial x_{q_{n-1}}}\right) ^{\top }\lambda _{q_{n-1}}^{o}(t). \end{aligned}$$
(108)

Therefore, the constants \(\lambda _{q_{n-1},\theta }^{o}(t)=\sum _{i=n}^{L}\frac{\partial c_{\sigma _{i}}}{\partial t}+\left[ \frac{\partial \xi _{\sigma _{i}}}{\partial t}\right] ^{\top }\lambda _{q_{i}}^{o}(t_{i}+)+p\frac{\partial m_{q_{i-1}q_{i}}}{\partial t}\), and \(\lambda _{q_{n-1},z}^{o}(t)=1\), for \(t\in \left( t_{n-1},t_n\right) \) are obtained as before and

$$\begin{aligned} {\dot{\lambda }}_{q_{n-1}}^{o}(t)=-\frac{\partial H_{q_{n-1}}\left( t,x_{q_{n-1}}^{o}(t),\lambda _{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) }{\partial x_{q_{n-1}}}, \end{aligned}$$
(109)

holds for \(t\in \left( t_{n-1},t_n\right) \) with the Hamiltonian defined as

$$\begin{aligned}{} & {} H_{q_{n-1}}\left( t,x_{q_{n-1}},\lambda _{q_{n-1}},u_{q_{n-1}}\right) =l_{q_{n-1}}\left( t,x_{q_{n-1}},u_{q_{n-1}}\right) \nonumber \\{} & {} \quad +\lambda _{q_{n-1}}^{\top }f_{q_{n-1}}\left( t,x_{q_{n-1}},u_{q_{n-1}}\right) . \end{aligned}$$
(110)

Also from (93) the minimization of the Hamiltonian is concluded, i.e.,

$$\begin{aligned} H_{q_{n-1}}\left( t,x_{q_{n-1}}^{o}(t),\lambda _{q_{n-1}}^{o}(t),u_{q_{n-1}}^{o}(t)\right) \le H_{q_{n-1}}\left( t,x_{q_{n-1}}^{o}(t),\lambda _{q_{n-1}}^{o}(t),v\right) , \end{aligned}$$
(111)

for all \(v\in U_{q_{n-1}}\).

In order to obtain the Hamiltonian boundary condition (21) (equivalently, (22)) at \(t_n\), we evaluate both \(H_{q_{n-1}}\) and \(H_{q_n}\) at \(t_n\) and invoke the previously established relations (as referenced therein) to arrive at

$$\begin{aligned}{} & {} H_{q_{n-1}}\big (t_{n}-\big ) \nonumber \\{} & {} = l_{q_{n-1}}\big (t_{n},x_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) +\lambda _{q_{n-1}}^{o}(t_{n}-)^{{\textsf{T}}}f_{q_{n-1}}\big (t_{n},x_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} \underset{(85)}{=}\big [{\tilde{\lambda }}_{q_{n-1}}^{o}(t_{n}-)\big ]^{{\textsf{T}}}{\tilde{f}}_{q_{n-1}} \big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big )-\lambda _{q_{n-1},\theta }^{o}(t_{n}-) \nonumber \\{} & {} \underset{(100)}{=}\bigg [\frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}^{{\textsf{T}}}{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)+p_{n} \frac{\partial {\tilde{m}}}{\partial {\tilde{x}}_{q_{n-1}}}\bigg ]^{\top }{\tilde{f}}_{q_{n-1}}\big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} \quad -\lambda _{q_{n-1},\theta }^{o}(t_{n}-)\overset{(99)}{\underset{(98)}{=}}-\lambda _{q_{n-1},\theta }^{o}(t_{n}-) +\bigg [{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)^{\top }\frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}+\gamma _{n}{\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}^{,}}q_{n-1}}{}^{{\textsf{T}}}{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)\nonumber \\{} & {} \quad \frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}^{{\textsf{T}}}\bigg ]{\tilde{f}}_{q_{n-1}}\big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} =-\lambda _{q_{n-1},\theta }^{o}(t_{n}-)+{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)^{\top }\frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}{\tilde{f}}_{q_{n-1}} \big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} \quad +\frac{{\tilde{f}}_{q_{n},{\tilde{\xi }}_{\sigma _{n}}}^{{\tilde{\xi }}_{\sigma _{n}^{,}}q_{n-1}}{}^{{\textsf{T}}}{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)}{\frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}{}^{{\textsf{T}}}{\tilde{f}}_{q_{n-1}}^{(t_{n}^{-})}} \frac{\partial {\tilde{m}}_{q_{n-1}q_{n}}}{\partial {\tilde{x}}_{q_{n-1}}}{}^{{\textsf{T}}}{\tilde{f}}_{q_{n-1}}\big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} \underset{(91)}{=}-\lambda _{q_{n-1},\theta }^{o}(t_{n}-)+{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)^{\top } \frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}{\tilde{f}}_{q_{n-1}}\big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big ) \nonumber \\{} & {} \quad +{\tilde{\lambda }}_{q_{n}}^{o}(t_{n}+)^{\top }\Big [{\tilde{f}}_{q_{n}}\big ({\tilde{x}}_{q_{n}}^{o}(t_{n}),u_{q_{n}}^{o}(t_{n})\big ) -\frac{\partial {\tilde{\xi }}_{\sigma _{n}}}{\partial {\tilde{x}}_{q_{n-1}}}{\tilde{f}}_{q_{n-1}}\big ({\tilde{x}}_{q_{n-1}}^{o}(t_{n}-),u_{q_{n-1}}^{o}(t_{n}-)\big )\Big ] \nonumber \\{} & {} =-\lambda _{q_{n-1},\theta }^{o}(t_{n}-)+{\tilde{\lambda }}_{q_{n}}^{o}\left( t_{n}+\right) ^{{\textsf{T}}}{\tilde{f}}_{q_{n}} \big ({\tilde{x}}_{q_{n}}^{o}(t_{n}),u_{q_{n}}^{o}(t_{n})\big ) \nonumber \\{} & {} =-\lambda _{q_{n-1},\theta }^{o}(t_{n}-)+\lambda _{q_{n},\theta }^{o}(t_{n})+l_{q_{n}}\left( t,x_{q_{n}}^{o}(t_{n}),u_{q_{n}}^{o}(t_{n})\right) \nonumber \\{} & {} \quad +\lambda _{q_{n}}^{o}\left( t_{n}+\right) ^{{\textsf{T}}}f_{q_{n}}\left( t,x_{q_{n}}^{o}(t_{n}),u_{q_{n}}^{o}(t_{n})\right) \nonumber \\{} & {} \quad \underset{(102)}{=}H_{q_{n}}\left( t_{n}+\right) -\dfrac{\partial c_{\sigma _{n}}}{\partial t}-\left[ \dfrac{\partial \xi _{\sigma _{n}}}{\partial t}\right] ^{\top }\lambda _{q_{n}}^{o}(t_{n})-p\dfrac{\partial m_{q_{n-1}q_{n}}}{\partial t}, \end{aligned}$$
(112)

which is equivalent to (21). This completes the proof of the hybrid minimum principle. \(\square \)

5 Analytic examples

5.1 Example 1

Consider a hybrid system with the indexed vector fields:

$$\begin{aligned} {\dot{x}}&=f_{q_1}\left( x,u\right) =x+x\, u, \end{aligned}$$
(113)
$$\begin{aligned} {\dot{x}}&=f_{q_2}\left( x,u\right) =-x+x\, u, \end{aligned}$$
(114)

and the hybrid optimal control problem

$$\begin{aligned} J\left( t_{0},t_{f},h_{0},1;I_1\right) =\int _{t_0}^{t_{s}}\frac{1}{2}u^{2}\textrm{d}t+\frac{1}{1+\left[ x\left( t_{s}-\right) \right] ^{2}} +\int _{t_{s}}^{t_{f}}\frac{1}{2}u^{2}\textrm{d}t+\frac{1}{2}\left[ x(t_{f})\right] ^{2},\nonumber \\ \end{aligned}$$
(115)

subject to the initial condition \(h_{0}=\left( q(t_{0}),x(t_{0})\right) =\left( q_1,x_{0}\right) \) provided at the initial time \(t_{0}=0\). At the controlled switching instant \(t_s\), the boundary condition for the continuous state is provided by the jump map \(x\left( t_{s}\right) =\xi \left( x\left( t_{s}-\right) \right) =-x\left( t_{s}-\right) \).

5.1.1 The HMP formulation

Writing down the hybrid minimum principle results for the above HOCP, the Hamiltonians are formed as

$$\begin{aligned} H_{q_1}&=\frac{1}{2}u^{2}+\lambda \, x\left( u+1\right) , \end{aligned}$$
(116)
$$\begin{aligned} H_{q_2}&=\frac{1}{2}u^{2}+\lambda \, x\left( u-1\right) , \end{aligned}$$
(117)

from which the minimizing control input for both Hamiltonian functions is determined as

$$\begin{aligned} u^{o}=-\lambda x . \end{aligned}$$
(118)

Therefore, the adjoint process dynamics, determined from (16) and with the substitution of the optimal control input from (118), is written as

$$\begin{aligned} {\dot{\lambda }}&= \frac{-\partial H_{q_1}}{\partial x} = -\lambda \left( u^{o}+1\right) =\lambda \left( \lambda \, x-1\right) , t \in \left( t_0,t_s\right] , \end{aligned}$$
(119)
$$\begin{aligned} {\dot{\lambda }}&=\frac{-\partial H_{q_2}}{\partial x} =-\lambda \left( u^{o}-1\right) =\lambda \left( \lambda \, x+1\right) , t \in \left( t_s,t_f\right] , \end{aligned}$$
(120)

which are subject to the terminal and boundary conditions

$$\begin{aligned} \lambda (t_{f})&=\left. \nabla g\right| _{x(t_{f})}=x(t_{f}), \end{aligned}$$
(121)
$$\begin{aligned} \lambda \left( t_{s}-\right) \equiv \lambda \left( t_{s}\right)&=\left. \nabla \xi \right| _{x\left( t_{s}-\right) }\lambda \left( t_{s}+\right) +\left. \nabla c\right| _{x\left( t_{s}-\right) } \nonumber \\&=-\lambda \left( t_{s}+\right) +\frac{-2x\left( t_{s}-\right) }{\left( 1+\left[ x\left( t_{s}-\right) \right] ^{2}\right) ^{2}} \;. \end{aligned}$$
(122)

The substitution of the optimal control input (118) in the continuous state dynamics (15) gives

$$\begin{aligned} {\dot{x}}&=\frac{\partial H_{q_1}}{\partial \lambda } =x\left( 1+u^{o}\right) =-x\left( \lambda \, x-1\right) ,{} & {} t \in \left[ t_0,t_s\right) , \end{aligned}$$
(123)
$$\begin{aligned} {\dot{x}}&=\frac{\partial H_{q_2}}{\partial \lambda }=x\left( -1+u^{o}\right) =-x\left( \lambda \, x+1\right) ,{} & {} t \in \left[ t_s,t_f\right) , \end{aligned}$$
(124)

which are subject to the initial and boundary conditions

$$\begin{aligned} x(t_{0})&=x\left( 0\right) =x_{0}, \end{aligned}$$
(125)
$$\begin{aligned} x\left( t_{s}\right)&=\xi \left( x\left( t_{s}-\right) \right) =-x\left( t_{s}-\right) . \end{aligned}$$
(126)

The Hamiltonian continuity condition (21) states that

$$\begin{aligned} H_{q_1}\left( t_{s}-\right)= & {} \frac{1}{2}\left[ u^{o}\left( t_{s}-\right) \right] ^{2}+\lambda \left( t_{s}-\right) x\left( t_{s}-\right) \left[ u^{o}\left( t_{s}-\right) +1\right] \nonumber \\= & {} \frac{1}{2}\left[ -\lambda \left( t_{s}-\right) x\left( t_{s}-\right) \right] ^{2} +\lambda \left( t_{s}-\right) x\left( t_{s}-\right) \left[ -\lambda \left( t_{s}-\right) x\left( t_{s}-\right) +1\right] \nonumber \\= & {} H_{q_2}\left( t_{s}+\right) =\frac{1}{2}\left[ u^{o}\left( t_{s}+\right) \right] ^{2}+\lambda \left( t_{s}+\right) x\left( t_{s}+\right) \left[ u^{o}\left( t_{s}+\right) -1\right] \nonumber \\= & {} \frac{1}{2}\left[ -\lambda \left( t_{s}+\right) x\left( t_{s}+\right) \right] ^{2} +\lambda \left( t_{s}+\right) x\left( t_{s}+\right) \left[ -\lambda \left( t_{s}+\right) x\left( t_{s}+\right) -1\right] ,\nonumber \\ \end{aligned}$$
(127)

which can be written, using (126), as

$$\begin{aligned} x\left( t_{s^-}\right) \left[ \lambda \left( t_{s^-}\right) -\lambda \left( t_{s^+}\right) \right] =\frac{1}{2}\left[ x\left( t_{s^-}\right) \right] ^{2}\left[ \left[ \lambda \left( t_{s^-}\right) \right] ^{2}-\left[ \lambda \left( t_{s^+}\right) \right] ^{2}\right] . \end{aligned}$$
(128)
Fig. 3
figure 3

The optimal state and adjoint processes, optimal inputs and the Hamiltonians for the system in Example 1 with \(x_{0}=0.5\) and \(t_{f}=4\)

5.1.2 The HMP results

The solution to the set of ODEs (119), (120), (123), (124) together with the initial condition (125) expressed at \(t_0\), the terminal condition (121) determined at \(t_f\) and the boundary conditions (126) and (122) provided at \(t_s\) which is not a priori fixed but determined by the Hamiltonian continuity condition (128), provides the optimal control input and its corresponding optimal trajectory that minimize the cost \(J\left( t_{0},t_{f},h_{0},1;I_1\right) \) over \(\varvec{I_{1}}\), the family of hybrid inputs with one switching. The numerical results for \(x_{0}=0.5\) and \(t_{f}=4\) are illustrated in Fig. 3. Interested readers are referred to [58] for further analytic steps to reduce the above boundary value ODE problem into a set of algebraic equations using the special forms of the differential equations under study.

5.2 Example 2

Consider the hybrid system with the indexed vector fields

$$\begin{aligned} {\dot{x}}=\left[ \begin{array}{c} {\dot{x}}_{1}\\ {\dot{x}}_{2} \end{array}\right] =f_{1}\left( x,u\right) =\left[ \begin{array}{c} x_{2}\\ -x_{1}+u \end{array}\right] , \end{aligned}$$
(129)

and

$$\begin{aligned} {\dot{x}}=\left[ \begin{array}{c} {\dot{x}}_{1}\\ {\dot{x}}_{2} \end{array}\right] =f_{2}\left( x,u\right) =\left[ \begin{array}{c} x_{2}\\ u \end{array}\right] , \end{aligned}$$
(130)

where autonomous switchings occur on the switching manifold described by

$$\begin{aligned} m\left( x_{1}\left( t_{s}\right) ,x_{2}\left( t_{s}-\right) \right) \equiv x_{2}\left( t_{s}-\right) =0, \end{aligned}$$
(131)

with the continuity of the trajectories at the switching instant. Consider the hybrid optimal control problem defined as the minimization of the total cost functional

$$\begin{aligned} J=\int _{t_{0}}^{t_{f}}\frac{1}{2}u^{2}\textrm{d}t+\frac{1}{2}\left( x_{1}\left( t_{s}\right) \right) ^{2}+\frac{1}{2}\left( x_{2}\left( t_{f}\right) -v_{ref}\right) ^{2} \end{aligned}$$
(132)

5.2.1 The HMP formulation and results

Employing the HMP, the corresponding Hamiltonians are defined as

$$\begin{aligned} H_{1}=\lambda _{1}x_{2}+\lambda _{2}\left( -x_{1}+u\right) +\frac{1}{2}u^{2}, \end{aligned}$$
(133)

and

$$\begin{aligned} H_{2}=\lambda _{1}x_{2}+\lambda _{2}u+\frac{1}{2}u^{2} \end{aligned}$$
(134)

The Hamiltonian minimization with respect to u (Eq. (14)) gives

$$\begin{aligned} u^{o}=-\lambda _{2} \end{aligned}$$
(135)

for both \(q=1\) and \(q=2\).

Therefore the state dynamics (15) and the adjoint process dynamics (16) become

$$\begin{aligned} {\dot{x}}_{1}&=\frac{\partial H_1}{\partial \lambda _{1}}=x_{2}, \end{aligned}$$
(136)
$$\begin{aligned} {\dot{x}}_{2}&=\frac{\partial H_1}{\partial \lambda _{2}}=-x_{1}+u^{o}=-x_{1}-\lambda _{2}, \end{aligned}$$
(137)
$$\begin{aligned} {\dot{\lambda }}_{1}&=\frac{-\partial H_1}{\partial x_{1}} =\lambda _{2}, \end{aligned}$$
(138)
$$\begin{aligned} {\dot{\lambda }}_{2}&=\frac{-\partial H_1}{\partial x_{2}} =-\lambda _{1}, \end{aligned}$$
(139)

for \(q=1\), and

$$\begin{aligned} {\dot{x}}_{1}&=\frac{\partial H_2}{\partial \lambda _{1}}=x_{2}, \end{aligned}$$
(140)
$$\begin{aligned} {\dot{x}}_{2}&=\frac{\partial H_2}{\partial \lambda _{2}}=u^{o}=-\lambda _{2}, \end{aligned}$$
(141)
$$\begin{aligned} {\dot{\lambda }}_{1}&=\frac{-\partial H_2}{\partial x_{1}}=0, \end{aligned}$$
(142)
$$\begin{aligned} {\dot{\lambda }}_{2}&=\frac{-\partial H_2}{\partial x_{2}}=-\lambda _{1}, \end{aligned}$$
(143)

for \(q=2\). At the initial time \(t=t_0\), the continuous valued states are specified by the initial conditions

$$\begin{aligned} x_{1}\left( t_{0}\right)&=x_{10}, \end{aligned}$$
(144)
$$\begin{aligned} x_{2}\left( t_{0}\right)&=x_{20} \end{aligned}$$
(145)

At the switching instant \(t=t_s\), the boundary conditions for the states and adjoint processes are determined as

$$\begin{aligned} x_{1}\left( t_{s}\right)&=x_{1}\left( t_{s}-\right) \equiv \lim _{t\uparrow t_{s}}x_{1}\left( t\right) , \end{aligned}$$
(146)
$$\begin{aligned} x_{2}\left( t_{s}\right)&=x_{2}\left( t_{s}-\right) = 0, \end{aligned}$$
(147)
$$\begin{aligned} \lambda _{1}\left( t_{s}\right)&=\lambda _{1}\left( t_{s}+\right) +\frac{\partial c}{\partial x_{1}}+p\frac{\partial m}{\partial x_{1}}= \lambda _{1}\left( t_{s}+\right) + x_{1}\left( t_{s}\right) , \end{aligned}$$
(148)
$$\begin{aligned} \lambda _{2}\left( t_{s}\right)&=\lambda _{2}\left( t_{s}+\right) +\frac{\partial c}{\partial x_{2}}+p\frac{\partial m}{\partial x_{2}}=\lambda _{2}\left( t_{s}+\right) +p \end{aligned}$$
(149)

And at the terminal time \(t=t_f\), the adjoint processes are determined by (19) as

$$\begin{aligned} \lambda _{1}\left( t_{f}\right)&=\frac{\partial g}{\partial x_{1}}=0, \end{aligned}$$
(150)
$$\begin{aligned} \lambda _{2}\left( t_{f}\right)&=\frac{\partial g}{\partial x_{2}}=x_{2}\left( t_{f}\right) -v_\mathrm{{ref}} \end{aligned}$$
(151)

Note that unlike \(t_0\) and \(t_f\) which are a priori determined, \(t_s\) is not fixed and needs to be determined by the Hamiltonian continuity condition (21) as

$$\begin{aligned} H_{1}\left( t_{s}-\right)= & {} \lambda _{1}\left( t_{s}-\right) x_{2}\left( t_{s}-\right) -\lambda _{2}\left( t_{s}-\right) x_{1}\left( t_{s}-\right) -\frac{1}{2}\lambda _{2}\left( t_{s}-\right) ^{2} \nonumber \\= & {} -\lambda _{2}\left( t_{s}\right) x_{1}\left( t_{s}-\right) -\frac{1}{2}\lambda _{2}\left( t_{s}\right) ^{2} \nonumber \\= & {} H_{2}\left( t_{s}+\right) =\lambda _{1}\left( t_{s}+\right) x_{2}\left( t_{s}+\right) -\frac{1}{2}\lambda _{2}\left( t_{s}+\right) ^{2}=-\frac{1}{2}\lambda _{2}\left( t_{s}+\right) ^{2},\nonumber \\ \end{aligned}$$
(152)

i.e.,

$$\begin{aligned} \lambda _{2}\left( t_{s}\right) x_{1}\left( t_{s}-\right) +\frac{1}{2}\lambda _{2}\left( t_{s}\right) ^{2}=\frac{1}{2}\lambda _{2}\left( t_{s}+\right) ^{2}, \end{aligned}$$
(153)

that with the insertion of (149), it becomes

$$\begin{aligned} \left( \lambda _{2}\left( t_{s}+\right) +p\right) x_{1}\left( t_{s}-\right) +\frac{1}{2}\left( \lambda _{2}\left( t_{s}+\right) +p\right) ^{2}=\frac{1}{2}\lambda _{2}\left( t_{s}+\right) ^{2}, \end{aligned}$$
(154)

The set of ODEs (136) to (143), together with the initial conditions (144) and (145) expressed at \(t_0\), the boundary conditions (146), (198), (148) and (149) provided at \(t_s\), and the terminal conditions (150) and (151) determined at \(t_f\), with the two unknowns \(t_s\) and p determined by the Hamiltonian continuity condition (154) and the switching manifold condition (131), form an ODE boundary value problem whose solution results in the determination of the optimal control input and its corresponding optimal trajectory that minimize the cost \(J\left( t_{0},t_{f},h_{0},1;I_1\right) \) over \(\varvec{I_{1}}\), the family of hybrid inputs with one switching on the switching manifold (131).

5.2.2 Analytical solution to the HMP

Similar to the previous example, further steps can be taken in order to reduce the above boundary value ODE problem into a set of algebraic equations using the special forms of the differential equations under study. This has been done in detail in [60], and a brief version is provided here.

From (142) and (148) we may write

$$\begin{aligned} \lambda _{1} \left( t\right) =0, \hspace{190pt} t\in \left( t_{s},t_{f}\right] . \end{aligned}$$
(155)

Therefore, the dynamics of the second component of the adjoint process in \(\left( t_{s},t_{f}\right] \) is determined from (143) as

$$\begin{aligned} {\dot{\lambda }}_{2}=0, \hspace{200pt} t\in \left( t_{s},t_{f}\right] , \end{aligned}$$
(156)

which from (151) we conclude that

$$\begin{aligned} \lambda _{2} \left( t\right) =x_{2}\left( t_{f}\right) -v_\mathrm{{ref}} \hspace{180pt} t\in \left( t_{s},t_{f}\right] .\nonumber \\ \end{aligned}$$
(157)

The boundary conditions (148) and (149) on adjoint processes at the switchings instant give

$$\begin{aligned} \lambda _{1}\left( t_{s}\right)&=\lambda _{1}\left( t_{s}+\right) + x_{1}\left( t_{s}\right) =x_{1}\left( t_{s}\right) , \end{aligned}$$
(158)
$$\begin{aligned} \lambda _{2}\left( t_{s}\right)&=\lambda _{2}\left( t_{s}+\right) +p=x_{2}\left( t_{f}\right) -v_{ref}+p, \end{aligned}$$
(159)

The conditions (158) and (159) serve as terminal conditions for the adjoint processes dynamics (138) and (138) which have a general solution of the form

$$\begin{aligned} \lambda _{1}&=A\sin \left( t+\alpha \right) ,&t\in \left[ t_{0},t_{s}\right] , \end{aligned}$$
(160)
$$\begin{aligned} \lambda _{2}&=A\cos \left( t+\alpha \right) ,&t\in \left[ t_{0},t_{s}\right] . \end{aligned}$$
(161)

Therefore, the state dynamics (136) and (137) are written as

$$\begin{aligned} {\dot{x}}_{1}&=x_{2}, \end{aligned}$$
(162)
$$\begin{aligned} {\dot{x}}_{2}&=-x_{1}-\lambda _{2}=-x_{1}-A\cos \left( t+\alpha \right) , \end{aligned}$$
(163)

for \(t\in \left[ t_{0},t_{s}\right] \), which have a general solution of the form

$$\begin{aligned} x_{1} \left( t\right)&=\frac{-1}{2}At\sin \left( t+\alpha \right) +B\sin \left( t+\beta \right) , \end{aligned}$$
(164)
$$\begin{aligned} x_{2} \left( t\right)&=\frac{-1}{2}At\cos \left( t+\alpha \right) -\frac{1}{2}A\sin \left( t+\alpha \right) +B\cos \left( t+\beta \right) , \end{aligned}$$
(165)

for \(t\in [t_{0},t_{s} ) = [{0},t_{s}) \), subject to the initial conditions

$$\begin{aligned}&x_{1}\left( t_{0}\right) = B\sin \beta =x_{10}, \end{aligned}$$
(166)
$$\begin{aligned}&x_{2}\left( t_{0}\right) = -\frac{1}{2}A\sin \left( \alpha \right) +B\cos \left( \beta \right) =x_{20}. \end{aligned}$$
(167)

At the switching time \(t_{s}\) the continuity condition for \(x_{1}\) and \(x_{2}\) are written as

$$\begin{aligned} x_{1}\left( t_{s}+\right) \equiv x_{1}\left( t_{s}\right)&= x_{1}\left( t_{s}-\right) , \end{aligned}$$
(168)
$$\begin{aligned} x_{2}\left( t_{s}+\right) \equiv x_{2}\left( t_{s}\right)&= x_{2}\left( t_{s}-\right) =0, \end{aligned}$$
(169)

which form the initial conditions for the state dynamics in \(q_2\) and \(t\in \left[ t_{s},t_{f}\right] \), determined from (140) and (141) as

$$\begin{aligned} {\dot{x}}_{1}&=x_{2}, \end{aligned}$$
(170)
$$\begin{aligned} {\dot{x}}_{2}&=-\lambda _{2}=v_{ref}-x_{2}\left( t_{f}\right) . \end{aligned}$$
(171)

The above equations have the solution

$$\begin{aligned} x_{1} \left( t\right)&=x_{1}\left( t_{s}\right) +\frac{1}{2}\left( v_{ref}-x_{2}\left( t_{f}\right) \right) \left( t-t_{s}\right) ^{2}, \end{aligned}$$
(172)
$$\begin{aligned} x_{2} \left( t\right)&=\left( v_{ref}-x_{2}\left( t_{f}\right) \right) \left( t-t_{s}\right) , \end{aligned}$$
(173)

for \(t\in \left[ t_{s},t_{f}\right] \). Since (173) is expressed implicitly in terms of \(x_{2}\left( t_{f}\right) \), we evaluate (173) at \(t_{f}\) to write an explicit form for \(x_{2}\) as

$$\begin{aligned} x_{2}\left( t_{f}\right) =\left( v_{ref}-x_{2}\left( t_{f}\right) \right) \left( t_{f}-t_{s}\right) , \end{aligned}$$
(174)

which gives

$$\begin{aligned} x_{2}\left( t_{f}\right) =\frac{v_{ref}\left( t_{f}-t_{s}\right) }{1+t_{f}-t_{s}}. \end{aligned}$$
(175)
Fig. 4
figure 4

The optimal trajectory components \(x_{1}^o\) and \(x_{2}^o\), the corresponding adjoint process components \(\lambda _{1}^o\) and \(\lambda _{2}^o\), the optimal control input \(u^{o}\) and the corresponding Hamiltonian \(H \left( x^o, \lambda ^o, u^o\right) \) in Example 2 with \(t_{0}=0\), \(x_{10}=1\), \(x_{20}=-0.5\), \(t_{f}=5\) and \(v_\mathrm{{ref}}=1\)

Substitution of (175) into (172) and (173) results in

$$\begin{aligned} x_{1} \left( t\right)&=x_{1}\left( t_{s}\right) +\frac{v_\textrm{ref}}{2\left( 1+t_{f}-t_{s}\right) }\left( t-t_{s}\right) ^{2}, \end{aligned}$$
(176)
$$\begin{aligned} x_{2} \left( t\right)&=\frac{v_\textrm{ref}}{1+t_{f}-t_{s}}\left( t-t_{s}\right) , \end{aligned}$$
(177)

for \(t\in \left[ t_{s},t_{f}\right] \). This gives the adjoint boundary conditions (158) and (159) as

$$\begin{aligned}&A\left( 1+\frac{t_{s}}{2}\right) \sin \left( t_{s}+\alpha \right) =B\sin \left( t_{s}+\beta \right) , \end{aligned}$$
(178)
$$\begin{aligned}&A\cos \left( t_{s}+\alpha \right) =\frac{v_\textrm{ref}}{1+t_{f}-t_{s}}+p. \end{aligned}$$
(179)

The switching manifold condition (169) states that

$$\begin{aligned} \frac{-1}{2}At_{s}\cos \left( t_{s}+\alpha \right) -\frac{1}{2}A\sin \left( t_{s}+\alpha \right) +B\cos \left( t_{s}+\beta \right) =0, \end{aligned}$$
(180)

and the Hamiltonian continuity condition (154) gives

$$\begin{aligned}{} & {} A\cos \left( t_{s}+\alpha \right) \left( \frac{-1}{2}At_{s}\sin \left( t_{s}+\alpha \right) +B\sin \left( t_{s} +\beta \right) \right) \nonumber \\{} & {} \quad +\frac{1}{2}A^{2}\cos ^{2}\left( t_{s}+\alpha \right) =\frac{1}{2}\left( \frac{v_\textrm{ref}}{1+t_{f}-t_{s}}\right) ^{2}. \end{aligned}$$
(181)

Hence, by solving simultaneously the set of 6 equations (166), (167), (178), (179), (180), and (181) for the given \(t_{0}=0\), \(t_{f}<\infty \), \(x\left( t_{0}\right) \equiv \left[ x_{10},x_{20}\right] ^{T}\) and \(v_\textrm{ref}\) the values of the 6 unknown parameters \(A,\alpha ,B,\beta ,t_{s}\) and p are determined. For the values of \(t_{0}=0\), \(x_{10}=1\), \(x_{20}=-0.5\), \(t_{f}=5\) and \(v_\textrm{ref}=1\) the results are demonstrated in Fig. 4.

5.3 Example 3

Consider the hybrid system with the indexed vector fields

$$\begin{aligned} {\dot{x}}=\left[ \begin{array}{c} {\dot{x}}_{1}\\ {\dot{x}}_{2}\\ {\dot{x}}_{3}\\ {\dot{x}}_{4} \end{array}\right] =f_{1}\left( x,u\right) =\left[ \begin{array}{cccc} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 0 &{} 1\\ -3 &{} -2 &{} -4 &{} -1 \end{array}\right] \left[ \begin{array}{c} x_{1}\\ x_{2}\\ x_{3}\\ x_{4} \end{array}\right] + \left[ \begin{array}{c} 0\\ 0\\ 0\\ 1 \end{array}\right] u, \end{aligned}$$
(182)

and

$$\begin{aligned} {\dot{x}}=\left[ \begin{array}{c} {\dot{x}}_{1}\\ {\dot{x}}_{2}\\ {\dot{x}}_{3} \end{array}\right] =f_{2}\left( x,u\right) =\left[ \begin{array}{ccc} 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 1\\ -6 &{} -11 &{} -6 \end{array}\right] \left[ \begin{array}{c} x_{1}\\ x_{2}\\ x_{3} \end{array}\right] + \left[ \begin{array}{c} 0\\ 0\\ 1 \end{array}\right] u, \end{aligned}$$
(183)

where autonomous switchings occur on the switching manifold described by

$$\begin{aligned} m\big (x(t_{s}-)\big ) \equiv m\Big (\left[ \begin{array}{cccc} x_{1}(t_{s}-)&x_{2}(t_{s}-)&x_{3}(t_{s}-)&x_{4}(t_{s}-)\end{array}\right] ^{\top }\Big )=x_{3}(t_{s}-) = 0, \end{aligned}$$
(184)

with the jump map

$$\begin{aligned} x(t_s) \equiv \left[ \begin{array}{c} x_{1}(t_s)\\ x_{2}(t_s)\\ x_{3}(t_s) \end{array}\right] = \xi \big (x(t_{s}-)\big ) = \left[ \begin{array}{ccccccc} 2 &{} &{} 0 &{} &{} 0 &{} &{} 0\\ 0 &{} &{} \frac{1}{2} &{} &{} 0 &{} &{} 0\\ 0 &{} &{} 0 &{} &{} 0 &{} &{} 3 \end{array}\right] \left[ \begin{array}{c} x_{1}(t_{s}-)\\ x_{2}(t_{s}-)\\ x_{3}(t_{s}-)\\ x_{4}(t_{s}-) \end{array}\right] \end{aligned}$$
(185)

Consider the hybrid optimal control problem defined as the minimization of the total cost functional

$$\begin{aligned} J=\int _{t_{0}}^{t_{f}}\frac{1}{2}u^{2}dt+\frac{1}{8}\left\| x(t_{s}-)\right\| ^{2}+ 2 \left\| x(t_{f})\right\| ^{2} \end{aligned}$$
(186)

5.3.1 The HMP formulation and results

Employing the HMP, the corresponding Hamiltonians are defined as

$$\begin{aligned} H_{1} (x,\lambda ,u)&= \frac{1}{2} u^2 + \lambda ^\top (A_1 x + B_1 u), \end{aligned}$$
(187)
$$\begin{aligned} H_{2}(x,\lambda ,u)&=\frac{1}{2} u^2 + \lambda ^\top (A_2 x + B_2 u). \end{aligned}$$
(188)

The Hamiltonian minimization with respect to u (Eq. (14)) yields

$$\begin{aligned} u^{o}=-B_1^\top \lambda = \lambda _{4} ,{} & {} q = 1, \end{aligned}$$
(189)
$$\begin{aligned} u^{o}=-B_2^\top \lambda = \lambda _{3} ,{} & {} q = 2. \end{aligned}$$
(190)

Therefore the state dynamics (15) and the adjoint process dynamics (16) become

$$\begin{aligned} {\dot{x}}&= A_1 x - B_1 \lambda _{4} \end{aligned}$$
(191)
$$\begin{aligned} {\dot{\lambda }}&= - A_1^\top \lambda \end{aligned}$$
(192)

for \(q = 1\), and

$$\begin{aligned} {\dot{x}}&= A_2 x - B_2 \lambda _{3} \end{aligned}$$
(193)
$$\begin{aligned} {\dot{\lambda }}&= - A_2^\top \lambda \end{aligned}$$
(194)

for \(q =2\).

At the initial time \(t=t_0\), the continuous valued states are specified by the initial condition

$$\begin{aligned} x\left( t_{0}\right)&=x_{0} . \end{aligned}$$
(195)

At the switching instant \(t=t_s\), the switching manifold condition

$$\begin{aligned} x_{3}\left( t_{s}-\right) = 0, \end{aligned}$$
(196)

must hold, and the boundary conditions for the states and adjoint processes are determined as

$$\begin{aligned} x_{1}\left( t_{s}\right)&= 2 \, x_{1}\left( t_{s}-\right) , \end{aligned}$$
(197)
$$\begin{aligned} x_{2}\left( t_{s}\right)&= \frac{1}{2} \, x_{2}\left( t_{s}-\right) , \end{aligned}$$
(198)
$$\begin{aligned} x_{3}\left( t_{s}\right)&= 3 \, x_{4}\left( t_{s}-\right) , \end{aligned}$$
(199)
$$\begin{aligned} \lambda _{1}\left( t_{s}\right)&=2 \, \lambda _{1}\left( t_{s}+\right) + \dfrac{1}{4} \, x_{1}\left( t_{s}-\right) \end{aligned}$$
(200)
$$\begin{aligned} \lambda _{2}\left( t_{s}\right)&=\dfrac{1}{2} \, \lambda _{2}\left( t_{s}+\right) +\dfrac{1}{4} \, x_{2}\left( t_{s}-\right) \end{aligned}$$
(201)
$$\begin{aligned} \lambda _{3}\left( t_{s}\right)&=p + \dfrac{1}{4} \, x_{3}\left( t_{s}-\right) \end{aligned}$$
(202)
$$\begin{aligned} \lambda _{4}\left( t_{s}\right)&=3 \, \lambda _{4}\left( t_{s}+\right) + \dfrac{1}{4} \, x_{4}\left( t_{s}-\right) \end{aligned}$$
(203)

And at the terminal time \(t=t_f\), the adjoint processes are determined by (19) as

$$\begin{aligned} \lambda _{1}\left( t_{f}\right)&=4 \, x_{1}\left( t_{f}\right) , \end{aligned}$$
(204)
$$\begin{aligned} \lambda _{2}\left( t_{f}\right)&=4 \, x_{2}\left( t_{f}\right) , \end{aligned}$$
(205)
$$\begin{aligned} \lambda _{3}\left( t_{f}\right)&=4 \, x_{3}\left( t_{f}\right) . \end{aligned}$$
(206)

Note that unlike \(t_0\) and \(t_f\) which are a priori determined, \(t_s\) is not fixed and, together with the unknown parameter p, they need to be determined by the switching manifold condition (196) and the Hamiltonian continuity condition (21) as

$$\begin{aligned} H_{1}\left( t_{s}-\right)\equiv & {} \lambda (t_{s})^\top A_1 \, x(t_{s}-) - \dfrac{1}{2} \lambda (t_{s})^\top B_1 B_1^\top \lambda (t_{s}) \nonumber \\= & {} \lambda (t_{s})^\top A_2 \, x(t_{s}) - \dfrac{1}{2} \lambda (t_{s}+)^\top B_2 B_2^\top \lambda (t_{s}+) \equiv H_{2}\left( t_{s}+\right) . \end{aligned}$$
(207)
Fig. 5
figure 5

The optimal trajectory \(x^o\), the corresponding adjoint process \(\lambda ^o\) and the corresponding Hamiltonian \(H \left( x^o, \lambda ^o, u^o\right) \) in Example 3 over the horizon \([t_{0},t_{f}]=[0,3]\) with \(x_{0}=\left[ \begin{array}{cccc} -2&0&3&-2\end{array}\right] ^{\top }\), an autonomous switching with the switching manifold \(x^{(3)}(t_{s}-) = 0\), and the jump maps \(\left[ \begin{array}{ccc} x^{(1)}(t_{s})&x^{(2)}(t_{s})&x^{(3)}(t_{s})\end{array}\right] ^{\top }=\left[ \begin{array}{ccc} 2x^{(1)}(t_{s}-)&\dfrac{1}{2}x^{(2)}(t_{s}-)&3x^{(4)}(t_{s}-)\end{array}\right] ^{\top }\)

5.3.2 Numerical solution to the HMP

In order to numerically solve the HMP results, we employ the HMP–MAS Conceptual Algorithm presented in [67] and we exploit the analytical availability of trajectory solutions due to the linearity of dynamics before and after switching to expedite the algorithm. More specifically, the algorithm initiation consists of selecting arbitrary switching time \(t_s^0 \in (t_0,t_f)\) and pre-switching state \(x_s^0 \in {\mathbb {R}}^4\) such that the switching manifold condition \(m(x_s^0) = 0\) holds. Then, at each iteration k the hybrid optimal control problem decomposes into two decoupled auxiliary classical (non-hybrid) optimal control problems, one with the dynamics \({\dot{x}} = A_1 x + B_1 u\) with fixed initial and terminal states \(x_0\) at \(t_0\) and \(x_s^k\) at \(t_s^k\) with the cost \(J_1 = \int _{t_0}^{t_s^k} \frac{1}{2} u^2 ds\) and the other with the dynamics \({\dot{x}} = A_2 x + B_2 u\) with a fixed initial state \({\tiny \left[ \begin{array}{cccc} 2 &{} 0 &{} 0 &{} 0\\ 0 &{} {1}/{2} &{} 0 &{} 0\\ 0 &{} 0 &{} 0 &{} 3 \end{array}\right] }x_{s}^{k}\) at \(t_s^k\) and a free terminal state and with the cost \(J_2 = \int _{t_s^k}^{t_f} \frac{1}{2} u^2 \textrm{d}s\). At each iteration, the adjoint process of the first auxiliary problem is determined from \(\lambda _{q_1}^k(t) = \exp (- A_1^\top t) [{\mathcal {G}}(t_0,t_s^k)]^{-1} \big (x_0 - \exp (- A_1 (t_s^k - t_0)) x_s^k\big )\) where \({\mathcal {G}}(t_0,t_s^k) = \int _{t_0}^{t_s^k} \exp (- A_1 \tau ) B_1 B_1^\top \exp (- A_1^\top \tau ) \textrm{d}\tau \) is the controllability Gramian; and the adjoint process of the second auxiliary problem is determined from \(\lambda _{q_2}^k(t) = \Pi _2(t) x(t)\), where \(\Pi _2\) is the solution of the Riccati equation \({\dot{\Pi }}_2 = \Pi _2 B_2 B_2^\top \Pi _2 - A_2^\top \Pi _2 - \Pi _2 A_2\) subject to the terminal condition \(\Pi _2(t_f) = 4 \, I_{3 \times 3}\).

Then the algorithm updates \(t_s^k\) and \(x_s^k\) according to

$$\begin{aligned} t_{s}^{k+1}&= t_{s}^{k}- r_{k} \Big (H_{1}^{k}(t_s^k-) - H_{2}^{k}(t_s^k+)\Big ) \end{aligned}$$
(208)
$$\begin{aligned} x_{s}^{k+1}&= x_{i}^{k} - r_{k} \left( \left[ \begin{array}{ccc} 2 &{} 0 &{} 0\\ 0 &{} \frac{1}{2} &{} 0\\ 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 3 \end{array}\right] \lambda _{q_2}^{k}(t_s^k +)+\frac{1}{4} x_{s}^{k} + p^{k} \left[ \begin{array}{c} 0\\ 0 \\ 1 \\ 0 \end{array}\right] -\lambda _{q_1}^{k}(t_s^k)\right) \nonumber \\&\hspace{140pt} -r_{k} \, m(x_{s}^{k})\left[ \begin{array}{c} 0\\ 0 \\ 1 \\ 0 \end{array}\right] \end{aligned}$$
(209)

where \(r_{k} \in (0,1)\) is a set of monotonically non-decreasing sequence of step sizes and

$$\begin{aligned} p^{k}=\frac{H_{2(t_{s^{+}}^{k}\!)}^{k}\!-\!H_{1(t_{s^{-}}^{k}\!)}^{k}\!+\!\big (A_{1}x_{s}^{k}\!-\!B_{1}B_{1}^{\top }{\lambda _{q_{1}^{(t_{s}^{k})}}^{k}}^{\!\!\!\top }\big )^{\!\top }\!\!\left( \lambda _{q_{1}^{(t_{s}^{k})}}^{k}-{\tiny \left[ \begin{array}{ccc} 2 &{} 0 &{} 0\\ 0 &{} \frac{1}{2} &{} 0\\ 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 3 \end{array}\right] }\lambda _{q_{2}^{(t_{s^{+}}^{k})}}^{k}\!\!-\frac{1}{4}x_{s}^{k}\right) }{\left[ \begin{array}{cccc} 0&0&1&0\end{array}\right] \big (A_{1}x_{s}^{k}-B_{1}B_{1}^{\top }\lambda _{q_{1}}^{k}(t_{s}^{k})^{\top }\big )}\nonumber \\ \end{aligned}$$
(210)

For the initial condition \(x_{0}=\left[ \begin{array}{cccc} -2&0&3&-2\end{array}\right] ^{\top }\), over the time horizon [0, 3] and with the initial guesses \(t_s^0 = 1.5\), \(x_{s}^{0}=\left[ \begin{array}{cccc} 0&2&0&-1\end{array}\right] ^{\top }\), the algorithm converges with \(\epsilon = 0.001\) to \(|H_{2}^{k}(t_{s}^{k}+)-H_{1}^{k}(t_{s}^{k}-)|^{2}+\left\| \lambda _{q_{1}}^{k}(t_{s}^{k})-{\tiny \left[ \begin{array}{ccc} 2 &{} 0 &{} 0\\ 0 &{} \frac{1}{2} &{} 0\\ 0 &{} 0 &{} 0\\ 0 &{} 0 &{} 3 \end{array}\right] }\lambda _{q_{2}}^{k}(t_{s}^{k}+)-\frac{1}{4}x_{s}^{k}\right\| ^{2}+|m(x_{s}^{k})|^{2}\) within the order of \(10^5\) steps and the corresponding results are displayed in Fig. 5.

5.4 Example 4

Consider the hybrid model of an electric vehicle equipped with a dual planetary transmission (presented in detail in [56]) with the set of (active) vector fields F given as

$$\begin{aligned} f_{q_1}\left( x,u\right)&=-A_1 x^2 + B_1 u -C_1 x - D_1 \,, \end{aligned}$$
(211)
$$\begin{aligned} f_{q_2}\left( x,u\right)&=-A_2 x^2 + B_2 \frac{u}{x} - C_2 x - D_2 \,, \end{aligned}$$
(212)
$$\begin{aligned} f_{q_3}^{\left( 1\right) }\left( x,u\right)&= -A_{SS}x^{(1)}+A_{SR}x^{(2)}-A_{SA}\left( x^{(1)}+R_{2}x^{(2)}\right) ^{2} \nonumber \\&\quad +B_{SM}\frac{u^{\left( 1\right) }}{x^{(1)}+R_{1}x^{(2)}} +B_{SS} u^{\left( 2\right) } - B_{SR} u^{\left( 3\right) } -D_{SL} \,, \nonumber \\ f_{q_3}^{\left( 2\right) }\left( x,u\right)&= A_{RS}x^{(1)}-A_{RR}x^{(2)}-A_{RA}\left( x^{(1)}+R_{2}x^{(2)}\right) ^{2} \nonumber \\&\quad +B_{RM} \left( 1+R_{1}\right) \frac{u^{\left( 1\right) }}{x^{(1)}+R_{1}x^{(2)}} - B_{RS} u^{\left( 2\right) } + B_{RR} u^{\left( 3\right) }-D_{RL} \,, \end{aligned}$$
(213)
$$\begin{aligned} f_{q_4}\left( x,u\right)&= -A_4 x^2 + B_4 \frac{u}{x} - C_4 x - D_4 \,, \end{aligned}$$
(214)

where \(x_{q_1}, x_{q_2}, x_{q_4}, \in {\mathbb {R}}\), \(x_{q_3} \in {\mathbb {R}}^2\) are the continuous components of the hybrid state, with the notation \(x_{q_i}^{(j)}\) used for denoting the \(j^{\text {th}}\) component, and \(u_{q_1}, u_{q_2}, u_{q_4}\in \left[ -1,1\right] \subset {\mathbb {R}}\), \(u_{q_3}\in \left[ -1,1\right] ^3 \subset {\mathbb {R}}^3\) are the continuous components of the hybrid input, with the coefficients on the right hand side of equations assumed to have deterministically known values. In this example, transition from \(q_1\) to \(q_2\) is an autonomous switching, the transition from \(q_2\) to \(q_3\) is a controlled switching accompanied by a dimension change, and transition from \(q_3\) to \(q_4\) is an autonomous switching accompanied by a dimension change. The set of switching manifolds \({{\mathcal {M}}}\) for the autonomous switchings are given by

$$\begin{aligned} m_{q_1 q_2}&\equiv x - k_1 = 0\,, \end{aligned}$$
(215)
$$\begin{aligned} m_{q_3 q_4}&\equiv x^{(1)} = 0 \,, \end{aligned}$$
(216)

and the set of jump transition maps \(\Xi \) is provided as

$$\begin{aligned} \xi _{q_{1}q_{2}}&: \; x \rightarrow x. \,, \end{aligned}$$
(217)
$$\begin{aligned} \xi _{q_{2}q_{3}}&: \; x \rightarrow \left[ \begin{array}{c} g_{tr}^1 x\\ 0 \end{array}\right] \,, \end{aligned}$$
(218)
$$\begin{aligned} \xi _{q_{3}q_{4}}&: \; \left[ \begin{array}{c} x^{(1)}\\ x^{(2)} \end{array}\right] \rightarrow g_{tr}^2 x^{(2)} \,. \end{aligned}$$
(219)

Let the performance measure be given as

$$\begin{aligned} J\left( t_{0},t_{f},\left( q_{1},0\right) ,3;I_{3}\right)= & {} \int _{t_{0}}^{t_{s_{1}}}l_{q_{1}}\left( x,u\right) \textrm{d}t+\int _{t_{s_{1}}}^{t_{s_{2}}}l_{q_{2}}\left( x,u\right) \textrm{d}t \nonumber \\{} & {} +\int _{t_{s_{2}}}^{t_{s_{3}}}l_{q_{3}}\left( x,u\right) \textrm{d}t+\int _{t_{s_{3}}}^{t_{f}}l_{q_{4}}\left( x,u\right) \textrm{d}t + g\left( x\left( t_f\right) \right) , \nonumber \\ \end{aligned}$$
(220)

where the running costs \(l_{q_i}\)’s are the power consumption rates, determined from the motor efficiency map in [56] as

$$\begin{aligned} l_{q_{1}}\left( x,u\right)&=a_{1}u^{2}+b_{1}xu+c_{1}u+d_{1}x\,, \end{aligned}$$
(221)
$$\begin{aligned} l_{q_{2}}\left( x,u\right)&=a_{2}\frac{u^{2}}{x^{2}}+b_{2}u+c_{2}\frac{u}{x}+d_{2}x \,, \end{aligned}$$
(222)
$$\begin{aligned} l_{q_{3}}\left( x,u\right)&=a_{3}\frac{\left( u^{\left( 1\right) }\right) ^{2}}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}+b_{3}u^{\left( 1\right) } \nonumber \\&\quad +c_{3}\frac{u^{\left( 1\right) }}{x^{(1)}+R_{1}x^{(2)}}+d_{3}\left( x^{(1)}+R_{1}x^{(2)}\right) \,, \end{aligned}$$
(223)
$$\begin{aligned} l_{q_{4}}\left( x,u\right)&=a_{4}\frac{u^{2}}{x^{2}}+b_{4}u+c_{4}\frac{u}{x}+d_{4}x\,, \end{aligned}$$
(224)
$$\begin{aligned} g\left( x\left( t_f\right) \right)&= d_0 + d_1 x \left( t_f\right) + d_2 x\left( t_f\right) ^2 \,. \end{aligned}$$
(225)

5.4.1 The HMP results and solution

Fig. 6
figure 6

Optimal state and adjoint processes, optimal input and the corresponding Hamiltonians for the example of vehicle with transmission

Based on the HMP (details of the derivation are presented in [56]), optimal inputs are determined as

$$\begin{aligned}&u_{q_{1}}^{o}\left( t\right) =\underset{_{\left[ -1,1\right] }}{\text {sat}}\left( \frac{-\big (b_{1}x\left( t\right) +c_{1}+B_{1}\lambda \left( t\right) \big )}{2a_{1}}\right) , \end{aligned}$$
(226)
$$\begin{aligned}&u_{q_{2}}^{o}\left( t\right) =\underset{_{\left[ -1,1\right] }}{\text {sat}}\left( \frac{-x\left( t\right) \big (b_{2}x\left( t\right) +c_{2}+B_{2}\lambda \left( t\right) \big )}{2a_{2}}\right) , \end{aligned}$$
(227)
$$\begin{aligned}&\begin{array}{c} u_{q_{3}}^{o\left( 1\right) }\left( t\right) =\underset{_{\left[ -1,1\right] }}{\text {sat}}\left( \frac{-\left( x_{\left( t\right) }^{\left( 1\right) }+R_{1}x_{\left( t\right) }^{\left( 2\right) }\right) \left[ b_{3}\left( x_{\left( t\right) }^{\left( 1\right) }+R_{1}x_{\left( t\right) }^{\left( 2\right) }\right) +c_{3}+B_{SM}^{4}\lambda _{\left( t\right) }^{\left( 1\right) }+B_{RM}^{4}\lambda _{\left( t\right) }^{\left( 2\right) }\right] }{2a_{3}}\right) ,\\ u_{q_{3}}^{o\left( 2\right) }\left( t\right) =\left\{ \begin{array}{ccc} -1 &{} \text {if} &{} B_{SS}\lambda ^{\left( 1\right) }\left( t\right) -B_{RS}\lambda ^{\left( 2\right) }\left( t\right) \ge 0\\ 0 &{} \text {if} &{} B_{SS}\lambda ^{\left( 1\right) }\left( t\right) -B_{RS}\lambda ^{\left( 2\right) }\left( t\right)<0 \end{array}\right. \,,\\ u_{q_{3}}^{o\left( 3\right) }\left( t\right) =\left\{ \begin{array}{ccc} -1 &{} \text {if} &{} B_{RR}\lambda ^{\left( 2\right) }\left( t\right) -B_{SR}\lambda ^{\left( 1\right) }\left( t\right) \ge 0\\ 0 &{} \text {if} &{} B_{RR}\lambda ^{\left( 2\right) }\left( t\right) -B_{SR}\lambda ^{\left( 1\right) }\left( t\right) <0 \end{array}\right. \,,\end{array} \end{aligned}$$
(228)
$$\begin{aligned}&u_{q_{4}}^{o}\left( t\right) =\underset{_{\left[ -1,1\right] }}{\text {sat}}\left( \frac{-x\left( t\right) \big (b_{4}x\left( t\right) +c_{4}+B_{4}\lambda \left( t\right) \big )}{2a_{4}}\right) , \end{aligned}$$
(229)

where \(\lambda \left( t\right) \equiv \lambda ^o_{q_i}\left( t\right) \) are governed by the set of differential equations

$$\begin{aligned} {\dot{\lambda }}_{q_{4}}&=\frac{2a_{4}\left( u_{q_{4}}^{o}\left( t\right) \right) ^{2}}{\left( x_{q_{4}}\left( t\right) \right) ^{3}}+\frac{c_{4}u_{q_{4}}^{o}\left( t\right) }{\left( x_{q_{4}}\left( t\right) \right) ^{2}}-d_{4}\nonumber \\&\quad +\lambda _{q_{4}}\left( t\right) \left( 2A_{4}x_{q_{4}}\left( t\right) +B_{4}\frac{u_{q_{4}}^{o}\left( t\right) }{\left( x_{q_{4}}\left( t\right) \right) ^{2}}+C_{4}\right) \,, \end{aligned}$$
(230)
$$\begin{aligned} {\dot{\lambda }}_{q_{3}}^{(1)}&=\frac{2a_{3}\left( u_{q_{3}}^{o\left( 1\right) }\left( t\right) \right) ^{2}}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{3}}+\frac{c_{3}u_{q_{3}}^{o\left( 1\right) }\left( t\right) }{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}-d_{3}\nonumber \\&\quad +\lambda _{q_{3}}^{\left( 1\right) }\left( A_{SS}+2A_{SA}\left( x^{(1)}+R_{2}x^{(2)}\right) +\frac{B_{SM}\left( 1+R_{1}\right) u_{q_{3}}^{o\left( 1\right) }}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}\right) \nonumber \\&\quad +\lambda _{q_{3}}^{\left( 2\right) }\left( -A_{RS}+2A_{RA}\left( x^{(1)}+R_{2}x^{(2)}\right) +\frac{B_{RM}\left( 1+R_{1}\right) u_{q_{3}}^{o\left( 1\right) }}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}\right) \,, \end{aligned}$$
(231)
$$\begin{aligned} {\dot{\lambda }}_{q_{3}}^{(2)}&=\left( \frac{2R_{1}a_{3}\left( u_{q_{3}}^{o\left( 1\right) }\left( t\right) \right) ^{2}}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{3}}+\frac{R_{1}c_{3}u_{q_{3}}^{o\left( 1\right) }\left( t\right) }{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}-R_{1}d_{3}\right) \nonumber \\&\quad +\lambda _{q_{3}}^{\left( 1\right) }\left( -A_{SR}+2R_{2}A_{SA}\left( x^{(1)}+R_{2}x^{(2)}\right) +\frac{R_{1}B_{SM}\left( 1+R_{1}\right) u_{q_{3}}^{o\left( 1\right) }}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}\right) \nonumber \\&\quad +\lambda _{q_{3}}^{\left( 2\right) }\left( A_{RR}+2R_{2}A_{RA}\left( x^{(1)}+R_{2}x^{(2)}\right) +\frac{R_{1}B_{RM}\left( 1+R_{1}\right) u_{q_{3}}^{o\left( 1\right) }}{\left( x^{(1)}+R_{1}x^{(2)}\right) ^{2}}\right) \,, \end{aligned}$$
(232)
$$\begin{aligned} {\dot{\lambda }}_{q_{2}}&=\frac{2a_{2}\left( u_{q_{2}}^{o}\left( t\right) \right) ^{2}}{\left( x_{q_{2}}\left( t\right) \right) ^{3}}+\frac{c_{2}u_{q_{2}}^{o}\left( t\right) }{\left( x_{q_{2}}\left( t\right) \right) ^{2}}-d_{2} +\lambda _{q_{2}}\left( t\right) \Bigg (2A_{2}x_{q_{2}}\left( t\right) \nonumber \\&\quad +B_{2}\frac{u_{q_{2}}^{o}\left( t\right) }{\left( x_{q_{2}}\left( t\right) \right) ^{2}}+C_{2}\Bigg ), \end{aligned}$$
(233)
$$\begin{aligned} {\dot{\lambda }}_{q_{1}}&=-b_{1}u_{q_{1}}^{o}\left( t\right) -d_{1}+\lambda _{q_{1}}\left( t\right) \left( 2A_{1}x_{q_{1}}\left( t\right) +C_{1}\right) , \end{aligned}$$
(234)

subject to the terminal and boundary conditions:

$$\begin{aligned} \lambda _{q_4}\left( t_{f}\right)&= d_1 + 2 d_2 x_{q_4}\left( t_{f}\right) \,, \end{aligned}$$
(235)
$$\begin{aligned} \lambda _{q_{3}}\left( t_{s_{3}}\right)&=\left[ \begin{array}{c} 0\\ g_{tr}^{2} \end{array}\right] \lambda _{q_{3}}\left( t_{s_{3}}+\right) +p_{3}\left[ \begin{array}{c} 1\\ 0 \end{array}\right] \,, \end{aligned}$$
(236)
$$\begin{aligned} \lambda _{q_{2}}\left( t_{s_{2}}\right)&=\left[ \begin{array}{cc} g_{tr}^{1}&0\end{array}\right] \left[ \begin{array}{c} \lambda _{q_{3}}^{\left( 1\right) }\left( t_{s_{2}}+\right) \\ \lambda _{q_{3}}^{\left( 2\right) }\left( t_{s_{2}}+\right) \end{array}\right] =g_{tr}^{1}\lambda _{q_{3}}^{\left( 1\right) }\left( t_{s_{2}}+\right) \,, \end{aligned}$$
(237)
$$\begin{aligned} \lambda _{q_1}\left( t_{s_{1}}\right)&= \lambda _{q_2}\left( t_{s_{1}}+\right) +p_{1} \,, \end{aligned}$$
(238)

where the optimal switching instances \(t_{s_1}\), \(t_{s_2}\), \(t_{s_3}\) together with the unknown scalar \(p_1\) and \(p_3\) are determined from switching manifold conditions and Hamiltonian continuity conditions. The associated results are illustrated in Fig. 6. Interested readers are referred to [56] for further details about hybrid systems modeling and the determination of the HMP results for this system.

6 Concluding remarks

The hybrid minimum principle (HMP) presented and proved in this paper exhibits several distinctive characteristics of hybrid systems which are not simultaneously present in other versions of the HMP available in the literature. One of the key aspects of the established HMP is the explicit presentation of the boundary conditions on the Hamiltonians and adjoint processes (in contrast to their implicit expressions in [27,28,29,30, 33] in the form of transversality conditions), the relaxation of the regularity requirements (relative to, e.g., [32, 34]) and the presence of time-varying switching manifolds and jump maps corresponding to both autonomous and controlled, together with time varying switching costs and the possibility of state space dimension change (where only subsets of these features have been considered for the presentation of other versions of the HMP).

It is worth remarking that the statement of the HMP (like other versions of the HMP established in the literature) is along a fixed sequence of discrete states and while the associated switching times are not a priori fixed (and are part of the solution to the HMP), the currently available versions of the HMP are silent about the optimality of a sequence of discrete states. In other words, the adjoint process in the HMP is only in adjoint relationship with variations of the continuous state process while, to the best of our knowledge, the determination of an adjoin-type variable for discrete-valued processes (including especially the discrete component of the state of hybrid systems) is still an open problem. In contrast, one can obtain the optimal switching sequence using hybrid dynamic programming (HDP) (see, e.g., [18, 35]) at the expense of being required to solve multiple partial differential equations and possibly encountering the curse of dimensionality in the associated numerical algorithms. An interesting future line of research would be the development of numerical algorithms based upon the intrinsic relationship between the HMP and HDP [35] where the optimality results of the HMP are combined with HDP in order to also determine the optimal sequence of discrete states.