Integration of Prior Knowledge into Direct Learning for Safe Control of Linear Systems

Extracted source text · arXiv 2502.04195

\documentclass[10pt,shortpaper,twoside,web] {ieeecolor}


\usepackage{generic}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{psfrag} 
\usepackage{cuted}
\usepackage{float}
\usepackage{graphicx} 
\usepackage{amsmath}  
\usepackage[fancythm,fancybb,morse,ieee]{jphmacros2e} 
%\usepackage{flushend}
\usepackage{array}
\usepackage{bbm}
\usepackage{mathrsfs}
\usepackage{epstopdf}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[fancythm,fancybb,morse,ieee]{jphmacros2e}
%\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\pagestyle{empty}

\usepackage{multirow}
\usepackage{csquotes}
\usepackage{url}
\newtheorem{thm}{Theorem}
\newtheorem{lem}{Lemma}
\newtheorem{prop}{Proposition}
\newtheorem{cor}{Corollary}
\newtheorem{defn}{Definition}
\newtheorem{conj}{Conjecture}
\newtheorem{exmp}{Example}
\newtheorem{rem}{Remark}
\newtheorem{pf}{Proof}
\newtheorem{cond}{Condition}
\newtheorem{assm}{Assumption}


\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
		T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\markboth{\journalname, }
{Author \MakeLowercase{\textit{et al.}}: Integration of Prior Knowledge into Direct Learning for Safe Control of Linear Systems}
\begin{document}
	\title{Integration of Prior Knowledge into Direct Learning for Safe Control of Linear Systems}
	\author{Amir Modares, Bahare Kiumarsi, and Hamidreza Modares
		\thanks{ }
		\thanks{A. Modares is with Sharif University, Tehran, Iran (e-mail: amir.modares.81@gmail.com). B. Kiumarsi and H. Modares are with Michigan State University, USA (emails: kiumarsi@msu.edu; modaresh@msu.edu) }}
	
\maketitle
\thispagestyle{empty} 
\begin{abstract} 
This paper integrates prior knowledge into direct learning of safe controllers for linear uncertain systems under disturbances. To this end, we characterize the set of all closed-loop systems that can be explained by available prior knowledge of the system model and the disturbances. We leverage matrix zonotopes for data-based characterization of closed-loop systems and show that the explainability of closed-loop systems by prior knowledge can be formalized by adding an equality conformity constraint to the matrix zonotope. We then leverage the resulting constrained matrix zonotope and design safe controllers that conform with both data and prior knowledge. This is achieved by ensuring the inclusion of a constrained zonotope of all possible next states in a $\lambda$-scaled level set of the safe set. We consider both polytope and zonotope safe sets and provide set inclusion conditions using linear programming. 
% We show that leveraging closed-loop or direct learning requires less data than its open-loop or indirect learning counterpart, while integrating it with prior knowledge reduces conservatism.  
%The prior knowledge on the system model can be further refined by open-loop learning or system identification.
\end{abstract}
\begin{IEEEkeywords}
Safe Control, Data-driven Control, Prior Knowledge, Zonotope, Closed-loop Learning.
\end{IEEEkeywords}

\IEEEpeerreviewmaketitle



\section{Introduction}



\IEEEPARstart{D}ata-driven control design is categorized into direct data-driven control and indirect data-driven control \cite{Data1}-\cite{DI1}. The former parameterizes the controller and directly learns its parameters to satisfy control specifications. The latter learns a set of system models that explain the data and then designs a robust controller accordingly. 

A recent popular direct data-driven approach \textit{characterizes the set of all closed-loop systems} using data \cite{Data2}-\cite{Data6}. This approach has the potential to avoid the suboptimality of indirect learning \cite{Data4}. Besides, direct learning can achieve a lower sample complexity than indirect learning \cite{Data5}. However, despite advantages of direct learning, it is challenging to incorporate available prior knowledge into its learning framework.  Leveraging prior knowledge of the system model can significantly improve the performance of direct learning and reduce its conservatism. This occurs by removing the set of closed-loop systems that cannot be explained by prior knowledge. Despite its vital importance, the integration of direct learning and indirect learning is surprisingly unsettled.  


In contrast to direct learning, indirect learning using system identification can incorporate prior knowledge to refine the set of learned system models. For instance, set-membership identification \cite{ID1}-\cite{ID2} can incorporate prior knowledge to learning the system models. Zonotope-based system modeling and its integration with prior knowledge have also been recently presented in \cite{ID21}-\cite{ID5}. 
% To bring both of the best worlds, indirect learning (i.e., open-loop learning to refine the prior knowledge) and direct learning (i.e., closed-loop learning) are brought together in this paper. 


% To bring  the best of both worlds, 
This paper integrates closed-loop learning (i.e., direct learning) with prior knowledge (i.e., system model knowledge obtained from system identification and/or prior physical information) for linear discrete-time systems under disturbances. To this end, we characterize the set of all closed-loop systems that can be explained by the prior knowledge available in terms of the system model parameters and the disturbance bounds. To incorporate this prior knowledge into closed-loop learning, we first represent a matrix zonotope for closed-loop systems conformed with data. We then provide equality conformity constraints under which the explainability of closed-loop system models by prior knowledge can be formalized. We then leverage the resulting constraint matrix zonotope presentation of closed-loop systems to characterize the set of all possible next states by a constrained zonotope. This characterization is then leveraged to ensure the inclusion of the constrained zonotope of all possible next states in a $\lambda$-scaled level set of the safe set (i.e., to ensure $\lambda$-contractivity). The set inclusion conditions are provided for cases where the safe set is characterized by a convex polytope and by a constrained zonotope. \vspace{6pt}  
% A simulation example is provided to verify the superiority of our proposed approach to both direct learning and indirect learning approaches. \vspace{6pt}



% Data-based control has recently gained tremendous attention \cite{Data1}-\cite{Data4} due to their potential to deal with system uncertainties, which are inevitable in real-world control systems. Data-driven safe control design methods can be categorized into direct (i.e., model-free) and indirect (i.e., model-based) learning approaches. The former approach bypasses system identification and leverages the collected data to directly learn a controller by imposing safety constraints. The latter uses the collected data to identify a system model first and then leverages the system model to impose safety constraints. Data-driven safety filters and controllers \cite{Data5}-\cite{Data7}, and data-driven MPC \cite{MPCd1}-\cite{MPCd2}) have also been presented to relax the requirement of the system dynamics. In addition to the computational complexity, the sample complexity (i.e., the number of data required to achieve a control task) is an important trait to account for when designing data-based safe controllers. These methods are typically indirect learning approaches in that either a model is learned, or the behavior theory \cite{PE1} is used to predict the future outcome of the system over a horizon. However, a strong data richness condition must be satisfied to learn a system model or to satisfy the persistence of excitation (PE) condition required in behavior theory. However, the system cannot commit to making safe decisions only after a rich data set is collected, and reducing data richness requirements is of vital importance to the success of next-generation autonomous systems.

%As shown in \cite{safeDTconvex}, for DT systems, unless the system is linear and the constraints are also affine, for which it leads to a quadratically constrained quadratic programming (QCQP), the CBF-based approach leads to a non-convex optimization. 
% \indent Direct data-driven control has recently been considered for control systems for DT systems \cite{Data4}-\cite{Data6}. However, existing results for direct data-driven safe control design of DT systems are mainly limited to linear systems. Recently, data-driven stabilizing controllers have been designed in \cite{Data4} for nonlinear DT systems. In one direction, for nonlinear systems in the form of $x(t+1)=AZ(x(t))+Bu(t)$, a nonlinear controller in the form of $u(t)=KZ(x(t))$ is learned to stabilize the closed-loop system. 
% This setup assumes that a library of functions is known and capable of describing the dynamics of the system  (i.e., $Z(x)$ is known), which can be obtained by physical laws governing the system dynamics. Letting $Z(x)=[x^T, \, S(x)^T]^T$, the controller is then decomposed into $u(t)=K_1 x(t)+K_2 S(x(t))$, where $K_1$ is learned to locally stabilize the closed-loop system, while $K_2$ is designed to cancel/minimize the nonlinear terms. These results are limited to local stabilization. 

% In this paper, we show that using this data-based approach based on nonlinearity minimization leads to computational intractability for safe control design of nonlinear systems with polyhedral safe sets. Therefore, it is not straightforward to use this approach to learn a nonlinear safe controller.  


% In this paper, we present a computationally tractable data-based direct safe nonlinear controller for nonlinear DT systems with parametric uncertainties and additive disturbances. Building on \cite{Data4}, we first present a data-based characterization of the closed-loop nonlinear system composed of a linear term and a nonlinear term. In a slightly different proof than of \cite{Data4}, we show that the data requirement for learning a closed-loop system that is used to impose safety is less than its model-based counterpart. We then show that using the data-based nonlinearity minimization approach of \cite{Data4} leads to computational intractability for safe control design of nonlinear systems with polyhedral safe sets. The computational intractability comes from two sources: 1) a non-convex optimization that must be solved online, and 2) the characterization of the lumped uncertainty caused by the closed-loop representation and the additive disturbances. We propose a novel approach that accounts for nonlinearities, rather than treating them as disturbances. This approach requires solving a linear programming optimization and allows a computationally-tractable characterization of lumped uncertainties, which is considerably less conservative. The control gains are then learned to impose safety and reduce the control-dependent uncertainties. Simulation examples are provided to verify the theoretical results. \vspace{6pt}

\noindent \textbf{Notations and Definitions.} Throughout the paper, $\mathbb{R}^n$ denotes vectors of real numbers with $n$ elements, $\mathbb{R}^{n \times m}$ denotes a matrix of real numbers with $n$ rows and $m$ columns. Moreover, $Q \ge  0$ denotes that $Q$ is a non-negative matrix with all elements being positive real numbers. The symbol $I$ denotes the identity matrix of the appropriate dimension.  The symbol $\bar{\textbf{1}}$ represents the column vector of values of one.
% $diag(a_1,...,a_n)$ is a diagonal matrix with main elements being $a_1$, ..., $a_n$. 
For a vector $x=[x_1,...,x_n]$, the notation  $\|x\|=\max \{x_1,...,x_n\}$ is used as the infinity norm, and $x_i$ denotes its $i$-th element. The unit hypercube in $\mathbb{R}^n$ is denoted by $B_{\infty}$. For a matrix $X$, $X_i$ denotes its $i$-th row, and $\|X\|$ denotes its infinity norm.
For sets $Z,W \in \mathbb{R}^n$, their Minkowski sum is $Z \oplus W= \{z + w |z \in Z,w \in W \}$. For a matrix $G=[G_1,...,G_s] \in \mathbb{R}^{n \times ms}$ with $G_i \in \mathbb{R}^{n \times m}$, \, $i=1,...,s$, and a matrix $N \in \mathbb{R}^{m \times p}$, we define $G \circ N=[G_1 N,...,G_s N] \in \mathbb{R}^{n \times ps}$, and $Vec(G)=[Vec(G_{1}),...,Vec(G_{s})]$, with ${Vec}(G_i)$ as an operator that transforms the matrix $G_i$ into a column vector by vertically stacking the columns of the matrix. 
 \vspace{3pt}
