# Safe Control Design for Unknown Nonlinear Systems with Koopman-based Fixed-
Time Identification

Mitchell Black  Dimitra Panagou  Department of Aerospace Engineering,
University of Michigan, Ann Arbor, MI 48109, USA (e-mail: mblackjr@umich.edu).
Department of Robotics and Department of Aerospace Engineering, University of
Michigan, Ann Arbor, MI 48109, USA (e-mail<EMAIL_ADDRESS>
###### Abstract

We consider the problem of safe control design for a class of nonlinear,
control-affine systems subject to an unknown, additive, nonlinear disturbance.
Leveraging recent advancements in the application of Koopman operator theory
to the field of system identification and control, we introduce a novel fixed-
time identification scheme for the infinitesimal generator of the infinite-
dimensional, but notably linear, Koopman dynamical system analogous to the
nonlinear system of interest. That is, we derive a parameter adaptation law
that allows us to recover the unknown, residual nonlinear dynamics in the
system within a finite-time independent of an initial estimate. We then use
properties of fixed-time stability to derive an error bound on the residual
vector field estimation error as an explicit function of time, which allows us
to synthesize a provably safe controller using control barrier function based
methods. We conduct a quadrotor-inspired case study in support of our proposed
method, in which we show that safe trajectory tracking is achieved despite
unknown, nonlinear dynamics.

###### keywords:

Control of constrained systems; identification for control; robust adaptive
control; fixed-time stability; nonlinear system identification.

##  1 Introduction

Recent advances in computing power and memory storage have ushered in an era
of estimation, identification, and control for autonomous systems dominated by
data-driven methods. For example, compared to the 74 kilobytes of memory
available on the United States National Aeronautics and Space Administration’s
(NASA) first lunar module computer, the gigabytes of memory used in many of
today’s data-driven approaches to dynamical system identification (e.g. deep
neural networks) have allowed engineers to create significantly more
expressive models. Though regression methods are widely-used for linear system
identification, the field of identification for nonlinear systems is vast.
Popular approaches in recent years include classes of neural networks (NNs),
including deep NNs (e.g. Zancato and Chiuso (2021)) and recurrent NNs for
time-varying systems (Gonzalez and Yu (2018)), Gaussian processes (Frigola and
Rasmussen (2013)), and more recently the application of Koopman operator
theory (e.g. Mauroy and Goncalves (2020); Brunton et al. (2016); Klus et al.
(2020), among others), which introduces an infinite-dimensional but notably
linear representation of a nonlinear system on which traditional linear
identification approaches may be used.

Under Koopman theory there exists a linear Koopman dynamical system that
captures the dynamics of the original nonlinear system over an infinite-
dimensional space of scalar functions known as observables. Beginning with
Mauroy and Goncalves (2020), recent work has focused on using data-driven
approaches to approximate a finite-dimensional matrix representation of the
Koopman operator, which acts as a state-transition operator for the Koopman
dynamical system. In particular, extended dynamic mode decomposition (EDMD),
first introduced in Williams et al. (2015) has emerged as a popular tool for
carrying out such an approximation. The end result in many cases is a batch
estimate of either the Koopman matrix (i.e. in Bruder et al. (2021); Haseli
and Cortés (2021)) or its infinitesimal generator (Klus et al. (2020); Drmač
et al. (2021)) obtained by solving a least-squares regression problem.
Potential shortcomings of this class of approaches include slower response
times than e.g. recursive methods, and a lack of formal guarantees on the
approximation error bound, which may be particularly detrimental when used in
control design. In contrast, it has been shown by Black et al. (2022a) that
fixed-time stability in the context of recursive parameter identification
admits a such bound on the identification error as an explicit function of
time.

Finite- and fixed-time stability (FTS and FxTS) are stronger notions of
stability for equilibria of a dynamical system, each of which guarantee
convergence of the system trajectories to the origin within a finite time.
They have been used in the analysis of linear parameter identification schemes
by Ríos et al. (2017); Ortega et al. (2022), and synthesized for the purpose
of safe control design in Black et al. (2022a); Wang et al. (2022). The
benefit to recursive parameter identification in fixed-time, i.e. in a finite-
time independent of the initial condition, is the knowledge of an error bound
on the identification error as an explicit function of time. When synthesized
with a safe control law, this class of identification schemes yields less
conservative control solutions, as highlighted in Black et al. (2022a).

Control barrier functions (CBFs) have proven to be a useful tool for safe
control synthesis. As a model-based approach, however, it is critical that an
accurate system model be available in order to preserve forward invariance of
the set of safe states. Though robust CBF controllers can protect against
bounded disturbances to the system dynamics (e.g. Jankovic (2018); Black et
al. (2020)), the cost is conservatism. Various other approaches to safe
control have sought to adapt to the unknown residual dynamics (e.g. Taylor and
Ames (2020); Lopez et al. (2021)), or to learn their effects via data-driven
Koopman-based policies both online (Folkestad et al. (2020)) and offline
(Zinage and Bakolas (2022)). None of these methods, however, provide
guarantees on learning convergence time.

In this paper, we address this open problem by introducing a Koopman-based
identification scheme for safe control design that guarantees convergence
within a fixed-time for a class of nonlinear, control-affine systems subject
to an additive, nonlinear perturbation. We use knowledge of the bound on
convergence time to quantify the identification error as an explicit function
of time, the magnitude of which is leveraged to design a provably safe CBF-
based controller. We demonstrate the advantages of our proposed approach on a
trajectory tracking problem, and highlight that the identification and control
laws succeed in preserving safety of the system even in the presence of
measurement noise.

The rest of the paper is organized as follows. In Section 2 we introduce the
preliminaries and define the problem under consideration. Section 3 contains
our main result on fixed-time nonlinear system identification, which we use in
Section 4 to design a safe controller. We demonstrate the approach on a
numerical case study in Section 5, and conclude in Section 6 with directions
for future work.

##  2 Preliminaries and Problem Statement

In this paper, we use the following notation. $\mathbb{R}$ denotes the set of
real numbers. The ones matrix of size $n\times m$ is denoted
$\boldsymbol{1}_{n\times m}$. We use $\|\cdot\|$ to denote the Euclidean norm
and $\|\cdot\|_{\infty}$ to denote the sup norm. We denote the minimum and
maximum eigenvalue of a matrix $\boldsymbol{M}$ as
$\lambda_{min}(\boldsymbol{M})$ and $\lambda_{max}(\boldsymbol{M})$, and refer
to its rth singular value as $\sigma_{r}(\boldsymbol{M})$, to its nullspace as
$\mathcal{N}(\boldsymbol{M})$, and its ith column as
$\mathrm{col}_{i}(\boldsymbol{M})$. The gradient operator is $\nabla$, and the
Lie derivative of a function $V:\mathbb{R}^{n}\rightarrow\mathbb{R}$ along a
vector field $f:\mathbb{R}^{n}\rightarrow\mathbb{R}^{n}$ at a point
$x\in\mathbb{R}^{n}$ is denoted as $L_{f}V(x)\triangleq\frac{\partial
V}{\partial x}f(x)$.

Consider the following class of nonlinear, control-affine systems

$\dot{\boldsymbol{x}}=f(\boldsymbol{x}(t))+g(\boldsymbol{x}(t))\boldsymbol{u}(t)+d(\boldsymbol{x}(t)),\quad\boldsymbol{x}(0)=\boldsymbol{x}_{0},$
(1)

where $\boldsymbol{x}\in\mathcal{X}\subset\operatorname{\mathbb{R}}^{n}$ and
$\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}$ denote the state and control
input vectors, the drift vector field
$f:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}^{n}$ and
control matrix field
$g:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}^{n}\times\operatorname{\mathbb{R}}^{m}$
are known and continuous, and
$d:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}^{n}$ is
an unknown disturbance known to be continuous and to obey
$\|d(\boldsymbol{x})\|_{\infty}\leq D<\infty$ for all
$\boldsymbol{x}\in\mathcal{X}$. Consider also the following set of safe
states,

