Discrete-Time Conewise Linear Systems with Finitely Many Switches

Jamal Daafouz, Jérôme Lohéac, Constantin Morărescu, Romain Postoyan
The authors are with Université de Lorraine, CNRS, CRAN, F-54000 Nancy, France (e-mails: firstname.surname@univ-lorraine.fr).
This work is supported by the ANR through the projects NICETWEET, ANR-20-CE48-0009, TRECOS, ANR-20-CE40-0009, and OLYMPIA, ANR-23-CE48-0006.

We investigate discrete-time conewise linear systems (CLS) for which all the solutions exhibit a finite number of switches. By switches, we mean transitions of a solution from one cone to another. Our interest in this class of CLS comes from the optimization-based control of an insulin infusion model for which the fact that solutions switch finitely many times appears to be key to establish the global exponential stability of the origin. The stability analysis of this class of CLS greatly simplifies compared to general CLS as  all solutions eventually exhibit linear dynamics. The main challenge is to  characterize CLS satisfying this finite number of switches property.
We first present general conditions in terms of set intersections for this purpose. To ease the testing of these conditions, we translate them as a non-negativity test of linear forms using Farkas lemma. As a result, the problem reduces to verify the non-negativity of a single solution to an auxiliary linear discrete-time system. Interestingly, this property  differs from the classical non-negativity problem, where any solution to a
system must remain non-negative (component-wise) for any non-negative initial condition, and thus requires novel tools to test it. We finally illustrate the relevance of the presented results on  the optimal insulin infusion problem.

Conewise linear systems, Lyapunov stability, optimization-based control, insulin infusion,
Farkas lemma.

§ INTRODUCTION

Conewise linear systems (CLS) are dynamical systems for which the state space is partitioned into a finite number of non-overlapping polyhedral cones [1, 2, 3]. The dynamics within each cone is governed by a linear time-invariant dynamical system called a mode. These systems pose significant challenges due to their piecewise linear nature.
In particular, it has been shown in [4] that the stability analysis of CLS is a NP-hard problem. Hence, algorithms for deciding stability of CLS are inherently inefficient.
We can mention the converse Lyapunov results in [3], which lead to necessary and sufficient stability conditions. The results in [3] state that the origin of a CLS is globally exponentially stable (GES) if and only if it admits a conewise linear Lyapunov function, whose associated conic partition does not coincide with the original system partition in general.
As a consequence, the method proposed in
[3]
may be undecidable or computationally intractable. We can also mention that CLS are known to be equivalent to a class of linear complementarity systems [1] for which cone-copositive Lyapunov functions may be synthesized as done recently in [5] in continuous-time. The advantage is the derivation of converse results with polynomial approximations but, again, there is no guarantee of computational tractability in general. To alleviate the computational obstruction of the CLS stability analysis, an alternative approach is to exploit additional properties for classes of CLS.
This is the approach pursued in this work where we focus on discrete-time CLS, whose solutions all exhibit a finite number of switches. By switches, we mean the transition of a solution from one cone to another.

Our motivation to study CLS with finitely many switches comes from the application of the optimization-based control approach of [6], namely quadratic control-Lyapunov policy (QCLP), for optimal insulin infusion in [7]. The primary objective is to minimize peak blood glucose level (BGL) caused by a food impulse, while adhering to the constraint that insulin flow must be positive [7]. Under the assumption that
the response of the meal lasts longer than the response of an insulin impulse, as observed in specific situations (e.g., low glycemic index or high-fat/protein meals), it is proved in [7] that the optimal infusion policy is given by an open-loop policy combining an insulin bolus (applied with the meal) and a specific form of decaying insulin flow thereafter. This strategy exhibits the shortcomings of being open-loop and of  requiring the perfect knowledge of the meals. This justifies the need for alternative efficient, suboptimal, closed-loop feedback policies.

It appears that the problem can be formalized as a Linear Quadratic Regulator (LQR) problem with positive control inputs as we show. This constrained optimal LQR problem arises in numerous real-world systems
and leads to major methodological challenges [8, 9, 10, 11, 12]. Necessary and sufficient optimality conditions for the continuous-time case are available in [9].
Nevertheless, the associated numerical algorithm suffers from the curse of dimensionality,  approximations are thus required to determine the stationary infinite horizon optimal feedback, moreover and importantly, no stability guarantees are provided. This is the reason why we opted for QCLP [11] instead, which is easy to implement and shows remarkable performances in simulations when applied to the model in [7]; see Figure <ref> in Section <ref>. We show that the obtained closed-loop system can be modelled as a CLS but ensuring its stability remains challenging. Indeed, despite our attempts to apply existing methods for stability analysis of CLS [3] or optimization-based control systems, such as [13] and its extensions [14, 15, 16], as well as sum-of-squares-based methods like [17] or the discrete-time counterpart of [5], we were unable to obtain a stability certificate for the CLS under consideration.

We realized that the above-mentioned motivating example satisfies a distinctive feature: the number of switches of any solution to the closed-loop system is uniformly bounded. This property is extremely useful to investigate stability as any solution is eventually given by a linear dynamical system. As, for this example, each mode has a Schur state matrix, the global exponential stability of the origin can then be established. Our goal in this work is to formalize and generalize these findings.

We start by assuming that a given general discrete-time CLS is such that all its solutions exhibit a finite number of switches, and we give a necessary and sufficient condition for the origin to be globally exponentially stable. This stability property relies on the assumption that solutions switch finitely many times, which is non-robust to exogenous disturbances a priori. We might thus deduce that the ensured stability property is not robust. We prove that this is not the case by establishing that, for a CLS, global exponential stability of the origin implies exponential input-to-state stability with respect to a general class of additive disturbances. Afterwards, we focus on the main challenge of this work that is to derive conditions under which all solutions to a CLS exhibit a finite number of switches. We are not aware of such results in the literature. We can mention e.g., [18],  which deals with linear complementarity systems with continuous-time dynamics and not discrete-time dynamics as we do, and ensures finitely many switches for any solution  on finite time intervals only, while we are seeking for results over the whole domain of the solutions. There is therefore a need for novel methodological tools that allows establishing that any solution to given discrete-time CLS switch a given maximum number of times.

In this context, we present general conditions in terms of set intersections. To ease the testing of these conditions, we derive alternative, tractable conditions, which boil down to verifying whether a specific solution to an auxiliary discrete-time system is non-negative thanks to the use of Farkas lemma. These conditions are derived for the case of a partition of the state space made of two cones, only to avoid over complicating the used notation. It is interesting to note that the required non-negativity property differs from the abundant literature on positive systems e.g., [19], which concentrate on systems for which all solutions take non-negative values (component-wise). In our case, a single solution has to be non-negative, we therefore present tailored conditions for this purpose, which have their own interest and which are successfully applied to the optimal insulin infusion problem.

The rest of the paper is organized as follows. The motivating example inspired by [7] and the problem statement are presented in Section <ref>. Stability results are established in Section <ref> assuming all the solutions of the considered CLS have a finite number of switches.
Section <ref> provides conditions under which solutions to a CLS exhibit no more than a given maximum number of switches. Section <ref> is dedicated to the non-negativity analysis of the auxiliary system derived from Farkas Lemma.
The results are finally applied to examples, including the insulin infusion problem, in Section <ref>. Section <ref> concludes the paper.
Some results are postponed to the appendix to avoid breaking the flow of exposition.

Notations. $\R$ denotes the set of real numbers, $\R_+$ the set of non-negative real numbers, $\N$ the set of non-negative integers, $\N^\star:=\N\backslash\{0\}$, and $\mathbb{C}$ the set of complex numbers. For real matrices or vectors ($^{\top}$) indicates
transpose. The  identity matrix of the considered set of matrices is denoted $\1$. For any symmetric matrix $X > 0$ ($X \geq 0$) means that $X$ is positive (semi-)definite. Given $a_1,\ldots,a_n\in\R$ with $n\in\N^\star$, we use $\diag(a_1,\ldots,a_n)$ to denote the diagonal matrix, whose diagonal components are $(a_1,\ldots,a_n)$.
For any real square matrix $M$, $\sigma(M)$ denotes its spectrum.
For any vectors $v$, we write $v\geq 0$ when all its entries are non-negative.
The notation $\lfloor s\rfloor$ for $s\in\R$ stands for the integer part of $s$, and recall that $s-1\le\lfloor s\rfloor$.
The interior of a set $S$ is denoted $\inter(S)$, its closure $\cl(S)$ and we use $\mathbb{B}(0,r)$ for the closed ball centered at the origin of radius $r>0$ of the considered Euclidean space. Also, $\card(S)$ is the cardinal of the set $S$. Given $n\in\N^\star$,  we say that set $\mathcal{C}\subset\R^n$ is a closed convex cone of $\R^n$ if $\mathcal{C}$ is closed and, for any $x,y\in\mathcal{C}$ and any $a,b\in\R_+$,  $a x+b y\in \mathcal{C}$. Given two sets $A$ and $B$, $A^B$ stands for the set of functions defined on $B$ with values in $A$.

§ MOTIVATION AND PROBLEM FORMULATION

We first focus on the LQR problem with scalar positive inputs (Section <ref>), which covers the optimal insulin infusion problem presented in more details afterwards (Section <ref>). After having illustrated the potential of QCLP for the near-optimal insulin infusion, we formalize the stability analysis of the obtained closed-loop system as the stability problem of a CLS (Section <ref>). There, we also discuss possible, but unfortunately unsuccessful, Lyapunov-based approaches to establish stability properties for the considered example thereby motivating the problem statement (Section <ref>).

§.§ LQR with positive inputs

The envisioned optimal insulin infusion problem is modeled as a LQR problem with positive inputs. We thus consider the deterministic discrete-time linear system

\begin{equation}\label{eqdisc}
x_{t+1} = A x_t + Bu_t,
\end{equation}

where $x _t =(x_t^1, \ldots, x_t^n)^\top \in \R ^n$ is the state and $u_t \in \R_+$ is the non-negative scalar control input at time $t\in\N$, with $n\in\N^\star$. We denote the solution to (<ref>) initialized at state $x\in\R^{n}$ with input sequence $\mathbf{u}\in\R_+^{\N}$ at time $t\in\N$ as $\phi(t,x,\mathbf{u})$ and $\phi(0,x,\cdot)=x$. The cost function is given, for any $x\in\R^n$ and infinite-length sequence of non-negative inputs $\mathbf{u}=(u_0,u_1,\ldots)\in\R_+^{\N}$, by

\begin{equation}
\begin{array}{rllll}
J(x,\mathbf{u}) & := & \displaystyle\sum_{t=0}^{\infty} \ell(\phi(t,x,\mathbf{u}),u_t),
\end{array}
\label{eq:cost-J}
\end{equation}

where $\ell(z,v):=z^{\top}Qz + 2z^{\top}Sv + {Rv^2}$ for any $(z,v)\in\R^{n}\times\R_+$, $Q\in\R^{n\times n}$ such that $Q=Q^{\top} \geq 0$, $R\in(0,\infty)$, $S\in\R ^n$ and $\left[\begin{matrix} Q & S \\ S^\top & R \end{matrix}\right]\geq 0$. We know from Bellman equation that the optimal value function associated with (<ref>), namely $V^{\star}(x):=\min_{\mathbf{u}\in\R_+^{\N}}J(x,\mathbf{u})$ satisfies, for any $x\in\R^{n}$,

\begin{equation}\label{eqValueF}
V^\star(x) \defeq \min_{u\in\R_+}\Big(\ell(x,u)+V^{\star}(Ax+Bu)\Big)
\end{equation}

based on which  the optimal feedback policy is given by

\begin{equation}\label{eqBell}
g^\star(x) = \min_{u\in\R_+}\Big(\ell(x,u)+V^{\star}(Ax+Bu)\Big).
\end{equation}

Hence to construct the optimal policy $g^\star$, we need to know $V^{\star}$, which is very challenging in general because of the constraint that $u$ has to be non-negative; see [9] for results in the continuous-time case. Consequently, we exploit an alternative suboptimal policy proposed in [11] known as QCLP. The idea is to construct the feedback policy using a known control Lyapunov function $V_{\text{clf}}$ instead of $V^{\star}$ in (<ref>). This leads to, for any $x\in\R^{n}$,

\begin{equation}\label{eq:QCLP}
g(x) := \argmin_{u\in\R_+} \big( \ell(x,u) + V_{\text{clf}}(Ax+Bu)\big).
\end{equation}

In this work, and as proposed in [6], we define $V_{\text{clf}}$ as the optimal value function associated with the unconstrained LQR problem in the sense that the input can take any value in $\R$, i.e., $V_{\text{clf}}(x):=x^{\top}Px$ for any $x\in\R^{n}$ where $P$ is the unique, real, symmetric, positive definite solution to the Riccati equation $A^{\top}PA-P	 -(A^{\top}PB+S)(B^{\top}PB+R)^{-1}(A^{\top}PB+S)^{\top}+Q=0$, which exists as long as the pair $(A,B)$ is controllable.

In view of the expressions of $\ell$ and $V_{\text{clf}}$, (<ref>) can be re-written as

\begin{equation}\label{QP99}
\begin{array}{r@{\ }c@{\ }lll}
g(x) & = &  \argmin_{u\in\R_+} {\big((R+B^{\top}PB)(u-Kx)^2\big)} \\
& = & \max\{0,Kx\},\end{array}
\end{equation}

with $K=-(R+B^\top P B)^{-1}(B^\top P A+S^\top)$ the optimal gain for the unconstrained LQR problem.
This equivalence follows from (<ref>) and the equalities $K^{\top}(R+B^{\top}PB)K = A^{\top}PA-P+Q$ and $-(R+B^{\top}PB)K = B^{\top}PA+S^{\top}$.

§.§ Optimal insulin infusion

We apply the approach of Section <ref> to the problem of optimal insulin infusion of [7] where
the primary objective is to minimize the peak of the blood glucose level (BGL) resulting from a food impulse while ensuring that insulin flow remains non-negative.
We reformulate the problem as a LQR problem with a control non-negativity constraint and apply the associated QCLP strategy (<ref>). The continuous-time model of [7] was obtained from clinical trials. Here we use a sampled-data version with a sampling period $T=5$ min; see Appendix <ref> for more details. As a result, the discrete-time state model is given by (<ref>) with $n=4$, and