% \noindent \textbf{Definition 1.} \cite{SetB} A convex and compact set that includes the origin as its interior point is called C-set. \vspace{6pt}

\begin{defn}
 \textbf{(Convex Polytope)}  Given a matrix $H \in \mathbb{R}^{q \times n}$ and a vector $h \in \mathbb{R}^q$, a convex polytope $\cal{P}(H,h)$ is represented by \vspace{-10pt}
\begin{align} 
\cal{P} (H,h) = \{ x \in {\mathbb{R}^n}:H x  \le h\}.
\end{align}
\end{defn} \vspace{6pt}

\begin{defn} \textbf{(Zonotope)} \cite{ID3}
 Given a generator matrix $G \in \mathbb{R}^{n \times s}$ and a center $c \in \mathbb{R}^n$, a zonotope $\cal{Z}=\big<G,c\big>$  of dimension $n$ with $s$ generators is represented by \vspace{-3pt}
\begin{align} 
& \cal{Z}=\big<G,c\big> \\ \nonumber & \quad = \big\{x \in \mathbb{R}^n:x=G \, \zeta +c, \, \big\Vert \zeta  \big\Vert_{\infty} \leq 1, \zeta \in \mathbb{R}^s \big\}.
\end{align}
% The tuple $\big<G,c\big>$ is called the generator-representation (or G-Rep) of $\cal{Z}$.
\end{defn} \vspace{6pt}

% \begin{defn} \textbf{(Constrained zonotope)}
% Given a generator matrix $G \in \mathbb{R}^{n \times s}$ and a center $c \in \mathbb{R}^n$, a constrained zonotope $\cal{C}=\big<G,c,L,b\big>$ of dimension $n$  with $s$ generators is represented by \vspace{-3pt}
% \begin{align} \label{elip}
% & \cal{C}=\big<G,c,L,b\big>  \\ \nonumber & \quad  =\big\{x \in \mathbb{R}^n: x=G \, \zeta +c, \, \big\Vert \zeta \big\Vert_{\infty} \leq 1, \,\,\, L \zeta =b \big\}.
% \end{align}
% where $L \in \mathbb{R}^{n_c \times s}$ and $b \in \mathbb{R}^{n_c}$ are, respectively, a constraint matrix and a constant vector. The tuple $\big<G,c,L,b\big>$ is called the constrained generator-representation (or CG-Rep) of $\cal{Z}_c$. \vspace{6pt}
% \end{defn} 

\begin{defn} \textbf{(Constrained zonotope)} \label{defcz}
Given a generator matrix $G \in \mathbb{R}^{n \times s}$ and a center $c \in \mathbb{R}^n$, a constrained zonotope $\cal{C}=\big<G,c,A_c,b_c\big>$ of dimension $n$  with $s$ generators is represented by \vspace{-3pt}
% \begin{align} \label{elip}
% & \cal{C}=\big<G,c,A_C,B_C\big>  \\ \nonumber & \quad  =\big\{x \in \mathbb{R}^n: x=G \, \zeta +c, \, \big\Vert \zeta \big\Vert_{\infty} \leq 1, \,\,\, \sum\limits_{i=1}^{s} {A_C}_i \zeta_i=B_C \big\}.
% \end{align}
% where $A_C=[{A_C}_1,...,{A_C}_s]$ with ${A_C}_i \in \mathbb{R}^{n_c \times p_c} \,\, $, $i=1,...,s$, and $B_C \in \mathbb{R}^{n_c \times p_c}$. The tuple $\big<G,c,A_C,B_C\big>$ is called the constrained generator-representation (or CG-Rep) of $ \cal{C}$. 
% \end{defn} \vspace{6pt}
\begin{align} 
& \cal{C}=\big<G,c,A_c,b_c\big>  \\ \nonumber & \quad  =\big\{x \in \mathbb{R}^n: x=G \, \zeta +c, \, \big\Vert \zeta \big\Vert_{\infty} \leq 1, \,\,\,  {A_c} \zeta=b_c \big\},
\end{align}
where ${A_C} \in \mathbb{R}^{n_c \times s}$, and $b_C \in \mathbb{R}^{n_c}$. 
% The tuple $\big<G,c,A_c,b_c\big>$ is called the constrained generator-representation (or CG-Rep) of $ \cal{C}$. 
\end{defn} \vspace{6pt}
% \begin{rem}
%  For the equality constraint in a standard constraint zonotope, as defined in \cite{ID3}, ${A_C}_i, \, i=1,...,s$ and $B_C$ are vectors rather than matrices. That is, the standard constraint zonotope is a special case of Definition \ref{defcz} with $p_c=1$. 
% \end{rem} \vspace{6pt}



\begin{defn} \textbf{(Matrix zonotope)} \cite{ID3}
Given a generator matrix $G \in \mathbb{R}^{n \times ps}$ and a center $C \in \mathbb{R}^{n \times p}$, a matrix zonotope $\cal{M}=\big<G,C\big>$ of dimension $(n,p)$  with $s$ generators is represented by \vspace{-3pt}
\begin{align}
& \cal{M}=\big<G,C\big> \\ \nonumber & \quad \,\, = \big\{X \in \mathbb{R}^{n \times p}:X=\sum\limits_{i=1}^{s} G_i \, \zeta_i +C, \big\Vert \zeta  \big\Vert_{\infty} \leq 1  \big\},
\end{align}
where $G=[G_1,...,G_s]$ and $G_i \in \mathbb{R}^{n \times p}, \,\, i=1,...,s$. 
% The tuple $\big<G,C\big>$ is called the matrix generator-representation (or MG-Rep) of $\cal{M}$.
\end{defn}  \vspace{6pt}

\begin{defn} \textbf{($T$-concatenation of zonotopes)} \cite{ID3}
The concatenation of two zonotopes $\cal{Z}_A$ and $\cal{Z}_B$ is a matrix zonotope $\cal{M}_{AB}$ formed by the horizontal stacking of the two zonopotes. That is, $\cal{M}_{AB}=\big \{[x_A \,\, x_B]: x_A \in \cal{Z}_A, \, x_B \in \cal{Z}_B \big \}$. From this definition, the $T$-concatenation of a zonotope $\cal{Z}_A$ is its concatenation of $\cal{Z}_A$ with itself $T$ times. That is, $\cal{M}_{A^T}=\big \{[x_A^1,..., x_A^T]: x_A^i \in \cal{Z}_A, i=1,..,T \big \}$.
\end{defn}  \vspace{6pt}


\begin{defn} \textbf{(Constrained Matrix zonotope)} \cite{ID3}
Given a generator matrix $G \in \mathbb{R}^{n \times ps}$, a center $C \in \mathbb{R}^{n \times p}$, a constrained matrix zonotope $\cal{K}=\big<G,C,A_C,B_C\big>$ of dimension $(n,p)$  with $s$ generators is represented by \vspace{-3pt}
\begin{align} 
& \cal{K}=\big<G,C,A_C,B_C\big> \\ \nonumber & \quad \,\, = \Big\{X \in \mathbb{R}^{n \times p}:X=\sum\limits_{i=1}^{s} G_i \, \zeta_i +C, \\ \nonumber & \quad \quad \quad \sum\limits_{i=1}^{s} {A_C}_i \zeta_i=B_C, \,\, \big\Vert \zeta  \big\Vert_{\infty} \leq 1  \Big\},
\end{align}
where $G=[G_1,...,G_s], A_C=[{A_C}_1,...,{A_C}_s]$ and $G_i \in \mathbb{R}^{n \times p}, \, {A_C}_i \in \mathbb{R}^{n_c \times p_c} \,\, $, $i=1,...,s$,  
and  $B_C \in \mathbb{R}^{n_c \times p_c}$. 
% The tuple $\big<G,C,A_C,B_C\big>$ is called the constrained matrix generator-representation (or CMG-Rep) of $\cal{K}$.
\end{defn}  \vspace{6pt}

% zonotopes are special polytopes (i.e., symmetric polytopes), and are widely used in control systems due to their compact representation. The symmetry of zonotopes, similar to that of ellipsoids, however, implies that they cannot accurately represent sets that are strongly centrally asymmetric, which are readily generated by a constrained zonotope. Indeed, a constrained zonotope can be equivalently represented by a convex polytope. Working with convex polytopes is very costly and numerically unstable for a large number of states or a number of halfspaces. Constrained zonotopes provide a new set representation that combines the flexibility of convex polytopes with the efficiency and scalability of zonotopes, with regard to several key set operations. \vspace{6pt}

\begin{lem} \label{twoZen} \cite{setcont2}
   For two constrained zonotope $\cal{C}_i=\big<G_i,c_i,A_i,b_i \big>, \, i=1,2$, their Minkowski sum becomes 
   \begin{align} \label{minsum}
       Z \oplus W=\Big<[G_1 \quad G_2],c_1+c_2,\begin{bmatrix}
    A_1 & 0 \\
    0 & A_2
\end{bmatrix},\begin{bmatrix}
    b_1  \\
    b_2
\end{bmatrix} \Big>.
   \end{align}
\end{lem}  \hfill   $\blacksquare$  \vspace{6pt}

\begin{lem} \cite{inclusion} \label{inclusion}
    Consider two constrained zonotopes $\cal{C}_i=\big<G_i,c_i,A_i,b_i \big>$ with $c_i \in \mathbb{R}^{n_i}$, $G_i \in \mathbb{R}^{n_i \times s_i}$, $A_i \in \mathbb{R}^{q_i \times s_i}$ and $b_i \in \mathbb{R}^{q_i}$, $i=1,2$. Then, set inclusion $\cal{C}_1 \subseteq \cal{C}_2$ hold if
    \begin{align} 
        \exists \Gamma \in \mathbb{R}^{s_2 \times s_1}, L \in \mathbb{R}^{s_2}, P \in \mathbb{R}^{q_2 \times q_1}
    \end{align}
such that  \vspace{-12pt}
    \begin{align}
      &  c_2-c_1=G_2 L, \quad G_1=G_2 \Gamma, \nonumber \\ 
      & P A_1=A_2 \Gamma, \quad Pb_1=b_2+A_2 L, \nonumber \\ 
      & |\Gamma|\bar{\textbf{1}}+|L| \le \bar{\textbf{1}}. 
    \end{align}
\end{lem}  \hfill   $\blacksquare$ 