$S=\\{\boldsymbol{x}\in\mathcal{X}\;|\;h(\boldsymbol{x})\geq 0\\},$ (2)

for a continuously differentiable function
$h:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}$, where
the boundary and interior of $S$ are $\partial
S=\\{\boldsymbol{x}\in\operatorname{\mathbb{R}}^{n}\;|\;h(\boldsymbol{x})=0\\}$
and
$\textrm{int}(S)=\\{\boldsymbol{x}\in\operatorname{\mathbb{R}}^{n}\;|\;h(\boldsymbol{x})>0\\}$
respectively. The trajectories of (1) are said to be safe if the set $S$ is
forward-invariant, i.e. if $\boldsymbol{x}_{0}\in
S\implies\boldsymbol{x}(t)\in S,\forall t\geq 0$. The following lemma, known
as Nagumo’s Theorem, provides necessary and sufficient conditions for
rendering $S$ forward-invariant.

###### Lemma 1

(Blanchini (1999)) Suppose that $\boldsymbol{u}(t)$ is continuous such that
the closed-loop trajectories of (1) are uniquely determined in forward-time.
The set $S$ is forward-invariant if and only if

$\dot{h}=\frac{\partial
h(\boldsymbol{x})}{\partial\boldsymbol{x}}\dot{\boldsymbol{x}}\geq
0,\;\forall\boldsymbol{x}\in\partial S.$ (3)

In recent years, control barrier functions have emerged as a viable approach
for control design satisfying (3).

###### Definition 1

(Ames et al. (2017)) Given a set
$S\subseteq\mathcal{X}\subset\operatorname{\mathbb{R}}^{n}$ defined by (2) for
a continuously differentiable function
$h:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}$, the
function $h$ is a control barrier function (CBF) defined on the set
$\mathcal{X}$ if there exists a Lipschitz continuous class
$\mathcal{K}_{\infty}$ function
$\alpha:\operatorname{\mathbb{R}}\rightarrow\operatorname{\mathbb{R}}$ such
that

$\sup_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}\dot{h}(\boldsymbol{x},\boldsymbol{u})\geq-\alpha(h(\boldsymbol{x})),$
(4)

for all $\boldsymbol{x}\in\mathcal{X}$.

We refer to (4) as the CBF condition, and observe that it constitutes
sufficiency for the satisfaction of (3). As such, any continuous control law
$\boldsymbol{u}(t)$ that 1) admits unique closed-loop trajectories of (1) in
forward-time and 2) satisfies (4) renders the trajectories of (1) safe.
Consider now that for the system (1) the CBF condition is

$\sup_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}\left[L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}+L_{d}h(\boldsymbol{x})\right]\geq-\alpha(h(\boldsymbol{x})),$

where, without identification of $d(\boldsymbol{x})$, the precise value of
$L_{d}h(\boldsymbol{x})$ is unknown. It is known, however, that

$-b_{d}\leq L_{d}h(\boldsymbol{x})\leq b_{d},$

where $b_{d}=D\left|\frac{\partial
h(\boldsymbol{x})}{\partial\boldsymbol{x}}\right|\mathbf{1}_{n\times 1}$.
Under such circumstances, a robust-CBF may be used for safe control design.

###### Definition 2

(Jankovic (2018)) Given a set
$S\subseteq\mathcal{X}\subset\operatorname{\mathbb{R}}^{n}$ defined by (2) for
a continuously differentiable function
$h:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}$, the
function $h$ is a robust control barrier function (r-CBF) for the system (1)
defined on the set $\mathcal{X}$ if there exists a Lipschitz continuous class
$\mathcal{K}_{\infty}$ function
$\alpha:\operatorname{\mathbb{R}}\rightarrow\operatorname{\mathbb{R}}$ such
that

$\sup_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}\left[L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}-b_{d}\right]\geq-\alpha(h(\boldsymbol{x})),$
(5)

for all $\boldsymbol{x}\in\mathcal{X}$.

Designing a controller to protect against the worst possible disturbance in
perpetuity, however, may lead to poor performance, especially if $D$ is large.
Recent work (e.g. Lopez et al. (2021); Black et al. (2022a)) has shown that
this may be mitigated by using an estimate of the unknown disturbance
$\hat{d}(\boldsymbol{x})$. Thus, we define the vector field estimation error
$\tilde{d}(\boldsymbol{x})$ as

$\tilde{d}(\boldsymbol{x})\coloneqq
d(\boldsymbol{x})-\hat{d}(\boldsymbol{x}).$

In Black et al. (2022a), it was shown under mild assumptions that if the
uncertain vector field is parameter-affine, i.e. if

$d(\boldsymbol{x})=\Delta(\boldsymbol{x})\boldsymbol{\theta}^{*},$

for some known, continuous, bounded regressor matrix
$\Delta:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}^{n\times p}$ and
unknown, static, polytopic parameters
$\boldsymbol{\theta}^{*}\in\Theta\subset\operatorname{\mathbb{R}}^{p}$, then
the vector field estimation error may be driven to zero within a fixed time
using parameter adaptation, i.e.
$\|\Delta(\boldsymbol{x}(t))(\boldsymbol{\theta}^{*}-\hat{\boldsymbol{\theta}}(t))\|\rightarrow
0$ as $t\rightarrow T<\infty$, independent of $\hat{\boldsymbol{\theta}}(0)$.
We now review the notion of fixed-time stability.

###  2.1 Fixed-Time Parameter Identification

Consider a nonlinear, autonomous system of the form

$\dot{\boldsymbol{x}}=F(\boldsymbol{x}),\quad\boldsymbol{x}(0)=\boldsymbol{x}_{0},$
(6)

where
$F:\operatorname{\mathbb{R}}^{n}\rightarrow\operatorname{\mathbb{R}}^{n}$ is
continuous such that (6) admits a unique solution for all
$\boldsymbol{x}_{0}\in\operatorname{\mathbb{R}}^{n}$, the value of which at
time $t$ is denoted $\boldsymbol{\varphi}_{t}(\boldsymbol{x}_{0})$, and where
$F(0)=0$.

###### Definition 3

(Polyakov (2012)) The origin of (6) is fixed-time stable (FxTS) if it is
stable in the sense of Lyapunov and any solution
$\boldsymbol{\varphi}_{t}(\boldsymbol{x}_{0})$ of (6) reaches the origin
within a finite time $T$ independent of $\boldsymbol{x}_{0}$, i.e. $\exists
T<\infty$ such that $\boldsymbol{\varphi}_{t}(\boldsymbol{x}_{0})=0$ for all
$t\geq T$, $\forall\boldsymbol{x}_{0}\in\operatorname{\mathbb{R}}^{n}$.

In what follows, we review a fixed-time stable parameter adaptation law from
the literature.

###### Theorem 1

(Black et al. (2022a)) Consider a perturbed dynamical system of the form (1).
Suppose that the following hold:

  1. i)

the unknown, additive dynamics are parameter-affine, i.e.
$d(\boldsymbol{x})=\Delta(\boldsymbol{x})\boldsymbol{\theta}^{*}$,

  2. ii)

there exist a known matrix
$\boldsymbol{M}(t)\in\operatorname{\mathbb{R}}^{n\times p}$ and vector
$\boldsymbol{v}(t)\in\operatorname{\mathbb{R}}^{n}$ such that
$\boldsymbol{M}(t)(\boldsymbol{\theta}^{*}-\hat{\boldsymbol{\theta}}(t))=\boldsymbol{v}(t)$,

  3. iii)

the nullspace of $\Delta(\boldsymbol{x}(t))$ is constant for all $t\leq T$,
i.e.
$\mathcal{N}(\Delta(\boldsymbol{x}(t)))=\mathcal{N}(\Delta(\boldsymbol{x}(0)))$,
$\forall t\leq T$,

where

$T=\frac{\mu\pi}{2k_{V}^{2}\sqrt{ab}},$ (7)

with $a,b>0$, $\mu>2$, and