\begin{equation}
\begin{array}{l}\label{eq:matrices-insulin-A-B}
A= \left[ \begin{array}{ cccc}
0.8351  & -0.1150 &  -0.0521    &     0 \\
0.0716  &  0.9954&   -0.0021     &    0 \\
0.0014   & 0.0390  &  1.0000   &      0 \\
-0.0082 &  -0.3249 & -16.4423  &  0.9277 \end{array} \right] \\
B =\left[ \begin{array}{ c}
-0.0163 \end{array} \right].
\end{array}
\end{equation}

We have selected the weighting matrices $Q,S$ and $R$ as in Appendix <ref>, which leads to
\begin{equation}\begin{array}{l}\label{eq:matrices-insulin-K}
K = \left[\begin{array}{cccc}
-0.4936 &   -6.9988 & -104.7360  & 1.6626
\end{array}\right].
\end{array}
\end{equation}

A solution to the  corresponding  closed-loop system with (<ref>) is depicted in Figure <ref> together with the solutions using the optimal open-loop strategy given in [7] and the zero-input strategy.

As it can be seen in Figure <ref>,

the control is effective in reducing the excursion due to an impulse of food ingested ($60$ g) compared to the open-loop behavior with zero input in black dash-dotted line.
Our result shows a maximum BGL excursion of $2$ mmol/L. The best feedback policy in <cit.>, for the corresponding continuous-time model (see Appendix <ref>) has a maximum BGL excursion of $1.28$ mmol/L. However, the associated controller assumes the BGL can be exactly differentiated, which is unfortunately unrealistic.
To make the strategy realistic, the bandwidth of these differentiators has been restricted in [7], and the results show larger peaks ($5.71$ mmol/L).

Top: glucose evolution (open-loop with zero input in black dash-dotted line, closed-loop with $K$ in red solid line, optimal open-loop of [7]  in blue dashed line). Bottom: Insulin flow (closed-loop with $K$ in (<ref>)).

QCLP (<ref>) is thus  promising  for this application. However, the stability of the corresponding closed-loop system is an open question as we now explain.

§.§ Limitations of existing Lyapunov-based techniques

System (<ref>) in closed-loop with (<ref>) is a CLS given by

\begin{equation}\label{sysPWQ}
x_{t+1} = \begin{cases}
A_1x_t  & x_t \in  \mathcal{C}_1,  \\
A_2x_t  & x_t \in  \mathcal{C}_2,
\end{cases}
\end{equation}

with $A_1 = A+BK$ and $A_2=A$ and

\begin{equation}\label{eqcvx12}
\begin{array}{r@{\>}l}
\mathcal{C}_1&=\left\{ x\in\R^n\ \,:\,\ Kx\geq0 \right\},\\
\mathcal{C}_2&=\left\{ x\in\R^n\ \,:\,\ -Kx\geq0 \right\}=\cl\left(\R^n\backslash\mathcal{C}_1\right),
\end{array}
\end{equation}

where $K$ is the gain associated with the optimal unconstrained LQR problem. It appears that certifying the stability of the origin for system (<ref>) is challenging [4]; even when $A_1$ and $A_2$ are Schur as in Section <ref>.

Interestingly, this stability problem can be formulated in other frameworks such as optimization-based systems due to (<ref>), piecewise linear systems to which system (<ref>) belongs to, or linear complementarity systems[This can be seen by noticing that the necessary and sufficient optimality Karush-Kuhn-Tucker (KKT) conditions of the quadratic problem (<ref>) write $ (R+B^{\top}PB)v -(R+B^{\top}PB)K x_t - \lambda  = 0$, $v \geq 0$, $\lambda  \geq 0$, $\lambda v=0$,
where $\lambda \in \R$ is a Lagrange multiplier. As a result, the closed-loop system (<ref>)-(<ref>) can also be written as a discrete-time LCS $x_{t+1} = Ax_t + Bu_t$, $y_t = Cx_t + Du_t$,
$0 \leq u_t \perp y_t \geq 0$,
where $C = -(R+B^{\top}PB)K$ and $D = R+B^{\top}PB$. ] (LCS) [20].

Nevertheless, none of the corresponding Lyapunov-based stability tools of the literature certifies the stability of the system in Section .  To elaborate a bit more on this claim, we  introduce below a novel comparison between three distinct classes of Lyapunov function candidates commonly encountered in the above mentioned fields. The first one is found in the optimization-based framework [13, 21, 22], and corresponds to the value function associated to (<ref>), i.e., for any $x\in\R^{n}$,

\begin{equation}\label{eqLyapVk}
\begin{array}{l}
V(x) := \displaystyle\min_{u\in\R_+}\Big(x^{\top} Qx+2x^{\top} Su+u^{\top} Ru
\\[-2mm] \ \hskip 3.0cm
+(Ax+Bu)^{\top} P(Ax+Bu)\Big).
\end{array}
\end{equation}

The second Lyapunov function candidate is the quadratic form inherited from the LCS literature [23], i.e., for any $x\in\R^{n_x}$ and $u=g(x)$ as in (<ref>),

\begin{equation}\label{eqLyapLCP}
V_{\text{quad}}(x) : =  \left[ \begin{array}{cc} x^{\top}  & u^{\top}   \end{array}\right] \underbrace{\left[ \begin{array}{cc}  X_1 & X_2 \\ X_2^{\top}  & X_3 \end{array}\right]}_{\cal X}\left[ \begin{array}{c} x \\ u  \end{array}\right]  %, \quad    {\mathcal X}
\end{equation}

where $X_1=X_1^\top  \in \R ^{n \times n}$, $X_2 \in \R ^{n \times m}$, and $X_3=X_3^\top  \in \R ^{m \times m}$ and ${\mathcal X}$ strictly copositive [23].
The third one is the piecewise quadratic function, as in [24], that is for any $x\in\R^{n}$

\begin{equation}\label{eqLyapPWQ}
V_{\text{PWQ}}(x) =:\begin{cases}
x^{\top}  P_1 x, & \text{if } x \in {\cal C}_1, \\
x^{\top}  P_2 x, & \text{if } x \in {\cal C}_2,
\end{cases}
\end{equation}

where $P_1=P_1^\top  \in \R ^{n \times n}$ and $P_2=P_2^\top  \in \R ^{n \times n}$.
This function is also a conewise quadratic function with the same partition as (<ref>).

The relationship between these three Lyapunov function candidates unfolds as follows. Function $V$ is a particular instance of $V_{\text{quad}}$. Specifically, if we set, in (<ref>), $X_1 = A^{\top} PA+Q$, $X_2 = A^{\top} PB+S$, and $X_3 = B^{\top} PB+R$, then we obtain $V_{\text{quad}}=V$. Function $V_{\text{PWQ}}$ is the most general form, encompassing both (<ref>) and (<ref>), as it accommodates $V_{\text{quad}}$ (which is more general than $V$) by setting $P_1= X_1+K^{\top} X_2^{\top} +X_2K+K^{\top} X_3K$ and $P_2 = X_1$, leading to $V_{\text{PWQ}}=V_{\text{quad}}$. Having identified the most general Lyapunov function candidate among these three options for system (<ref>), LMI conditions under which the stability of the origin of (<ref>) would be guaranteed using (<ref>) are provided in Appendix <ref>. Regrettably, these conditions are infeasible for the system discussed in Section <ref>.  Furthermore, all our attempts to ensure the stability of this system based on other existing tools from the literature [13, 3, 5, 14, 15, 16] failed.

Now, for all the tested values of $Q$, $R$ and $S$ in (<ref>), all the solutions of the corresponding system (<ref>) have the distinctive feature to switch a maximum of $4$ times, which, once analytically established, allows concluding on the stability of the origin for the considered system, see Section <ref>. In the following, we formalize these findings for general CLS.

§.§ Problem statement

Motivated by the above developments, we consider in this paper general discrete-time CLS of the form

\begin{equation}\label{eqCLS}
x_{t+1} = A_i x_t \quad \quad x_t \in {\cal C}_i, \quad i \in \{1,\dots,m\},
\end{equation}

where $m\in\N^\star$ is the number of non-empty closed convex cones $\mathcal{C}_i$, $i\in\{1,\ldots,m\}$, which partition the state space $\R^n$, i.e.,

* ${\cal C}_1\cup\dots\cup{\cal C}_m = \R ^n$,

* $\inter({\cal C}_i ) \cap \inter({\cal C}_j) = \emptyset$ for all $i\neq j \in\{1,\dots,m\}$.

As in [3], we require that $A_i \xi = A_j \xi$ for any $\xi \in {\cal C}_i \cap {\cal C}_j$. This implies the uniqueness of solutions for system (<ref>) for any initial condition. For the sake of convenience and with some slight abuse of notation, we use $\phi$ to denote solutions to (<ref>), so that  for initial condition $x\in\R^n$, the corresponding solution to (<ref>) at time $t\in\N$ is denoted $\phi(t,x)$.

We refer to the dynamics of (<ref>) for a given $i\in\{1,\ldots,m\}$ as a mode. We next formalize what is meant by a switch and the maximum number of switches.

Given initial condition $x\in\R^{n}$, solution $\phi(\cdot,x)$ to (<ref>) switches at time $t\in\N^*$ if for any $i\in\{1,\ldots,m\}$ such that $\phi(t-1,x)\in \mathcal{C}_i$, $\phi(t,x)\notin\mathcal{C}_i$.

A switch of a solution means that the solution has left the cone it lies at the last time step to enter a different cone. In view of Definition <ref>, the set of switching instants for the solution initialized at $x\in\R^n$ is

\begin{multline}
\mathcal{J}(x) := \Big\{t\in\N^\star\!:\! \forall i\in\{1,\ldots,m\}\ \st\ \\[-2mm]
\phi(t-1,x)\in\mathcal{C}_i\et\phi(t,x)\notin\mathcal{C}_i\Big\}.
\end{multline}

Thus, we can define the number of switches exhibited by a solution to (<ref>).

Consider system (<ref>) and $x\in\R^n$, the number of switches exhibited by the solution $\phi(\cdot,x)$ is $\varsigma(x):=\card(\mathcal{J}(x))$.

In view of Definition <ref>, a solution $\phi(\cdot,x)$ for some $x\in\R^n$ exhibits a finite number of switches if and only if $\varsigma(x)<\infty$.

The main objective of this work is to derive conditions under which all solutions to system (<ref>) exhibits a finite number of switches, see Section <ref>. This is motivated by the fact that  the stability analysis simplifies for this class of CLS as we show in the next section.

§ STABILITY RESULTS

We first provide a necessary and sufficient condition for $x=0$ to be GES for system (<ref>), again, assuming all its solutions switch a finite number of times; conditions to ensure this property are provided in Section <ref>. We then show that this stability property is robust in the sense that an input-to-state stability property holds when (<ref>) is perturbed by exogenous disturbances.

§.§ Global exponential stability

We define next the set $\mathcal{F}$, which characterizes the region of the state space where solutions to (<ref>) stop switching

\begin{equation}\label{eq:F}
\mathcal{F}:=\left\{x\in\R^n\,:\,\exists i\in\{1,\ldots,m\}\,\, \forall t\in\N\,\, A_i^t x \in\mathcal{C}_i\right\}.
\end{equation}

In other words, $\mathcal{F}=\{x\in\R^n\,:\,\varsigma(x)=0\}$ with the notation of Definition <ref>.
Obviously, $0\in\mathcal{F}$ and $\mathcal{F}$ is forward invariant for system (<ref>).

The next theorem gives a necessary and sufficient condition for the origin of system (<ref>) to be GES, i.e., there exist $c_1\geq 1$ and $c_2>0$ such that for any $x\in\R^{n}$, $|\phi(t,x)|\leq c_1e^{-c_2 t}|x|$ for any $t\in\N$, when we know that any solution exhibit a finite number of switches.
Again, conditions to ensure the latter property are provided in Section <ref>.

Consider system (<ref>) and suppose that any solution exhibits a finite number of switches, i.e., $\varsigma(x)<\infty$ for any $x\in\R^n$ with $\varsigma$ as in Definition <ref>. Then the origin is GES if and only if the origin of the restriction of (<ref>) to $\mathcal{F}$, namely,

\begin{equation}\label{eqCLS-constrained}
x_{t+1} = A_i x_t \quad \quad x_0 \in {\cal C}_i\cap \mathcal{F}, \quad i \in \{1,\dots,m\},
\end{equation}

is GES.

We first suppose the origin of (<ref>) is GES.
As $\mathcal{F}$ is forward invariant, it follows that the origin of (<ref>) is GES.

Suppose now that the origin of (<ref>) is GES.
Let $\phi$ be a solution to (<ref>) initialized at $x\in\R^n$.
Since $\phi(\cdot,x)$ exhibits a finite number of switches over $\N$, we define $t_0=t_0(x)=\max\mathcal{J}(x)$, and have $\phi(t_0,x)\in\mathcal{F}$.
As a result, $\phi(t,x)\in\mathcal{F}$ for any $t\geq t_0$ as $\mathcal{F}$ is forward invariant.
This implies that $\phi(t,x)\to 0$ as $t\to \infty$ as the origin is GES for system (<ref>).
Since $x$ has been arbitrarily chosen, we have proved that any solution to (<ref>) asymptotically converges to the origin, i.e., the origin is globally attractive for system (<ref>).
As item <ref> of Theorem <ref> in Appendix <ref> holds, it yields that the origin is GES for system (<ref>).

To apply Theorem <ref> we need two ingredients: that any solution to (<ref>) exhibits a finite number of switches and that the origin of (<ref>) is GES. We note that $\mathcal{C}_i\cap\mathcal{F}$, which appears in (<ref>), is the largest forward set within cone $\mathcal{C}_i$ for the dynamics $x_{t+1}=A_i x_t$ with $i\in\{1,\ldots,m\}$. When we know in which cone(s) the solutions eventually enter and remain for all future times, this boils down in investigating the spectrum of the state matrices associated with these cones. When all the matrices $A_i$, $i\in\{1,\ldots,m\}$, are Schur as in the examples of Section <ref>, the fact that the origin of (<ref>) is GES directly follows as solutions to (<ref>)  exhibit no switches.
Regarding the first condition, namely that all solutions exhibit a finite number of switches, this requires the development of novel tools, which are presented in Section <ref>.