\begin{lem} \label{intmz}
    Consider two constrained matrix zonotopes $\cal{M}^l=\big<G^l,C^l,A^l,B^l \big>$, $G^l \in \mathbb{R}^{n_l \times p_l s_l}$, $C^l \in \mathbb{R}^{n_l \times p_l}$, $A^l \in \mathbb{R}^{n_{ci}  \times p_{cl} s_l}$, and $B^l \in \mathbb{R}^{n_{cl}  \times p_{cl} }$, $l=1,2$. Let $p_{cl}=p_l, \,\, l=1,2$. Then, 
    \begin{align}
        \cal{M}^1 \bigcap \cal{M}^2=\Big< [G^1 \quad 0],C^1,\begin{bmatrix}
            A^1 & 0 \\
            0 & A^2 \\
            G^1 & - G^2
        \end{bmatrix}, \begin{bmatrix}
            B^1 \\
            B^2 \\
            C^2-C^1
        \end{bmatrix}.
    \end{align}
\end{lem}
\noindent \textit{Proof.} The proof is similar to the proof of  \cite{Czen}, which is provided for generalized constrained zonotopes. \hfill   $\blacksquare$ 


\vspace{-6pt}

\section{Problem Formulation}
% This section presents the problem formulation and a set-based representation of closed-loop systems using data. \vspace{-7pt}
Consider the discrete-time system with dynamics 
\begin{equation}\label{system} 
x(t+1) = {A}^{*}x(t) + B^{*} u(t) + w(t),
\end{equation}
where $x(t) \in \cal{S}_s \subset \mathbb{R}^n$ is the system's state, $u(t) \in \mathbb{R}^m$ is the control input, and $w(t) \in  \cal{Z}_w \subset \mathbb{R}^n$ is the additive disturbance. 

The following assumptions are made for the system \eqref{system}. \vspace{3pt}


\begin{assumption}
 $\theta^{*}=[A^{*} \quad B^{*}]$ is uncertain and is only known to belong to a constrained matrix zonotope. That is, $\theta^* \in \cal{M}_{prior}=\big <G_{\theta},C_{\theta},A_{\theta},B_{\theta} \big>$ for some $C_{\theta} \in \mathbb{R}^{n \times (n+m)}$ and $G_{\theta} \in \mathbb{R}^{n \times (n+m)s_{\theta}}$, $A_{\theta} \in \mathbb{R}^{n_{\theta} \times T s_{\theta}}$ and $B_{\theta} \in \mathbb{R}^{n_{\theta} \times T}$. 

% of dimension $(n,n+m)$ with $s_{\theta}$ generators. 
% \begin{align}
% \Theta {_{physics}} := \big\{H_{\theta} \, \theta+h_{\theta}: \big\Vert \theta  \big\Vert \leq 1 \big\}, \,\,\,\, \theta^* \in \Theta {_{physics}} 
% \end{align}
\end{assumption}

% The prior knowledge on the system model can be obtained based on the physical insight we have on the system and can be refined using open-loop system identification, as explained later and in Remark 1. 
\vspace{3pt}
 
 
\begin{assumption}
    The pair $(A,B)$ is controllable.  
\end{assumption} \vspace{3pt}

\begin{assumption} \label{dist}
   The disturbance set $\cal{Z}_w$ is a constrained zonotope of order $n$ with $s_{w}$ generators. That is, $\cal{Z}_w=\big<G_h,c_h,A_h,b_h\big>$ for some $G_h \in \mathbb{R}^{n \times s_{w}}$, $c_h \in  \mathbb{R}^{n}$, $A_h \in \mathbb{R}^{n_w \times s_w}$, and $b_h \in \mathbb{R}^{n_w}$.
\end{assumption} \vspace{3pt}

% \begin{assumption}
%   The system's safe set $\cal{S}_s$ is a convex polytope given by 
%       $\cal{S}_s=\cal{P}(H_s,h_s)$ for some matrix $H_s \in \mathbb{R}^{q \times n}$ and vector $H_s \in \mathbb{R}^{q}$.
% \end{assumption} \vspace{3pt}
\begin{assumption}
  The system's safe set $\cal{S}_s$ is given by either 1) a constrained zonotope
      $\cal{C}_x=\big<G_x,c_x,A_x,b_x \big>$ for some  $c_x \in \mathbb{R}^{n}$, $G_x \in \mathbb{R}^{n \times s_x}$, $A_x \in \mathbb{R}^{q \times s_x}$, and $b_x \in \mathbb{R}^{q}$, or 2) by its equivalent convex polytope $\cal{P}(H_s,h_s)$ for some matrix $H_s \in \mathbb{R}^{q \times n}$ and vector $h_s \in \mathbb{R}^{q}$.  
\end{assumption} \vspace{3pt}

% Using prior knowledge of the system mode (Assumption 1) and disturbance (Assumption 3), one can design robust controllers. These controllers, however, are conservative.
% Besides prior knowledge, it is highly desired to leverage collected data to improve control performance. 
To collect data for learning, a sequence of control inputs, given as follows, is typically applied to the system \eqref{system}
\begin{align} \label{data-u}
U_0 := \begin{bmatrix} u(0) & u(1) & \cdots & u(T-1) \end{bmatrix} \in \mathbb{R}^{m \times T}.
\end{align}
We then arrange the collected $T+1$ samples of the state vectors as \vspace{-9pt}
\begin{align} \label{data-x1}
X := \begin{bmatrix} x(0) & x(1) & \cdots & x(T) \end{bmatrix} \in \mathbb{R}^{n \times (T+1)}.
\end{align}

These collected state samples are then organized as follows 
\begin{align} \label{data-x}
X_0 &:= \begin{bmatrix} x(0) & x(1) & \cdots & x(T-1) \end{bmatrix} \in \mathbb{R}^{n \times T}, \\
X_1 &:= \begin{bmatrix} x(1) & x(2) & \cdots & x(T) \end{bmatrix} \in \mathbb{R}^{n \times T}.  \label{data-z}
\end{align}

Additionally, the sequence of unknown and unmeasurable disturbances is represented as
\begin{equation}\label{data}
W_0 :=  \begin{bmatrix} w(0) & w(1) & \ldots & w(T-1) \end{bmatrix} \in \mathbb{R}^{n \times T},
\end{equation}
which is not available for the control design. We also define
\begin{align} \label{D}
  D_0:= \begin{bmatrix}
X_0 \\ U_0
\end{bmatrix}.
\end{align}
\vspace{-3pt}

\begin{assumption}\label{assumption_5}
The data matrix $X_0$ has full row rank, and the number of samples satisfies $T \geq n+1$.
\end{assumption} \vspace{6pt}

We are now ready to formalize the data-based safe control design problem. The following definition is required. \vspace{6pt}


\begin{defn}
\textbf{Robust Invariant Set (RIS)} \cite{SetB} The set $\cal{P}$ is a RIS for the system \eqref{system} if $x(0) \in \cal{P}$ implies that $x(t) \in \cal{P} \,\,\, \forall t \ge 0, \,\,\,  \forall w \in \cal{Z}_w $.
\end{defn} \vspace{6pt}



\noindent \textbf{Problem 1: Data-based Safe control Design} 
Consider the collected data \eqref{data-u}, \eqref{data-x1} from the system \eqref{system} under Assumptions 1-5. Learn a controller in the form of \vspace{-3pt}
\begin{align} \label{cont}
    u(t)=K x(t),
\end{align}
to ensure that the safe set described in Assumption 4 is an RIS. To this end, use the following two sources of information: 1) prior information (i.e., prior knowledge of the system parameters $\theta^*$ and the disturbance bound $w$), and 2) the posterior information (i.e., collected data).  \vspace{3pt}