$k_{V}=\sigma_{r}(\boldsymbol{M})\sqrt{2\lambda_{max}(\boldsymbol{\Gamma})},$
(8)

where $\boldsymbol{\Gamma}\in\mathbb{R}^{p\times p}$ is a constant, positive-
definite, gain matrix and $\sigma_{r}(\boldsymbol{M})>0$ denotes the smallest
nonzero singular value of $\boldsymbol{M}$ over the time interval. Then, under
the ensuing parameter adaptation law,

$\dot{\hat{\boldsymbol{\theta}}}=\boldsymbol{\Gamma}\boldsymbol{M}^{T}\boldsymbol{v}\left(a\|\boldsymbol{v}\|^{\frac{2}{\mu}}+\frac{b}{\|\boldsymbol{v}\|^{\frac{2}{\mu}}}\right),$
(9)

the estimated disturbance $\hat{d}(\boldsymbol{x}(t))$ converges to the true
disturbance $d(\boldsymbol{x}(t))$ within fixed-time $T$, i.e.
$\Delta(\boldsymbol{x}(t))\hat{\boldsymbol{\theta}}(t)\rightarrow\Delta(\boldsymbol{x}(t))\boldsymbol{\theta}^{*}$
as $t\rightarrow T$, and
$\Delta(\boldsymbol{x}(t))\hat{\boldsymbol{\theta}}(t)=\Delta(\boldsymbol{x}(t))\boldsymbol{\theta}^{*}$
for all $t\geq T$, independent of $\hat{\boldsymbol{\theta}}(0)$.

See (Black et al., 2022a, Proof of Theorem 3).

Theorem 1 provides a framework for adapting parameter estimates
$\hat{\boldsymbol{\theta}}$ such that an unknown disturbance of the form
$d(\boldsymbol{x})=\Delta(\boldsymbol{x})\boldsymbol{\theta}^{*}$ is learned
within fixed-time. In reality, however, it is far more common for the unknown
vector field $d(\boldsymbol{x})$ to be nonlinear, which to this point has
precluded the use of (9) as a learning or adaptation strategy. By utilizing
Koopman operator theory, however, we can transform the problem of identifying
the nonlinear function $d$ into a linear, albeit infinite-dimensional,
identification problem, which with appropriate modifications permits the use
of the above adaptation framework.

###  2.2 Koopman Operator based Identification

Koopman theory dictates that a nonlinear system of the form (6) has an
analogous and notably linear representation in an infinite-dimensional Hilbert
space $\mathcal{Q}$ consisting of continuous, real-valued functions
$q:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}$ referred to as
observables. The continuous-time Koopman dynamical system analogous to (6) is
then described by

$\dot{q}=\mathcal{L}q,\quad q\in\mathcal{Q},$ (10)

where $\mathcal{L}$ denotes the infinitesimal generator of the linear
semigroup of Koopman operators
$\mathcal{U}^{t}:\mathcal{Q}\rightarrow\mathcal{Q}$, i.e.

$\mathcal{L}q=\lim_{t\rightarrow 0}\frac{\mathcal{U}^{t}q-q}{t}=F\cdot\nabla
q.$

For tractability, however, many works (e.g. Bruder et al. (2021); Drmač et al.
(2021), among others) derive matrix representations
$\boldsymbol{U}\in\operatorname{\mathbb{R}}^{N\times N}$ and
$\boldsymbol{L}\in\operatorname{\mathbb{R}}^{N\times N}$ of the respective
finite-rank operators
$\mathcal{U}_{N}^{t}=\Pi_{N}\mathcal{U}^{t}|_{\mathcal{Q}_{N}}$ and
$\mathcal{L}_{N}=\Pi_{N}\mathcal{L}|_{\mathcal{Q}_{N}}$, where
$\Pi_{N}:\mathcal{Q}\rightarrow\mathcal{Q}_{N}$ is a projection operator onto
the subspace $\mathcal{Q}_{N}\subset\mathcal{Q}$ (spanned by $N>n$ linearly
independent basis functions
$\\{\psi_{i}:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}\\}_{i=1}^{N}$)
and $\mathcal{O}|_{\mathcal{Q}_{N}}$ denotes the restriction of the operator
$\mathcal{O}$ to $\mathcal{Q}_{N}$. We refer the reader to Mauroy et al.
(2020) for additional details, and instead highlight that in practice
$\boldsymbol{U}$ and $\boldsymbol{L}$ are taken to be the respective solutions
to

$\displaystyle\boldsymbol{\psi}^{T}(\boldsymbol{x})\boldsymbol{U}=(\boldsymbol{\psi}(\boldsymbol{\varphi}_{t}(\boldsymbol{x})))^{T},$
(11)
$\displaystyle\boldsymbol{L}^{T}\boldsymbol{\psi}(\boldsymbol{x})=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}F(\boldsymbol{x}),$
(12)

where
$\boldsymbol{\psi}(\boldsymbol{x})=[\psi_{1}(\boldsymbol{x})\ldots\psi_{N}(\boldsymbol{x})]^{T}\in\operatorname{\mathbb{R}}^{N}$
and
$\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}\in\operatorname{\mathbb{R}}^{N\times
n}$.

If $\boldsymbol{L}$ can be identified directly (as in e.g. Klus et al.
(2020)), the vector field $F$ may be reconstructed by solving (12) for
$F(\boldsymbol{x})$. When this is not possible, identification of
$\boldsymbol{U}$ may be used to reconstruct $F$ after computing
$\boldsymbol{L}$ via

$\boldsymbol{L}=\frac{1}{T_{s}}\log\boldsymbol{U},$ (13)

in the case of sampled data, where $\log$ denotes the principal matrix
logarithm and $T_{s}>0$ is the sampling interval. We observe that both (11)
and (12) describe linear systems of equations of the form
$\boldsymbol{a}^{T}\boldsymbol{X}=\boldsymbol{b}$, and thus $\boldsymbol{X}$
(in this case $\boldsymbol{U}$ or $\boldsymbol{L}$) can be identified using
linear identification techniques such as the parameter identification law (9).

###  2.3 Problem Statement

Now, reconsider the unknown, control-affine, nonlinear system (1). Suppose
that an estimate of its Koopman generator matrix $\hat{\boldsymbol{L}}$ is
available, and let the estimated unknown vector field
$\hat{d}(\boldsymbol{x})$ then via (12) be the solution to

$\hat{\boldsymbol{L}}^{T}\boldsymbol{\psi}(\boldsymbol{x})=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}\big{(}f(\boldsymbol{x})+g(\boldsymbol{x})\boldsymbol{u}+\hat{d}(\boldsymbol{x})\big{)}.$

We assume that
$\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}$ is
full column rank, which may be satisfied by design (e.g. sinusoidal basis
functions), and thus have that $\hat{d}(\boldsymbol{x})\rightarrow
d(\boldsymbol{x})$ as $\hat{\boldsymbol{L}}\rightarrow\boldsymbol{L}$ (which
can also be satisfied if $\hat{\boldsymbol{U}}\rightarrow\boldsymbol{U}$).
Define the vectorized Koopman matrix and generator ($\boldsymbol{\mu}^{*}$ and
$\boldsymbol{\lambda}^{*}$), and their estimates ($\hat{\boldsymbol{\mu}}$ and
$\hat{\boldsymbol{\lambda}}$), as

$\displaystyle\boldsymbol{\mu}^{*}$
$\displaystyle\coloneqq[\mathrm{col}_{1}^{T}(\boldsymbol{U})\ldots\mathrm{col}_{N}^{T}(\boldsymbol{U})]^{T},$
(14) $\displaystyle\boldsymbol{\lambda}^{*}$
$\displaystyle\coloneqq[\mathrm{col}_{1}^{T}(\boldsymbol{L})\ldots\mathrm{col}_{N}^{T}(\boldsymbol{L})]^{T},$
(15) $\displaystyle\hat{\boldsymbol{\mu}}$
$\displaystyle\coloneqq[\mathrm{col}_{1}^{T}(\hat{\boldsymbol{U}})\ldots\mathrm{col}_{N}^{T}(\hat{\boldsymbol{U}})]^{T},$
(16) $\displaystyle\hat{\boldsymbol{\lambda}}$
$\displaystyle\coloneqq[\mathrm{col}_{1}^{T}(\hat{\boldsymbol{L}})\ldots\mathrm{col}_{N}^{T}(\hat{\boldsymbol{L}})]^{T},$
(17)