A necessary condition for the origin of system (<ref>) to be GES is that for every $i\in\{1,\dots,m\}$, if $\lambda\in\sigma(A_i)\cap\R$ is such that there exists an eigenvector $v\in\mathcal{C}_i$ of $A_i$ associated with $\lambda$, then $\lambda\in[0,1)$.
This comes from the fact that, with these conditions, the solution of (<ref>) initialized at $v$, $\phi(t,v)=\lambda^t v$, belongs to $\mathcal{C}_i$ for every $t\in\N$.
In particular, we have $\R_+ v\subseteq \mathcal{F}$.

§.§ Exponential input-to-state stability

The property assumed in Theorem <ref> that any solution to (<ref>) switches a finite number of times is non-robust a priori, in the sense that an arbitrarily small exogenous disturbance may destroy it. It is therefore essential  to analyze the robustness of the stability result in Theorem <ref>.
This is formalized in the next theorem, which we could not find in the literature, although similar statements have been established for discrete-time systems but with different homogeneity degrees, see <cit.>, or for general continuous-time homogeneous systems, see e.g. [26].

We consider for this purpose system (<ref>) perturbed by exogenous disturbance as follows

\begin{equation}\label{eqCLS-perturbed}
x_{t+1} \in\left\{ A_i x_t + w_t \,:\, i\in\{1,\ldots,m\},\,\, x_t\in \mathcal{C}_i,\,\,w_t\in E(x_t)v_t\right\},
\end{equation}

where $v_t\in\R^{n_v}$, with $n_v\in\N^\star$, is the disturbance at time $t$ and $E$ is a set-valued map from $\R^n$ to $\R^{n\times n_v}$ such that: (i) $E(\lambda x)=E(x)$ for any $x\in\R^{n}$ and $\lambda >0$; (ii) there exists $m_E\geq 0$ such that for any $x\in\R^{n}$ and  $z\in E(x)$, $|z|\leq m_E$. Set-valued map $E$ covers as a special case the situation where  $E(x)=\{E_i\,:\, i\in\{1,\ldots,m\},\,\, x\in \mathcal{C}_i\}$ for some constant matrices $E_i$.  On the other hand, matrices $A_i$ and sets $\mathcal{C}_i$, $i\in\{1,\ldots,m\}$, are as  in (<ref>). System (<ref>) is a difference inclusion as its right-hand side is set-valued.
For the sake of convenience and like in Section , we denote a solution to (<ref>) initialized at $x\in\R^{n}$ with disturbance sequence $\mathbf{v}=(v_0,v_1,\ldots)\in(\R^{n_v})^\N$ at time $t\in\N$ as $\phi(t,x,\mathbf{v})$. We have the next robustness result.

Suppose the origin is GES for system (<ref>), then system (<ref>) is exponentially input-to-state stable, in particular there exist $c_1\geq 1$ and $c_2,c_3> 0$ such that for any $x\in\R^{n}$ and any $\mathbf{v}\in(\R^{n_v})^\N$, any solution $\phi$ satisfies $|\phi(t,x,\mathbf{v})|\leq c_1 e^{-c_2 t}|x|+c_3\sup_{t'\in\{1,\ldots,t\}}|v_{t'}|$.

We first apply <cit.> to obtain a suitable homogeneous Lyapunov function for system (<ref>). With the notation of [27], we take $\omega(\cdot)=|\cdot|$ and $\mathcal{D}=\R^n$. Then, Assumption 1 in [27] holds by <cit.>, as $x=0$ is GES for system (<ref>) and the vector field in (<ref>) is continuous[Recall that $A_i x=A_j x$ for any $x\in\mathcal{C}_i\cap \mathcal{C}_j$.]. Assumption 2 in [27] also holds, as the vector field in (<ref>) is homogeneous of degree $0$.
The last condition to check is <cit.>, which is verified with $G_\lambda=\lambda \1$ and $d=1$. Consequently, by <cit.>, there exist $V:\R^n\to\R_{+}$ continuous on $\R^n$, smooth on $\R^{n}\backslash\{0\}$, such that $V(\lambda x)=\lambda V(x)$ for any $\lambda >0$ and $x\in\R^n$, as well as $\underline\alpha,\overline\alpha>0$ and $\mu\in(0,1)$ such that, for any $x\in\R^n$ and any $i\in\{1,\ldots,m\}$ such that $x\in\mathcal{C}_i$,

\begin{equation}
\begin{array}{r@{\ }c@{\ }c@{\ }c@{\ }l}
\underline\alpha|x| & \leq   &  V(x) & \leq & \overline\alpha|x|\\[2mm]
V(A_i x) & \leq & \mu V(x).
\end{array}
\label{eq:proof-iss-lyap}
\end{equation}

Let $(x,v)\in\R^{n}\times\R^{n_v}$, $w\in E(x)v$, and any $i\in\{1,\ldots,m\}$ such that $x\in \mathcal{C}_i$.
In view of (<ref>) and <ref> stated below, there exists $L\ge0$ (independent of $x$, $v$ and thus $w$) such that

\begin{multline}
V(A_ix+w) \le V(A_i x) + |V(A_i x+w)-V(A_i x)|\\
\leq \mu V(x) + L|w|\le \mu V(x)+Lm_E|v|.
\label{eq:proof-issue-first-ineq}
\end{multline}

Let $\mathbf{v}\in(\R^{n_v})^\N$, we derive from (<ref>) that for any $t\in\N$, any solution $\phi$ to (<ref>) verifies

\begin{equation*}
V(\phi(t,x,\mathbf{v})) \leq \mu^t\, V(x) + \frac{Lm_E}{1-\mu}\sup_{t'\in\{1,\ldots,t\}}|v_{t'}|.
\end{equation*}

We deduce the desired property with $c_1=\overline\alpha/\underline\alpha$, $c_2=-\ln(\mu)$ and $c_3=Lm_E/(\underline\alpha(1-\mu))$ by invoking the first line in (<ref>).

We have used the next lemma in the proof of <ref>.

Let $V:\R^n\to\R$ be such that $V(\lambda x)=\lambda V(x)$ for every $\lambda>0$ and every $x\in\R^n$.
$V$ is globally  Lipschitz if and only if $V$ is Lipschitz on the unit sphere of $\R^n$.

A consequence of Lemma <ref>  is that, if $V$ is $C^1$ on $\R^n\setminus\{0\}$, then it is globally  Lipschitz on $\R^n$.

We set $D=\mathbb{B}(0,1)$ and $\partial D=D\setminus \inter(\mathbb{B}(0,1))$, the unit sphere of $\R^n$.
Obviously, if $V$ is Lipschitz on $\R^n$, then $V$ is Lipschitz on $\partial D$. Reciprocally, we assume that $V$ is Lipschitz on $\partial D$.

It is enough to prove that $V$ is Lipschitz on $D$.
In fact, by homogeneity, if $V$ is Lipschitz on $D$, then $V$ is (globally) Lipschitz on $\R^n$.
Assume by contradiction that $V$ is not Lipschitz on $D$.
Then, for every $k\in\N$, there exists $x_k,y_k\in D$ such that $|V(x_k)-V(y_k)|>k|x_k-y_k|$.
Obviously, we have $x_k\neq y_k$, and without loss of generality, we can assume that $|x_k|{>}|y_k|$.
Using the homogeneity of $V$, we can also assume without loss of generality that $x_k\in\partial D$.

In addition, since $k|x_k-y_k|<|V(x_k)-V(y_k)|\le 2\max_{\xi\in\partial D}|V(\xi)|$, we get that $\lim_{k\to\infty}|y_k|=1$, and in particular, for $k$ large enough, we have $|y_k|\neq0$.
We then define $z_k=y_k/|y_k|\in\partial D$, and we have

\begin{align*}
& \ge |V(x_k)-V(y_k)|-|V(y_k)-V(z_k)|\\
& = |V(x_k)-V(y_k)|-(1-|y_k|)|V(z_k)|\\
& > k|x_k-y_k|-(1-|y_k|)\max_{\partial D}|V|.
\end{align*}

Since $V$ is Lipschitz on $\partial D$, there exist $L\in\R_+$ such that $|V(x_k)-V(z_k)|\le L|x_k-z_k|\le L\left( |x_k-y_k|+(1-|y_k|) \right)$.
We thus have,

$$k|x_k-y_k|<L|x_k-y_k|+\left( L+\max_{\partial D}|V| \right)(1-|y_k|).$$

But, $1-|y_k|=|x_k|-|y_k|\le |x_k-y_k|$, and finally, for every $k\in\N$, we should have $k<2L+\max_{\partial D}|V|$ (recall that $x_k\neq y_k$) which is a contradiction.

§ CLS WITH A FINITE NUMBER OF SWITCHES

The objective of this section is to provide conditions under which all the solutions to (<ref>) exhibit a finite number of switches, as required by <ref>.
We will actually focus on a stronger property, that is that there exists $p\in\N$ such that $\varsigma(x)\leq p$ for any $x\in\R^n$, where we recall that $\varsigma(x)$ is the number of switches exhibited by the solution of (<ref>) initialized at $x$, see Definition <ref>. To this end, we first give a sufficient condition based on the emptiness of the intersection of a finite number of sets, see <ref>.
To ease the testing of this condition, we translate it in <ref> in terms of checking the non-negativity of linear forms, by exploiting Farkas lemma. As a result, the problem reduces to verify the non-negativity of a single solution to an auxiliary linear discrete-time system.

In <ref>, we consider the general case $m\ge2$, while for the sake of clarity and readability only, we focus on the case $m=2$ in <ref>.
Note however that the methodology described in <ref> is easily extendable to the general case.

§.§ A sufficient condition

Given $p>0$ time instants $t_1,\dots,t_p>0$ and $t\ge0$, and given indexes $i_1,\dots,i_{p+1}\in\{1,\dots,m\}$ with $i_{k+1}\neq i_{k}$ for $k\in\{1,\dots,p\}$, we define the set $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}$ of initial conditions $x_0$ such that the solution to (<ref>) satisfies $x_s=A_{i_1}^sx_0\in\mathcal{C}_{i_1}$ for $0\le s<t_1$, $x_{t_1+s}=A_{i_2}^sA_{i_1}^{t_1}x_0\in\mathcal{C}_{i_2}$ for $0\le s<t_2$, etc, and finally $x_{t_1+\dots+t_p+s}=A_{i_{p+1}}^sA_{i_p}^{t_p}\ldots A_{i_1}^{t_1}x_0\in\mathcal{C}_{i_{p+1}}$ for $0\le s\le t$.
In other words, if a solution to (<ref>) is initialized in $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}$, then it admits at least $p$ switches.
The first step is to give a condition under which any solution to (<ref>) initialized in $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}$ admits exactly $p$ switches.

Writing down the definition of $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}$, we obtain that this set is given by the following intersections

\begin{equation}\label{eq:set-Sigma}
\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}
= \bigcap_{\tau=0}^t \left(S_{\subalign{&t_1,\dots,t_p,\tau\\&i_1,\dots,i_p,i_{p+1}}}\right)
\cap \left(\bigcap_{k=1}^p\bigcap_{\tau=0}^{t_k-1} S_{\subalign{&t_1,\dots,t_{k-1},\tau\\&i_1,\dots,i_{k-1},i_k}}\right),
\end{equation}

where, for every $k\in\N$, $t_1,\cdots,t_k\in\N^*$, $\tau\in\N$ and $i_1,\cdots,i_k,i\in\{1,\dots,m\}$ we have set

\begin{equation}\label{eq:set-S}
S_{\subalign{&t_1,\dots,t_{k},\tau\\&i_1,\dots,i_{k},i}}:=\left\{ x_{{0}}\in\R^n\ \,:\,\ A^{{\tau}}_iA_{i_k}^{t_k}\dots A_{i_1}^{t_1}x_{{0}}\in \mathcal{C}_{{i}} \right\}.
\end{equation}

For notation convenience, in (<ref>), for $k=1$ (resp. $k=2$), $S_{\subalign{&t_1,\dots,t_{k-1},\tau\\&i_1,\dots,i_{k-1},i_k}}$ is identified with $S_{\subalign{&\tau\\&i_1}}:=\big\{ x_{{0}}\in\R^n\ \,:\,\ A^\tau_{i_1}x_{{0}}\in \mathcal{C}_{i_1} \big\}$ (resp. $S_{\subalign{&t_1,\tau\\&i_1,i_2}}=\big\{ x_{{0}}\in\R^n\ \,:\,\ A^\tau_{i_2}A_{i_1}^{t_1}x_{{0}}\in \mathcal{C}_{i_2} \big\}$).

To give a better intuition on the meaning of the sets $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}$ and $S_{\subalign{&t_1,\dots,t_{k},\tau\\&i_1,\dots,i_{k},i}}$, we consider a solution of (<ref>) that is initialized at some $x_0\in\mathcal{C}_1$, stays in $\mathcal{C}_1$ for times $t\in\{0,1\}$,  enters in $\mathcal{C}_2$ in time $t=2$ and stays in $\mathcal{C}_2$ at time $t=3$.
We then have:

* $x_0\in\mathcal{C}_1=S_{\subalign{&0\\&1}}$;

* $x_1=A_1x_0\in\mathcal{C}_1$, i.e., $x_0\in S_{\subalign{&1\\&1}}=\left\{ x_0\in\R^n\ :\ A_1x_0\in\mathcal{C}_1 \right\}$;

* $x_2=A_1x_1=A_1^2x_0\in\mathcal{C}_2$, i.e., $x_0\in S_{\subalign{&2,0\\&1,2}}=\left\{ x_0\in\R^n\ :\ A_1^2x_0\in\mathcal{C}_2 \right\}$;