To design a controller that guarantees RIS of the safe set (i.e., to ensure that the system's states never leave the safe set), we leverage the concept of $\lambda$-contractive sets defined next. \vspace{3pt}

\begin{defn} \textbf{Contractive Sets} \label{contract} \cite{SetB} Given a $\lambda \in (0,1)$, the set  $\cal{P}$ is $\lambda$-contractive for the system \eqref{system} if $x(t) \in \cal{P} $ implies that $x(t+1) \in \lambda \cal{P}, \,\,\, \forall w \in \cal{Z}_w$.  \vspace{3pt}
\end{defn}

Guaranteeing that a set is $\lambda$-contractive not only guarantees that the set is RIS, but also the convergence of the system's states to the origin with a speed of at least $\lambda$. \vspace{-6pt}

\section{Closed-loop System Representation Using Data and Prior Knowledge}
In this section, we present a novel data-based closed-loop representation of the system that integrates both data and prior knowledge in a systematic manner. 

Since the actual realization of the disturbance sequence $W_0$
is unknown, there generally exist multiple pairs $\theta=[A \quad B]$ which are consistent with the data for 
some disturbance instance $W_0 \in \cal{M}_{\cal{Z}_w^T}$, where
\begin{align} \label{T-dis}
    \cal{M}_{\cal{Z}_w^T}=\big <G_w,C_w,A_w,B_w\big>,
\end{align}
is the constrained matrix zonotope formed by $T$-concatenation of $\cal{Z}_w$, with $G_w \in \mathbb{R}^{n \times T s_w}$, $C_w \in \mathbb{R}^{n \times T}$, $A_w \in \mathbb{R}^{n_{w}  \times T s_w}$, and $B_w \in \mathbb{R}^{n_{w}  \times T }$. 
% To avoid conservatism, these pairs, however, must also be consistent with prior knowledge provided in Assumption 1 and the collected data. 
We denote the set of all such open-loop models $\theta=[A \quad B]$ consistent with both data and prior knowledge by
\begin{align} \label{open-set}
    \Sigma_{X,U_0}=\Big \{\theta \in \cal{M}_{prior}: X_1=\theta D_0+W, \,\, W \in  \cal{M}_{\cal{Z}_w^T} \Big  \}.
\end{align}
% The true system model $\theta^*=[A^* \quad B^*]$ is in the set $\Sigma_{X,U_0}$ with $W=W_0$. 
% While we will not directly use this open-loop set of system models that are consistent with data and prior knowledge, we will leverage it to limit the set of closed-loop systems by making them consistent with prior knowledge and system models that can be realized by some disturbance realization. 
For a given control gain $K$, we now define the set of all closed-loop systems consistent with data and prior knowledge as
\begin{align} \label{cl-set}
   \Sigma^K_{X,U_0}= \Big \{A_K: A_K=A+BK, \,\,  [A \quad B] \in \Sigma_{X,U_0} \Big \}.
\end{align}
The following lemma is required for the development of the closed-loop characterization using constrained matrix zonotopes.
\vspace{6pt}



\begin{lem} \label{trans}
    Let $\cal{M}=\big <G,C \big>$ be a matrix zonotope of dimension $(n,p)$ with $s$ generators. Then, the transformation $\cal{M}\circ N =\{XN: X \in \cal{M}\}$ for some matrix $N \in \mathbb{R}^{p \times n}$ is a matrix zonotope of order $(n,n)$ with $s$ generators, defined by  $\cal{M}_N=\big <G \circ N,C N \big>$. \vspace{3pt}
\end{lem}
\noindent \textit{Proof:} The proof is along the lines of \cite{Czen}. For any $X \in \cal{M}$, there exists a $\zeta \in B_{\infty}$ such that $X=\sum\limits_{i=1}^{s} G_i \, \zeta_i +C$. Therefore, $XN=\sum\limits_{i=1}^{s} (G_i N) \, \zeta_i +CN$. By the definition of $\cal{M}_N$, this implies that $XN \in \cal{M}_N$, and since $X$ is arbitrary, $\cal{M} \circ N \subseteq \cal{M}_N$. 
Conversely, for any $Y \in \cal{M}_N$ there exists $\zeta \in B_{\infty}$ such that $Y=G \circ N \, \zeta+CN= \sum\limits_{i=1}^{s} G_i N \, \zeta_i +CN= (\sum\limits_{i=1}^{s} G_i \, \zeta_i +C)N$. Therefore, there exists $X \in \cal{M}$ with $Y=XN$. That is, $Y \in \cal{M} \circ N$, and since $Y$ is arbitrary, $\cal{M_N} \subseteq \cal{M} \circ N$. We conclude that $\cal{M_N}= \cal{M} \circ N$, which completes the proof.  \hfill   $\blacksquare$ \vspace{6pt}

\begin{lem} \label{trans2}
    Let $\cal{K}=\big <G,C,A_C,B_C \big>$ be a constrained matrix zonotope of dimension $(n,p)$. Then,  $\cal{K}\circ N =\{XN: X \in \cal{K}\}$ for some  vector $N \in \mathbb{R}^{p}$ (matrix $N \in \mathbb{R}^{p \times q}$  ) is a constrained zonotope (a constrained matrix zonotope), defined by $\cal{K}_N=\big <G \circ N,CN,\text{Vec}(A_C),\text{Vec}(B_C) \big>$ \big($\cal{K}_N=\big <G \circ N,CN,A_C,B_C \big>$ \big). 
\end{lem}
\noindent \textit{Proof:} The proof is similar to Lemma \ref{trans}. \hfill   $\blacksquare$\vspace{6pt}

Inspired by \cite{Data2}, we parameterize the control gain by a decision variable $G_K$ as $K=U_0 G_K$ where $G_{K} \in \mathbb{R}^{T \times n}$ satisfies $X_0 G_K=I$. That is, we assume $G_K$ satisfies
\begin{align} \label{G}
   D_0 \, G_K=\begin{bmatrix}
I \\ K
\end{bmatrix},
\end{align}
and parametrize the set of all closed-loop systems. \vspace{6pt}

\begin{thm} \label{clrep}
Consider the system \eqref{system}. Let the input-state collected data be given by \eqref{data-u} and \eqref{data-x}-\eqref{data-z}, and the prior knowledge be given by Assumptions 1 and 3. Then, under Assumption 5 and parametrization \eqref{G}, the set \eqref{cl-set} is exactly represented by the following constrained matrix zonotope of dimension $(n,n)$
 \begin{align}\label{clset}
\cal{M}_{cl}=\Big<[G_w \circ G_K \quad 0],(X_1-C_w)G_K,A_C,B_C \Big>,
\end{align}
 with  $s_c=s_{\theta}+s_w$ generators and
\begin{align} \label{AcBc}
  A_C=\begin{bmatrix}
        A_w & 0  \\ 
        0 & A_{\theta} \\
       G_w  & -G_{\theta}\circ D_0
    \end{bmatrix}, \,\, B_c=\begin{bmatrix}
        B_w \\ 
        B_{\theta} \\
        {X}_1-C_{\theta} D_0-C_w
    \end{bmatrix}.  
\end{align}
% where $\cal{M}_{\cal{Z}_w^T}=\big <G_w,C_w \big>$ is given in \eqref{T-dis}. 
\end{thm}

\vspace{3pt}
\noindent \textit{Proof: }
Using the control input $u(t)=Kx(t)$ in the system \eqref{system}, the closed-loop system becomes
\begin{align}\label{cl-syst}
 x(t+1)  = (A^*+B^*K) x(t) + w(t).
\end{align}
On the other hand, using the data \eqref{data-x}-\eqref{data-z} and the system \eqref{system}, one has \vspace{-10pt}
\begin{equation}\label{system-data} 
X_1 = {A}^*X_0 + B^*U_0 + W_0.
\end{equation}
Multiplying both sides of this equation by
$G_K$, one has
% \begin{align} 
% & X_1 G_K= {A}^*X_0 G_K+ B^*U_0 G_K+ W_0 G_K,
% % \nonumber \\ & \quad \quad \,\,\,\,\, =A_l X_0 G_{K,1}+A_n S_0 G_{K,2}+ W_0 G_K.
% \end{align}
% or equivalently,
\begin{align}\label{system-cl1} 
& (X_1-W_0) G_K=(A^* X_0+B^*U_0) G_{K}.
\end{align}
Using $K=U_0 G_K$ and $X_0 G_K=I$, the data-based closed-loop dynamics becomes 
\begin{align}\label{system-cl2} 
A^*+B^*K=(X_1-W_0) G_K.
\end{align}
Since the disturbance realization is unknown, the set of all possible closed-loop systems $A_K=A+BK$ is a subset of the set characterized by $(X_1-W) G_K$ for some $W \in \cal{M}_{\cal{Z}_w^T}$.
However, this leads to a conservative characterization of closed-loop systems, as the set $\cal{M}_{\cal{Z}_w^T}$ is typically conservatively large. To find the exact set $\Sigma^K_{X,U_0}$, we now need to limit this set by the disturbances that can be explained by data and prior knowledge. Using \eqref{G}, we have
\begin{align} \label{sys-cl3}
 A^*+B^*K= \begin{bmatrix}
    A^* & B^*
 \end{bmatrix} \begin{bmatrix}
    I \\ K
 \end{bmatrix}=  \begin{bmatrix}
    A^* & B^*
 \end{bmatrix} D_0 \, G_K.
\end{align}
Comparing \eqref{system-cl2} and \eqref{sys-cl3}, the consistency condition $[A \quad B] \in \Sigma_{X,U_0}$ implies that \vspace{-6pt}
\begin{align} \label{con11}
 \begin{bmatrix}
    A & B
 \end{bmatrix}  D_0 =(X_1-W),
\end{align}
is satisfied for some $W \in \cal{M}_{\cal{Z}_w^T}$ and some $\theta=[A \quad B] \in \cal{M}_{prior}$.  Using \eqref{con11} and Assumption 1, the disturbance set that is consistent with prior knowledge and data becomes
\begin{align}
    {W}={X}_1-\theta D_0 \in \big<G_{\theta}\circ D_0,{X}_1-C_{\theta} D_0,A_{\theta},B_{\theta} \big>=\cal{M}_{d}
\end{align}
where Lemma \ref{trans2} is used to find $\theta D_0$. 
Besides, there might not exist a disturbance solution $\theta$ to the system of linear equation \eqref{con11}. Similar to \cite{ID3}, one can limit the disturbance set 
 $\cal{M}_{\cal{Z}_{{w}}^T}$. We assume the set  $\cal{M}_{\cal{Z}_{{w}}^T}$ is refined based on  \cite{ID3}. Therefore, the disturbance set that is consistent with both Assumptions 1 and 3 and can be explained by data is obtained by ${W} \in \cal{M}_{d}  \bigcap \cal{M}_{\cal{Z}_{{w}}^T}=\cal{M}_{dp}$. Using Lemma \ref{intmz}, it yields
\begin{align} \label{dp}
  &  \cal{M}_{dp}= \Bigg< \big[ G_w  \quad 0 \big], C_w  ,\begin{bmatrix}
        A_w & 0  \\ 
        0 & A_{\theta} \\
       G_w  & -G_{\theta}\circ D_0
    \end{bmatrix}, \nonumber \\ & \quad \quad \begin{bmatrix}
        B_w \\ 
        B_{\theta} \\
        {X}_1-C_{\theta} D_0-C_w 
    \end{bmatrix} \Bigg>=\big<G_{dw},C_{dw},A_{dw},{B}_{dw} \big>.
\end{align}
Therefore, $\Sigma^K_{X,U_0} \subseteq \cal{A}_G$ where
\begin{align}
 &  \cal{A}_G= \Big \{A_K: A_K=(X_1-W) G_K, \,\, W \in \cal{M}_{dp} \Big \}.
\end{align}
Using Lemma \ref{trans2} and \eqref{dp} in the above equation yields \eqref{clset}. 



 \hfill   $\blacksquare$ \vspace{6pt}

\begin{rem}
The disturbance set is limited in \cite{ID3} to those that can be explained or generated for some $\theta$, given data. We, however, further limit the set of disturbance to ensure that they can be explained by some $\theta \in \cal{M}_{prior}$ (and not any $\theta$). Set-membership open-loop learning \cite{ID2} can be leveraged to further shrink the constrained zonotope $\cal{M}_{prior}$, and, consequently, the set of closed-loop systems. Starting from a matrix zonotope for the prior knowledge and using set-membership identification, for every data point, the information set is a set of all feasible system models consistent with data and the disturbance bounds, forming a halfspace \cite{ID2}. The constrained zonotope obtained from prior knowledge can then be refined using set-membership identification by finding the intersection of each halfspace with the constrained matrix zonotope, which is another constrained matrix zonotope \cite{setop}. This allows direct and indirect learning integration in a unified framework, and the number of columns of $B_{\theta}$ becomes $T$. \vspace{3pt}
\end{rem} \vspace{3pt}

\begin{rem}
Theorem \ref{clrep} parametrizes the set of all closed-loop systems using a decision variable $G_K$. To check the existence of a solution, by Assumption 5, a right inverse $G_{K}$ exists such that $X_0 \, G_{K}=I$. {Besides, since the rank of $X_0$ is $n$ while at least $n+1$ samples are collected, its right inverse $G_k$  exists and is not unique.} The non-uniqueness of $G_K$ will be leveraged to learn a controller that satisfies safety properties for all closed-loop systems parameterized by $G_K$. 
% Using set-theoretic tools such as $\lambda$-contractivity condition in Definition 7, this can be achieved by ensuring the set-theoretic-based system properties are satisfied for the entire set of all closed-loop next states characterized in \eqref{clset}.
Another point to note is that learning compact sets of $A$ and $B$ that are consistent with data requires that the data matrix $D_0$ in \eqref{D} be full-row rank, which is stronger than Assumption 5. This is related to the data informativeness in \cite{Data1} in which it is shown that satisfying some system properties directly by learning closed-loop dynamics is less data-hungry than satisfying them indirectly by learning a system model first, which requires satisfying the persistence of excitation \cite{PE1}.  
 \end{rem} 





 

\section{Robust Safe Control Design} 
% This section leverages the zonotope representation of the closed-loop system obtained in the previous section to learn a robust safe control policy. 
We design safe controllers for two different cases: 1) when the safe set is represented by a constrained zonotope, and 2) when the safe set is represented by a convex polytope. 