and observe that for the system (1) the relations (11) and (12) are equivalent
to

$\boldsymbol{\Psi}(\boldsymbol{x})\boldsymbol{\mu}^{*}=(\boldsymbol{\psi}(\boldsymbol{\varphi}_{t}(\boldsymbol{x})))^{T},$
(18)

and

$\boldsymbol{\Psi}(\boldsymbol{x})\boldsymbol{\lambda}^{*}=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}\big{(}f(\boldsymbol{x})+g(\boldsymbol{x})\boldsymbol{u}+d(\boldsymbol{x})\big{)},$
(19)

respectively, where

$\boldsymbol{\Psi}(\boldsymbol{x})\coloneqq\begin{bmatrix}\boldsymbol{\psi}^{T}(\boldsymbol{x})&0&\ldots&0\\\
0&\boldsymbol{\psi}^{T}(\boldsymbol{x})&\ldots&0\\\ \vdots&&\ddots&\vdots\\\
0&\ldots&0&\boldsymbol{\psi}^{T}(\boldsymbol{x})\end{bmatrix}\in\operatorname{\mathbb{R}}^{N\times
N^{2}}.$ (20)

Let the Koopman matrix and Koopman generator estimation errors respectively be
denoted

$\displaystyle\tilde{\boldsymbol{\mu}}$
$\displaystyle=\boldsymbol{\mu}^{*}-\hat{\boldsymbol{\mu}},$
$\displaystyle\tilde{\boldsymbol{\lambda}}$
$\displaystyle=\boldsymbol{\lambda}^{*}-\hat{\boldsymbol{\lambda}},$

and observe that
$\boldsymbol{\Psi}(\boldsymbol{x})\hat{\boldsymbol{\lambda}}=\boldsymbol{\Psi}(\boldsymbol{x})\boldsymbol{\lambda}^{*}$
for all
$\tilde{\boldsymbol{\lambda}}\in\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$.

We are now ready to formally define the problem under consideration.

###### Problem 1

Consider a dynamical system of the form (1). Design adaptation and control
laws,
$\dot{\hat{\boldsymbol{\lambda}}}=\eta(\boldsymbol{x},\boldsymbol{u},\hat{\boldsymbol{\lambda}})$
and $\boldsymbol{u}=\kappa(\boldsymbol{x},\hat{\boldsymbol{\lambda}})$
respectively, such that

  1. 1.

the Koopman generator error vector, $\tilde{\boldsymbol{\lambda}}$, is
rendered fixed-time stable to the nullspace of
$\boldsymbol{\Psi}(\boldsymbol{x})$, i.e.
$\tilde{\boldsymbol{\lambda}}(t)\rightarrow\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$
as $t\rightarrow T$ and
$\tilde{\boldsymbol{\lambda}}(t)\in\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$
for all $t\geq T$, independent of $\hat{\boldsymbol{\lambda}}(0)$, and

  2. 2.

the system trajectories remain safe for all time, i.e. $\boldsymbol{x}(t)\in
S$, $\forall t\geq 0$.

In the ensuing section, we introduce our approach to solving the first element
of Problem 1.

##  3 Nonlinear Estimation in Fixed-Time

In this section, we introduce our proposed adaptation law
$\dot{\hat{\boldsymbol{\lambda}}}=\eta(\boldsymbol{x},\boldsymbol{u},\hat{\boldsymbol{\lambda}})$
for the fixed-time identification of the Koopman generator vector
$\boldsymbol{\lambda}$, which allows us to identify the unknown vector field
$d(\boldsymbol{x})$ in (1) within a fixed-time. Before introducing one of our
main results, we require the following assumptions.

###### Assumption 1

The projection of the infinite-dimensional Koopman operator $\mathcal{U}^{t}$
onto the finite-rank subspace $\mathcal{Q}_{N}$ exactly describes the
evolution of observables $q\in\mathcal{Q}$, i.e.
$\mathcal{U}_{N}^{t}q=(\Pi_{N}\mathcal{U}^{t})q$, for all $q\in\mathcal{Q}$.

###### Assumption 2

There exist scalars $s>0$, $T>0$ such that
$\sigma_{N}(\boldsymbol{\Psi}(\boldsymbol{x}(t)))\geq s$ for all $0\leq t\leq
T$, where $\boldsymbol{\Psi}(\boldsymbol{x}(t))$ is given by (20).

The satisfaction of Assumption 1 depends on the choice of $N$ (and thus on the
basis functions $\boldsymbol{\psi}$), and while generally this is an open
problem recent work has studied the existence of Koopman invariant subspaces
(see e.g. Brunton et al. (2016)), i.e. subspaces
$\mathcal{Q}_{N}\subset\mathcal{Q}$ over which Assumption 1 holds. For our
numerical study in Section 5, we find that bases $\boldsymbol{\psi}$
constructed using monomials or sinusoids work well. The satisfaction of
Assumption 2 evidently depends on the choice of basis functions $\psi_{i}$.
Note, however, that $\boldsymbol{\Psi}(\boldsymbol{x}(t))$ is guaranteed to be
full row-rank (which implies that
$\sigma_{N}(\boldsymbol{\Psi}(\boldsymbol{x}(t)))>0$) provided that $\exists
i\in[N]$ such that $\psi_{i}(\boldsymbol{x}(t))\neq 0$. This can be guaranteed
with an appropriate choice of bases, e.g. $\psi_{1}(\boldsymbol{x}(t))=1$.

###### Theorem 2

Suppose that Assumptions 1 and 2 hold, where

$T=\frac{w\pi}{4s\lambda_{max}(\boldsymbol{\Gamma})\sqrt{ab}},$ (21)

with $a,b>0$, $w>2$, and
$\boldsymbol{\Gamma}\in\operatorname{\mathbb{R}}^{N^{2}\times N^{2}}$ a
constant, positive-definite gain matrix. Then, under the ensuing adaptation
law

$\displaystyle\small\dot{\hat{\boldsymbol{\lambda}}}=\boldsymbol{\Gamma}\boldsymbol{\Psi}^{T}(\boldsymbol{x})\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}})\left(a\|\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}})\|^{2/w}+\frac{b}{\|\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}})\|^{2/w}}\right),$
(22)

the Koopman generator error vector $\tilde{\boldsymbol{\lambda}}$ is rendered
FxTS to the nullspace of $\boldsymbol{\Psi}(\boldsymbol{x})$, i.e.
$\tilde{\boldsymbol{\lambda}}(t)\rightarrow\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}(t)))$
as $t\rightarrow T$ and
$\tilde{\boldsymbol{\lambda}}(t)\in\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$
for all $t\geq T$, independent of $\hat{\boldsymbol{\lambda}}(0)$, where

$\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}})=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}\dot{\boldsymbol{x}}-\boldsymbol{\Psi}(\boldsymbol{x})\hat{\boldsymbol{\lambda}}.$
(23)

We first show that there exists a time-invariant Koopman generator vector
$\boldsymbol{\lambda}(t)=\boldsymbol{\lambda}^{*}$, $\forall t\geq 0$, and
then prove that under (22) the aassociated Koopman generator error vector
$\tilde{\boldsymbol{\lambda}}$ is rendered FxTS to
$\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$.

First, under Assumption 1 it follows that there exists a finite-rank operator
$\mathcal{L}_{N}:\mathcal{Q}_{N}\rightarrow\mathcal{Q}_{N}$ such that the
nonlinear dynamics of (1) may be represented by the following linear system in
the space of observables:

$\dot{q}=\mathcal{L}_{N}q,\quad q\in\mathcal{Q}.$