* $x_3=A_2x_2=A_2A_1^2x_0\in\mathcal{C}_2$, i.e., $x_0\in S_{\subalign{&2,1\\&1,2}}=\left\{ x_0\in\R^n\ :\ A_2A_1^2x_0\in\mathcal{C}_2 \right\}$.

Gathering these constraints, we obtain $\displaystyle x_0\in \left( \bigcap_{\tau=0}^1 S_{\subalign{&2,\tau\\&1,2}} \right)\cap \left( \bigcap_{\tau=0}^1 S_{\subalign{&\tau\\&1}} \right)=\Sigma_{\subalign{&2,1\\&1,2}}$.
Reciprocally, if $x_0\in\Sigma_{\subalign{&2,1\\&1,2}}$ the solution initialized from this $x_0$ satisfies:

* $x_0\in S_{\subalign{&0\\&1}}=\mathcal{C}_1$, thus $x_1=A_1x_0$;

* $x_0\in S_{\subalign{&1\\&1}}$, thus $x_1=A_1x_0\in\mathcal{C}_1$ and $x_2=A_1x_1=A_1^2 x_0$;

* $x_0\in S_{\subalign{&2,0\\&1,2}}$, thus $x_2=A_1^2x_0\in\mathcal{C}_2$ and $x_3=A_2x_2=A_2A_1^2 x_0$;

* $x_0\in S_{\subalign{&2,1\\&1,2}}$, thus $x_3=A_2A_1^2x_0\in\mathcal{C}_2$.

We also emphasize  that, without additional information, $x_0\in S_{\subalign{&t\\&i}}$ does not implies $x_0\in S_{\subalign{&t-1\\&i}}$.

We aim to give conditions ensuring that any solution to (<ref>) exhibits no more than $p$ switches.
This is ensured by enforcing that, if the solution associated with an initial condition has already switched $p$ times, then it cannot switch anymore.
That is to say that $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}=\Sigma_{\subalign{&t_1,\dots,t_p,0\\&i_1,\dots,i_p,i_{p+1}}}$ for every $t\ge0$, and every $t_1,\dots,t_p$ and $i_1,\dots,i_{p+1}$.
Obviously, we have $\Sigma_{\subalign{&t_1,\dots,t_p,t\\&i_1,\dots,i_p,i_{p+1}}}\subset \Sigma_{\subalign{&t_1,\dots,t_p,0\\&i_1,\dots,i_p,i_{p+1}}}$, and these sets are equal if for every $i\in\{1,\dots,m\}\setminus\{i_{p+1}\}$ and every $t>0$, we have $\Sigma_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}=\emptyset$.
A sufficient condition for this is as follows.

Given $p\in\N^\star$, $i_1,\dots,i_p,i_{p+1}\in\{1,\dots,m\}$ with $i_{k+1}\neq i_k$ for every $k\in\{1,\dots,p\}$, and given $t_1,\dots,t_p\in\N^\star$, we also set $t_{p+1}=1$.
If there exist $\kappa\in\{1,\dots,p+1\}$, $1\leq j_1\leq\dots\leq j_\kappa\leq p+1$ and for every $k\in\{1,\dots,\kappa\}$, there exist $r_k\in\N$ and $\tau_{k,1},\dots,\tau_{k,r_k}\in\{0,\dots,t_{j_k}-1\}$, such that $\sum_{k=1}^\kappa r_k\leq n$ and

\begin{equation}\label{eq:interS}
\left( \bigcap_{k=1}^\kappa\bigcap_{\ell={1}}^{r_k} S_{\subalign{&t_{j_1},\dots,t_{j_{k-1}},\tau_{k,\ell}\\&i_{j_1},\dots,i_{j_{k-1}},i_{j_k}}}\right)\cap S_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}=\emptyset
\end{equation}

for every $t\in\N^\star$ and every $i\in\{1,\dots,m\}\backslash\{i_{p+1}\}$, then all the solutions to (<ref>) initialized in $\Sigma_{\subalign{&t_1,\dots,t_p,0\\&i_1,\dots,i_p,i_{p+1}}}$ exhibit no more than $p$ switches.

We make several comments before proving Proposition <ref>.

* As claimed in the paragraph preceding <ref>, the aim of this proposition is to give conditions ensuring that $\Sigma_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}=\emptyset$ for every $t\in\N^*$.

* The proof of this result relies on the fact that given a sequence of sets ${(S_i)}_{i\in I}$, if there exists $J\subset I$ such that $\bigcap_{j\in J}S_J=\emptyset$ then $\bigcap_{i\in I}S_i=\emptyset$.

* Using the abstract notation of the previous point, we add two constraints on the possible choices of $J$:

* the cardinality of $J$ is not greater than $n$ (this constraint is $\sum_{k=1}^\kappa r_k\leq n$).
This constraint is added for the numerical verification of the test (see <ref>), where a $n\times n$ matrix will be constructed from these sets;

* we do not consider sets ${(S_j)}_{j\in J}$ of the form $S_{\subalign{&t_1,\dots,t_p,\tau\\&i_1,\dots,i_p,i_{p+1}}}$ (with $\tau>0$).
This fact is expressed by the condition $t_{p+1}=1$, together with $\tau_{k,1},\dots,\tau_{k,r_k}\in\{0,\dots,t_{j_k}-1\}$ (that is to say that if $j_{\kappa}=p+1$, we enforce $r_\kappa=1$ and $\tau_{\kappa,r_\kappa}=0$).

For every $t\in\N^*$, we have

\begin{multline*}
\Sigma_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}
\subset \Sigma_{\subalign{&t_1,\dots,t_p,0\\&i_1,\dots,i_p,i_{p+1}}}\cap S_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}\\
\subset \left( \bigcap_{k=1}^\kappa\bigcap_{\ell={1}}^{r_k} S_{\subalign{&t_{j_1},\dots,t_{j_{k-1}},\tau_{k,\ell}\\&i_{j_1},\dots,i_{j_{k-1}},i_{j_k}}}\right)\cap S_{\subalign{&t_1,\dots,t_p,t,0\\&i_1,\dots,i_p,i_{p+1},i}}.
\end{multline*}

We are ready to state conditions under which any solution to (<ref>), and not only those initialized in $\Sigma_{\subalign{&t_1,\dots,t_p,0\\&i_1,\dots,i_p,i_{p+1}}}$ as in <ref>, exhibits at most $p$ switches.

Given $p\in\N^\star$, if for every $i_1,\dots,i_{p+1}\in\{1,\dots,m\}$ and every $t_2,\dots,t_{p}\in\N^\star$, the conditions of <ref> are satisfied with $t_1=1$, then all the possible solutions of (<ref>) admit at most $p$ switches.

Assume by contradiction that there exists $x_0\in\R^n$ such that the solution initialized at $x_0$ switches more that $p$ times.
Then there exists $i_1,\dots,i_p,i_{p+1},i_{p+2}$ (with $i_{k+1}\neq i_k$) and $t_1,\dots,t_p,t_{p+1}\in\N^\star$ such that $A^{t_1-1}_{i_1}x_0$ belongs to $\Sigma_{\subalign{&1,t_2,\dots,t_{p+1},0\\&i_1,i_2,\dots,i_{p+1},i_{p+2}}}$.
This leads to a contradiction, since by Proposition <ref>, this set is empty.

From a computational point of view, the main difficulties with the result of Theorem <ref> are related to checking the intersection (<ref>) for every $t\in\N^\star$ and every $i\in\{1,\dots,m\}\backslash\{i_{p+1}\}$. The problem is combinatorial by nature. However, we provide in the sequel, tractable conditions for the case $m=2$. In <ref>, we propose a solution to tackle the fact that $t$ is a priori not bounded. It consists in using Farkas lemma, which is a particular case of the S-procedure dedicated to linear forms, to transform the problem into assessing the non-negativity of specific solution to an auxiliary discrete-time system. We propose tractable conditions to check this non-negativity in  <ref>. As to the combinatorial complexity related to checking the intersection (<ref>) for every $i\in\{1,\dots,m\}\backslash\{i_{p+1}\}$, the situation is manageable as we will manipulate sets defined by linear inequalities, and checking if their intersection is nonempty can be done using linear programming.

Let us first recall that Helly's theorem [29] states that:
Given $s>n$ convex sets $S_1,\dots,S_s\subset\R^n$, if the intersection of every $n+1$ of these sets is nonempty, then $\bigcap_{i\in\{1,\ldots,s\}}S_i\neq \emptyset$.

A consequence of this result is that, given $s>n$ convex sets $S_1,\dots,S_s\subset\R^{n}$ for which $\bigcap_{i=1}^{s} S_i = \emptyset$, there exist $n+1$ sets among them whose intersection is empty.
Hence, we can certify whether the intersections overall the $s$ sets $S_i$ is empty by only considering the intersection of $n+1$ of them.

<ref> is in the spirit of Helly's theorem.
Indeed, the sufficient condition given in <ref> is expressed in term of sets intersections, and we enforce that $\sum_{k=1}^\kappa r_k\leq n$.
The result applies even if the sets $S_{\subalign{&t_1,\dots,t_{k-1},t\\&i_1,\dots,i_{k-1},i_k}}$ are not convex.
Here, these sets are convex as the sets $\mathcal{C}_i$ are.
However, <ref> is not an application of Helly's Theorem.
In fact, if we applied directly Helly's Theorem, we would obtain the same result as in Proposition <ref>, but the set selection (i.e., the choice of $j_k$, $r_k$ and $\tau_{k,r_k}$) would depend on $t$ and $i$. In this case, we would have obtained a necessary and sufficient condition, but this condition might be impossible to test in practice.

§.§ When $m=2$

To streamline the discussion and maintain clarity, we focus on the case where $m=2$, i.e., the partition of $\R^{n}$ is made of two cones, while keeping in mind that the results and concepts presented here can be readily extended to the general case when $m\in\N^\star$.
Note that the case where $m=2$ is notoriously difficult [4].

When $m=2$, the cones $\mathcal{C}_1$ and $\mathcal{C}_2$ can be written as in (<ref>) for some matrix $K\in\R^{1\times {n}}$, which is not the same as in <ref> in general.

§.§.§ General result

Since the indexes $i_k$ used in Section , are such that $i_{k+1}\neq i_k$, the only possibilities, when $m=2$ are the sequences $1,2,1,\dots$ or $2,1,2,\dots$
This observation together with the expression of $\mathcal{C}_1$ and $\mathcal{C}_2$ given in (<ref>), leads to set

\begin{multline*}
\mathcal{S}_{i_1;t_1,\dots,t_p,t}:=\mathcal{S}_{\subalign{&t_1,\dots,t_p,t\\&[i_1],\dots,[i_1+p]}}\\
=\left\{ x\in\R^n\ :\ (-1)^{i_1+p}KA_{[i_1+p+1]}^tA_{[i_1+p]}^{t_p} \ldots
A_{[i_1]}^{t_1}x\geq 0 \right\},
\end{multline*}

where, for every $i\in\N$, we have defined $[2i+1]=1$ and $[2i]=2$.
Similarly, we define $\Sigma_{i_1;t_1,\dots,t_p,t}$.
Given $i_1\in\{1,2\}$ if we start from an initial condition in $\mathcal{C}_{i_1}$, the solution stays for the remaining times in $\mathcal{C}_{i_1}$ or enters in $\mathcal{C}_{[i_1+1]}$.
Hence, the maximal number of switches starting from $\mathcal{C}_{i_1}$ is bounded by one plus the maximal number of switches starting from $\mathcal{C}_{[i_1+1]}$.
This observation leads to the next corollary of <ref>.

Consider the system (<ref>) with $m=2$.
Given $p\in\N^\star$, if there exists $i_1\in\{1,2\}$ such that for every $t_2,\dots,t_p\in\N^\star$, the conditions of <ref> are satisfied with $t_1=1$, then each solution of (<ref>) admits at most $p+1$ switches.

§.§.§ Tractable conditions

To make the paper self-contained, we recall Farkas lemma in the form in which we will use it, although other formulations are possible, see e.g. [30] and <cit.> for more detail.

Let $\ell,n\in\N^\star$ and $M_0,\ldots,M_{\ell}\in\R^n$.
We have

\begin{multline*}
\left\{ x\in\R^n\ \,:\,\ x^{\top} M_0\ge0 \right\}\subset\bigcap_{i=1}^\ell \left\{ x\in\R^n\ \,:\,\ x^{\top} M_i\ge0 \right\}\\[-1mm]
\quad\Leftrightarrow\quad
\exists \beta_1,\dots,\beta_\ell\in\R_+\ \text{s.t.}\ M_0=\sum_{i=1}^\ell\beta_i M_i.
\end{multline*}

In other words, Lemma <ref> states that, given any $x\in \R^n$,

$$x^{\top} M_i\ge 0 \quad \forall i\in\{1,\dots,\ell\} \quad \Longrightarrow \quad x^{\top} M_0 \ge 0$$

if and only if there exist non-negative numbers $\beta _1,\beta _2, \ldots,\beta_\ell$ such that $M_0 = \sum_{i=1}^{\ell} \beta _i M_i$.
In the sequel, to verify condition (<ref>), we consider without loss of generality that .
This is justified because, if (<ref>) holds with $\sum_{k=1}^\kappa r_k = \nu$ with $\nu<n$, it also holds with $\sum_{k=1}^\kappa r_k = n$.
This can be achieved by including any $n-\nu$ sets from the available sets, we recall that $\sum_{k=1}^\kappa r_k$ is the number of set used for testing the emptiness condition (<ref>).
Consequently, in order to state our results precisely, we consider without loss of generality, the case where the maximum number of switches is $n$; the results can be extended to any number.
For $t_1,\dots,t_{n-1}\in\N^\star$, we introduce the following matrices, which all belong to $\R^{1\times n}$,

\begin{equation}\label{eq:St}
\begin{array}{lr}
& \text{for }0\le t<t_1,\\[1mm]
& \text{for }0\le t<t_2,\\[1mm]
=(-1)^{i_1+3}KA_{[i_1+2]}^tA_{[i_1+1]}^{t_2}A_{[i_1]}^{t_1},\hskip -2mm & \text{for }0\le t<t_3, \\
\hskip 5mm ~\vdots &\\
=(-1)^{i_1+n-1}KA_{[i_1+n-2]}^tA_{[i_1+n-3]}^{t_{n-2}}\dots A_{[i_1]}^{t_1},\hskip -10 cm\\
& \text{for }0\le t<t_{n-1}, \\
=(-1)^{i_1+n}KA_{[i_1+n-2]}^{t_{n-1}}\dots A_{[i_1]}^{t_1}.\hskip -10 cm
\end{array}
\end{equation}