% To this end, we first provide an over-approximation of the set of the next states, given that the current state is inside the safe set. We then leverage set inclusion to ensure that the set of possible next states are inside a $\lambda$-scaled level sets of the safe set. The former is shown in the following corollary and the latter is shown in Theorem 2.
\vspace{6pt}

\begin{cor}
Consider the system \eqref{system} and let the closed-loop system be given by the constrained matrix zonotope \eqref{clset}.    Then, given $x(t) \in \big<G_x,c_x,A_x,b_x\big>$ as the current state, the next state satisfies 
 \begin{align}\label{statezen}
& x(t+1) \in \cal{C}_{cl}=\big<G_{cl},c_{cl},A_{cl},b_{cl} \big>,
\end{align}
% \begin{align}
%   &  G_x=[G_w \circ G_K \circ x(t) \quad 0 \quad  G_h] \\ \nonumber & 
%   c_x=(X_1-C_w)G_K \, x(t)+c_h \\ \nonumber &
%   \bar{A}_C=\begin{bmatrix}
%     A_c & 0 \\
%     0 & 0
% \end{bmatrix} \\ \nonumber &
% \bar{B}_C=\begin{bmatrix}
%     B_c  \\
%     0
% \end{bmatrix}
% \end{align}
where
\begin{align} \label{clzen}
    &G_{cl}= [(G_w \circ G_K) c_x \quad 0 \,\,\,\, (X_1-C_w)G_K G_x \,\,\,\, G_f \,\,\,\, G_h], \nonumber \\ 
   & c_{cl}=(X_1-C_w)G_K c_x+c_h, \nonumber \\ 
   & A_{cl}=\begin{bmatrix}
    \text{Vec}(A_{C}) & 0  & 0 & 0 \\
    0 & A_x & 0 & 0 \\
    0 & 0 & 0 & A_h
\end{bmatrix},  \nonumber \\ 
& b_{cl}=\begin{bmatrix}
    \text{Vec}(B_c) \\ b_x \\ b_h
\end{bmatrix},
\end{align}
where $G_{f}$ is formed using $G_w \circ G_k$ and $G_x$ and $A_C$, $B_c$, $A_x$ and $b_x$, and $A_C$ and $B_C$ are defined in \eqref{AcBc}.
\end{cor}
\noindent \textit{Proof:}
Using \eqref{clset}, Assumption 3, and $x(t) \in \big<G_x,c_x,A_x,b_x\big>$ in the system dynamics \eqref{system}, one has
\begin{align}
    x(t+1) \in \cal{M}_{cl} \times \cal{C}_x \oplus \cal{Z}_w.
\end{align}
Using proposition 2 in \cite{ID3} one has
\begin{align}
   & \cal{M}_{cl} \times \cal{C}_x \subseteq \cal{C}_{clw}=\Big<[(G_w \circ G_K) c_x  \quad 0
   \nonumber \\ & \quad  \quad \quad \quad \quad \quad \quad \quad \quad (X_1-C_w)G_K G_x \quad G_f], \nonumber \\ &  (X_1-C_w)G_K c_x,  \begin{bmatrix}
    \text{Vec}(A_{C}) & 0  & 0 \\
    0 & A_x & 0
\end{bmatrix},\begin{bmatrix}
   \text{Vec}(B_c) \\ b_x
\end{bmatrix} \Big> \nonumber \\  &
=\big<G_{clw},c_{clw},A_{clw},b_{clw} \big>.
\end{align}
where $G_f$ is formed similar to Proposition 2 of \cite{ID3}. Therefore, $x(t+1) \in \cal{C}_{clw} \oplus \cal{Z}_w$. Using Lemma \ref{twoZen}, for the constrained zonotope $\cal{Z}_w=\big<G_h,c_h,A_h,b_h \big>$ and the constrained zonotope $\cal{C}_{clw}=\big<G_{clw},c_{clw},A_{clw},b_{clw} \big>$, one has $\cal{C}_{clw} \oplus \cal{Z}_w =\Big<[G_{clw} \quad G_h],c_{clw}+c_h,\begin{bmatrix}
    A_{clw} & 0 \\
    0 & A_h
\end{bmatrix},\begin{bmatrix}
    b_{clw}  \\
    b_h
\end{bmatrix} \Big>=\cal{C}_{cl}$, which completes the proof. \hfill   $\blacksquare$ 
 \vspace{2pt}



\begin{thm}
Consider the system \eqref{system} under Assumptions 1-5 with the safe set  $\cal{C}_x=\big<G_{x},c_{x},A_{x},b_{x}. \big>$ Then, Problem 1 is solved using the controller $u(t)=U_0 G_K x(t)$ if there exist $G_K$, $\Gamma$, $L$ and $P$ satisfying \vspace{-2pt}
\begin{align}
   & (I-(X_1-C_w)G_K) c_x-c_h=\lambda G_x L, \nonumber \\
   & G_{cl}=\lambda G_x \Gamma, \nonumber \\
    & P A_{cl}=A_x \Gamma, \nonumber \\
    & P b_{cl}=\lambda b_x+A_x L, \nonumber \\
    &|\Gamma|\bar{\textbf{1}}+|L| \le \bar{\textbf{1}}, \nonumber \\
&
X_0 G_K=I.
\end{align}
where $G_{c}$, $c_{cl}$, $A_{cl}$, $b_{cl}$ are defined in \eqref{clzen}. 
\end{thm}
% \noindent 
% \begin{align} \label{LPf}
% &  \min\limits_{P,G_{K},\rho} \,\,\, \rho \nonumber \\
% &{P} h_s \le \lambda  h_s-H_s c_h-\rho \, g -y \nonumber  \\
% &{P} H_s  = H_s (X_1-C_w) G_K, \nonumber \\
% & \big\Vert G_K \big\Vert  \ge \rho
% \nonumber \\
% & P \ge 0
% \end{align} 
% where $g=[g_1,...,g_q]^T$ and $y=[y_1,...,y_q]^T$, and $g_j$ and $y_j$ are defined as
% \begin{align} \label{gj}
%     g_j=\max \{\big| h_{sj} \big|  \big\Vert { {G_w}_1} \big\Vert,...,\big| h_{sj} \big|  \big\Vert { {G_w}_{s_{w}}} \big\Vert\}
% \end{align}
% and \vspace{-10pt}
% \begin{align} \label{mj}
%  & y_j  = \max\limits_{\zeta} \sum\limits_{i=1}^{s}  {H_s}_j \big[0  \quad {G_h}_i \big]  \,  \zeta_i  \nonumber \\ &  
%  {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s} \bar{A}_{C}_i \zeta_i=\bar{B}_C, \nonumber \\  &  \quad \quad \big\Vert \zeta  \big\Vert_{\infty} \leq 1.
% \end{align}
% where $A_C$ and $B_C$ are defined in \eqref{clA} and \eqref{clB}, respectively.

\noindent \textit{Proof:}  Based on definition of the $\lambda$-contractivity in Definition \ref{contract} is satisfied if $\cal{C}_{cl}$ defined in \eqref{statezen} is contained in $\lambda$-scaled level set of the safe set $\cal{C}_x=\big<G_x,c_x,A_x,b_x \big>$. The $\lambda$-scaled level set of the constrained zonotope is obtained by scaling its boundaries. The safe set is $\cal{C}_x=\{x(t):x(t)=c_x+G_x \zeta,  \,\, \|\zeta\| \le 1, A_x \zeta =b_x \}$. $\lambda$-scaled level set of the safe set is obtained by scaling the boundaries of set, which gives $\{x(t):x(t)=c_x+G_x \zeta,  \,\, \|\zeta\| \le \lambda, A_x \zeta = \lambda b_x \}$, or equivalently, a constrained zonotope $\cal{C}_{x\lambda}=\big<\lambda G_x,c_x,A_x, \lambda b_x$ \big>. Therefore, the proof boils down to ensuring $\cal{C}_{cl} \subseteq \cal{C}_{x\lambda}$. The rest of the proof follows Lemma \ref{inclusion}.  \hfill   $\blacksquare$ \vspace{6pt}

\begin{thm}
Consider the system \eqref{system} under Assumptions 1-5 and assume that the safe set is represented by the convex polytope $\cal{P}(H_s,h_s)$. Then, Problem 1 is solved using the controller $u(t)=U_0 G_K x(t)$ if there exist $G_K$, $\rho$  and $P$ satisfying \vspace{-13pt}
\begin{align} \label{LPf}
&  \min\limits_{P,G_{K},\rho} \,\,\, \rho \nonumber \\
&{P} h_s \le \lambda  h_s-H_s c_h-\rho \, l -y, \nonumber  \\
&{P} H_s  = H_s (X_1-C_w) G_K, \nonumber \\
& \big\Vert G_K \big\Vert  \le \rho, \nonumber \\
&
X_0 G_K=I,
\nonumber \\
& P \ge 0,
\end{align} 
where $y=[y_1,...,y_q]^T$ and $l=[l_1,...,l_q]^T$, and $y_j$ and $l_j$ are defined as \vspace{-6pt}
\begin{align} \label{lj}
& y_j  = \sum\limits_{i=1}^{s_w} | {H_s}_j {G_h}_i|, \nonumber \\
 & l_j  = \max\limits_{\beta}  \Big(\sum\limits_{i=1}^{s_c}  \Big[\big| h_{sj} \big|  \big\Vert  G_{wi} \big\Vert \quad 0 \Big]    \,  \beta_i  \Big) \nonumber \\ &  
 \quad \quad {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s_c} \bar{A}_{c_i}\beta_i=\bar{b}_{c}, \nonumber \\  &  \quad \quad \quad \quad  \big\Vert \beta  \big\Vert_{\infty} \leq 1, \,\,\, \beta_i \ge 0, i=1,...,s_c
\end{align}
where 
\begin{align} \label{acbc}
   \bar{A}_c= \begin{bmatrix}
    \text{Vec}(A_C) & 0 \\ 0 & A_h
\end{bmatrix}, \quad \bar{b}_c= \begin{bmatrix}
    \text{Vec}(B_c) \\ b_h
\end{bmatrix},
\end{align}
and $A_C$ and $B_C$ defined in \eqref{AcBc}.
\end{thm}
\noindent \textit{Proof:}
Using \eqref{clset}, Lemma \ref{trans2} and Lemma \ref{twoZen}, one has 
\begin{align} \label{next2}
 &   x(t+1) \in \Big<[{G}_w \circ G_K \circ x(t) \quad 0 \quad G_h], \nonumber \\ & \quad \quad \quad  \quad \quad (X_1-C_w)G_K x(t)+c_h,\bar{A}_c,\bar{b}_c\Big>.
\end{align}

 By definition, $\lambda$-contractivity is satisfied if $\gamma_j=\max\limits_{x(t)} \, H_{sj} x(t+1) \le \lambda {h_c}_j, \,\, j=1,...,q$, whenever $H_s x(t) \le h_s$. Using \eqref{next2}, define