Then, there exists a finite-dimensional matrix representation
$\boldsymbol{L}\in\operatorname{\mathbb{R}}^{N\times N}$ in a basis
$\\{\psi_{i}:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}\\}_{i=1}^{N}$
corresponding to the operator $\mathcal{L}_{N}$ such that the relation (12)
holds over the trajectories of (1). Thus, the Koopman generator matrix
$\boldsymbol{L}$ admits the (time-invariant) Koopman generator vector
$\boldsymbol{\lambda}^{*}$ defined by (15).

Next, observe that (19) over the trajectories of (1) may be modified to obtain

$\displaystyle\boldsymbol{\Psi}(\boldsymbol{x})\boldsymbol{\lambda}^{*}-\boldsymbol{\Psi}(\boldsymbol{x})\hat{\boldsymbol{\lambda}}$
$\displaystyle=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x})}{\partial\boldsymbol{x}}\dot{\boldsymbol{x}}-\boldsymbol{\Psi}(\boldsymbol{x})\hat{\boldsymbol{\lambda}},$
$\displaystyle\boldsymbol{\Psi}(\boldsymbol{x})\tilde{\boldsymbol{\lambda}}$
$\displaystyle=\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}}),$

where $\boldsymbol{\nu}(\boldsymbol{x},\hat{\boldsymbol{\lambda}})$ is given
by (23). Thus, we have that the premises of Theorem 1 are satisfied with
$\boldsymbol{M}=\boldsymbol{\Psi}$ and $\boldsymbol{v}=\boldsymbol{\nu}$ and
the adaptation law (22) takes the form of (9). Then, with Assumption 2 it
follows directly from Theorem 1 that $\tilde{\boldsymbol{\lambda}}$ is
rendered FxTS to $\mathcal{N}(\boldsymbol{\Psi}(\boldsymbol{x}))$ with
settling time given by (21).

In what follows, we show how the parameter adaptation law (22) results in
learning the exact disturbance $d(\boldsymbol{x})$ to the system dynamics (1)
within fixed-time.

###### Corollary 1

Consider the system (1). Suppose that the premises of Theorem 2 hold, and that
the estimated Koopman vector $\hat{\boldsymbol{\lambda}}$ is adapted according
to (22). If the estimated disturbance $\hat{d}(\boldsymbol{x})$ is taken to be

$\hat{d}(\boldsymbol{x}(t))=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}^{\dagger}\boldsymbol{\Psi}(\boldsymbol{x}(t))\hat{\boldsymbol{\lambda}}(t)-a(\boldsymbol{x}(t),\boldsymbol{u}(t)),$
(24)

where
$a(\boldsymbol{x}(t),\boldsymbol{u}(t))=f(\boldsymbol{x}(t))+g(\boldsymbol{x}(t))\boldsymbol{u}(t)$,
then, the vector field estimation error $\tilde{d}(\boldsymbol{x}(t))$ is
rendered FxTS to the origin and the estimated disturbance
$\hat{d}(\boldsymbol{x}(t))$ converges to the true disturbance
$d(\boldsymbol{x}(t))$ within a fixed-time $T$ given by (21), i.e.
$\tilde{d}(\boldsymbol{x}(t))\rightarrow 0$ and
$\hat{d}(\boldsymbol{x}(t))\rightarrow d(\boldsymbol{x}(t))$ as $t\rightarrow
T$ independent of $\hat{d}(\boldsymbol{x}(0))$.

We first observe from (19) that the disturbance $d(\boldsymbol{x}(t))$ is the
solution to

$\displaystyle\small\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}d(\boldsymbol{x}(t))=\boldsymbol{\Psi}(\boldsymbol{x}(t))\boldsymbol{\lambda}^{*}-\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}a(\boldsymbol{x}(t),\boldsymbol{u}(t)).$
(25)

Next, it follows from Theorem 2 that under (22)
$\hat{\boldsymbol{\lambda}}(t)\rightarrow\boldsymbol{\lambda}^{*}$ as
$t\rightarrow T$. Then, we have that
$\boldsymbol{\Psi}(\boldsymbol{x}(t))\hat{\boldsymbol{\lambda}}(t)\rightarrow\boldsymbol{\Psi}(\boldsymbol{x}(t))\boldsymbol{\lambda}^{*}$
and thus that
$\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}\hat{d}(\boldsymbol{x}(t))\rightarrow\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}d(\boldsymbol{x}(t))$
as $t\rightarrow T$ when $\hat{d}(\boldsymbol{x}(t))$ is taken to be the
solution to (25). Finally, with
$\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}$
full column rank we use its pseudoinverse
$\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}^{\dagger}$
to recover (24) and thus have that $\hat{d}(\boldsymbol{x}(t))\rightarrow
d(\boldsymbol{x}(t))$ as $t\rightarrow T$.

For the purpose of control design it is important to know how the estimation
error signals behave during the transient period $t\leq T$ before the unknown
vector field $d(\boldsymbol{x})$ has been learned. In contrast to least-
squares and related regression based approaches to learning the Koopman matrix
$\boldsymbol{U}$ and/or generator matrix $\boldsymbol{L}$, our FxTS parameter
adaptation law allows us to derive explicit estimation error bounds as a
function of time. In fact, prior work (see Black et al. (2022a)) has shown
that the magnitude of this error bound is a monotonically decreasing function
of time. In the following result, we introduce a modification to the prior
work in order to derive a bound on the magnitude of the vector field
estimation error $\tilde{d}(\boldsymbol{x}(t))$ as an explicit function of
time.

###### Corollary 2

Suppose that the premises of Corollary 1 hold. If, in addition, the initial
estimated Koopman generator vector is set to zero, i.e.
$\hat{\boldsymbol{\lambda}}(0)=\mathbf{0}_{N^{2}\times 1}$, and
$\boldsymbol{\Gamma}$ in (22) is constant, positive-definite, and also
diagonal, then $\forall t\in[0,T]$, where $T$ is given by (21), the following
expression constitutes a monotonically decreasing upper bound on
$\|\tilde{d}(\boldsymbol{x}(t))\|_{\infty}$:

$\|\tilde{d}(\boldsymbol{x}(t))\|_{\infty}\leq\Lambda\sigma_{max}(\boldsymbol{W}(t))\tan^{\frac{w}{2}}(A(t))\coloneqq\delta(t),$
(26)

where

$\Lambda=\sqrt{2\lambda_{max}(\boldsymbol{\Gamma})}\left(\frac{a}{b}\right)^{w/4},$
(27)

and

$\displaystyle\boldsymbol{W}(t)$
$\displaystyle=\frac{\partial\boldsymbol{\psi}(\boldsymbol{x}(t))}{\partial\boldsymbol{x}}^{\dagger}\boldsymbol{\Psi}(\boldsymbol{x}),$
(28) $\displaystyle A(t)$
$\displaystyle=\max\left\\{\Xi-\frac{\sqrt{ab}}{w}t,0\right\\},$ (29)
$\displaystyle\Xi$
$\displaystyle=\tan^{-1}\left(\sqrt{\frac{b}{a}}\left(\frac{1}{2}\boldsymbol{l}^{T}\Gamma^{-1}\boldsymbol{l}\right)^{\frac{1}{w}}\right),$
(30)

where
$\boldsymbol{l}=\frac{2D}{\sigma_{min}(\boldsymbol{W}(0))}\cdot\boldsymbol{1}_{N^{2}\times
1}$, and $\|\tilde{d}(\boldsymbol{x}(t))\|_{\infty}=0$, $\forall t>T$.

See Appendix A.

Knowledge of the upper bound on the disturbance estimation error bound (26)
permits the use of robust, adaptive model-based control techniques. In
particular, we will show in the next section how to synthesize a CBF-based
controller that guarantees safety both before and after the transient phase
$t\leq T$ during which the unknown disturbance $d(\boldsymbol{x})$ is learned,
and in doing so address the second element of Problem 1.

##  4 Robust-Adaptive Control Design

In this section, we describe two approaches to synthesizing the Koopman-based
parameter adaptation law with a CBF-based control law for safe control under
model uncertainty.