Observe that these matrices verify

\begin{equation}\label{eq:St2}
S_{i_1;t_1,\dots,t_p,t}=\left\{ x\in\R^n\ \,:\,\ N_{i_1;t_1,\dots,t_p,t}x\ge0 \right\}.
\end{equation}

To verify (<ref>) we investigate the intersection of $S_{i_1;1,t_2,\dots,t_{n-1},t,0}$ with $n$-sets taken from (<ref>).
We notice that in (<ref>), there are exactly $1+\sum_{i=1}^{n-1} t_i$ row vectors defined  (recall that $t_1,\ldots,t_{n-1}\in\N^*$, hence, $1+\sum_{i=1}^{n-1} t_i\ge n$).

In addition, we also have (with $t_1=1$)

$$S_{i_1;1,t_2,\dots,t_{n-1},t,0}=\left\{ x\in\R^n\ \,:\,\ N_{i_1;{1},t_2,\dots,t_{n-1},t,0}x\ge0 \right\},$$

\begin{multline*}
N_{i_1;{1, t_2}\dots,t_{n-1},t,0}=(-1)^{i_1+n}KA_{[i_1+n-1]}^tA_{[i_1+n-2]}^{t_{n-1}}\dots {A_{[i_1]}}.
\end{multline*}

The next result gathers <ref>.

Assume that $A_1$ and $A_2$ are invertible and suppose there exists $i_1\in\{1,2\}$ such that for every $t_2,\dots,t_{n-1}\in\N^\star$, we either have $\Sigma_{i_1;1,t_2,\dots,t_{n-1},0}=\emptyset$ or one is able to build  an invertible matrix $\mathcal{N}\in\R^{n\times n}$ whose lines are taken from (<ref>) such that

*  $\beta _0 = -(KA_{i_{[i_1+n-1]}}{\cal M}\mathcal{N}^{-1})^{\top} $ is non-negative,

*  the solution to

\begin{equation}
\beta _{t+1} = {\cal L} \beta_t,
\quad \mbox{with}\ \
{\cal L}^{\top} = \mathcal{N}{\cal M}^{-1} A_{i_{[i_1+n-1]}} {\cal M}\mathcal{N}^{-1}
\label{eqbeta}
\end{equation}

initialized with $\beta _0 = -(KA_{i_{[i_1+n-1]}}{\cal M}\mathcal{N}^{-1})^{\top} \ge 0$ remains non-negative for all future time,

where we have set

$$\mathcal{M}\defeq (-1)^{i_1+n}A_{[i_1+n-2]}^{t_{n-1}}\dots A_{[i_1+1]}^{t_2}A_{i_1}.$$

Then any solution to (<ref>) exhibits no more than $n$ switches.

Using <ref>, any solution to (<ref>) exhibits no more than $n$ switches if (<ref>) is satisfied with $t_1=1$ and .
This means checking that the intersection of $ S_{\subalign{&1,\dots,t_{n-1},t,0\\&i_1,\dots,i_{n-1},i_{n},i}}$ with the sets characterized by (<ref>) and (<ref>) is empty.
To check this emptiness condition, it is enough to exhibit $n$ sets such that, for every $t\in\N^\star$, their intersection with $S_{i_1;1,t_2,\dots,t_{n-1},t,0}$ is empty.

This is equivalent to find $n$ rows in (<ref>) such that the matrix $\mathcal{N}\in\R^{n\times{n}}$ formed by these $n$ rows is such that

\begin{equation}\label{eqNj}
\mathcal{N}x\ge0
\end{equation}

\begin{equation*}%\label{eqCns}
(-1)^{i_1+n}KA_{[i_1+n-1]}^tA_{[i_1+n-2]}^{t_{n-1}}\dots A_{[i_1]}x\le0,
\qquad\forall t \in \N^\star,
\end{equation*}

i.e., implies

\begin{equation}\label{eqCns2b}
\qquad\forall t \in \N^\star.
\end{equation}

Invoking Lemma <ref>, checking that (<ref>) implies (<ref>) reduces to check whether there exists $\beta_t\in\R_+^n$ such that

$$-KA_{[i_1+n-1]}^t\mathcal{M}=\beta_t^{\top} \mathcal{N}, \qquad\forall t \in \N^\star,$$

that is to say, with $\mathcal{N}$ invertible,

\begin{equation}\label{eqCns2pos}
\beta_t^{\top} =-KA_{[i_1+n-1]}^t\mathcal{M}\mathcal{N}^{-1}\ge0, \qquad\forall t \in \N^\star.
\end{equation}

To conclude the proof, we show that (<ref>) is equivalent to check the positivity of a solution of a discrete time dynamics.
Indeed, as the invertibility of $A_1$ and $A_2$ implies that $\mathcal{M}$ is invertible, we have

\begin{align*}
\beta_{t+1}^{\top} &= -KA_{[i_1+n-1]}^{t+1}\mathcal{M}\mathcal{N}^{-1}\\
&=\beta_t^{\top} \mathcal{N}\mathcal{M}^{-1}A_{[i_1+n-1]}\mathcal{M}\mathcal{N}^{-1}\\
\end{align*}

This theorem states that to verify the non-negativity of a single solution to the auxiliary linear discrete-time system described in (<ref>) is enough to ensure that any solution to (<ref>) switches no more than $n$ times.

This property  is different from the classical non-negativity problem where any solution to a system must remain non-negative (component-wise) for any non-negative initial condition. In this classical setting, it is well known that, for a discrete-time system to be positive, a necessary and sufficient condition is that the entries of the dynamical matrix have to be positive [19]. This does not correspond to our problem, and we will see in Section <ref> that the entries of the dynamical matrix ${\cal L}$ are not necessarily non-negative so that we cannot invoke the results from [19] in general. This means new results are needed to ensure the non-negativity of  system (<ref>) for a given initial condition: this is addressed in the next section.

§ NON-NEGATIVITY ANALYSIS

We derive in this section conditions under which the solution to (<ref>) initialized with a given $\beta_0\ge0$ is non-negative.
The results are based on a function analysis and allows deriving numerically tractable conditions.

§.§ Non-negativity theorem

The next theorem provides easy-to-test conditions to ensure the satisfaction of item (ii) of Theorem <ref>.
The result of <ref> is based on the necessary condition given in <ref>, which is given below.

Consider system (<ref>) with a given $\beta_0 \geq~0$ and assume that $\sigma(A_{[i_1+n-1]})=\{\lambda_1,\dots,\lambda_n\}$, with $\lambda_1>\dots>\lambda_n>0$.
Then $\mathcal{L}$ is diagonalizable, and we set $v_1,\dots,v_n$ the eigenvectors of $\mathcal{L}$, and $\gamma_1,\dots,\gamma_n\in\R$ such that $\beta_0=\sum_{i=1}^n\gamma_iv_i$.
Let us finally set $\rho_i = \gamma_i v_i\in\R^n$ and $\mu_i=-\ln(\lambda_i/\lambda_1)$ with $i=1, \ldots, n$ and assume that $\rho_1 \geqslant 0$.
Then, the solution $\beta _t$ is non-negative for any $t \in \N$ if for every $\ell\in\{1,\dots,n\}$, one of the conditions of <ref> is satisfied, with $z_i$ the $\ell$-th component of $\rho_i$.

According to the definition of ${\cal L}$ in (<ref>), the eigenvalues of ${\cal L}$ are also eigenvalues of $A_{[i_1+n-1]}$.
They are distinct, and the $n$ eigenvectors $v_i$ are independent.
The solution of the linear discrete-time system (<ref>) is a weighted linear combination of modal solutions:

$$\beta _t = \sum_{i=1}^{n} \gamma_i v_i \lambda _i^t.$$

To conclude the proof of this theorem, we have to find conditions on $( \rho_1,\dots, \rho_n)$ such that

\begin{equation}\label{eq:Obj0z}
\beta _t = \sum_{i=1}^{n} \gamma_i v_i \lambda _i^t =	\lambda_1^t\rho_1+\dots+\lambda_n^t\rho_n\geqslant0\qquad (t\in\N).
\end{equation}

We recall that $\rho_i\in\R^n$ and inequality (<ref>) has to be understood component-wise, i.e., $[\beta_t]_\ell\ge0$ for every $\ell\in\{1,\dots,n\}$.
According to the definition of $\mu _i$, for every $i\in\{2, \ldots ,n\}$, we have $0<\mu_2<\ldots <\mu_n$.
Hence, the problem is equivalent with finding a condition on $(\rho_1,\dots,\rho_n)\in\R^n$ such that

\begin{equation}\label{eq:Objn1}
\rho_1\ge -\sum_{i=2}^n e^{-\mu_it} \rho_i\qquad (t\in\N).
\end{equation}

Note that (<ref>) holds if we have

\begin{equation*}%\label{eq:Objn}
\rho_1\ge -\sum_{i=2}^n e^{-\mu_is} \rho_i\qquad (s\in\R_+).
\end{equation*}

We conclude the proof using <ref>

Let $n\in\N^*$, $0<\mu_2<\dots<\mu_n$ and .
If $z_1\ge0$, $z_1+\dots+z_n\ge0$ and one of the following conditions holds:

*  $z_2,\dots,z_n\ge0$;

*  $z_2,\dots,z_n\le0$;

*  there exists $j\in\{2,\dots,n\}$ such that

\begin{equation}\label{eq:casn}
z_1\ge-\sum_{\substack{i=2\\i\neq j}}^n\left( 1-\frac{\mu_i}{\mu_j} \right)z_ie^{-\mu_i s}, \quad \forall s\in\R_+.
\end{equation}

Then, the function $\varphi(s)=z_1+z_2e^{-\mu_2 s}+\dots+z_ne^{-\mu_ns}$ defined for every $s\in\R_+$ is non-negative on $\R_+$.

Observe that $\varphi(0)=z_1+\dots+z_n$ and $\lim_{s\to\infty}\varphi(s)=z_1$.
They are both non-negative in the setup of the statement.
Obviously, if <ref> is satisfied, $\varphi\ge0$ on $\R$.
If <ref> is satisfied, we have $\varphi'\ge0$ on $\R$ and $\varphi(0)=z_1+\dots+z_n\ge0$.

Without the sign constraints on $z_2,\dots,z_n$, we have either $\inf_{\R_+}\varphi=\varphi(0)=z_1+\dots+z_n$ or $\inf_{\R_+}\varphi=\lim_{s\to\infty}\varphi(s)=z_1$ or $\inf_{\R_+}\varphi=\varphi(s_0)$ for some $s_0\in\R_+^*$ such that $\varphi'(s_0)=0$.
Hence, to guarantee the nonnegativity of $\varphi$ on $\R_+$ it remains to check the positivity of $\varphi(s_0)$ in the last case.
Observe that, given $j\in\{2,\dots,n\}$, $\varphi'(s_0)=0$ is equivalent to $\mu_jz_je^{-\mu_j s_0}=\sum_{\substack{i=1\\i\neq j}}^n -\mu_iz_ie^{-\mu_i s_0}$.
Hence, we have $\varphi(s_0)=z_1+\sum_{\substack{i=2\\i\neq j}}\left( 1-\frac{\mu_i}{\mu_j} \right)z_ie^{-\mu_i s_0}$, and <ref> ensures that $\varphi(s_0)\ge0$.

<ref> allows deriving numerically tractable conditions by iteratively applying (<ref>) for any chosen value of $n$. As a title of example, consider the case $n=4$.
By iteratively applying (<ref>), one can conclude that $\beta _t \geq 0$ for all $ t$ if

\begin{equation}\label{corro4}
\begin{array}{c}
\rho_1\ge0, \quad
\rho_1+\left( 1-\frac{\mu_3}{\mu_2} \right)\rho_3+\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\ge0, \\
\mbox{and }	\rho_1+\left( 1-\frac{\mu_4}{\mu_3} \right)\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\ge0.
\end{array}
\end{equation}

To check that this is true, first iterate (<ref>) with $n=4$.
As $\left( 1-\frac{\mu_4}{\mu_3} \right)\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\ge0$ or $\left( 1-\frac{\mu_4}{\mu_3} \right)\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\le0$, this together with $\rho_1\ge0$ and $\rho_1+\left( 1-\frac{\mu_4}{\mu_3} \right)\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\ge0$ ensures

$$\rho_1\ge -\left( 1-\frac{\mu_4}{\mu_3} \right)\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4e^{-\mu_4 s}\qquad(s\in\R_+).$$

This, together with $\rho_1\ge0$ and $\rho_1+\left( 1-\frac{\mu_3}{\mu_2} \right)\rho_3+\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4\ge0$ ensures

$$\rho_1\ge-\left( 1-\frac{\mu_3}{\mu_2} \right)\rho_3e^{-\mu_3 s}-\left( 1-\frac{\mu_4}{\mu_2} \right)\rho_4e^{-\mu_4 s}\qquad (s\in\R_+).$$

Finally, this last fact, together with $\rho_1\ge0$ and $\beta _0 = \rho_1+\rho_2+\rho_3+\rho_4\ge0$ ensures

$$\rho_1\ge -\rho_2e^{-\mu_2 s}-\rho_3e^{-\mu_3 s}-\rho_4e^{-\mu_4 s}\qquad(s\in\R_+).$$

We will exploit (<ref>) for the insulin infusion example in <ref>.

§.§ Tailored results for small values of $n$

For small values of $n$ ($n\in\{2,3,4\}$), the function analysis in the proof of <ref> can be tailored to derive tighter conditions.

When $n=2$, it is easy to see that $\varphi(s)=z_1+z_2e^{-\mu_2 s}\ge0$ for every $s\in\R_+$ (with $\mu_2\ge0$) if and only if $z_1\ge0$ and $z_1+z_2\ge0$.
The next propositions provide tailored results for $n=3$ and $n=4$.