\begin{align} \label{bargam}
 & \bar \gamma_j  = \max\limits_{\beta} \max\limits_{x(t)}  \Big( {H_s}_j (X_1-C_w)G_K \, x(t)+{H_s}_j c_h+ \nonumber \\ &  \sum\limits_{i=1}^{s_c}  \Big [\big| {H_s}_j G_{wi} G_K x(t) \big| \quad 0 \Big] \beta_i \big| +  \sum\limits_{i=1}^{s_w}  |{H_s}_j  {G_h}_i | \Big) \nonumber \\  &
 {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s_c} \bar{A}_{c_i} \beta_i=\bar{b}_{c},  \quad \big\Vert \beta  \big\Vert_{\infty} \leq 1, \nonumber \\  & \quad \quad H_s x(t) \le h_s,
\end{align}
where the last two terms of the cost function are obtained using the fact that for $\zeta=[\beta^T \,\,\, \eta^T] \in \mathbb{R}^{s_c+s_w}$, one has
\begin{align} \label{ineql}
   & {H_s}_j \, [G_w \circ G_K \circ x(t) \quad 0  \quad G_h] \zeta  \le  \nonumber \\ & 
    \sum\limits_{i=1}^{s_{c}}  \Big[ |{H_s}_j G_{wi} G_K x(t)| \quad 0  \Big] \,  |\beta_i|  +  \sum\limits_{i=1}^{s_{w}} | {H_s}_j  {G_h}_i |.
\end{align}
% and the fact that $ {H_s}_j {G_w}_i G_K x(t) \beta_i \le \big| {H_s}_j {G_w}_i G_K x(t)\big| \big| \beta_i \big|$ and ${H_s}_j  {G_h}_i \zeta_ i \le | {H_s}_j  {G_h}_i |$ since $|\zeta|_i \le 1$. 
Based on \eqref{ineql}, $\gamma_j \le \bar \gamma_j$, and, thus, Problem 1 is solved if $\bar \gamma_j \le \lambda h_{cj}, \, j=1,...,q$. To find a bound for the term depending on $\beta_i$ in the cost function, since ${H_s}_j x(t) \leq {h_s}_j$, one has $\|x(t)\| \leq \frac{|{h_s}_j|}{\|{H_s}_j\|}$. Using this inequality, one has $\big| {H_s}_j G_{wi} G_K x(t)\big| \le \big| h_{sj} \big|  \big\Vert { {G_w}_i}  \big\Vert \big\Vert {G_K}  \big\Vert$. Therefore, $\bar \gamma_j \le \hat \gamma_j$ where
% Therefore, he $\lambda$-contractivity in Definition \ref{contract} is satisfied if $\bar \gamma_j \le \lambda {h_c}_j$ where 
% \begin{align}
%  & \bar \gamma_j  = \max\limits_{\zeta} \max\limits_{x(t)}  \Big( {H_s}_j (X_1-C_w)G_K \, x(t)+{H_s}_j c_h+ \nonumber \\ &  \sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big| +  \sum\limits_{i=1}^{s}  {H_s}_j \big[0  \quad {G_h}_i \big]  \,  \zeta_i  \Big) \nonumber \\  &
%  {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s} \bar{A}_{C}_i \zeta_i=\bar{B}_{C}, \nonumber \\  &  \quad \quad \big\Vert \zeta  \big\Vert_{\infty} \leq 1, \nonumber \\  & \quad \quad H_s x(t) \le h_s
% \end{align}
% Define $f_1(x)= {H_s}_j (X_1-G_w)G_K \, x(t)+{H_s}_j c_h$, $f_2(x)= \sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big|$, and $f_3(x)=\sum\limits_{i=1}^{s}  {H_s}_j \big[{G_h}_i  \quad 0 \big]  \,  \zeta_i  \Big)$. Using $\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)+f_3(x)) \le \max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x)+\max\limits_{x \in \cal{X}} f_3(x)$, 
% if $\max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x) \le \lambda g_i$, then $\bar \gamma_i \le \hat{\gamma_i}$ with
% $\bar \gamma_i=\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)) \le \lambda {h_c}_i$ is satisfied if 
\begin{align} \label{hatgamma}
 & \hat \gamma_j  =  \max\limits_{x(t)}  \Big( {H_s}_j (X_1-G_w)G_K \, x(t)+{H_s}_j c_h+  \big\Vert {G_K}  \big\Vert l_j+y_j \Big) \nonumber \\  & 
 {\rm{s}}{\rm{.t}}{\rm{.}}   \quad H_s x(t) \le h_s,
\end{align}
where $l_j$ and $y_j$ are defined in \eqref{lj}, inside of which the absolute value of $\beta_i$ in \eqref{bargam} is removed by adding the constraint $\beta_i\ge 0$. 
% and $y_j$ is defined in \eqref{mj}. Then, using $\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)) \le \max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x)$, one has $\bar \gamma_i \le \hat \gamma_i$. On the other hand, since ${H_s}_j x(t) \leq {h_s}_j$, one has $\|x(t)\| \leq \frac{|{h_s}_j|}{\|{H_s}_j\|}$. Using this inequality, one has $\big| {H_s}_j {G_w}_i G_K x(t)\big| \le \big| h_{sj} \big|  \big\Vert { {G_w}_i}  \big\Vert \big\Vert {G_K}  \big\Vert$. Therefore, $l_j \le g_j  \big\Vert  \big\Vert {G_K} \big\Vert  \big\Vert \zeta \big\Vert_{\infty}$ with $g_j$ is defined in \eqref{gj}. Using $\big\Vert \zeta \big\Vert_{\infty} \le 1$, one has
% \begin{align} \label{li}
%  & l_j   \le g_j \big\Vert {G_K} \big\Vert
% \end{align}
Using duality, $\lambda$-contactivity is satisfied if $\tilde \gamma_j \le \lambda {h_c}_j$ where \vspace{-8pt}
\begin{align} 
&\tilde \gamma_j  = \min\limits_{\alpha_j} \alpha_j^T \, h_s+  {H_s}_j c_h+ l_j \big\Vert {G_K} \big\Vert+y_j, \label{a1} \nonumber \\&
{\alpha_j}^T H_s = {H_s}_j (X_1-C_w) G_K,  \nonumber \\&
{\alpha_j}^T \ge 0,  
\end{align}
where $\alpha_i \in \mathbb{R}^q$. Define $
{P}=[\alpha_1,....,\alpha_q]^T \in \mathbb{R}^{q \times q}$. $P$ is non–negative since $\alpha_i$ is non-negative for all $i=1,...,q$. Therefore, using the dual optimization,  $\lambda$-contractivity is satisfied if \eqref{LPf} is satisfied. \hfill   $\blacksquare$ \vspace{-6pt}

% \begin{rem}
%     Even thought the constraints on inputs are not considered here, since intersection of two constrained zonotopes is a constrained zonotope, a single constrained zonotope on the state can be obtained as in \cite{inclusion} (see equations (29) and (30) in this paper). Therefore, the results of this paper can be readily used for systems under both state and input constraints. 
% \end{rem} \vspace{6pt}

% \begin{rem} The computational complexity of the presented safe control design approach depends on the number of generators of the constrained matrix zonotope $\cal{M}_{cl}$, and the constrained zentope used for describing the safe set, and, consequently, the constrained zonotope $\cal{C}_{cl}$. A reduce operator for constrained zonotopes \cite{setop} can be leveraged to get over-approximated set of next states with a lower number of generators to decrease the complexity
% \end{rem}


% $\gamma_j \le \lambda {h_c}_j, \,\, j=1,...,q$ where
% \begin{align} \label{gam1}
% &\gamma_j  = \max\limits_{x(t)} {H_s}_j \, x(t+1) \nonumber \\&
% {\rm{s}}{\rm{.t}}{\rm{.}}\,\,\,\,{\rm{ }}H_s x(t) \le h_s.
% \end{align}
% and $H_s$ and $h_s$ are defined in Assumption 4. 
% where $\cal{C}_s$ is defined in  \eqref{clset}.
% Using the fact that for a constrained zonotope $\big<(G_x,C_x,A_C,B_C \big>$, the linear transformation $H \, \big<(G_x,C_x,A_C,B_C \big>$ leads to a constraints zonotope $\big<(H G_x,HC_x,A_C,B_C \big>$, one has
% Using \eqref{statezen}, \eqref{gam1} leads to
% \begin{align}
%  & \gamma_j  =  \max\limits_{\zeta}  {H_s}_j \Big((X_1-C_w)G_K \, c_x+c_h+ G_{cl} \zeta \Big) \nonumber \\  &
%  {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s} {A}_{cl}_i \zeta_i={b}_{cl}, \nonumber \\  &  \quad \quad \big\Vert \zeta  \big\Vert_{\infty} \leq 1, 
% \end{align}
% One has
% \begin{align}
%    & {H_s}_j \, [G_w \circ G_K \circ x(t) \quad 0 \quad G_h] \zeta  = \nonumber \\ & 
%     \sum\limits_{i=1}^{s_{c}} \big[ {H_s}_j {G_w}_i G_K x(t) \quad 0 \big] \,  \beta_i  +  \sum\limits_{i=1}^{s_{w}}  {H_s}_j  {G_h}_i  \,  \zeta_i    
% \end{align}
% On the other hand, ${H_s}_j {G_w}_i G_K x(t) \beta_i=|{H_s}_j {G_w}_i G_K x(t)| \bar{\beeta}_i$, where $bar{\beta}_i = \beta_i$  if ${H_s}_j {G_w}_i G_K x(t) \ge 0$ and 

% Therefore, he $\lambda$-contractivity in Definition \ref{contract} is satisfied if $\bar \gamma_j \le \lambda {h_c}_j$ where 
% \begin{align}
%  & \bar \gamma_j  = \max\limits_{\zeta} \max\limits_{x(t)}  \Big( {H_s}_j (X_1-C_w)G_K \, x(t)+{H_s}_j c_h+ \nonumber \\ &  \sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big| +  \sum\limits_{i=1}^{s}  {H_s}_j \big[0  \quad {G_h}_i \big]  \,  \zeta_i  \Big) \nonumber \\  &
%  {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s} \bar{A}_{C}_i \zeta_i=\bar{B}_{C}, \nonumber \\  &  \quad \quad \big\Vert \zeta  \big\Vert_{\infty} \leq 1, \nonumber \\  & \quad \quad H_s x(t) \le h_s
% \end{align}
% Define $f_1(x)= {H_s}_j (X_1-G_w)G_K \, x(t)+{H_s}_j c_h$, $f_2(x)= \sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big|$, and $f_3(x)=\sum\limits_{i=1}^{s}  {H_s}_j \big[{G_h}_i  \quad 0 \big]  \,  \zeta_i  \Big)$. Using $\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)+f_3(x)) \le \max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x)+\max\limits_{x \in \cal{X}} f_3(x)$, 
% if $\max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x) \le \lambda g_i$, then $\bar \gamma_i \le \hat{\gamma_i}$ with
% $\bar \gamma_i=\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)) \le \lambda {h_c}_i$ is satisfied if 
% Define 
% \begin{align} \label{hatgamma}
%  & \hat \gamma_j  =  \max\limits_{x(t)}  \Big( {H_s}_j (X_1-G_w)G_K \, x(t)+{H_s}_j c_h+ l_j+y_j \Big) \nonumber \\  & 
%  {\rm{s}}{\rm{.t}}{\rm{.}}   \quad H_s x(t) \le h_s
% \end{align}
% where
% \begin{align} \label{li}
%  & l_j  = \max\limits_{\zeta}  \max\limits_{x(t)} \Big(\sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big| \Big) \nonumber \\ &  
%  {\rm{s}}{\rm{.t}}{\rm{.}} \,\, \sum\limits_{i=1}^{s} \bar{A}_{C}_i \zeta_i=\bar{B}_{C}, \nonumber \\  &  \quad \quad \big\Vert \zeta  \big\Vert_{\infty} \leq 1, \nonumber \\  & \quad \quad H_s x(t) \le h_s
% \end{align}
% and $y_j$ is defined in \eqref{mj}. Then, using $\max\limits_{x \in \cal{X}} (f_1(x)+f_2(x)) \le \max\limits_{x \in \cal{X}} f_1(x)+\max\limits_{x \in \cal{X}} f_2(x)$, one has $\bar \gamma_i \le \hat \gamma_i$. On the other hand, since ${H_s}_j x(t) \leq {h_s}_j$, one has $\|x(t)\| \leq \frac{|{h_s}_j|}{\|{H_s}_j\|}$. Using this inequality, one has $\big| {H_s}_j {G_w}_i G_K x(t)\big| \le \big| h_{sj} \big|  \big\Vert { {G_w}_i}  \big\Vert \big\Vert {G_K}  \big\Vert$. Therefore, $l_j \le g_j  \big\Vert  \big\Vert {G_K} \big\Vert  \big\Vert \zeta \big\Vert_{\infty}$ with $g_j$ is defined in \eqref{gj}. Using $\big\Vert \zeta \big\Vert_{\infty} \le 1$, one has
% \begin{align} \label{li}
%  & l_j   \le g_j \big\Vert {G_K} \big\Vert
% \end{align}
% Using duality and the fact that $\bar \gamma_j \le \hat \gamma_j$, $\lambda$-contactivity is satisfied if $\tilde \gamma_j \le \lambda {h_c}_j$ where
% \begin{align} \label{LP1}
% &\tilde \gamma_j  = \min\limits_{\alpha_j} \alpha_j^T \, h_c+  {H_s}_j c_h+ g_j \big\Vert {G_K} \big\Vert+y_j\label{a1} \\&
% {\alpha_j}^T H_s = {H_s}_j (X_1-C_w) G_K \label{a2} \\&
% {\alpha_j}^T \ge 0,  \label{a3}
% \end{align}
% where $\alpha_i \in \mathbb{R}^q$ is the decision variable of the dual optimization. Define $
% {P}$ as 
% \begin{align} \label{P}
% {P} = \left[ \begin{array}{l}
% {\alpha _{1}}^T\\
% {\alpha _{2}}^T\\
%  \vdots \\
% {\alpha _{s}}^T
% \end{array} \right] \in {R^{q \times q}}.
% \end{align}