###  4.1 Robust-CBF Approach

In the first approach, we demonstrate how to apply robust-CBF principles to
the design of a safe controller
$\boldsymbol{u}=\kappa(\boldsymbol{x},\hat{\boldsymbol{\lambda}})$ when using
the Koopman-based adaptation scheme (22).

###### Theorem 3

Consider a system of the form (1), a safe set $S$ defined by (2) for a
continuously differentiable function
$h:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}$, and suppose that the
premises of Corollary 2 hold. Then, any control input $\boldsymbol{u}$
satisfying

$\sup_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}\left[L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}+L_{\hat{d}}h(\boldsymbol{x})-b_{d}(t)\right]\geq-\alpha(h(\boldsymbol{x}))$
(31)

renders the trajectories of (1) safe, where

$b_{d}(t)=\left|\frac{\partial
h}{\partial\boldsymbol{x}}\right|\delta(t)\cdot\mathbf{1}_{n\times 1},$ (32)

and $\delta(t)$ is given by (26).

Observe that over the trajectories of (1)

$\displaystyle\dot{h}$
$\displaystyle=L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}+L_{d}h(\boldsymbol{x})$
$\displaystyle=L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}+\frac{\partial
h}{\partial\boldsymbol{x}}\hat{d}(\boldsymbol{x})+\frac{\partial
h}{\partial\boldsymbol{x}}\tilde{d}(\boldsymbol{x})$ $\displaystyle\geq
L_{f}h(\boldsymbol{x})+L_{g}h(\boldsymbol{x})\boldsymbol{u}+\frac{\partial
h}{\partial\boldsymbol{x}}\hat{d}(\boldsymbol{x})-\left|\frac{\partial
h}{\partial\boldsymbol{x}}\right|\delta(t)\cdot\mathbf{1}_{n\times 1}.$

By Corollary 2 it follows that
$\|\tilde{d}(\boldsymbol{x}(t))\|_{\infty}\leq\delta(t)$ for all $t\geq 0$.
Therefore, $\dot{h}\geq-\alpha(h(\boldsymbol{x})$ whenever (31) holds, and
thus $S$ is rendered forward-invariant by any control input satisfying (31).

It is worth noting that as the estimated disturbance $\hat{d}(\boldsymbol{x})$
converges to the true disturbance $d(\boldsymbol{x})$ the robustness term
$b_{d}(t)$ will go to zero. So while initially the condition (31) may demand
large control inputs to guarantee safety in the face of a the unknown
disturbance, as $t\rightarrow T$ the term $b_{d}(t)\rightarrow 0$ and the
standard CBF condition is recovered.

###  4.2 Robust-Adaptive CBF Approach

In this approach, we define the following robust-adaptive safe set

$S_{r}=\\{\boldsymbol{x}\in\mathcal{X}:h_{r}(\boldsymbol{x},t)\geq 0\\}$ (33)

for the continuously differentiable function

$h_{r}(\boldsymbol{x},t)=h(\boldsymbol{x})-\frac{1}{2}\boldsymbol{\delta}^{T}(t)\boldsymbol{\Omega}^{-1}\boldsymbol{\delta}(t),$

for $\boldsymbol{\delta}(t)=\delta(t)\cdot\mathbf{1}_{n\times 1}$ with
$\delta(t)$ given by (26), and a constant, positive-definite matrix
$\boldsymbol{\Omega}\in\operatorname{\mathbb{R}}^{n\times n}$. We note that
the set $S_{r}$ defined by (33) is a subset of the safe set $S$ defined by
(2), i.e. $S_{r}\subseteq S$. We now introduce a robust-adaptive CBF condition
that renders the trajectories of (1) safe.

###### Theorem 4

Consider a system of the form (1), a set $S_{r}$ defined by (33) for a
continuously differentiable function
$h_{r}:\mathcal{X}\rightarrow\operatorname{\mathbb{R}}$, and suppose that the
premises of Corollary 2 hold. Then, any control input $\boldsymbol{u}$
satisfying

$\sup_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}\left[L_{f}h_{r}(\boldsymbol{x})+L_{g}h_{r}(\boldsymbol{x})\boldsymbol{u}-r\big{(}t,\hat{d}(\boldsymbol{x}(t))\big{)}\right]\geq-\alpha(h_{r}(\boldsymbol{x}))$
(34)

renders the trajectories of (1) safe, where

$r\big{(}t,\hat{d}(\boldsymbol{x}(t))\big{)}=\mathrm{Tr}(\boldsymbol{\Omega}^{-1})\delta(t)\dot{\delta}(t)+b_{d}(t),$

where $\delta(t)$ is given by (26), $b_{d}(t)$ is given by (32), and

$\displaystyle\dot{\delta}(t)$
$\displaystyle=\Lambda\dot{\sigma}_{max}(\boldsymbol{W}(t))\tan^{\frac{w}{2}}(A(t))$
(35)
$\displaystyle\quad-\frac{1}{2}\Lambda\sigma_{max}(\boldsymbol{W}(t))\sqrt{ab}\tan^{\frac{w}{2}-1}(A(t))\mathrm{sec}^{2}(A(t))$

Follows directly from (Black et al., 2022a, Theorem 5) by replacing
$\tilde{\boldsymbol{\theta}}$ with $\tilde{d}(\boldsymbol{x})$.

###### Remark 1

We note that the robust-adaptive CBF condition (34) requires the time-
derivative of the maximum singular value of the matrix $\boldsymbol{W}(t)$
given by (28), i.e. $\dot{\sigma}_{max}(\boldsymbol{W}(t))$. While this may
not be available in closed-form, it may be approximated in practice using
finite-difference methods.

Since both the robust (31) and robust-adaptive (34) CBF conditions ensure
safety of the trajectories of (1), either condition may be included as an
affine constraint in the now popular quadratic program based control law (eg.
Ames et al. (2017); Black et al. (2020)). We now introduce one such iteration
of the QP controller,

$\displaystyle\boldsymbol{u}^{*}=\operatorname*{arg\,min}_{\boldsymbol{u}\in\operatorname{\mathbb{R}}^{m}}$
$\displaystyle\frac{1}{2}\|\boldsymbol{u}-\boldsymbol{u}^{0}\|^{2}$ (36a) s.t.
$\displaystyle\forall s\in[1..c]$
$\displaystyle\mathrm{Either}\;\eqref{eq.robust_koopman_cbf_condition}\;\mathrm{or}\;\eqref{eq.ra_koopman_cbf_condition},$
(36b)

the objective (36a) of which seeks to find a minimally deviating solution
$\boldsymbol{u}^{*}$ from a nominal, potentially unsafe input
$\boldsymbol{u}^{0}$ subject to the specified CBF constraint (36b).

In the following section, we demonstrate the efficacy of our jointly proposed
adaptation (22) and control (36) laws on a quadrotor tracking problem.

##  5 Numerical Case Study

Let $\mathcal{F}$ be an inertial frame with a point $s_{0}$ denoting its
origin. Consider a quadrotor seeking to track a Gerono lemnisicate (i.e.
figure-eight) trajectory amidst circular obstacles in the 2D plane. Quadrotor
dynamics are known to be differentially-flat, thus as shown to be feasible in
Zhou and Schwager (2014) we take the model to be the following 2D double-
integrator subject to an unknown, wind disturbance:

$\begin{bmatrix}\dot{x}\\\ \dot{y}\\\ \dot{v}_{x}\\\
\dot{v}_{y}\end{bmatrix}=\begin{bmatrix}v_{x}\\\ v_{y}\\\ a_{x}\\\
a_{y}\end{bmatrix}+\begin{bmatrix}0\\\ 0\\\ d_{x}(\boldsymbol{z})\\\
d_{y}(\boldsymbol{z})\end{bmatrix},$ (37)