With the notation of <ref> with $n=3$, we have $\varphi(s)\ge0$ for all $s\in\R_+$ if and only if $z_1\ge0$, $z_1+z_2+z_3\ge0$ and one of the following conditions is satisfied:

* $z_2\ge0$.

* $z_2<0$, $z_3\le0$.

* $z_2<0$, $z_3>0$, $\mu_2z_2+\mu_3z_3\le0$.

* $z_2<0$, $z_3>0$, $\mu_2z_2+\mu_3z_3>0$ and

$$z_1+z_2\left( \frac{-\mu_2z_2}{\mu_3z_3} \right)^{\frac{\mu_2}{\mu_3-\mu_2}}+z_3\left( \frac{-\mu_2z_2}{\mu_3z_3} \right)^{\frac{\mu_3}{\mu_3-\mu_2}}\ge0.$$

Note that the cases where $z_2$ and $z_3$ have the same signs is treated in items <ref> and <ref> of <ref>.
Hence, it remains to prove the result when $z_2$ and $z_3$ do not have the same sign.
Recall that $\varphi'(s)=-\mu_2z_2e^{-\mu_2s}-\mu_3z_3e^{-\mu_3s}$, and $\sign \varphi'=\sign g$, with $g=-z_2-\frac{\mu_3}{\mu_2}z_3e^{-(\mu_3-\mu_2)s}$.
We also have $g'(s)=\frac{\mu_3}{\mu_2}z_3(\mu_3-\mu_2)e^{-(\mu_3-\mu_2)}$, thus $\sign g'=\sign z_3$.
When $z_2$ and $z_3$ do not have the same sign, there exists one and only one $s_0\in\R$ such that $g(s_0)=0$ (see <ref>).
We thus have the following situations.

* If $z_2>0$ and $z_3<0$, we have the situation described by <ref>.
We observe that $\varphi(s)\ge\min\{\varphi(0),z_1\}\ge0$ for every $s\in\R_+$.

* If $z_2<0$ and $z_3>0$, we have the situation described by <ref>.
We observe that $\inf_{\R_+}\varphi=\begin{cases}
\varphi(0) & \text{if } s_0\le0,\\
\varphi(s_0) & \text{otherwise.}
\end{cases}$
But $s_0$ is such that $g(s_0)=0$, i.e., $s_0=\frac{-1}{\mu_3-\mu_2}\ln\frac{-\mu_2z_2}{\mu_3z_3}$.
We have $s_0\le0$ if and only if $\mu_2z_2+\mu_3z_3\le0$, and $\varphi(s_0)=z_1+z_2\left( \frac{-\mu_2z_2}{\mu_3z_3} \right)^{\frac{\mu_2}{\mu_3-\mu_2}}+z_3\left( \frac{-\mu_2z_2}{\mu_3z_3} \right)^{\frac{\mu_3}{\mu_3-\mu_2}}$.

$z_2>0$ and $z_3<0$

$z_2<0$ and $z_3>0$

Different situations in the proof of <ref>.

With the notations used in <ref> with $n=3$, we have $\varphi(s)\ge0$ for all $s\in\R_+$ if $z_1\ge0$, $z_1+z_2+z_3+z_4\ge0$ and one of the following conditions is satisfied:

*  $z_4\le0$, $z_3\le0$.

*  $z_4\le0$, $z_3>0$, $z_2\ge0$.

*  $z_4\le0$, $z_3>0$, $z_2<0$ and

$\frac{\mu_4}{\mu_2}\left( \frac{\mu_4-\mu_2}{\mu_3-\mu_2}-1\right)e^{\frac{\mu_4-\mu_2}{\mu_4-\mu_3}\ln\left(\frac{z_3}{|z_4|}\frac{\mu_3}{\mu_4}\frac{\mu_3-\mu_2}{\mu_4-\mu_2}\right)}z_4\ge z_2$.

*  $z_4>0$, $z_3\ge0$, $z_2\ge0$.

*  $z_4>0$, $z_3<0$, $z_2\le0$ and $|z_3|\mu_3(\mu_3-\mu_2)\ge z_4\mu_4(\mu_4-\mu_2)$.

*  $z_4>0$, $z_3<0$, $z_2>0$ and

$\frac{\mu_4}{\mu_2}\left( \frac{\mu_4-\mu_2}{\mu_3-\mu_2}-1\right)e^{\frac{\mu_4-\mu_2}{\mu_4-\mu_3}\ln\left(\frac{|z_3|}{z_4}\frac{\mu_3}{\mu_4}\frac{\mu_3-\mu_2}{\mu_4-\mu_2}\right)}z_4\le z_2$. $\Box$

The proof of this proposition follows the lines of the one of <ref>.
For the sake of brevity we do not detail it here.

§ APPLICATIONS

Before applying the results to the insulin infusion example in Section <ref>, we provide in Section <ref> a second order example to illustrate the fact that the application of <ref> and <ref> is easy in $\R ^2$. It reduces to check the invertibility of a second order matrix and the non-negativity of a second order dynamics.

§.§ Second order example

Consider system (<ref>) with $n=2$, $m=2$,

\begin{equation}
\begin{array}{l}
A_1 = \left[ \begin{array}{ cc}
13 & 12.5 \\
-12.5 & -12 \end{array} \right], \quad
A_2 = \left[ \begin{array}{cc}
0.93 & 0 \\
0    & 0.95
\end{array} \right]\\
K=\left[ \begin{array}{ cc} -8.7 & -9.2 \end{array} \right],
\end{array}
\end{equation}

and $\mathcal{C}_1$ and $\mathcal{C}_2$ as in (<ref>).

The solutions associated with various initial conditions selected from the unit circle are represented in Figure <ref> as well as the corresponding number of switches they exhibit. These solutions predominantly reside within ${\cal C}_2$ and only sporadically venture into ${\cal C}_1$.

We observe on this example that $\R^2$ is partitioned in three cones, which are respectively defined by the set initial conditions that result in exactly $0$, $1$ and $2$ switches.
These cones are formed by the line $Kx=0$ and the half-line $\R_+\left[ 1 \,\, 0 \right]^\top$.
Observe also that $\left[1 \,\, 0\right]^\top\in\mathcal{C}_2$ is an eigenvector of $A_2$.

Phase portrait in red with $x_0$ on the unit circle.

Let us illustrate the theoretical results of Section <ref>. The application of
Theorem <ref> reduces to check that the following implication holds true for $x\in\R^{n}$

Kx \geq 0 \mbox{ and } KA_1x \leq 0 \quad \Longrightarrow \quad \forall t > 0, \quad KA_2^{t}A_1x \leq 0

For $t=1$, using Lemma <ref>, this is equivalent to the existence of $\alpha_1^1, \alpha_2^1 \geq 0 $ such that

-KA_2A_1 = \alpha_1^1 K - \alpha_2^1 KA_1 .

The pair ($-A_1, K$) is observable. Hence,

\begin{array}{ r@{\>}c@{\>}l}
\left[ \begin{array}{cc}  \alpha_1^1 & \alpha_2^1 \end{array} \right]
&=& -KA_2A_1 \left[ \begin{array}{cc} K \\ -KA_1 \end{array} \right] ^{-1}\\
&=& \left[ \begin{array}{cc} 0.1281 & 1.5541 \end{array} \right].
% &= &		\beta_0 %\\
%	& \geq &0
\end{array}

Now, we have to study the system

\beta _{t+1} = {\cal L} \beta _{t}, \quad \beta _0 = \left[ \begin{array}{cc} \alpha_1^1 & \alpha_2^1 \end{array} \right]^{\top} \geq 0

\mbox{with } {\cal L} = \left[ \begin{array}{cc}
0.3259  & 0.1281 \\
-2.9443 & 1.5541
%  0.0000    &0.2612 \\
%	-3.3786  &  1.8789
\end{array} \right], \quad \beta _0 = \left[ \begin{array}{c} 0.1281 \\ 1.5541 \end{array} \right].

The eigenvalues of ${\cal L}$, which are also eigenvalues of $A_2$, and the associated eigenvectors are given by
$\lambda_1 = 0.95$,
$\lambda_2 = 0.93$,
$v_1 = \left[ \begin{array}{cc} -0.2010 & -0.9796 \end{array} \right]^\top$.
$v_2 = \left[ \begin{array}{cc} -0.2074 & -0.9783 \end{array} \right]^\top$,
We have $\beta _t = \sum_{i=1}^{n} \gamma_i v_i \lambda _i^t$, with $\beta_0 = \sum_{i=1}^{n} \gamma_i v_i \geq 0$,
where $\gamma_1$ and $\gamma_2$ are given by

\left[ \begin{array}{c} \gamma_1 \\ \gamma_2 \end{array} \right]
= \left[ \begin{array}{ccc}  v_1 & v_2 \end{array} \right] ^{-1} \beta _0
= \left[ \begin{array}{c}  28.7099 \\  -30.2574  \end{array} \right].

\mbox{and } \gamma_1 v_1 =	\left[ \begin{array}{c}  6.0818 \\29.6399 \end{array} \right],
\quad
\gamma_2 v_2 =	\left[ \begin{array}{c} -5.9537 \\-28.0858 \end{array} \right],

with $\lambda_1 > \lambda_2 > 0$, we conclude from <ref> that

$$\beta _t  = \sum_{i=1}^{2} \gamma_i v_i \lambda _i^t>0, \quad \forall t\in\N.$$

As a conclusion, any solution starting in the set ${\cal C}_1$ switches not more than once. We can conclude that, for this example, any solution to the considered system switches not more than twice as some can be initialized in ${\cal C}_2$. The fact that the origin of the considered system is GES follows by Theorem <ref> as $A_1$ and $A_2$ are Schur.

For this example, it turns out that a piecewise quadratic Lyapunov function, given by (<ref>), exists.
Indeed, the LMIs conditions (<ref>) given in Appendix <ref> are feasible with
P_1 =  \left[ \begin{array}{cc}
2.5662  &  2.6008\\
2.6008  &  2.6427  \end{array} \right]$ , $
P_2 = \left[ \begin{array}{cc}
0.1744 &   0.1570\\
0.1570  &  0.1482  \end{array} \right]
$, $
Y_1 = 0.0091$, $Y_2 = 9.2206\times10^{-6}
$, $
Y_3 =  \left[ \begin{array}{cc}
0.0017   & 0.0232 \\
0.0232  &  0.0038   \end{array} \right]$, $
Y_4 =  \left[ \begin{array}{cc}
0.0043  &  0.0058 \\
0.0058 &   0.0297     \end{array} \right]

§.§ Insulin infusion problem

We consider system (<ref>) with $n=4$, $m=2$ and matrices $A$, $B$ and $K$ given by (<ref>) and (<ref>).

Without the results presented in this paper, stability analysis of this $4^{{th}}$-order example is an open question as far as we know.

Let $A_1=A+BK$ and $A_2=A$ as in Section <ref>. The eigenvalues of $A_2$ are $\lambda_1 =  0.9592$, $\lambda_2 = 0.9512$, $\lambda_3 = 0.9277$ and $\lambda_4 =0.9200$.

We next show that the conditions of Theorem <ref> hold with $i_n =2$. To this end, we use Theorem <ref>  along with conditions given in (<ref>).

We start by considering (<ref>) with $i_0 = 1$, $n = 4$ and $t_1=1$. We have to determine the values of $t_2$ and $t_3$ that satisfy the conditions of Theorem <ref>, namely for every $t_2,t_{3}\in\N^\star$, we either have  $\Sigma_{i_1;1,t_2,t_{3},0}=\emptyset$ or there exists an invertible matrix $\mathcal{N}\in\R^{4\times 4}$, whose lines are taken from (<ref>) such that items (i) and (ii) of Theorem <ref> are satisfied. By employing linear programming techniques, we have identified 58 pairs of values for $t_2$ and $t_3$, as displayed in <ref>.

$t_2$     1        3        4        5        6        7        8        9       10       11       12       13
$t_3$       1        1        1        1        1        1       1        1        1        1        1     1
$t_2$     14       15       16       17       18       19     20       21       22       23       24        1
$t_3$      1        1        1        1        1        1         1        1        1        1        1        2
$t_2$       3        4        5        6        7      8        9       10       11       12       13       14
$t_3$        2        2        2        2        2        2         2        2        2        2        2        2
$t_2$      15       16       17        1        2        3        4        5         6        7        8        9
$t_3$       2        2        2        3        3        3        3        3        3         3        3        3
$t_2$     10        1        2        3        4        1         2        3        1        2
$t_3$       3        4        4        4        4        5         5        5        6        6

Values of $t_2$ and $t_3$ in section <ref>.

For all these 58 pairs, we checked that Theorem <ref> holds, that is, we have found for each of them an invertible matrix $\mathcal{N}\in\R^{4\times 4}$ whose lines are taken from (<ref>) such that items <ref> and <ref> of Theorem <ref> are satisfied.
For item <ref>, we use Theorem <ref> and conditions (<ref>). Detailed computations for two of these pairs are provided in Appendix <ref>.   The conclusion is that any solution to the considered system exhibits no more than 4 switches. As the eigenvalues of $A_1$ and $A_2$ lie inside the unit circle, the origin is GES by Theorem <ref>.

§ CONCLUSION

This paper focuses on the stability analysis of  CLS, whose solutions all exhibit a finite number of switches.
This property is very useful when investigating stability as we showed, and somehow move the problem to analytically establish that all solutions indeed switch a finite number of times. We have first presented general, sufficient conditions in terms of sets intersections.
To illustrate how these conditions can be exploited, we have then concentrated on the case where two cones partitions the state space for which we have developed numerically tractable sufficient conditions.
Interestingly, these contributions required the development of novel results on the non-negativity of solutions to discrete-time dynamical systems for given initial conditions.
The theoretical developments have been applied successfully to the optimization-based control of a model of insulin infusion, for which all the existing stability results we are aware of failed.

It would be interesting in future work to develop similar tools to prove that solutions exhibit a finite number of switches and exploit this property for stability analysis for other classes of hybrid dynamical systems.

§.§ Sampled-data modeling for optimal insulin infusion