% $P$ is non–negative since $\alpha_i$ is non-negative for all $i=1,...,p$. Therefore, using the dual optimization,  $\lambda$-contractivity is satisfied if \eqref{LPf} is satisfied.
% $\sum\limits_{i=1}^{s} \big[ \big| {H_s}_j {G_w}_i G_K x(t)\big| \quad 0 \big] \, \big| \zeta_i \big| \le \sum\limits_{i=1}^{s} \big[ \big|{h_s}_j\big| \big\Vert {G_h}  \big\Vert \big\Vert {G_K}  \big\Vert \quad 0 \big] \, \big| \zeta_i \big|$ 
% \begin{lem} \label
% Consider the system \eqref{system}. Let the input-state collected data be given by \eqref{data-u} and \eqref{data-x}-\eqref{data-z}. Let the controller be given as $u(t)=Kx(t)=U_0 G_{K} x(t)$ with $G_{K} \in \mathbb{R}^{T \times n}$  as a decision variable satisfying $X_0 G_{K}=I$. Then,  under Assumptions 3 and 5, the set of closed-loop next states satisfy
%  \begin{align}\label{clset}
% x(t+1) \in  \cal{M}_{cl} \, x(t) + \cal{Z}_w
% \end{align}
% where 
% \begin{align}
%     \cal{M}_{\cal{Z}_w^T}=\big <G_w,C_w \big>
% \end{align}
% is the matrix zonotope of dimension $(n,T)$ formed by $T$-concatenation of the disturbance zonotope $\cal{Z}_w$, and 
% \begin{align}
%     \cal{M}_{cl}=\big<(X_1-G_w) G_K,C_w G_K \big>
% \end{align}
% is the matrix zonotope of of dimension $(n,n)$. 
% \end{lem} \vspace{3pt}
% \noindent \textit{Proof: }
% Using the control input $u(t)=Kx(t)$ in the system \eqref{system}, the closed-loop system becomes
% \begin{align}\label{cl-syst}
%  x(t+1)  = (A+BK) x(t) + w(t) 
% \end{align}
% On the other hand, using the data \eqref{data-x}-\eqref{data-z} and the system \eqref{system}, one has
% \begin{equation}\label{system-data} 
% X_1 = {A}X_0 + BU_0 + W_0,
% \end{equation}
% Multiplying both sides of this equation by
% $G_K$, one has
% \begin{align}\label{system-cl1} 
% & X_1 G_K= {A}X_0 G_K+ BU_0 G_K+ W_0 G_K,
% % \nonumber \\ & \quad \quad \,\,\,\,\, =A_l X_0 G_{K,1}+A_n S_0 G_{K,2}+ W_0 G_K.
% \end{align}
% or equivalently,
% \begin{align}\label{system-cl1} 
% & (X_1-W_0) G_K=(A X_0+BU_0) G_{K}.
% \end{align}
% Using $K=U_0 G_K$, the data-based closed-loop dynamics becomes
% \begin{align}\label{system-cl2} 
%  A+BK=(X_1-W_0) G_K.
% \end{align}
% Now based on  Lemma \ref{trans}, one has
% \begin{align}
%     (X_1-W_0) G_K= \Big<(X_1-G_w) G_K,C_w G_K \Big>
% \end{align}
% Using this representation in \eqref{cl-syst} leads to \eqref{clset}. 
% To check the existence of a solution, by Assumption 5, a right inverse $G_{K}$ exists such that $X_0 \, G_{K}=I$. {Besides, since the rank of $X_0$ is $n$ while at least $n+1$ samples are collected, its right inverse $G_k$  exists and is not unique.} This completes the proof.  \hfill   $\blacksquare$ \vspace{6pt}




\section{Simulation Results}
Consider the following discrete-time system used in \cite{example}
% \cite{sim,babak}
\begin{align}
& x_1(t+1) = a_1^* x_1(t) + a_2^* x_2(t)+b_1^* u(t)+ w(t),  \nonumber \\ &
x_2(t+1) = a_3^* x_1(t) +a_4^* x_2(t)+b_2^* u(t).
\end{align}
where the actual but unknown values of the system are $a_1^*=0.8, \,\, a_2^*=0.5, \,\, a_3^*=-0.4, \,\, a_4=1.2 \,\, b_1^*=0, \,\, b_2^*=1$.
% where $x_1(t)$ represents the displacement of the carriage from equilibrium, and $x_2(t)$ is the carriage velocity. The input $u(t)$ is the external force. For the system parameters and matrices, readers are referred to \cite{sim}. 
The safe set in \cite{example} is considered as a polyhedral set $\cal{C}_x=\{x: H_sx \le h_s \}$ where $h_s=[1,1,1,1]^T$ and $H_s$ is a $4 \times 2$ matrix defined in \cite{example}.
% \begin{align}
%     F=\begin{bmatrix}
%         0.2 & 0.4 \\
%         -0.2 &  -0.4 \\
%         -0.15 &  0.2 \\
%         0.15 & -0.2
%     \end{bmatrix}.
% \end{align}
 Since the safe set is symmetric here, it is equivalent to a zonotope $\cal{C}_x=\big<G_x,c_x,0,0\big>$. The contractility level is chosen as $\lambda=0.95$. 
% The disturbance is assumed to belong to the zonotope $\cal{Z}_w = \bigg<0, \begin{bmatrix}
%     0.1 & 0.02 \\
%     0.02 & 0.1
% \end{bmatrix}\bigg>$. 
It is also assumed that the prior knowledge of the system parameters provided the bounds $a_1^* \in [0.6 \quad 1], \quad a_2^* \in [0.35 \quad 0.65], \quad a_3^* \in [-0.3 \quad -0.5], \quad a_4^* \in [1 \quad 1.4], \quad b_1^* \in [-0.1 \quad 0.1], \,\,  \text{and} \,\,\, b_2^* \in [0.8 \quad 1.2]$. A matrix zonotope can be found for this prior knowledge since the prior knowledge is provided as box constraints.
% See \cite{thesis} for conversion of polyhedrals and multidimensional intervals to costrained zonotopes. 
A controller in the form of $u(t)=K [x_1 \,\, x_2]$ is then learned using Theorem 3. We compared the results for the case where the prior knowledge is used and the case where it is ignored. The comparison is performed in terms of the disturbance level they can tolerate and the speed of convergence (i.e., $\lambda$) they can achieve under the same level of disturbance. To this end, the unknown disturbance set is assumed $\cal{Z}_w =[-b, b]^2$, with $b$ as the disturbance level. A zonotope with a symmetric positive definite generator is formed for this disturbance set. Our simulation results showed that while the disturbance bound that the learning algorithm can tolerate and provide a solution for the case where the prior knowledge is ignored is $b=0.05$ for a fixed $\lambda=0.98$, the disturbance level that the control design algorithm that accounts for prior knowledge can tolerate increase to $b=0.08$ for the same speed level $\lambda=0.98$. Besides, for a disturbance level $b=0.04$, while the minimum value of $\lambda$ that can be achieved is $0.89$ for the case where no prior knowledge is used, this value decreases to $0.76$ when prior knowledge is leveraged. Figure 1 shows how using prior knowledge can improve performance by finding a lower value $\lambda$ for which the optimization is feasible. The disturbance level is considered as $b=0.03$ in this case.

\begin{figure}[t!]
    \vspace{-10pt}
        \centering
        \subfloat[]{{\includegraphics[width=\linewidth,height=2in, trim=0cm 6.0cm 0cm 4.2cm, clip]{PKx1.pdf} }}%