where $x$ and $y$ denote the position coordinates (in m), $v_{x}$ and $v_{y}$
are the velocities (in m/s), and $a_{x}$ and $a_{y}$ are the accelerations (in
m/s2). The full state and control input vectors are
$\boldsymbol{z}=[x\;y\;v_{x}\;v_{y}]^{T}\in\operatorname{\mathbb{R}}^{4}$ and
$\boldsymbol{u}=[a_{x}\;a_{y}]^{T}\in\operatorname{\mathbb{R}}^{2}$
respectively, and
$d_{x}:\operatorname{\mathbb{R}}^{4}\rightarrow\operatorname{\mathbb{R}}$ and
$d_{y}:\operatorname{\mathbb{R}}^{4}\rightarrow\operatorname{\mathbb{R}}$ are
unknown wind-gust accelerations satisfying the requirements of $d$ in (1).
Specifically, we used the wind-gust model from Davoudi et al. (2020) to obtain
spatially varying wind velocities $w_{i}(\boldsymbol{z})$ and set
$d_{i}(\boldsymbol{z})=C_{d}(w_{i}(\boldsymbol{z})-v_{i})$ for
$i\in\\{x,y\\}$, where $C_{d}$ is a drag coefficient, such that
$\|d_{x}(\boldsymbol{z})\|_{\infty},\|d_{y}(\boldsymbol{z})\|_{\infty}\leq
D=10$.

We consider the presence of two circular obstacles, each of which occludes the
desired quadrotor path. As such, the safe set is defined as

$S=\\{\boldsymbol{z}\in\operatorname{\mathbb{R}}^{4}:h_{1}(\boldsymbol{z})\geq
0\\}\cap\\{\boldsymbol{z}\in\operatorname{\mathbb{R}}^{4}:h_{2}(\boldsymbol{z})\geq
0\\},$

where $h_{i}(\boldsymbol{z})=(x-c_{x,i})^{2}+(y-c_{y,i})^{2}-R^{2}$ for
$i\in\\{1,2\\}$, $(c_{x,i},c_{y,i})$ denotes the center of the ith obstacle,
and $R$ is its radius. Since $h_{1},h_{2}$ are relative-degree two with
respect to (37), we use future-focused CBFs for a form of safe, predictive
control (see Black et al. (2022b) for details).

We use forms of the CBF-QP control law111All simulation code and data are
available online at https://github.com/6lackmitchell/nonlinear-fxt-adaptation-
control (36) corresponding to both the robust (31) and robust-adaptive (34)
CBF conditions, and compare the performance against a naive (i.e. assuming
exact identification, $\hat{d}=d$) CBF controller equipped with the data-
driven Koopman-based identification schemes proposed in Bruder et al. (2021)
and Klus et al. (2020) respectively. For the robust and robust-adaptive
simulations we inject additive Gaussian measurement noise into both
$\boldsymbol{x}$ and $\dot{\boldsymbol{x}}$ in order to stress-test the
algorithm under non-ideal conditions. We use the nominal control law
introduced for quadrotors in Schoellig et al. (2012) and adapted for our
dynamics, where the reference trajectory is the Gerono lemniscate defined by

$\displaystyle x^{*}(t)$ $\displaystyle=4\sin(0.2\pi t)$ $\displaystyle
y^{*}(t)$ $\displaystyle=4\sin(0.2\pi t)\cos(0.2\pi t),$

which specifies that one figure-eight pattern be completed every 10s. Our
circular obstacles are centered on $(-2.5,0)$ and $(2,-1)$ respectively, each
with a radius of $R=1.5$m. For all controllers, we used linear class
$\mathcal{K}_{\infty}$ functions $\alpha(h)=h$. For our Koopman basis
functions, we used sinusoids of the form $\psi_{i}=\sqrt{2}\cos(n\pi z)$,
$\psi_{i+1}=\sqrt{2}\sin(n\pi z)$, for $n\in\\{1,2\\}$ and
$z\in\\{x,y,v_{x},v_{y}\\}$.

The resulting paths taken by the simulated CBF-controlled vehicles (Koopman-
based naive, robust, and robust-adaptive), as well as the path taken for the
nominally controlled vehicle without disturbance estimation are displayed in
Figure 1. Here, only the robust and robust-adaptive CBF controllers that use
our fixed-time identification approach preserve safety (as seen in Figure 2).
As the data-driven Koopman matrix (Bruder et al. (2021)) and generator (Klus
et al. (2020)) approaches are non-recursive and unable to quantify the
identification error, they are neither sufficiently responsive nor accurate
enough to guarantee safety in this example. Figure 3 highlights that our
disturbance estimates indeed converge to the true values within the fixed-time
$T=0.12$ sec, computed using (21), and the control inputs are shown in Figure
4. We further note that even when measurement noise is injected into the
system, the adaptation-based approach succeeds in both reconstructing the
unknown disturbance to within a small error and preserving safety. We leave
quantification of this measurement error and any error associated with
representing the infinite-dimensional Koopman operator in a finite-dimensional
subspace to future work.

Figure 1: XY paths under the various CBF-QP control laws in the double-
integrator example. Only the controllers using the proposed Koopman-based
fixed-time identification scheme succeed in preserving safety. Figure 2:
Evolutions of $h_{1}$ and $h_{2}$ for the various controllers considered in
the double-integrator example. Figure 3: The estimates $\hat{d}_{x}$,
$\hat{d}_{y}$ of the unknown wind gusts ($d_{x}$ and $d_{x}$). In our scheme,
the estimates converge to the true values within the fixed-time $T$ without
noise, and converge to a close approximation in the presence of measurement
noise. Figure 4: Control inputs for the double-integrator example.

##  6 Conclusion

We introduced a safe control synthesis using Koopman-based fixed-time system
identification. We showed that under mild assumptions we can learn the
unknown, additive, nonlinear vector field perturbing the system dynamics
within a fixed-time independent of the initial estimate. The a priori
knowledge of this identification guarantee allows us to derive robust and
robust-adaptive control barrier function conditions suitable for use in a
standard class of quadratic program based controllers.

We recognize that there are practical limitations to our method, including the
need to measure the state derivative and to be able to exactly represent the
linear, infinite-dimensional Koopman dynamical system with a finite-rank
operator. Though we demonstrated some robustness to measurement noise in our
simulated study, in the future we will seek to relax these assumptions by
analyzing the use of observers and filters for state and state-derivative
approximation and by seeking to quantify the residual error associated with
projecting the infinite-dimensional Koopman operator onto a finite-dimensional
subspace.

The authors would like to acknowledge the support of the National Science
Foundation (NSF) through grants 1931982 and 1942907.