Let $y$ be the BGL response, $u$ the insulin input and $f=F \delta$ an impulse of food at time $t=0$.
In [7] impulses are used as a mathematical abstraction of insulin applied, and meals consumed and the optimal insulin infusion model is given by linear transfer functions as, for any $s\in\mathbb{C}$, $y(s) = T_F(s) f(s) - T_I(s) u(s)$ where

\begin{equation}\label{eq:T-I}
T_I(s) := \dfrac{K_I}{(\alpha_1s+1)(\alpha_2s+1)(\alpha_3s+1)},
\end{equation}

with $K_I = 600 \text{ (mmol/L)/(U/min)}$, $\alpha_1 = 60 \text{ min}$,  $\alpha_2 = 100 \text{ min}$, $\alpha_3 = 120 \text{ min}$, and

T_F(s) := \dfrac{K_F}{(\beta_1s+1)(\beta_2s+1)(\beta_3s+1)}

with $K_F = 50 \text{ (mmol/L)/(g/min)}$,  $\beta_1 = 70 \text{ min}$,  $\beta_2 = 110 \text{ min}$ and $\beta_3 = 125 \text{ min}$. To enhance disturbance rejection,  we add an integral action, however instead of implementing a pure integral action, we opt for a first-order filter, for any $s\in\mathbb{C}$, $\tilde{y}(s) = y(s)/(s+\tau)$ with $\tau = 0.015$.
To design the state feedback control, we use a state space model with four state variables, three of them correspond to the transfer function $T_I$ in (<ref>). It is given by
$\dot{x} = A_c x + B_c u$,  $y = C_c x$ with

A_c := \left[ \begin{array}{cccc}
-0.0350  & -0.0249 &  -0.0114   &      0 \\
0.0156  &       0     &    0   &      0\\
0  &  0.0078      &   0   &      0\\
0   &      0 &  -3.4133 &  -0.0150 \end{array} \right],

B_c :=\left[ \begin{array}{c}
2 \\
0 \\
0\end{array} \right] , \quad
C_c :=\left[ \begin{array}{cccc}
0   &      0  & -3.4133    &     0\end{array} \right].

We consider the quadratic cost

J_c(x_0,u)  := \int_0^{\infty} \Big( x^{\top}(\tau )Q_cx(\tau) + u^{\top}(\tau)R_c u(\tau) \Big) d\tau,

with $Q_c:=\diag(1,1,1,70)$ and $R_c=1$.

The design is performed using a sampled-data version, with a sampling period of $T=5$ min, that is (<ref>)

with $A =  e^{A_cT}$,  $B = e^{A_cT} B_c$, and cost $J$  as in (<ref>) with

$Q = \int_0^T (e^{A_c\nu})^{\top} Q_c e^{A_c\nu} d\nu$, $S =  \int_0^T  (e^{A_c\nu})^{\top}   Q_c e^{A_c\nu} B_c   d\nu$, $R=\int_0^T B_c^{\top} (e^{A_c\nu})^{\top}  Q_c e^{A_c\nu} B_c  d\nu +  R_c$.
This leads to the matrices in (<ref>), and $R = 17.8719$,

Q = 10^4\left[ \begin{array}{cccc}
0.0004 &   0.0000 &   0.0009 &  -0.0001 \\
0.0000  &  0.0012 &   0.0474&   -0.0036 \\
0.0009  &  0.0474  &  3.2140  & -0.2772 \\
-0.0001&   -0.0036 &  -0.2772  &  0.0325
\end{array}\right]$ and$S = \left[ \begin{array}{c}
8.4359 \\
0.1558 \\
\end{array}\right].

§.§ LMI conditions for conewise quadratic Lyapunov function (<ref>) with the same partition as (<ref>)

The next result reduces the conservatism of the conditions in [24] by taking into account the switches from one cone to another, and obviously applies to general CLS with $m=2$.

The origin of  (<ref>) is GES if there exist symmetric matrices $P_1$, $P_2$, and symmetric matrices $Y_i$, $i\in\{1,\ldots,4\}$ with non-negative entries, satisfying

\begin{equation} \label{eqLMIPWQ}
\begin{array}{l}
P_1-\left[\begin{array}{c} K \\KA_1\end{array} \right]^{\top} Y_1\left[\begin{array}{c} K \\KA_1\end{array} \right] >0\\
A_1^{\top} P_1A_1-P_1+\left[\begin{array}{c} K \\KA_1\end{array} \right]^{\top} Y_1 \left[\begin{array}{c} K \\KA_1\end{array} \right]  < 0\\
%  ~\\
P_2-\left[\begin{array}{c} K \\ KA_2 \end{array} \right] ^{\top}Y_2\left[\begin{array}{c} K \\ KA_2 \end{array} \right] >0 \\
A_2^{\top} P_2A_2-P_2+\left[\begin{array}{c} K \\ KA_2 \end{array} \right] ^{\top}  Y_2 \left[\begin{array}{c} K \\ KA_2 \end{array} \right] < 0\\
%	~\\
A_2^{\top} P_1A_2-P_2+ \left[\begin{array}{c} -K \\ KA_2 \end{array} \right] ^{\top}  Y_3 \left[\begin{array}{c} -K \\ KA_2 \end{array} \right] < 0\\
%	~\\
A_1^{\top} P_2A_1-P_1
+\left[\begin{array}{c} K \\-KA_1\end{array} \right]^{\top} Y_4 \left[\begin{array}{c} K \\-KA_1\end{array} \right] < 0.
\end{array}\hskip -1cm
\end{equation}

The proof uses  (<ref>) as a Lyapunov function candidate.
The next conditions ensure that $x\mapsto x^{\top}P_i x$, $i\in\{1,2\}$, strictly decreases along solutions to (<ref>), for $x\neq 0$,