\vspace{-30pt}
        \centering
        \subfloat[]{{\includegraphics[width=\linewidth,height=2 in, trim=0cm 6.0cm 0cm 4.2cm, clip]{WPNx1.pdf} }}%
    \caption{Comparison of the performance of the case where prior knowledge is used (Figure (a)) with the case where prior knowledge is ignored (Figure (b)) for the same level of disturbance.}
    \label{fig:alpha_results}
\end{figure}




\section{conclusion} A novel approach is presented to integrate prior knowledge and open-loop learning with closed-loop learning for safe control design of linear systems. Assuming that the disturbance belongs to a zonotope and without accounting for prior knowledge, we show that the set of the closed-loop representation of systems can be characterized by a matrix zonotope. We then show how to add prior knowledge into this closed-loop representation by turning the matrix zonotope into a constrained matrix zonotope. The equality constraints added by incorporating prior knowledge limit the set of closed-loop systems to those that can be explained by prior knowledge, therefore reducing its conservatism. We then leveraged a set inclusion approach to impose constrained zonotope safety. 
% Future work will leverage the presented approach in the context of tube-based model-predictive control (MPC) to allow integration of prior knowledge into the MPC framework. This approach can also be leveraged to estimate reachable sets of uncertain systems under additive disturbances. 




\bibliographystyle{IEEEtran}

\begin{thebibliography}{99}

%%%%%%% Data  CL
\bibitem{Data1} H. J. van Waarde, J. Eising, H. L. Trentelman and M. K. Camlibel, \enquote{Data Informativity: A new perspective on data-driven analysis and control,}  IEEE Transactions on Automatic Control, vol. 65, no. 11, pp. 4753-4768, 2020.

\bibitem{DI1}  F. Dörfler, \enquote{Data-Driven Control: Part Two of Two: Hot Take: Why not go with Models?,} IEEE Control Systems Magazine, vol. 43, no. 6, pp. 27-31, Dec. 2023.

% \bibitem{DI2} V. Krishnan and F. Pasqualetti, \enquote{On Direct vs Indirect Data-Driven Predictive Control,} 60th IEEE Conference on Decision and Control (CDC), Austin, TX, USA, 2021, pp. 736-741.

\bibitem{Data2} A. Luppi and C. {De Persis} and P. Tesi, \enquote{On data-driven stabilization of systems with nonlinearities satisfying quadratic constraints},  Systems and Control Letters, vol. 163, pp. 1-11, 2022.


\bibitem{Data3} C. {De Persis}, and P. Tesi,
\enquote{Low-complexity learning of Linear Quadratic Regulators from noisy data}, {Automatica}, vol. {128}, pp. {109548}, {2021}.

\bibitem{Data4} F. Dörfler, J. Coulson and I. Markovsky, \enquote{Bridging Direct and Indirect Data-Driven Control Formulations via Regularizations and Relaxations}, IEEE Transactions on Automatic Control, vol. 68, no. 2, pp. 883-897,  2023.


\bibitem{Data5} H. Modares, \enquote{Minimum-Variance and Low-Complexity Data-Driven Probabilistic Safe Control Design,} IEEE Control Systems Letters, vol. 7, pp. 1598-1603, 2023.

%%%%%%%%%%

% \bibitem{SAfeRL4} N. Jansen, B. Konighofer, S. Junges, A.C Serban, and R. Bloem, \enquote{Safe reinforcement learning using probabilistic shields,} in Proc. of International Conference on Concurrency Theory, pp. 31-316, 2020.
% \bibitem{SAfeRL5} S. Junges, N. Jansen, C. Dehnert, U. Topcu, and J.P. Katoen,  \enquote{Safety-constrained reinforcement learning for {MDP}s,} in Proc. of International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 130-146, 2016.
% \bibitem{SAfeRL10} R.  Cheng and  G.  Orosz and  R.  M.  Murray and  J.  W.  Burdick, \enquote{End-to-end safe reinforcement learning through barrier functions for safety-critical continuous control tasks,} in Proc. of the AAAI Conference on Artificial Intelligence,  vol. 33,  pp. 3387--3395, 2019.
%  \bibitem{SAfeRL16} S.   Li,   O.   Bastani, \enquote{Robust model predictive shielding for safe reinforcement learning with stochastic dynamics,} in Proc. of IEEE International Conference on Robotics and Automation, pp. 7166-7172, 2020.

%%%%%%%%% CBF

% \bibitem{SB1}  M.J. Khojasteh, V. Dhiman, M. Franceschetti, and N. Atanasov, \enquote{Probabilistic safety constraints for learned high relative degree system dynamics,} in Proc. of 2nd Conference on Learning for Dynamics and Control, pp. 781-792, 2020.

% \bibitem{SB2} W. Luo, W. Sun, and A. Kapoor, \enquote{Multi-robot collision avoidance under uncertainty with probabilistic safety barrier certificates,} in Advances in Neural Information Processing Systems, vol. 33, pp. 372-383, 2020.

%  \bibitem{SB3} M. Ahmadi, X. Xiong, and A. D. Ames, \enquote{Risk-averse planning via CVaR barrier functions: Application to bipedal robot locomotion,} in arXiv, 2021.
 
  % \bibitem{SB4} A. Chern, X. Wang, A. Iyer and Y. Nakahira, \enquote{Safe Control in the Presence of Stochastic Uncertainties,} in Proc. IEEE Conference on Decision and Control, pp. 6640-6645, 2021.

 %  \bibitem{SB4} B. T. Lopez, J.c. Slotine, and J.P. How, \enquote{Robust adaptive control barrier functions: An adaptive and data-driven approach to safety,} \textit{IEEE Control Systems Letters}, vol. 5, pp. 1031-1036, 2021.

 %    \bibitem{SB6} S. Stephen, A. Jadbabaie, and J. Pappas, \enquote{A framework for worst-case and stochastic safety verification using barrier certificates,} \textit{IEEE Transactions on Automatic Control}, vol. 52, pp. 1415-1428, 2007.

 %    % \bibitem{SB7} S. Samuelson, and I. Yang, \enquote{Safety-aware optimal control of stochastic systems using conditional Value-at-Risk,} in American Control Conference, pp. 6285-6290, 2018.
   
 % \bibitem{SB8} M. Ahmadi, X. Xiong and A. D. Ames, \enquote{Risk-averse control via CVaR barrier functions: Application to bipedal robot locomotion,} \textit{IEEE Control Systems Letters}, vol. 6, pp. 878-883, 2022.


% %%%%%%% Merge
% \bibitem{merge1} {S. Grammatico, F. Blanchini, and A. Caiti,
%  \enquote{Online data-enabled predictive control}, {IEEE Transactions on Automatic Control}, vol. {59}, pp. {107-119}, {2014}.}

%   %%%%%% MPC
%   \bibitem{MPC1} { C.E. García,  D. M. Prett, and M. Morari,
%  \enquote{Model predictive control: Theory and practice—A survey}, {Automatica}, vol. {25}, pp. {335-348}, {1989}.}


% %%%%%%% safe DT CBF

% \bibitem{safeDTconvex} A. Agrawal and K. Sreenath, \enquote{Discrete Control Barrier Functions for Safety-Critical Control of Discrete Systems with Application to Bipedal Robot Navigation}, Robotics: Science and Systems, pp. 1-10, 2017.



%%%%%%%%%%% Data safe and MPC

   \bibitem{Data6} A. Bisoffi, C. De Persis and P. Tesi, \enquote{Controller design for robust invariance from noisy data,}  IEEE Transactions on Automatic Control, vol. {68}, pp. {636-643}, 2023. 

\bibitem{ID1} L. Lützow and M. Althoff, \enquote{Scalable Reachset-Conformant Identification of Linear Systems,}  IEEE Control Systems Letters, vol. 8, pp. 520-525, 2024.

\bibitem{ID2} D. Wang, X. Wu, L. Pan, J. Shen and K. Y. Lee, \enquote{A novel zonotope-based set-membership identification approach for uncertain system,}  IEEE Conference on Control Technology and Applications (CCTA), Maui, HI, USA, 2017, pp. 1420-1425. 

\bibitem{ID21} J. Berberich, A. Romer. C. W. Scherer and Frank Allg{\"o}wer, \enquote{Robust data-driven state-feedback design},  American Control Conference (ACC), {2019}, pp. {1532-1538}.
\bibitem{ID3} A. Alanwar, A. Koch, F. Allg{\"o}wer and K.H. Johansson \enquote{Data-Driven Reachability Analysis From Noisy Data,} IEEE Transactions on Automatic Control, vol. 68, pp. 3054-3069, 2021.

\bibitem{ID4} A. Alanwar, Y. Sturz, and Karl Henrik Johansson,
\enquote{Robust data-driven predictive control using reachability analysis,} European Journal of Control, vol. 68, 2022.

\bibitem{ID5} J. Berberich, A. Romer, C. W. Scherer and F. Allg{\"o}wer \enquote{Robust data-driven state-feedback design,}  American Control Conference (ACC), 2019, pp. 1532-1538.






% \bibitem{setcont} S. Sadraddini and R. Tedrake, \enquote{Linear Encodings for Polytope Containment Problems} in IEEE 58th Conference on Decision and Control (CDC), 2019, pp. 4367-4372. 

\bibitem{setcont2} B. Gheorghe, D. M. Ioan, F. Stoican and I. Prodan, \enquote{Computing the Maximal Positive Invariant Set for the Constrained Zonotopic Case,} IEEE Control Systems Letters, vol. 8, pp. 1481-1486, 2024.

\bibitem{inclusion} B. Gheorghe, D.M. Ioan, F. Stoican and I. Prodan, \enquote{Computing the Maximal Positive Invariant Set for the Constrained Zonotopic Case,} IEEE Control Systems Letters, vol. 8, pp. 1481-1486, 2024.

\bibitem{Czen} J. K. Scott, D. M. Raimondo, G. R. Marseglia, and R. D. Braatz,
\enquote{Constrained zonotopes: A new tool for set-based estimation and fault
detection,} Automatica, vol. 69, pp. 126–136, 2016.


\bibitem{SetB} F. Blanchini,  and S. Miani, \textit{ Set-Theoretic Methods
in Control,} Springer, 2nd edition, 2008.


\bibitem{setop} V. Raghuraman and P. Koeln,
\enquote{Set operations and order reductions for constrained zonotopes,}  Automatica, vol. 139, 2022.


 \bibitem{PE1} {J.C. Willems, P. Rapisarda, I. Markovsky, and B. De Moor, \enquote{A note on persistency of excitation}, Systems and Control Letters, vol. 54, pp. 325-329, 2005.}
 


\bibitem{example} A. Bisoffi, C. De Persis, and P. Tesi,
\enquote{Data-based guarantees of set invariance properties}
IFAC, vol. 53, pp. 3953-3958, 2020. 


% \bibitem{thesis} Matthias Althof, \enquote{Reachability Analysis and its Application to the Safety Assessment of Autonomous Cars}, PhD dissertation, Technische Universitat Munchen, 2010. 
% Matthias Althof

\end{thebibliography}


\end{document}