## References

  * Ames et al. (2017) Ames, A.D., Xu, X., Grizzle, J.W., and Tabuada, P. (2017).  Control barrier function based quadratic programs for safety critical systems.  _IEEE Trans. on Automatic Control_ , 62(8), 3861–3876.
  * Black et al. (2022a) Black, M., Arabi, E., and Panagou, D. (2022a).  Fixed-time parameter adaptation for safe control synthesis.  _arXiv preprint arXiv:2204.10453_.
  * Black et al. (2020) Black, M., Garg, K., and Panagou, D. (2020).  A quadratic program based control synthesis under spatiotemporal constraints and non-vanishing disturbances.  In _2020 59th IEEE Conference on Decision and Control (CDC)_ , 2726–2731.
  * Black et al. (2022b) Black, M., Jankovic, M., Sharma, A., and Panagou, D. (2022b).  Future-focused control barrier functions for autonomous vehicle control.  _arXiv preprint arXiv:2204.00127_.
  * Blanchini (1999) Blanchini, F. (1999).  Set invariance in control.  _Automatica_ , 35(11), 1747–1767.
  * Bruder et al. (2021) Bruder, D., Fu, X., Gillespie, R.B., Remy, C.D., and Vasudevan, R. (2021).  Data-driven control of soft robots using koopman operator theory.  _IEEE Transactions on Robotics_ , 37(3), 948–961.  10.1109/TRO.2020.3038693.
  * Brunton et al. (2016) Brunton, S.L., Brunton, B.W., Proctor, J.L., and Kutz, J.N. (2016).  Koopman invariant subspaces and finite linear representations of nonlinear dynamical systems for control.  _PloS one_ , 11(2), e0150171.
  * Davoudi et al. (2020) Davoudi, B., Taheri, E., Duraisamy, K., Jayaraman, B., and Kolmanovsky, I. (2020).  Quad-rotor flight simulation in realistic atmospheric conditions.  _AIAA Journal_ , 58(5), 1992–2004.
  * Drmač et al. (2021) Drmač, Z., Mezić, I., and Mohr, R. (2021).  Identification of nonlinear systems using the infinitesimal generator of the koopman semigroup—a numerical implementation of the mauroy–goncalves method.  _Mathematics_ , 9(17), 2075.  10.3390/math9172075.
  * Folkestad et al. (2020) Folkestad, C., Chen, Y., Ames, A.D., and Burdick, J.W. (2020).  Data-driven safety-critical control: Synthesizing control barrier functions with koopman operators.  _IEEE Control Systems Letters_ , 5(6), 2012–2017.
  * Frigola and Rasmussen (2013) Frigola, R. and Rasmussen, C.E. (2013).  Integrated pre-processing for bayesian nonlinear system identification with gaussian processes.  In _52nd IEEE Conference on Decision and Control_ , 5371–5376. IEEE.
  * Gonzalez and Yu (2018) Gonzalez, J. and Yu, W. (2018).  Non-linear system modeling using lstm neural networks.  _IFAC-PapersOnLine_ , 51(13), 485–489.
  * Haseli and Cortés (2021) Haseli, M. and Cortés, J. (2021).  Data-driven approximation of koopman-invariant subspaces with tunable accuracy.  In _2021 American Control Conference (ACC)_ , 470–475.  10.23919/ACC50511.2021.9483259.
  * Jankovic (2018) Jankovic, M. (2018).  Robust control barrier functions for constrained stabilization of nonlinear systems.  _Automatica_ , 96, 359–367.
  * Klus et al. (2020) Klus, S., Nüske, F., Peitz, S., Niemann, J.H., Clementi, C., and Schütte, C. (2020).  Data-driven approximation of the koopman generator: Model reduction, system identification, and control.  _Physica D: Nonlinear Phenomena_ , 406, 132416.  https://doi.org/10.1016/j.physd.2020.132416.
  * Lopez et al. (2021) Lopez, B.T., Slotine, J.J.E., and How, J.P. (2021).  Robust adaptive control barrier functions: An adaptive and data-driven approach to safety.  _IEEE Control Systems Letters_ , 5(3), 1031–1036.  10.1109/LCSYS.2020.3005923.
  * Mauroy and Goncalves (2020) Mauroy, A. and Goncalves, J. (2020).  Koopman-based lifting techniques for nonlinear systems identification.  _IEEE Transactions on Automatic Control_ , 65(6), 2550–2565.  10.1109/TAC.2019.2941433.
  * Mauroy et al. (2020) Mauroy, A., Susuki, Y., and Mezić, I. (2020).  _Koopman operator in systems and control_.  Springer.
  * Ortega et al. (2022) Ortega, R., Bobtsov, A., and Nikolaev, N. (2022).  Parameter identification with finite-convergence time alertness preservation.  _IEEE Control Systems Letters_ , 6, 205–210.  10.1109/LCSYS.2021.3057012.
  * Polyakov (2012) Polyakov, A. (2012).  Nonlinear feedback design for fixed-time stabilization of linear control systems.  _IEEE Transactions on Automatic Control_ , 57(8), 2106.
  * Ríos et al. (2017) Ríos, H., Efimov, D., Moreno, J.A., Perruquetti, W., and Rueda-Escobedo, J.G. (2017).  Time-varying parameter identification algorithms: Finite and fixed-time convergence.  _IEEE Transactions on Automatic Control_ , 62(7), 3671–3678.
  * Schoellig et al. (2012) Schoellig, A.P., Wiltsche, C., and D’Andrea, R. (2012).  Feed-forward parameter identification for precise periodic quadrocopter motions.  In _2012 American Control Conference (ACC)_ , 4313–4318.  10.1109/ACC.2012.6315248.
  * Taylor and Ames (2020) Taylor, A.J. and Ames, A.D. (2020).  Adaptive safety with control barrier functions.  In _2020 American Control Conference (ACC)_ , 1399–1405.  10.23919/ACC45564.2020.9147463.
  * Wang et al. (2022) Wang, S., Lyu, B., Wen, S., Shi, K., Zhu, S., and Huang, T. (2022).  Robust adaptive safety-critical control for unknown systems with finite-time elementwise parameter estimation.  _IEEE Transactions on Systems, Man, and Cybernetics: Systems_ , 1–11.  10.1109/TSMC.2022.3203176.
  * Williams et al. (2015) Williams, M.O., Kevrekidis, I.G., and Rowley, C.W. (2015).  A data–driven approximation of the koopman operator: Extending dynamic mode decomposition.  _Journal of Nonlinear Science_ , 25(6), 1307–1346.
  * Zancato and Chiuso (2021) Zancato, L. and Chiuso, A. (2021).  A novel deep neural network architecture for non-linear system identification.  _IFAC-PapersOnLine_ , 54(7), 186–191.
  * Zhou and Schwager (2014) Zhou, D. and Schwager, M. (2014).  Vector field following for quadrotors using differential flatness.  In _2014 IEEE International Conference on Robotics and Automation (ICRA)_ , 6567–6572.  10.1109/ICRA.2014.6907828.
  * Zinage and Bakolas (2022) Zinage, V. and Bakolas, E. (2022).  Neural koopman control barrier functions for safety-critical control of unknown nonlinear systems.  _arXiv preprint arXiv:2209.07685_.

##  Appendix A Proof of Corollary 1

Using (24) and (28) we can express the disturbance vector field error as

$\displaystyle\tilde{d}(\boldsymbol{x}(t))$
$\displaystyle=d(\boldsymbol{x}(t))-\hat{d}(\boldsymbol{x}(t)),$
$\displaystyle=\boldsymbol{W}(t)\tilde{\boldsymbol{\lambda}}(t),$

and thus can observe that
$\|d(\boldsymbol{x}(t))\|_{\infty}=\|\boldsymbol{W}(t)\tilde{\boldsymbol{\lambda}}(t)\|_{\infty}\leq\sigma_{max}(\boldsymbol{W}(t))\|\tilde{\boldsymbol{\lambda}}(t)\|_{\infty}$.
Then, using (Black et al., 2022a, Corollary 1) we obtain that
$\|\tilde{\boldsymbol{\lambda}}(t)\|_{\infty}\leq\Lambda\tan^{\frac{w}{2}}(A(t))$
for all $t\leq T$, where $\Lambda$, $A(t)$, and $T$ are given by (27), (29),
(21) respectively, and $\|\tilde{\boldsymbol{\lambda}}(t)\|_{\infty}=0$ for
all $t>T$.

Then, to obtain the $\Xi$ term in (30), observe that with
$\hat{\boldsymbol{\lambda}}(0)=\mathbf{0}_{N^{2}\times 1}$ and the assumption
that $\|d(\boldsymbol{x})\|_{\infty}\leq D$,
$\forall\boldsymbol{x}\in\mathcal{X}$, it follows that at $t=0$

$\sigma_{min}(\boldsymbol{W})\|\tilde{\boldsymbol{\lambda}}\|_{\infty}\leq\|\boldsymbol{W}\tilde{\boldsymbol{\lambda}}\|_{\infty}=\|\tilde{d}(\boldsymbol{x})\|_{\infty}\leq
2D,$

from which we obtain that

$\|\tilde{\boldsymbol{\lambda}}(0)\|_{\infty}\leq\frac{2D}{\sigma_{min}\left(\boldsymbol{W}(0)\right)}.$

Thus we obtain
$\boldsymbol{l}=\frac{2D}{\sigma_{min}\left(\boldsymbol{W}(0)\right)}\cdot\mathbf{1}_{N^{2}\times
1}$, and this completes the proof.