\left\{\begin{array}{r@{\>}c@{\>}l}
x^{\top} P_1x &>& \0,  \\
x^{\top}(A_1^{\top} P_1A_1-P_1)x&<&\0,
\end{array}\right. \quad 	x \in {\cal C}_1 \mbox{ and } A_1 x\in{\cal C}_1,

\left\{\begin{array}{r@{\>}c@{\>}l}
x^{\top} P_2x &>& \0,   \\
x^{\top} (A_2^{\top} P_2A_2-P_2)x&<&\0,
\end{array}\right. \quad 	x \in {\cal C}_2 \mbox{ and } A_2 x\in{\cal C}_2,

{	x^{\top} (A_2^{\top} P_1A_2-P_2)x<\0}, \quad x\in {\cal C}_2 \mbox{ and }   A_2x  \in {\cal C}_1,

{x^{\top}(A_1^{\top} P_2A_1-P_1)x <\0}, \quad
x\in{\cal C}_1	\mbox{ and } A_1 x\in{\cal C}_2.

The desired result is obtained by using the S-procedure, which leads to the LMIs conditions in (<ref>).

§.§ Discrete-time version of the results in [32]

The aim of this appendix is to prove that global attractivity of the origin is equivalent to the origin to be GES for homogeneous discrete-time systems of degree $1$, which includes system (<ref>). We consider for this purpose the system

\begin{equation}\label{eq:sys}
x_{t+1} = f(x_t),
\end{equation}

where $x_t\in\R^{n}$ is the state at time $t\in\N$, $n\in\N^\star$, and $f:\R^{n}\to\R^{n}$ satisfies the next assumption.

Vector field $f$ in (<ref>) verifies the properties:

(i) $f$ is continuous on $\R^{n}$.

(ii) $f$ is homogeneous of degree $1$, i.e., for any $x\in\R^{n}$ and any $\lambda\in\R_+$, $f(\lambda x)=\lambda f(x)$.

We denote the solution to (<ref>) initialized at $x\in\R^{n}$ at time $t\in\N$ as $\phi(t,x)$.
The goal is to prove the next result, which is stated in [32] for continuous-time systems.
Note that the result below is invoked in [33, 34] with no proofs.

Consider system (<ref>) and suppose that Assumption <ref> holds. The following statements are equivalent.

*  $x=0$ is globally attractive, i.e., any solution $\phi$ asymptotically converges to $0$ as time grows.

*  $x=0$ is GES.

Before proving Theorem <ref>, we need to state the next lemmas.
Define for $x\in\R^n$ and $\Omega$ an open set of $\R^n$,

$$\tau(x,\Omega)=\inf\left\{ t\in\N\ \,:\,\ \phi(t,x)\in\Omega \right\},$$

with the convention that $\inf\emptyset=\infty$.
The next lemma is a discrete-time special case of <cit.>.

Consider (<ref>) and suppose the following holds.

(i) Item (i) of Assumption <ref> holds.

(ii) There exist ${\mathcal{D}}\subset\R^{n}$ compact, $\Omega\subseteq\R^{n}$ open, $\mathcal{S}$ compact with $\mathcal{S}\subset \Omega$ and

\begin{equation}\label{eq:cor-condition}
\forall x\in{\mathcal{D}},\ \exists t\in\N\text{ s.t. }\ \phi(t,x)\in \mathcal{S}.
\end{equation}

Then there exists $t_0\in\N$ such that $\tau(x,\Omega)\le t_0$ for every $x\in{\mathcal{D}}$.

Assume by contradiction that there exist $(x_m)_{m\in\N}\in{\mathcal{D}}^{\N}$ such that $\tau(x_{{m}},\Omega)\ge m$.
Since ${\mathcal{D}}$ is compact, up to an extraction, we can assume that $(x_m)_m$ converges to some $x^*\in{\mathcal{D}}$.
But according to (<ref>), there exist $t^*\in\N$ such that $\phi(t^*,x^*)\in\mathcal{S}$.
In particular, there exists $\varepsilon>0$ such that $\mathbb{B}(x^*,\varepsilon)\subset\Omega$.
But for every $m>t^*$, we have $\phi(t^*,x_m)\not\in\Omega$, hence, $|\phi(t^*,x_m)-\phi(t^*,x^*)|\ge\varepsilon$.
This leads to a contradiction with $x\mapsto\phi(t^*,x)$ continuous on $\R^n$.

The second and final lemma is stated without proof as it directly follows from the continuity assumption made on $f$.

Consider system (<ref>) and suppose that item (i) of Assumption <ref> holds.
Let $\Omega$ be a bounded set of $\R^n$ and let $t_0\in\N$.
There exist $c>0$ depending on $\Omega$ and $t_0$ such that $|\phi(t,x)|\le c$, for every $x\in\Omega$ and every $t\in\{0,\dots,t_0\}$,

We are ready to prove Theorem <ref>.

The implication (ii)$\Rightarrow$(i) directly follows from the corresponding statements. We therefore focus on proving (i)$\Rightarrow$(ii).
By homogeneity, it is enough to prove the implication for $|x|=1$.
<ref> together with item (i) of Theorem <ref> ensure the existence of $t_0\in\N$ and of $t_{x,0}\in\{0,\dots,t_0\}$ such that $\phi(t_{x,0},x)\in\mathbb{B}(0,1/2)$.

Now, for every $t\in\N$, $\phi(t_{x,0}+t,x)=\phi(t,\phi(t_{x,0},x))=|\phi(t_{x,0},x)|\phi(t,y)$ for $y\in\R^n$, such that $|y|=1$ and $|\phi(t_{x,0},x)|y=\phi(t_{x,0},x)$.
Hence, there exists $t_{y,0}\in\{0,\dots,t_0\}$ such that $|\phi(t_{y,0},y)|\le1/2$, i.e., $|\phi(t_{x,0}+t_{y,0},x)|\le1/4$.

Thus, using the homogeneity relation, and repeating the above argument, we conclude to the existence of $(t_{x,\ell})_{\ell\in\N}\in\N^{\N}$ such that $t_{x,\ell}\le t_{x,\ell+1}\le t_{x,\ell}+t_0$ and $\phi(t_{x,\ell},x)\in\mathbb{B}(0,2^{-\ell})$ for every $\ell\in\N$.
Finally, using the homogeneity, together with Lemma <ref>, we conclude to the existence of a constant $c=c\left(t_0\right)$ such that for every $\ell\in\N$ and every $t\in\{t_{x,\ell},\dots,t_{x,\ell+1}\}$, $|\phi(t,x)|\le c2^{-\ell}$.
That is to say that $|\phi(t,x)|\le c2^{-\nu_x(t)}$, where $\nu_x(t)=\card\left\{ \ell\in\N\ \,:\,\ t_{x,\ell}\le t \right\}$.
Observe that $\nu_x(t)\ge \lfloor t/t_0\rfloor\ge (t/t_0)-1$.
We conclude the proof by setting $c_1=2c$ and $c_2=\frac{\ln 2}{t_0}$.

§.§ Details for the example of Section <ref>

To illustrate how the conditions of Theorem <ref> are checked, we treat two pairs of $(t_2,t_3)$ among the 58 pairs: $(t_2,t_3)=(1,1)$ and $(t_2,t_3)=(3,2)$.

For $t_2=1$ and $t_3=1$, we have from (<ref>)[Recall <ref> is used with $t_1=1$, and recall that in (<ref>), $N_{i_1;t_1,\dots,t_{p},t}$ is defined for $0\le t<t_{p+1}$. Hence, in (<ref>), the variable $t$ is $0$ in any cases.]

\begin{align}
\nonumber
N_{1;t} & =  K ,\\
\label{eq:St:exp}%\nonumber
N_{1;t_1,t} & = -KA_{1} ,\\
\nonumber
N_{1;t_1,t_2,t} & =  KA_{2}A_{1} ,\\
\nonumber
N_{1;t_1,t_2,t_{3},0} & =  -KA_{1}A_{2}A_{1} . 	\nonumber
\end{align}

This leads to

{\cal N} =
\left[ \begin{array}{cccc}
-0.4936 &  -6.9988& -104.7360 &   1.6626 \\
0.0139 &  -3.5448 & -93.6330   & 2.0398 \\
-0.0248    &9.9744  &246.4813 &  -4.9790 \\
-0.0140  &  1.8974 &  69.7493 &  -1.8635
\end{array} \right] .

To check that the intersection (<ref>) is empty for every $t \in \N^\star$, we have to check that
$\mathcal{N}x\ge0$ implies  $-KA_{2}^t\mathcal{M}x\ge0,$ for all $t \in \N^\star$ or equivalently $-KA_{2}^t\mathcal{M}=\beta_t^{\top} \mathcal{N}$, for all $t \in \N^\star$.
We obtain

\beta_0 %&=& \left[ \begin{array}{cccc}   \alpha_1^1 & \alpha_2^1  & \alpha_3^1 & \alpha_4^1 \end{array} \right]'  \\
= \left[ \begin{array}{cccc}   0.0100   & 3.3166  &  1.0539   & 3.7582  \end{array} \right] ^{\top},

{\cal L}\  = \left[ \begin{array}{cccc}
0.0000  &   0.0000   & -0.0000  &   0.0100 \\
-77.6570 &   -0.0000  &   0.0000  &   3.3166 \\
-22.1708  &  -0.0129  &   0.0000  &   1.0539 \\
300.8926  &  22.1708 &  -77.6570  &   3.7582
\end{array} \right],

\gamma _1 v_1 = 10^5\left[ \begin{array}{c}
0.0090    \\
2.2552    \\
0.7100   \\
\end{array} \right]  , \quad \gamma _2 v_2 = 10^5\left[ \begin{array}{c}
-0.0148   \\
-3.6872    \\
-1.1608    \\
\end{array} \right],

\gamma _3 v_3 = 10^5\left[ \begin{array}{c}
0.0141    \\
3.4783    \\
1.0951   \\
\end{array} \right]  , \quad \gamma _4 v_4 = 10^5\left[ \begin{array}{c}
\end{array} \right].

As $\beta _0  = \sum_{i=1}^{4} \gamma_i v_i \lambda _i ^0 >0$, $\lambda_1 > \lambda _2>\lambda_3 > \lambda _4>0$, and conditions (<ref>) hold, we conclude using Theorem <ref> that

\beta _t  = \sum_{i=1}^{4} \gamma_i v_i \lambda _i^t>0, \quad \forall t \in \N.

Now, we consider the case $t_2=3$ and $t_3=2$.

The number of possible matrices having 4 lines that can be generated from (<ref>) is 35. We have to check if there is an invertible matrix  ${\cal N}$ that allows to conclude that the intersection (<ref>) is empty for every $t \in \N^\star$.

We found

{\cal N}=
\left[ \begin{array}{cccc}      -0.4936   &-6.9988 &-104.7360  &  1.6626\\
0.0139  & -3.5448  &-93.6330  &  2.0398\\
0.0248 &  -9.9744 &-246.4813  &  4.9790\\
-0.0210  & 11.0313  &262.8501 &  -4.9946
\end{array} \right].

As previously, we compute

\beta_0 %&=& \left[ \begin{array}{cccc}   \alpha_1^1 & \alpha_2^1  & \alpha_3^1 & \alpha_4^1 \end{array} \right]'  \\
= \left[ \begin{array}{cccc}     0.0017 &   0.0607  &  0.3860  &  2.7102 \end{array}\right]^{\top},

{\cal L}\  = \left[ \begin{array}{cccc}
1.1997  & -0.0049  &-0.00076  &  0.00166\\
210.63    &  -1.1799   &  -0.42343   &  0.0607 \\
-239.25  &     1.9792    &   1.0282    &  0.386 \\
32044   &   -286.92   &   -98.232    &   2.7102
\end{array} \right],

\gamma _1 v_1 = 10^4\left[ \begin{array}{c}
\end{array} \right]  , \quad \gamma _2 v_2 = 10^4\left[ \begin{array}{c}
-0.0201   \\
-1.7998   \\
-1.3368   \\
\end{array} \right],

\gamma _3 v_3 = 10^4\left[ \begin{array}{c}
0.0190  \\
1.7366  \\
1.1679  \\
\end{array} \right]  , \quad \gamma _4 v_4 = 10^4\left[ \begin{array}{c}
-0.0112  \\
-1.0295  \\
-0.6683    \\
\end{array} \right].

We have $\beta _0  = \sum_{i=1}^{4} \gamma_i v_i \lambda _i ^0 >0$, $\lambda_1 > \lambda _2>\lambda_3 > \lambda _4>0$, and we verified that conditions (<ref>) are satisfied. We conclude that

\beta _t  = \sum_{i=1}^{4} \gamma_i v_i \lambda _i^t>0, \quad \forall t\in\N.

The same procedure has been repeated for all the 58 possible values of $t_2$ and $t_3$ meaning that  we were able to exhibit a matrix ${\cal N}$ such that, for every  $t \in\N^\star $, the intersection  (<ref>) is empty in all these cases.

[1]
M. K. Camlibel, J. Pang, and J. Shen, “Conewise linear systems: Non‐zenoness
and observability,” SIAM Journal on Control and Optimization,
vol. 45, pp. 1769–1800, 2006.

[2]
J. Shen, L. Han, and J.-S. Pang, “Switching and stability properties of
conewise linear systems,” ESAIM: Control, Optimisation and Calculus of
Variations, vol. 16, pp. 764–793, 2010.

[3]
R. Geiselhart, R. H. Gielen, M. Lazar, and F. R. Wirth, “An alternative
converse Lyapunov theorem for discrete-time systems,” Systems &
Control Letters, vol. 70, pp. 49–59, 2014.

[4]
V. D. Blondel and J. N. Tsitsiklis, “Complexity of stability and
controllability of elementary hybrid systems,” Automatica, pp.
479–489, 1999.

[5]
M. Souaiby, A. Tanwani, and D. Henrion, “Cone-copositive Lyapunov functions
for complementarity systems: converse result and polynomial approximation,”
IEEE Transactions on Automatic Control, vol. 67, pp. 1253–1268, 2022.

[6]
Y. Wang and S. Boyd, “Fast evaluation of quadratic control-Lyapunov
policy,” IEEE Transsactions on Control Systems Technology, pp.
939–946, 2011.

[7]
G. C. Goodwin and M. M. Seron, “A performance bound for optimal insulin
infusion in individuals with type 1 diabetes ingesting a meal with slow
postprandial response,” Automatica, vol. 103, pp. 531–537, 2019.

[8]
M. Pachter, “The linear-quadratic optimal control problem with positive
controllers,” International Journal of Control, vol. 32, pp.
589–608, 1980.

[9]
W. P. M. H. Heemels, S. J. L. V. Eijndhoven, and A. A. Stoorvogel, “Linear
quadratic regulator problem with positive controls,” International
Journal of Control, vol. 70, pp. 551–578, 1998.

[10]
A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos, “The explicit linear
quadratic regulator for constrained systems,” Automatica, vol. 38,
pp. 3–20, 2002.

[11]
Y. Wang and S. Boyd, “Performance bounds and suboptimal policies for linear
stochastic control via LMIs,” Interntional Journal of Robust and
Nonlinear Control, vol. 21, pp. 1710–1728, 2011.

[12]
J. Lohéac, E. Trélat, and E. Zuazua, “Nonnegative control of
finite-dimensional linear systems,” Ann. Inst. H. Poincaré Anal. Non
Linéaire, vol. 38, pp. 301–346, 2021.

[13]
J. A. Primbs, “The analysis of optimization based controllers,”
Automatica, vol. 37, pp. 933–938, 2001.

[14]
G. Li, W. Heath, and B. Lennox, “Concise stability conditions for systems with
static nonlinear feedback expressed by a quadratic program,” IET
Control Theory & Applications, vol. 2, pp. 554–563, 2008.

[15]
N. S. Ahmad, J. Carrasco, and W. P. Heath, “A less conservative LMI condition
for stability of discrete-time systems with slope-restricted
nonlinearities,” IEEE Transactions on Automatic Control, pp.
1692–1697, 2015.

[16]
J. Park, S. Y. Lee, and P. Parkn, “A less conservative stability criterion
for discrete-time Lur'e systems with sector and slope restrictions,”
IEEE Transactions on Automatic Control, vol. 64, pp. 4391–4395, 2019.

[17]
M. Korda and C. N. Jones, “Stability and performance verification of
optimization-based controllers,” Automatica, vol. 37, pp. 34–45,

[18]
J. Shen and J.-S. Pang, “Linear complementarity systems: Zeno states,”
SIAM Journal on Control and Optimization, vol. 44, no. 3, pp.
1040–1066, 2005.

[19]
L. Farina and S. Rinaldi, Positive Linear Systems: Theory and
Applications.1em plus 0.5em minus 0.4emWiley-Interscience, New
York, USA, 2000.

[20]
B. Brogliato and A. Tanwani, “Dynamical systems coupled with monotone
set-valued operators: Formalisms, applications, well-posedness, and
stability,” SIAM Review, vol. 62, no. 1, pp. 3–129, 2020.

[21]
R. Postoyan, L. Buşoniu, D. Nešić, and J. Daafouz, “Stability
analysis of discrete-time infinite-horizon optimal control with discounted
cost,” IEEE Trans. on Automatic Control, vol. 62, no. 6, pp.
2736–2749, 2017.

[22]
G. Grimm, M. Messina, S. Tuna, and A. Teel, “Model predictive control: for
want of a local control Lyapunov function, all is not lost,” IEEE
Transactions on Automatic Control, vol. 50, no. 5, pp. 546–558, 2005.

[23]
M. K. Camlibel, J. S. Pang, and J. Shen, “Lyapunov stability of
complementarity and extended systems,” SIAM Journal on Optimiation,
vol. 17, pp. 1056–1101, 2007.

[24]
G. Feng, “Stability analysis of piecewise discrete-time linear systems,”
IEEE Transactions on Automatic Control, vol. 47, pp. 1108–1112, 2002.

[25]
T. Sanchez, D. Efimov, and A. Polyakov, “Discrete-time homogeneity: Robustness
and approximation,” Automatica, vol. 122, p. 109275, 2020.

[26]
E. Ryan, “Universal stabilization of a class of nonlinear systems with
homogeneous vector fields,” Systems & Control Letters, vol. 26,
no. 3, pp. 177–184, 1995.

[27]
S. Tuna and A. Teel, “Discrete-time homogeneous Lyapunov functions for
homogeneous difference inclusions,” in IEEE Conference on Decision
and Control, vol. 2.1em plus 0.5em minus 0.4emIEEE, 2004, pp.

[28]
R. Goebel, R. Sanfelice, and A. Teel, Hybrid Dynamical Systems.1em plus 0.5em minus 0.4emPrinceton University Press, Princeton,
U.S.A., 2012.

[29]
E. Helly, “Über mengen konvexer körper mit gemeinschaftlichen
punkten,” Jahresbericht der Deutschen Mathematiker-Vereinigung,,
vol. 32, pp. 175–176, 1923.

[30]
M. de Lara and J. B. Hiriart-Urruty, “A fresh geometrical look at the general
S-procedure,” Optimization Letters, pp. 1129–1135, 2021.

[31]
D. Bertsimas and J. N. Tsitsiklis, Introduction to Linear
Optimization.1em plus 0.5em minus 0.4emAthena Scientific,

[32]
D. Angeli, “A note on stability of arbitrarily switched homogeneous systems,”
Nonlinear Control Abstracts: NCA 13-2-990701, 1999.

[33]
Z. Sun, “A note on marginal stability of switched systems,” IEEE
Transactions on Automatic Control, vol. 53, no. 2, pp. 625–631, 2008.

[34]
H. Alonso and P. Rocha, “A general stability test for switched positive
systems based on a multidimensional system analysis,” IEEE
Transactions on Automatic Control, vol. 55, no. 11, pp. 2660–2664, 2010.

[35]
E. Sontag and Y. Wang, “New characterizations of input-to-state stability,”
IEEE Transactions on Automatic Control, vol. 41, no. 9, pp.
1283–1294, 1996.

[]Jamal Daafouz
is a Full Professor at University de Lorraine, France, and researcher at CRAN, CNRS. He received a Ph.D. in Control from INSA Toulouse, in 1997 and the "Habilitation à Diriger des Recherches" in 2005. His research interests include switched systems and networked systems with a particular interest for convex based optimisation methods. In 2010, he was appointed as a junior member of the Institut Universitaire de France (IUF). He served as an associate editor of: Automatica, IEEE Trans. on Aut. Control, European J. of Control and Non linear Analysis and Hybrid Systems. He is senior editor of IEEE Control Systems Letters.

[]Jérôme Lohéac was born in 1985.
In 2012, he defended his Ph.D.
in Applied Mathematics at University of Lorraine, France, under the direction of M. Tucsnak and J.-F. Scheid.
Then, he was post-doc at BCAM, Bilbao (Spain), under the supervision of E. Zuazua.
He gets the position of junior researcher at CNRS, France in 2014 and moved to IRCCyN, Nantes.
Since 2017, he is researcher at CRAN, Nancy.
His research interests are control and optimal control theory in finite and infinite dimension.

[]Irinel-Constantin Morărescu is currently Full Professor at Université de Lorraine and researcher at CRAN, CNRS in Nancy, France. He received the Ph.D. degree in Mathematics and in Technology of Information and Systems from University of Bucharest and University of Technology of Compiegne, respectively in 2006. He received the “Habilitation à Diriger des Recherches” from the Université de Lorraine in 2016. His works concern stability and control of time-delay systems, stability and tracking for different classes of hybrid systems, consensus and synchronization problems. He is in the editorial board of Nonlinear Analysis: Hybrid Systems, IEEE Control Systems Letters, and member of the IFAC Technical Committee on Networked Systems.

[]Romain Postoyan received the “Ingénieur” degree in Electrical and Control Engineering from ENSEEIHT (France) in 2005. He obtained the M.Sc. by Research in Control Theory & Application from Coventry University (United Kingdom) in 2006 and the Ph.D. in Control Theory from Université Paris-Sud (France) in 2009. In 2010, he was a research assistant at the University of Melbourne. Since 2011, he is a CNRS researcher at CRAN, Nancy (France). He received the `Habilitation à Diriger des Recherches (HDR)” from Université de Lorraine in 2019. He serves/served as an associate editor for the journals: IEEE Transactions on Automatic Control, Automatica, IEEE Control Systems Letters and IMA Journal of Math. Control and Information.

0pt plus -1fill