Verification and Synthesis of Compatible Control Lyapunov and Control Barrier Functions

Hongkai Dai∗1, Chuanrui Jiang∗2, Hongchao Zhang2, and Andrew Clark2 1Hongkai Dai is with the Toyota Research Institute, Los Altos, CA, USA. Email: [email protected]2Chuanrui Jiang, Hongchao Zhang and Andrew Clark are with the Electrical and Systems Engineering Department, McKelvey School of Engineering, Washington University in St. Louis, St. Louis, MO 63130 {[email protected], hongchao, andrewclark}@wustl.edu denotes equal contributionThis work was supported by the Air Force Office of Scientific Research grants FA9550-22-1-0054 and FA9550-23-1-0208 and NSF grant CNS-1941670.
Abstract

Safety and stability are essential properties of control systems. Control Barrier Functions (CBFs) and Control Lyapunov Functions (CLFs) have been proposed to ensure safety and stability respectively. However, previous approaches typically verify and synthesize the CBFs and CLFs separately, satisfying their respective constraints, without proving that the CBFs and CLFs are compatible with each other, namely at every state, there exists control actions that satisfy both the CBF and CLF constraints simultaneously. There exists some recent works that synthesized compatible CLF and CBF, but relying on nominal polynomial or rational controllers, which is just a sufficient but not necessary condition for compatibility. In this work, we investigate verification and synthesis of compatible CBF and CLF independent from any nominal controllers. We derive exact necessary and sufficient conditions for compatibility, and further formulate Sum-Of-Squares program for the compatibility verification. Based on our verification framework, we also design an alternating nominal-controller-free synthesis method. We evaluate our method in a linear toy, a non-linear toy, and a power converter example.

I Introduction

Safety and stability are essential for control systems that must be ensured to prevent catastrophic economic damage and loss of human life, while still achieve the desired goal [1, 2, 3, 4]. Lyapunov stability guarantees that all trajectories starting within the system’s region-of-attraction (RoA) will converge to the goal state. Meanwhile, safety properties are normally formulated as the positive invariance [5] of given regions in the state space.

The importance of safety has motivated numerous methods such as artificial potential fields [6], reachability analysis[7], Hamilton–Jacobi analysis[8], model predictive control [9], and control barrier functions [10] to synthesize safe control strategies. Among these methods, energy-based methodologies such as barrier certificates [11] and Control Barrier Functions (CBFs) [10] have been proposed that construct an energy function that is positive if the system is safe, and then demonstrate safety by proving that the energy function remains positive for all time. Similarly, Lyapunov stability is certified by a Lyapunov function [12] or a Control Lyapunov function (CLF) [13], which remains non-negative and decreasing along any trajectories, and achieves the minimal value at the goal state. One major benefit of CLFs/CBFs is that they can be incorporated as constraints within optimization-based controllers, resulting in CLF-CBF control policies for joint safety and stability [5, 14]. Such techniques have been widely used in safety critical scenarios such as adaptive cruise control[5, 15], bipedal robot control [10, 16], and multi-waypoint navigation [3], with many different approaches to synthesize the CLF-CBF functions [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31].

A key challenge in CLF-CBF-based safe control policies is the compatibility of the CLF and CBF constraints, namely the existence of at least one admissible control action satisfying both CLF and CBF constraints simultaneously at every state in the safe region. Most previous approaches address incompatibility by relaxing the CLF constraints [5], and thus prioritizing safety over stability. However, this may sacrifice the stability and result in the system remaining in undesired states [32]. Recent efforts [33, 34] have utilized Sum-Of-Squares (SOS) methods [35, 36] to verify and synthesize compatible CLF and CBF based on nominal controllers. In such methods, a nominal controller is parameterized as a polynomial (or rational) function of state; these methods search for the CLF/CBF together with this nominal controller, such that this nominal controller simultaneously satisfies both the CLF and CBF constraints. The disadvantages of this approach is that it is only a sufficient but not necessary condition for compatibility, as there might exist a non-polynomial (or non-rational) compatible controller, which cannot be captured by the explicit parameterization. A related but orthogonal direction of research synthesizes closed-form controllers for CBF and CLF that are known to be compatible [37].

In this paper, we study the problem of exact verification and synthesis of compatible CLF/CBF for all states in the safe region. We consider a nonlinear control-affine system, both with and without input limits, and derive necessary and sufficient conditions for compatibility using Farkas’ Lemma and the algebraic-geometric Postivstellensatz. We formulate the verification as a SOS program and further simplify it using S-procedure. To synthesize compatible CLF/CBF, we propose a bi-linear alternating method based on the simplified verification program. To summarize, this paper makes the following contributions.

  • We derived the necessary and sufficient condition for CLF-CBF compatibility, and formulated a SOS program independent from any nominal controllers for compatibility verification.

  • We next proposed an alternating method based on verification program to synthesis compatible CBF and CLF, also independent from any nominal controllers.

  • We demonstrated our method in a linear toy, a non-linear toy and a power converter examples.

The rest of the paper is organized as follows. Section II introduces the mathematical background on Positivstellensatz and Farkas’ lemma. Section III presents the definition of the system model, CBF and CLF. The proposed verification and synthesis framework are introduced in Section IV. Section V gives the simulation results, and we conclude the paper in Section VI.

Notation: We use lower case letter (x𝑥xitalic_x) to denote a scalar, bold lower case (𝐱𝐱\mathbf{x}bold_x) to denote a vector, upper case letter (X𝑋Xitalic_X) for a matrix, and calligraphic letter (𝒳𝒳\mathcal{X}caligraphic_X) to denote a set.

II Mathematical background

A polynomial p(𝐱)𝑝𝐱p(\mathbf{x})italic_p ( bold_x ) is sum-of-squares (sos) iff

p(𝐱)=i=1n(pi(𝐱))2𝑝𝐱superscriptsubscript𝑖1𝑛superscriptsubscript𝑝𝑖𝐱2p(\mathbf{x})=\sum_{i=1}^{n}(p_{i}(\mathbf{x}))^{2}italic_p ( bold_x ) = ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ( italic_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT

for some polynomials pi(𝐱)subscript𝑝𝑖𝐱p_{i}(\mathbf{x})italic_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ). A sos polynomial is non-negative. It can be verified that a polynomial is sos through convex optimization.

The cone generated from a set of polynomials ϕ1,,ϕssubscriptitalic-ϕ1subscriptitalic-ϕ𝑠\phi_{1},\ldots,\phi_{s}italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT is given by

Σ[ϕ1,,ϕs]={S{1,,s}αS(𝐱)iSϕi(𝐱):αS(𝐱) SOS S{1,,s}}.Σsubscriptitalic-ϕ1subscriptitalic-ϕ𝑠conditional-setsubscript𝑆1𝑠subscript𝛼𝑆𝐱subscriptproduct𝑖𝑆subscriptitalic-ϕ𝑖𝐱subscript𝛼𝑆𝐱 SOS for-all𝑆1𝑠\Sigma[\phi_{1},\ldots,\phi_{s}]=\left\{\sum_{S\subseteq\{1,\ldots,s\}}{\alpha% _{S}(\mathbf{x})\prod_{i\in S}{\phi_{i}(\mathbf{x})}}:\right.\\ \left.\alpha_{S}(\mathbf{x})\in\mbox{ SOS }\forall S\subseteq\{1,\ldots,s\}% \right\}.start_ROW start_CELL roman_Σ [ italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ] = { ∑ start_POSTSUBSCRIPT italic_S ⊆ { 1 , … , italic_s } end_POSTSUBSCRIPT italic_α start_POSTSUBSCRIPT italic_S end_POSTSUBSCRIPT ( bold_x ) ∏ start_POSTSUBSCRIPT italic_i ∈ italic_S end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) : end_CELL end_ROW start_ROW start_CELL italic_α start_POSTSUBSCRIPT italic_S end_POSTSUBSCRIPT ( bold_x ) ∈ SOS ∀ italic_S ⊆ { 1 , … , italic_s } } . end_CELL end_ROW

The ideal generated from polynomials ψ1,,ψrsubscript𝜓1subscript𝜓𝑟\psi_{1},\ldots,\psi_{r}italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ψ start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT is given by

𝕀[ψ1,,ψr]={l=1rai(𝐱)ψl(𝐱):a1,,ar polynomials}.𝕀subscript𝜓1subscript𝜓𝑟conditional-setsuperscriptsubscript𝑙1𝑟subscript𝑎𝑖𝐱subscript𝜓𝑙𝐱subscript𝑎1subscript𝑎𝑟 polynomials\mathbb{I}[\psi_{1},\ldots,\psi_{r}]=\left\{\sum_{l=1}^{r}{a_{i}(\mathbf{x})% \psi_{l}(\mathbf{x})}:a_{1},\ldots,a_{r}\mbox{ polynomials}\right\}.start_ROW start_CELL blackboard_I [ italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ψ start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ] = { ∑ start_POSTSUBSCRIPT italic_l = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_r end_POSTSUPERSCRIPT italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) italic_ψ start_POSTSUBSCRIPT italic_l end_POSTSUBSCRIPT ( bold_x ) : italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_a start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT polynomials } . end_CELL end_ROW
Theorem 1 (Positivstellensatz (P-satz)[36])

Let (ϕj)j=1,,ssubscriptsubscriptitalic-ϕ𝑗𝑗1𝑠\left(\phi_{j}\right)_{j=1,\ldots,s}( italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_j = 1 , … , italic_s end_POSTSUBSCRIPT, (ψ)=1,,rsubscriptsubscript𝜓1𝑟\left(\psi_{\ell}\right)_{\ell=1,\ldots,r}( italic_ψ start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT roman_ℓ = 1 , … , italic_r end_POSTSUBSCRIPT be finite families of polynomials in [𝐱]delimited-[]𝐱\mathbb{R}\left[\mathbf{x}\right]blackboard_R [ bold_x ]. Denote the cone generated from (ϕj)j=1,,ssubscriptsubscriptitalic-ϕ𝑗𝑗1𝑠\left(\phi_{j}\right)_{j=1,\ldots,s}( italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_j = 1 , … , italic_s end_POSTSUBSCRIPT by Σ[ϕ1,,ϕs]Σsubscriptitalic-ϕ1subscriptitalic-ϕ𝑠\Sigma[\phi_{1},\ldots,\phi_{s}]roman_Σ [ italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ] , and the ideal generated from (ψ)=1,,rsubscriptsubscript𝜓1𝑟\left(\psi_{\ell}\right)_{\ell=1,\ldots,r}( italic_ψ start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT roman_ℓ = 1 , … , italic_r end_POSTSUBSCRIPT by 𝕀[ψ1,,ψr]𝕀subscript𝜓1subscript𝜓𝑟\mathbb{I}[\psi_{1},\ldots,\psi_{r}]blackboard_I [ italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ψ start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ]. Then, the following statements are equivalent:

  1. 1.

    The set

    {𝐱nϕj(𝐱)0,j=1,,sψ(𝐱)=0,l=1,,r}𝐱superscript𝑛subscriptitalic-ϕ𝑗𝐱0𝑗1𝑠subscript𝜓𝐱0𝑙1𝑟missing-subexpression\left\{\begin{array}[]{l|ll}\mathbf{x}\in\mathbb{R}^{n}&\begin{array}[]{ll}% \phi_{j}(\mathbf{x})\geq 0,&j=1,\ldots,s\\ \psi_{\ell}(\mathbf{x})=0,&l=1,\ldots,r\end{array}\end{array}\right\}{ start_ARRAY start_ROW start_CELL bold_x ∈ blackboard_R start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT end_CELL start_CELL start_ARRAY start_ROW start_CELL italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) ≥ 0 , end_CELL start_CELL italic_j = 1 , … , italic_s end_CELL end_ROW start_ROW start_CELL italic_ψ start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT ( bold_x ) = 0 , end_CELL start_CELL italic_l = 1 , … , italic_r end_CELL end_ROW end_ARRAY end_CELL start_CELL end_CELL end_ROW end_ARRAY }

    is empty.

  2. 2.

    There exist θ(𝐱)Σ,λ(𝐱)𝕀formulae-sequence𝜃𝐱Σ𝜆𝐱𝕀\theta(\mathbf{x})\in\Sigma,\lambda(\mathbf{x})\in\mathbb{I}italic_θ ( bold_x ) ∈ roman_Σ , italic_λ ( bold_x ) ∈ blackboard_I such that λ(𝐱)+θ(𝐱)+1=0𝜆𝐱𝜃𝐱10\lambda(\mathbf{x})+\theta(\mathbf{x})+1=0italic_λ ( bold_x ) + italic_θ ( bold_x ) + 1 = 0.

In Positivstellensatz, (2) is a necessary and sufficient condition for (1). On the other hand, (2) requires computing the cone ΣΣ\Sigmaroman_Σ, which needs exponential number of polynomials αS(𝐱)subscript𝛼𝑆𝐱\alpha_{S}(\mathbf{x})italic_α start_POSTSUBSCRIPT italic_S end_POSTSUBSCRIPT ( bold_x ) (as S𝑆Sitalic_S permutes over all subsets of {1,,s}1𝑠\{1,\ldots,s\}{ 1 , … , italic_s }). To remedy this computation challenge, people often resort to S-procedure[36], which replaces the cone ΣΣ\Sigmaroman_Σ with the quadratic module 𝒬𝒬\mathcal{Q}caligraphic_Q

𝒬[ϕ1,,ϕs]={α0(𝐱)+α1(𝐱)ϕ1(𝐱)++αs(𝐱)ϕs(𝐱),αi(𝐱)SOS}.𝒬subscriptitalic-ϕ1subscriptitalic-ϕ𝑠subscript𝛼0𝐱subscript𝛼1𝐱subscriptitalic-ϕ1𝐱subscript𝛼𝑠𝐱subscriptitalic-ϕ𝑠𝐱subscript𝛼𝑖𝐱SOS\mathcal{Q}[\phi_{1},\ldots,\phi_{s}]=\\ \{\alpha_{0}(\mathbf{x})+\alpha_{1}(\mathbf{x})\phi_{1}(\mathbf{x})+\ldots+% \alpha_{s}(\mathbf{x})\phi_{s}(\mathbf{x}),\alpha_{i}(\mathbf{x})\in\text{SOS}\}.start_ROW start_CELL caligraphic_Q [ italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ] = end_CELL end_ROW start_ROW start_CELL { italic_α start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_x ) + italic_α start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) + … + italic_α start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ( bold_x ) italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ( bold_x ) , italic_α start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ∈ SOS } . end_CELL end_ROW
Lemma 1 (S-procedure)

Eq. (2) in theorem 1 is a sufficient condition for (1) if we replace the cone θΣ𝜃Σ\theta\in\Sigmaitalic_θ ∈ roman_Σ with the quadratic module θ𝒬[ϕ1,,ϕs]𝜃𝒬subscriptitalic-ϕ1subscriptitalic-ϕ𝑠\theta\in\mathcal{Q}[\phi_{1},\ldots,\phi_{s}]italic_θ ∈ caligraphic_Q [ italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_ϕ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ].111Under some stronger assumptions on ϕ(𝐱),ψ(𝐱)italic-ϕ𝐱𝜓𝐱\phi(\mathbf{x}),\psi(\mathbf{x})italic_ϕ ( bold_x ) , italic_ψ ( bold_x ), such as Archimedean, S-procedure also gives a necessary and sufficient condition [38].

Farkas’ Lemma gives conditions for non-existence of solutions to linear inequalities and is presented as follows.

Lemma 2 (Farkas’ Lemma [39])

Let Λ𝐑m×nΛsuperscript𝐑𝑚𝑛\Lambda\in\mathbf{R}^{m\times n}roman_Λ ∈ bold_R start_POSTSUPERSCRIPT italic_m × italic_n end_POSTSUPERSCRIPT be a matrix, and ξm𝜉superscript𝑚\mathbf{\xi}\in\mathbb{R}^{m}italic_ξ ∈ blackboard_R start_POSTSUPERSCRIPT italic_m end_POSTSUPERSCRIPT be a vector. Then the system of inequalities Λ𝐱ξΛ𝐱𝜉\Lambda{\mathbf{x}}\leq\mathbf{\xi}roman_Λ bold_x ≤ italic_ξ has a solution if and only if the set {𝐳|𝐳0,𝐳TΛ=𝟎T,ξT𝐳=1}conditional-set𝐳formulae-sequence𝐳0formulae-sequencesuperscript𝐳𝑇Λsuperscript0𝑇superscript𝜉𝑇𝐳1\{\mathbf{z}\;|\;\mathbf{z}\geq 0,\mathbf{z}^{T}\Lambda=\mathbf{0}^{T},\mathbf% {\xi}^{T}\mathbf{z}=-1\}{ bold_z | bold_z ≥ 0 , bold_z start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ = bold_0 start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , italic_ξ start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_z = - 1 } is empty.

III Problem statement

III-A System Model

We consider a continuous-time nonlinear control-affine system in the form

𝐱˙=𝐟(𝐱)+g(𝐱)𝐮˙𝐱𝐟𝐱𝑔𝐱𝐮\displaystyle\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x})+g(\mathbf{x})\mathbf{u}over˙ start_ARG bold_x end_ARG = bold_f ( bold_x ) + italic_g ( bold_x ) bold_u (1a)
𝐮𝒰={𝐮|A𝐮𝐜},𝐮𝒰conditional-set𝐮𝐴𝐮𝐜\displaystyle\mathbf{u}\in\mathcal{U}=\{\mathbf{u}\;|\;A\mathbf{u}\leq\mathbf{% c}\},bold_u ∈ caligraphic_U = { bold_u | italic_A bold_u ≤ bold_c } , (1b)

where 𝐱𝒳nx𝐱𝒳superscriptsubscript𝑛𝑥\mathbf{x}\in\mathcal{X}\subset\mathbb{R}^{n_{x}}bold_x ∈ caligraphic_X ⊂ blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT end_POSTSUPERSCRIPT is the state and 𝐮𝒰nu𝐮𝒰superscriptsubscript𝑛𝑢\mathbf{u}\in\mathcal{U}\subset\mathbb{R}^{n_{u}}bold_u ∈ caligraphic_U ⊂ blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT is the control input. We also assume that f:𝒳nx:𝑓𝒳superscriptsubscript𝑛𝑥f:\mathcal{X}\rightarrow\mathbb{R}^{n_{x}}italic_f : caligraphic_X → blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT end_POSTSUPERSCRIPT and g:𝒳nx×nu:𝑔𝒳superscriptsubscript𝑛𝑥subscript𝑛𝑢g:\mathcal{X}\rightarrow\mathbb{R}^{n_{x}\times n_{u}}italic_g : caligraphic_X → blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT × italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT are polynomial functions of 𝐱𝐱\mathbf{x}bold_x. The set of admissible control 𝒰𝒰\mathcal{U}caligraphic_U is represented as a polyhedron A𝐮𝐜,Ap×nu,𝐜pformulae-sequence𝐴𝐮𝐜formulae-sequence𝐴superscript𝑝subscript𝑛𝑢𝐜superscript𝑝A\mathbf{u}\leq\mathbf{c},A\in\mathbb{R}^{p\times n_{u}},\mathbf{c}\in\mathbb{% R}^{p}italic_A bold_u ≤ bold_c , italic_A ∈ blackboard_R start_POSTSUPERSCRIPT italic_p × italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT , bold_c ∈ blackboard_R start_POSTSUPERSCRIPT italic_p end_POSTSUPERSCRIPT. Note that this parameterization of 𝒰𝒰\mathcal{U}caligraphic_U includes the entire set nusuperscriptsubscript𝑛𝑢\mathcal{R}^{n_{u}}caligraphic_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT (unconstrained control) as a special case, where A𝐴Aitalic_A and 𝐜𝐜\mathbf{c}bold_c are empty, hence we can model systems with or without input limits. A control policy μ:𝒳𝒰:𝜇𝒳𝒰\mu:\mathcal{X}\rightarrow\mathcal{U}italic_μ : caligraphic_X → caligraphic_U maps a state 𝐱𝐱\mathbf{x}bold_x to a control input 𝐮𝐮\mathbf{u}bold_u. Without loss of generality we assume the equilibrium state is 𝐱=𝟎𝐱0\mathbf{x}=\mathbf{0}bold_x = bold_0. The state space 𝒳𝒳\mathcal{X}caligraphic_X is divided into a safe region 𝒳ssubscript𝒳𝑠\mathcal{X}_{s}caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT and an unsafe region 𝒳u=𝒳𝒳ssubscript𝒳𝑢𝒳subscript𝒳𝑠\mathcal{X}_{u}=\mathcal{X}-\mathcal{X}_{s}caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = caligraphic_X - caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT. Our goal is to design a control policy μ𝜇\muitalic_μ which renders 𝒳ssubscript𝒳𝑠\mathcal{X}_{s}caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT positively invariant, and the trajectories converging to 𝐱=𝟎𝐱0\mathbf{x}=\mathbf{0}bold_x = bold_0.

III-B Control Barrier Function (CBF) and Control Lyapunov Function (CLF)

We consider safety constraints that are specified as super-level sets of differentiable functions b:𝒳:𝑏𝒳b:\mathcal{X}\rightarrow\mathbb{R}italic_b : caligraphic_X → blackboard_R. In particular, we consider sets 𝒞𝒞\mathcal{C}caligraphic_C that satisfy

𝒞𝒞\displaystyle\mathcal{C}caligraphic_C ={𝐱|b(𝐱)0}.absentconditional-set𝐱𝑏𝐱0\displaystyle=\{\mathbf{x}\;|\;b(\mathbf{x})\geq 0\}.= { bold_x | italic_b ( bold_x ) ≥ 0 } .

If 𝒞𝒳s𝒞subscript𝒳𝑠\mathcal{C}\subseteq\mathcal{X}_{s}caligraphic_C ⊆ caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT and 𝒞𝒞\mathcal{C}caligraphic_C is positively invariant, then any trajectory with 𝐱(0)𝒞𝐱0𝒞\mathbf{x}(0)\in\mathcal{C}bold_x ( 0 ) ∈ caligraphic_C will be safe for all time t𝑡titalic_t.

Definition 1 (CBF [10])

A function b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) is a CBF if

sup𝐮𝒰{Lfb(𝐱)+Lgb(𝐱)𝐮+κb(b(𝐱))}0subscriptsupremum𝐮𝒰subscript𝐿𝑓𝑏𝐱subscript𝐿𝑔𝑏𝐱𝐮subscript𝜅𝑏𝑏𝐱0\sup_{\mathbf{u}\in\mathcal{U}}\{L_{f}b(\mathbf{x})+L_{g}b(\mathbf{x})\mathbf{% u}+\kappa_{b}(b(\mathbf{x}))\}\geq 0roman_sup start_POSTSUBSCRIPT bold_u ∈ caligraphic_U end_POSTSUBSCRIPT { italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_b ( bold_x ) + italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_b ( bold_x ) bold_u + italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ( italic_b ( bold_x ) ) } ≥ 0 (2)

for all 𝐱𝒞𝐱𝒞\mathbf{x}\in\mathcal{C}bold_x ∈ caligraphic_C, where Lfb(𝐱)=b(𝐱)𝐱𝐟(𝐱)subscript𝐿𝑓𝑏𝐱𝑏𝐱𝐱𝐟𝐱L_{f}b(\mathbf{x})=\frac{\partial b(\mathbf{x})}{\partial\mathbf{x}}\mathbf{f}% (\mathbf{x})italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_b ( bold_x ) = divide start_ARG ∂ italic_b ( bold_x ) end_ARG start_ARG ∂ bold_x end_ARG bold_f ( bold_x ), Lgb(x)=b(𝐱)𝐱g(𝐱)subscript𝐿𝑔𝑏𝑥𝑏𝐱𝐱𝑔𝐱L_{g}b(x)=\frac{\partial b(\mathbf{x})}{\partial\mathbf{x}}g(\mathbf{x})italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_b ( italic_x ) = divide start_ARG ∂ italic_b ( bold_x ) end_ARG start_ARG ∂ bold_x end_ARG italic_g ( bold_x ), and κb()subscript𝜅𝑏\kappa_{b}(\cdot)italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ( ⋅ ) is an extended class κ𝜅\kappaitalic_κ function222Recall function κ(.)\kappa(.)italic_κ ( . ) is extended class κ𝜅\kappaitalic_κ if it is monotone, increasing, and satisfies κ(0)=0𝜅00\kappa(0)=0italic_κ ( 0 ) = 0..

A special class of Definition 1 consists of Exponential Control Barrier Functions, for which κb(b(𝐱))=κbb(𝐱)subscript𝜅𝑏𝑏𝐱subscript𝜅𝑏𝑏𝐱\kappa_{b}(b(\mathbf{x}))=\kappa_{b}b(\mathbf{x})italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ( italic_b ( bold_x ) ) = italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT italic_b ( bold_x ) where κbsubscript𝜅𝑏\kappa_{b}italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT is a positive constant. Constraint (2) ensures the set 𝒞𝒞\mathcal{C}caligraphic_C positive invariant for system represented by (1) [10].

A control Lyapunov function is defined as follows.

Definition 2 (CLF [40])

A differentiable function V:𝒳:𝑉𝒳V:\mathcal{X}\rightarrow\mathbb{R}italic_V : caligraphic_X → blackboard_R is a Control Lyapunov Function if V(𝟎)=0𝑉00V(\mathbf{0})=0italic_V ( bold_0 ) = 0, V(𝐱)>0 if 𝐱0𝑉𝐱0 if 𝐱0V(\mathbf{x})>0\text{ if }\mathbf{x}\neq 0italic_V ( bold_x ) > 0 if bold_x ≠ 0 and

inf𝐮𝒰{LfV(𝐱)+LgV(𝐱)𝐮+κV(V(𝐱))}0subscriptinfimum𝐮𝒰subscript𝐿𝑓𝑉𝐱subscript𝐿𝑔𝑉𝐱𝐮subscript𝜅𝑉𝑉𝐱0\inf_{\mathbf{u}\in\mathcal{U}}\{L_{f}V(\mathbf{x})+L_{g}V(\mathbf{x})\mathbf{% u}+\kappa_{V}(V(\mathbf{x}))\}\leq 0roman_inf start_POSTSUBSCRIPT bold_u ∈ caligraphic_U end_POSTSUBSCRIPT { italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_V ( bold_x ) + italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_V ( bold_x ) bold_u + italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT ( italic_V ( bold_x ) ) } ≤ 0 (3)

for all {𝐱|V(𝐱)1}conditional-set𝐱𝑉𝐱1\{\mathbf{x}\;|\;V(\mathbf{x})\leq 1\}{ bold_x | italic_V ( bold_x ) ≤ 1 }, where κV(.)\kappa_{V}(.)italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT ( . ) is also an extended class κ𝜅\kappaitalic_κ function. This proves that the sub-level set {𝐱|V(𝐱)1}conditional-set𝐱𝑉𝐱1\{\mathbf{x}\;|\;V(\mathbf{x})\leq 1\}{ bold_x | italic_V ( bold_x ) ≤ 1 } is an inner approximation of the region-of-attraction (ROA).

If a system satisfies constraint (3) for all time t𝑡titalic_t, then the system can be stabilized to the origin [40]. Also, in this paper, we use exponential stability so that κV(V(𝐱))=κVV(𝐱)subscript𝜅𝑉𝑉𝐱subscript𝜅𝑉𝑉𝐱\kappa_{V}(V(\mathbf{x}))=\kappa_{V}V(\mathbf{x})italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT ( italic_V ( bold_x ) ) = italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT italic_V ( bold_x ), where κVsubscript𝜅𝑉\kappa_{V}italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT is a positive constant.

IV Methodology

In this section, we first present our algorithm to verify compatibility of CLF and CBF through convex optimization (section IV-A); then build upon the verification formulation, we present our algorithm to synthesize compatible CLF/CBF through solving a sequence of convex optimization problems (section IV-B).

IV-A Verification of compatibility

For a candidate CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) and a candidate CLF V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ), define 0-super-level set 𝒞={𝐱|b(𝐱)0}𝒞conditional-set𝐱𝑏𝐱0\mathcal{C}=\{\mathbf{x}\;|\;b(\mathbf{x})\geq 0\}caligraphic_C = { bold_x | italic_b ( bold_x ) ≥ 0 } and the 1-sub-level set 𝒟:={𝐱|V(𝐱)1}assign𝒟conditional-set𝐱𝑉𝐱1\mathcal{D}:=\{\mathbf{x}\;|\;V(\mathbf{x})\leq 1\}caligraphic_D := { bold_x | italic_V ( bold_x ) ≤ 1 } (this 1-sub-level set will be an inner approximation of the region-of-attraction). We formally state the compatible CLF-CBF as follows

Problem 1 (Compatible CLF-CBF)

Given positive constants κVsubscript𝜅𝑉\kappa_{V}italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT, κbsubscript𝜅𝑏\kappa_{b}italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT, a positive definite function V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ), and a function b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) such that 𝒞𝒳s𝒞subscript𝒳𝑠\mathcal{C}\subseteq\mathcal{X}_{s}caligraphic_C ⊆ caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT, verify that 𝐱𝒞𝒟for-all𝐱𝒞𝒟\forall\mathbf{x}\in\mathcal{C}\cap\mathcal{D}∀ bold_x ∈ caligraphic_C ∩ caligraphic_D, there exists 𝐮𝐮\mathbf{u}bold_u such that

[LfV(𝐱)Lfb(𝐱)𝟎]+[LgV(𝐱)Lgb(𝐱)A]𝐮[κVV(𝐱)κbb(𝐱)𝐜]matrixsubscript𝐿𝑓𝑉𝐱subscript𝐿𝑓𝑏𝐱0matrixsubscript𝐿𝑔𝑉𝐱subscript𝐿𝑔𝑏𝐱𝐴𝐮matrixsubscript𝜅𝑉𝑉𝐱subscript𝜅𝑏𝑏𝐱𝐜\begin{bmatrix}L_{f}V(\mathbf{x})\\ -L_{f}b(\mathbf{x})\\ \mathbf{0}\end{bmatrix}+\begin{bmatrix}L_{g}V(\mathbf{x})\\ -L_{g}b(\mathbf{x})\\ A\end{bmatrix}\mathbf{u}\leq\begin{bmatrix}-\kappa_{V}V(\mathbf{x})\\ \kappa_{b}b(\mathbf{x})\\ \mathbf{c}\end{bmatrix}[ start_ARG start_ROW start_CELL italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_V ( bold_x ) end_CELL end_ROW start_ROW start_CELL - italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_b ( bold_x ) end_CELL end_ROW start_ROW start_CELL bold_0 end_CELL end_ROW end_ARG ] + [ start_ARG start_ROW start_CELL italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_V ( bold_x ) end_CELL end_ROW start_ROW start_CELL - italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_b ( bold_x ) end_CELL end_ROW start_ROW start_CELL italic_A end_CELL end_ROW end_ARG ] bold_u ≤ [ start_ARG start_ROW start_CELL - italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT italic_V ( bold_x ) end_CELL end_ROW start_ROW start_CELL italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT italic_b ( bold_x ) end_CELL end_ROW start_ROW start_CELL bold_c end_CELL end_ROW end_ARG ] (4)

namely there exists 𝐮𝒰𝐮𝒰\mathbf{u}\in\mathcal{U}bold_u ∈ caligraphic_U satisfying both the CBF condition (1) and the CLF condition (2) simultaneously. The region 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D is certified to be safe and stabilizable.

We call the functions V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) and b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) compatible CLF and CBF if they satisfy the conditions of Problem 1, with 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D as the compatible region.

IV-A1 Exact Verification

Verifying the condition (4) is equivalent to verifying that there exists a solution 𝐮𝐮\mathbf{u}bold_u for the inequality

Λ(𝐱)𝐮ξ(𝐱),𝐱𝒞𝒟formulae-sequenceΛ𝐱𝐮𝜉𝐱for-all𝐱𝒞𝒟\Lambda(\mathbf{x})\mathbf{u}\leq\xi(\mathbf{x}),\ \forall\mathbf{x}\in% \mathcal{C}\cap\mathcal{D}roman_Λ ( bold_x ) bold_u ≤ italic_ξ ( bold_x ) , ∀ bold_x ∈ caligraphic_C ∩ caligraphic_D (5)

where

Λ(𝐱)=[LgV(𝐱)Lgb(𝐱)A],ξ(𝐱)=[κVV(𝐱)LfV(𝐱)κbb(𝐱)+Lfb(𝐱)𝐜].formulae-sequenceΛ𝐱matrixsubscript𝐿𝑔𝑉𝐱subscript𝐿𝑔𝑏𝐱𝐴𝜉𝐱matrixsubscript𝜅𝑉𝑉𝐱subscript𝐿𝑓𝑉𝐱subscript𝜅𝑏𝑏𝐱subscript𝐿𝑓𝑏𝐱𝐜\Lambda(\mathbf{x})=\begin{bmatrix}L_{g}V(\mathbf{x})\\ -L_{g}b(\mathbf{x})\\ A\end{bmatrix},\mathbf{\xi}(\mathbf{x})=\begin{bmatrix}-\kappa_{V}V(\mathbf{x}% )-L_{f}V(\mathbf{x})\\ \kappa_{b}b(\mathbf{x})+L_{f}b(\mathbf{x})\\ \mathbf{c}\end{bmatrix}.roman_Λ ( bold_x ) = [ start_ARG start_ROW start_CELL italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_V ( bold_x ) end_CELL end_ROW start_ROW start_CELL - italic_L start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT italic_b ( bold_x ) end_CELL end_ROW start_ROW start_CELL italic_A end_CELL end_ROW end_ARG ] , italic_ξ ( bold_x ) = [ start_ARG start_ROW start_CELL - italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT italic_V ( bold_x ) - italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_V ( bold_x ) end_CELL end_ROW start_ROW start_CELL italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT italic_b ( bold_x ) + italic_L start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT italic_b ( bold_x ) end_CELL end_ROW start_ROW start_CELL bold_c end_CELL end_ROW end_ARG ] .

Note that Λ(𝐱)(p+2)×nuΛ𝐱superscript𝑝2subscript𝑛𝑢\Lambda(\mathbf{x})\in\mathbb{R}^{(p+2)\times n_{u}}roman_Λ ( bold_x ) ∈ blackboard_R start_POSTSUPERSCRIPT ( italic_p + 2 ) × italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT and ξ(𝐱)p+2𝜉𝐱superscript𝑝2\mathbf{\xi}(\mathbf{x})\in\mathbb{R}^{p+2}italic_ξ ( bold_x ) ∈ blackboard_R start_POSTSUPERSCRIPT italic_p + 2 end_POSTSUPERSCRIPT. We let Λi(𝐱)subscriptΛ𝑖𝐱\Lambda_{i}(\mathbf{x})roman_Λ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) denote the i𝑖iitalic_i-th column of Λ(𝐱)Λ𝐱\Lambda(\mathbf{x})roman_Λ ( bold_x ).

Based on Farkas’ Lemma, we give an equivalent condition (Lemma 3) for CLF-CBF compatibility.

Lemma 3

The CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) and CLF V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) are compatible if and only if the following set is empty:

{(𝐱,𝐳)|b(𝐱)0,V(𝐱)1,𝐳TΛ(𝐱)=𝟎T,ξ(𝐱)T𝐳=1,𝐳𝟎},conditional-set𝐱𝐳formulae-sequence𝑏𝐱0formulae-sequence𝑉𝐱1formulae-sequencesuperscript𝐳𝑇Λ𝐱superscript0𝑇formulae-sequence𝜉superscript𝐱𝑇𝐳1𝐳0\{(\mathbf{x},\mathbf{z})\;|\;b(\mathbf{x})\geq 0,V(\mathbf{x})\leq 1,\\ \mathbf{z}^{T}\Lambda(\mathbf{x})=\mathbf{0}^{T},\mathbf{\xi}(\mathbf{x})^{T}% \mathbf{z}=-1,\mathbf{z}\geq\mathbf{0}\},start_ROW start_CELL { ( bold_x , bold_z ) | italic_b ( bold_x ) ≥ 0 , italic_V ( bold_x ) ≤ 1 , end_CELL end_ROW start_ROW start_CELL bold_z start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ ( bold_x ) = bold_0 start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , italic_ξ ( bold_x ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_z = - 1 , bold_z ≥ bold_0 } , end_CELL end_ROW (6)

where 𝐳p+2𝐳superscript𝑝2\mathbf{z}\in\mathbb{R}^{p+2}bold_z ∈ blackboard_R start_POSTSUPERSCRIPT italic_p + 2 end_POSTSUPERSCRIPT and (𝐱,𝐳)nx+p+2𝐱𝐳superscriptsubscript𝑛𝑥𝑝2(\mathbf{x},\mathbf{z})\in\mathbb{R}^{n_{x}+p+2}( bold_x , bold_z ) ∈ blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT + italic_p + 2 end_POSTSUPERSCRIPT is a concatenated vector.

The conclusion of Lemma 3 can be further simplified. Define the element-wise squared operation of vector 𝐲=[y1,,yp+2]T𝐲superscriptsubscript𝑦1subscript𝑦𝑝2𝑇\mathbf{y}=[y_{1},\dots,y_{p+2}]^{T}bold_y = [ italic_y start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_y start_POSTSUBSCRIPT italic_p + 2 end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT as 𝐲2=[y12,,yp+22]Tsuperscript𝐲2superscriptsuperscriptsubscript𝑦12superscriptsubscript𝑦𝑝22𝑇\mathbf{y}^{2}=[y_{1}^{2},\dots,y_{p+2}^{2}]^{T}bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = [ italic_y start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT , … , italic_y start_POSTSUBSCRIPT italic_p + 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT. Then an equivalent formulation of Lemma 3 is as follows.

Lemma 4

The CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) and CLF V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) are compatible if and only if the following set is empty:

{(𝐱,𝐲)|b(𝐱)0,V(𝐱)1,(𝐲2)TΛ(𝐱)=𝟎T,ξ(𝐱)T𝐲2=1},conditional-set𝐱𝐲formulae-sequence𝑏𝐱0formulae-sequence𝑉𝐱1formulae-sequencesuperscriptsuperscript𝐲2𝑇Λ𝐱superscript0𝑇𝜉superscript𝐱𝑇superscript𝐲21\{(\mathbf{x},\mathbf{y})\;|\;b(\mathbf{x})\geq 0,V(\mathbf{x})\leq 1,\\ (\mathbf{y}^{2})^{T}\Lambda(\mathbf{x})=\mathbf{0}^{T},\mathbf{\xi}(\mathbf{x}% )^{T}\mathbf{y}^{2}=-1\},start_ROW start_CELL { ( bold_x , bold_y ) | italic_b ( bold_x ) ≥ 0 , italic_V ( bold_x ) ≤ 1 , end_CELL end_ROW start_ROW start_CELL ( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ ( bold_x ) = bold_0 start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , italic_ξ ( bold_x ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = - 1 } , end_CELL end_ROW (7)

where 𝐲20p+2superscript𝐲2superscriptsubscriptabsent0𝑝2\mathbf{y}^{2}\in\mathbb{R}_{\geq 0}^{p+2}bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ∈ blackboard_R start_POSTSUBSCRIPT ≥ 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_p + 2 end_POSTSUPERSCRIPT and (𝐱,𝐲)nx+p+2𝐱𝐲superscriptsubscript𝑛𝑥𝑝2(\mathbf{x},\mathbf{y})\in\mathbb{R}^{n_{x}+p+2}( bold_x , bold_y ) ∈ blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT + italic_p + 2 end_POSTSUPERSCRIPT is a concatenated vector. Namely, we replace the vector 𝐳𝐳\mathbf{z}bold_z and the non-negative constraint 𝐳0𝐳0\mathbf{z}\geq 0bold_z ≥ 0 with a new vector 𝐲2superscript𝐲2\mathbf{y}^{2}bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT which is non-negative by construction.

Applying P-satz to Lemma 4 gives the following theorem. Noted that (𝐲2)TΛ(𝐱)nusuperscriptsuperscript𝐲2𝑇Λ𝐱superscriptsubscript𝑛𝑢(\mathbf{y}^{2})^{T}\Lambda(\mathbf{x})\in\mathbb{R}^{n_{u}}( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ ( bold_x ) ∈ blackboard_R start_POSTSUPERSCRIPT italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUPERSCRIPT, each element of (𝐲2)TΛ(𝐱)superscriptsuperscript𝐲2𝑇Λ𝐱(\mathbf{y}^{2})^{T}\Lambda(\mathbf{x})( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ ( bold_x ) is computed by (𝐲2)TΛi(𝐱),i=1,2nuformulae-sequencesuperscriptsuperscript𝐲2𝑇subscriptΛ𝑖𝐱𝑖12subscript𝑛𝑢(\mathbf{y}^{2})^{T}\Lambda_{i}(\mathbf{x}),i=1,2\dots n_{u}( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) , italic_i = 1 , 2 … italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT , and also, ξ(𝐱)T𝐲2𝜉superscript𝐱𝑇superscript𝐲2\mathbf{\xi}(\mathbf{x})^{T}\mathbf{y}^{2}italic_ξ ( bold_x ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT is a scalar.

Theorem 2

The given CLF V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) and CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) are compatible if and only if there exist polynomials λ(𝐱,𝐲),θ(𝐱,𝐲)𝜆𝐱𝐲𝜃𝐱𝐲\lambda(\mathbf{x},\mathbf{y}),\theta(\mathbf{x},\mathbf{y})italic_λ ( bold_x , bold_y ) , italic_θ ( bold_x , bold_y ) satisfying:

  1. 1.

    θ(𝐱,𝐲)Σ[b(𝐱),1V(𝐱)]𝜃𝐱𝐲Σ𝑏𝐱1𝑉𝐱\theta(\mathbf{x},\mathbf{y})\in\Sigma[b(\mathbf{x}),1-V(\mathbf{x})]italic_θ ( bold_x , bold_y ) ∈ roman_Σ [ italic_b ( bold_x ) , 1 - italic_V ( bold_x ) ]

  2. 2.

    λ(𝐱,𝐲)𝕀[(𝐲2)TΛ1(𝐱),,(𝐲2)TΛnu(𝐱),ξ(𝐱)T𝐲2+1]𝜆𝐱𝐲𝕀superscriptsuperscript𝐲2𝑇subscriptΛ1𝐱superscriptsuperscript𝐲2𝑇subscriptΛsubscript𝑛𝑢𝐱𝜉superscript𝐱𝑇superscript𝐲21\lambda(\mathbf{x},\mathbf{y})\in\mathbb{I}[(\mathbf{y}^{2})^{T}\Lambda_{1}(% \mathbf{x}),\dots,(\mathbf{y}^{2})^{T}\Lambda_{n_{u}}(\mathbf{x}),\mathbf{\xi}% (\mathbf{x})^{T}\mathbf{y}^{2}+1]italic_λ ( bold_x , bold_y ) ∈ blackboard_I [ ( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) , … , ( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ start_POSTSUBSCRIPT italic_n start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT end_POSTSUBSCRIPT ( bold_x ) , italic_ξ ( bold_x ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 1 ]

  3. 3.

    θ(𝐱,𝐲)+λ(𝐱,𝐲)+1=0𝜃𝐱𝐲𝜆𝐱𝐲10\theta(\mathbf{x},\mathbf{y})+\lambda(\mathbf{x},\mathbf{y})+1=0italic_θ ( bold_x , bold_y ) + italic_λ ( bold_x , bold_y ) + 1 = 0

As explained in section II, directly applying P-satz might be computationally challenging. To remedy this, we could apply the S-procedure (Lemma 1) and formulate the following convex optimization problem to verify compatibility

Find 𝐬0(𝐱,𝐲),s1(𝐱,𝐲),s2(𝐱,𝐲),s3(𝐱,𝐲)subscript𝐬0𝐱𝐲subscript𝑠1𝐱𝐲subscript𝑠2𝐱𝐲subscript𝑠3𝐱𝐲\displaystyle\;\mathbf{s}_{0}(\mathbf{x},\mathbf{y}),s_{1}(\mathbf{x},\mathbf{% y}),s_{2}(\mathbf{x},\mathbf{y}),s_{3}(\mathbf{x},\mathbf{y})bold_s start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_s start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ( bold_x , bold_y ) (8a)
s.t 1𝐬0(𝐱,𝐲)T((𝐲2)TΛ(𝐱))s1(𝐱,𝐲)(ξ(𝐱)T𝐲2+1)s2(𝐱,𝐲)(1V(𝐱))s3(𝐱,𝐲)b(𝐱)SOSs.t 1subscript𝐬0superscript𝐱𝐲𝑇superscriptsuperscript𝐲2𝑇Λ𝐱subscript𝑠1𝐱𝐲𝜉superscript𝐱𝑇superscript𝐲21subscript𝑠2𝐱𝐲1𝑉𝐱subscript𝑠3𝐱𝐲𝑏𝐱SOS\displaystyle\begin{split}\text{s.t }&-1-\mathbf{s}_{0}(\mathbf{x},\mathbf{y})% ^{T}((\mathbf{y}^{2})^{T}\Lambda(\mathbf{x}))-s_{1}(\mathbf{x},\mathbf{y})(% \mathbf{\xi}(\mathbf{x})^{T}\mathbf{y}^{2}+1)\\ &\qquad-s_{2}(\mathbf{x},\mathbf{y})(1-V(\mathbf{x}))-s_{3}(\mathbf{x},\mathbf% {y})b(\mathbf{x})\in\text{SOS}\end{split}start_ROW start_CELL s.t end_CELL start_CELL - 1 - bold_s start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_x , bold_y ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT ( ( bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Λ ( bold_x ) ) - italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x , bold_y ) ( italic_ξ ( bold_x ) start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_y start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 1 ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL - italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x , bold_y ) ( 1 - italic_V ( bold_x ) ) - italic_s start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ( bold_x , bold_y ) italic_b ( bold_x ) ∈ SOS end_CELL end_ROW (8b)
s2(𝐱,𝐲),s3(𝐱,𝐲)SOS.subscript𝑠2𝐱𝐲subscript𝑠3𝐱𝐲SOS\displaystyle s_{2}(\mathbf{x},\mathbf{y}),s_{3}(\mathbf{x},\mathbf{y})\in% \text{SOS}.italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_s start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ( bold_x , bold_y ) ∈ SOS . (8c)

A given pair of CLF V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) and CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) are compatible if we can find the polynomials si(𝐱,𝐲),i=0,1,2,3formulae-sequencesubscript𝑠𝑖𝐱𝐲𝑖0123s_{i}(\mathbf{x},\mathbf{y}),i=0,1,2,3italic_s start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_i = 0 , 1 , 2 , 3 in program (8).

IV-A2 CBF Correctness Verification

In addition to verifying the CLF-CBF compatibility, we must also ensure that the set {𝐱|b(𝐱)0}conditional-set𝐱𝑏𝐱0\{\mathbf{x}\;|\;b(\mathbf{x})\geq 0\}{ bold_x | italic_b ( bold_x ) ≥ 0 } is contained in the desired safe region, i.e., {𝐱|b(𝐱)0}conditional-set𝐱𝑏𝐱0\{\mathbf{x}|b(\mathbf{x})\geq 0\}{ bold_x | italic_b ( bold_x ) ≥ 0 } implies 𝐱𝒳s𝐱subscript𝒳𝑠\mathbf{x}\in\mathcal{X}_{s}bold_x ∈ caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT Assume an unsafe region presented by:

𝒳u=j=1K{𝐱|hj(𝐱)0}.subscript𝒳𝑢superscriptsubscript𝑗1𝐾conditional-set𝐱subscript𝑗𝐱0\mathcal{X}_{u}=\cup_{j=1}^{K}\{\mathbf{x}|h_{j}(\mathbf{x})\leq 0\}.caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = ∪ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_K end_POSTSUPERSCRIPT { bold_x | italic_h start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) ≤ 0 } . (9)

Using the S-procedure, we can formulate the correctness verification program:

Find q1(𝐱)qK(𝐱),p1(𝐱)pK(𝐱)SOSsubscript𝑞1𝐱subscript𝑞𝐾𝐱subscript𝑝1𝐱subscript𝑝𝐾𝐱SOS\displaystyle q_{1}(\mathbf{x})\dots q_{K}(\mathbf{x}),p_{1}(\mathbf{x})\dots p% _{K}(\mathbf{x})\in\text{SOS}italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) … italic_q start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT ( bold_x ) , italic_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) … italic_p start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT ( bold_x ) ∈ SOS
s.t. 1+qj(𝐱)b(𝐱)+pj(𝐱)hj(𝐱)SOS,j=1,K.formulae-sequence1subscript𝑞𝑗𝐱𝑏𝐱subscript𝑝𝑗𝐱subscript𝑗𝐱SOS𝑗1𝐾\displaystyle-1+q_{j}(\mathbf{x})b(\mathbf{x})+p_{j}(\mathbf{x})h_{j}(\mathbf{% x})\in\text{SOS},\;j=1,\dots K.- 1 + italic_q start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) italic_b ( bold_x ) + italic_p start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) italic_h start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) ∈ SOS , italic_j = 1 , … italic_K . (10a)

On the other hand, if the unsafe region is defined as

𝒳u=j=1K{𝐱|hj(𝐱)0},subscript𝒳𝑢superscriptsubscript𝑗1𝐾conditional-set𝐱subscript𝑗𝐱0\mathcal{X}_{u}=\cap_{j=1}^{K}\{\mathbf{x}|h_{j}(\mathbf{x})\leq 0\},caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = ∩ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_K end_POSTSUPERSCRIPT { bold_x | italic_h start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) ≤ 0 } , (11)

then the correctness verification program is given by

Find q(𝐱),p1(𝐱)pK(𝐱)SOS𝑞𝐱subscript𝑝1𝐱subscript𝑝𝐾𝐱SOS\displaystyle q(\mathbf{x}),p_{1}(\mathbf{x})\dots p_{K}(\mathbf{x})\in\text{SOS}italic_q ( bold_x ) , italic_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) … italic_p start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT ( bold_x ) ∈ SOS
s.t. 1+q(𝐱)b(𝐱)+j=1Kpj(𝐱)hj(𝐱)SOS.1𝑞𝐱𝑏𝐱superscriptsubscript𝑗1𝐾subscript𝑝𝑗𝐱subscript𝑗𝐱SOS\displaystyle-1+q(\mathbf{x})b(\mathbf{x})+\sum_{j=1}^{K}p_{j}(\mathbf{x})h_{j% }(\mathbf{x})\in\text{SOS}.- 1 + italic_q ( bold_x ) italic_b ( bold_x ) + ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_K end_POSTSUPERSCRIPT italic_p start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) italic_h start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) ∈ SOS . (12a)

If the unsafe region is only characterized by single polynomial, then (10) and (12) are the same and we would have single q(𝐱)𝑞𝐱q(\mathbf{x})italic_q ( bold_x ) and p(𝐱)𝑝𝐱p(\mathbf{x})italic_p ( bold_x ).

Both problems (10) and (12) can be solved

IV-B Compatible CBF and CLF synthesis

Based on the previous verification framework, we next propose an alternating method to synthesize compatible CBF and CLF. We first formulate the synthesis problem, and then introduce the overall structure of the alternating algorithm and each component of the algorithm in detail. Finally we prove the compatibility of the synthesized CLF and CBF. For simplicity, in the following derivations, we use (9) as the definition of unsafe region and use the constraints in (10) as CBF correctness constraint.

Problem 2

Given a system (1), with equilibrium state 𝐱=𝟎superscript𝐱0\mathbf{x}^{*}=\mathbf{0}bold_x start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT = bold_0, constants κVsubscript𝜅𝑉\kappa_{V}italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT, κbsubscript𝜅𝑏\kappa_{b}italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT, and polynomials h1(𝐱)hK(𝐱)subscript1𝐱subscript𝐾𝐱h_{1}(\mathbf{x})\dots h_{K}(\mathbf{x})italic_h start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) … italic_h start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT ( bold_x ) characterizing the unsafe region, find a positive definite function V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) and a function b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) such that there always exist a 𝐮𝒰𝐮𝒰\mathbf{u}\in\mathcal{U}bold_u ∈ caligraphic_U satisfying (4) for all the 𝐱𝒟𝒞𝐱𝒟𝒞\mathbf{x}\in\mathcal{D}\cap\mathcal{C}bold_x ∈ caligraphic_D ∩ caligraphic_C, where 𝒞={𝐱|b(𝐱)0}𝒞conditional-set𝐱𝑏𝐱0\mathcal{C}=\{\mathbf{x}\;|\;b(\mathbf{x})\geq 0\}caligraphic_C = { bold_x | italic_b ( bold_x ) ≥ 0 }, and 𝒟={𝐱|V(𝐱)1}𝒟conditional-set𝐱𝑉𝐱1\mathcal{D}=\{\mathbf{x}\;|\;V(\mathbf{x})\leq 1\}caligraphic_D = { bold_x | italic_V ( bold_x ) ≤ 1 }. We call the region 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D as the “compatible region”, and our goal is to maximize some objective function γ(𝒞𝒟)𝛾𝒞𝒟\gamma(\mathcal{C}\cap\mathcal{D})italic_γ ( caligraphic_C ∩ caligraphic_D ) on this compatible region. One example of the objective function is the volume γ(𝒞𝒟)=Vol(𝒞𝒟)𝛾𝒞𝒟Vol𝒞𝒟\gamma(\mathcal{C}\cap\mathcal{D})=\text{Vol}(\mathcal{C}\cap\mathcal{D})italic_γ ( caligraphic_C ∩ caligraphic_D ) = Vol ( caligraphic_C ∩ caligraphic_D ).

Mathematically, our goal is to solve the following optimization problem

maxV(𝐱),b(𝐱),p(𝐱),q(𝐱),s(𝐱)γ(𝒞𝒟)subscript𝑉𝐱𝑏𝐱𝑝𝐱𝑞𝐱𝑠𝐱𝛾𝒞𝒟\displaystyle\max_{\begin{subarray}{c}V(\mathbf{x}),b(\mathbf{x}),\\ p(\mathbf{x}),q(\mathbf{x}),s(\mathbf{x})\end{subarray}}\gamma(\mathcal{C}\cap% \mathcal{D})roman_max start_POSTSUBSCRIPT start_ARG start_ROW start_CELL italic_V ( bold_x ) , italic_b ( bold_x ) , end_CELL end_ROW start_ROW start_CELL italic_p ( bold_x ) , italic_q ( bold_x ) , italic_s ( bold_x ) end_CELL end_ROW end_ARG end_POSTSUBSCRIPT italic_γ ( caligraphic_C ∩ caligraphic_D ) (13a)
s.t V(𝟎)=0,V(𝐱) SOSformulae-sequence𝑉00𝑉𝐱 SOS\displaystyle V(\mathbf{0})=0,V(\mathbf{x})\in\text{ SOS}italic_V ( bold_0 ) = 0 , italic_V ( bold_x ) ∈ SOS (13b)
Constraint (8b),(10a)Constraint italic-(8bitalic-)italic-(10aitalic-)\displaystyle\text{Constraint }\eqref{eq:verify_S-procedure_constraint},\eqref% {eq:cbf_safe_constraint}Constraint italic_( italic_) , italic_( italic_) (13c)
s2(𝐱,𝐲),s3(𝐱,𝐲),qi(𝐱),pi(𝐱) SOS,i=1,,K.formulae-sequencesubscript𝑠2𝐱𝐲subscript𝑠3𝐱𝐲subscript𝑞𝑖𝐱subscript𝑝𝑖𝐱 SOS𝑖1𝐾\displaystyle s_{2}(\mathbf{x},\mathbf{y}),s_{3}(\mathbf{x},\mathbf{y}),q_{i}(% \mathbf{x}),p_{i}(\mathbf{x})\in\text{ SOS},i=1,\ldots,K.italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_s start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ( bold_x , bold_y ) , italic_q start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) , italic_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ∈ SOS , italic_i = 1 , … , italic_K . (13d)

Unlike the verification problem (8) and (10) where V(𝐱)𝑉𝐱V(\mathbf{x})italic_V ( bold_x ) and b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) are given, now we need to jointly search for V(𝐱),b(𝐱)𝑉𝐱𝑏𝐱V(\mathbf{x}),b(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ) together with the Lagrangian multipliers p(𝐱),q(𝐱),s(𝐱)𝑝𝐱𝑞𝐱𝑠𝐱p(\mathbf{x}),q(\mathbf{x}),s(\mathbf{x})italic_p ( bold_x ) , italic_q ( bold_x ) , italic_s ( bold_x ) in (13). Notice that all the constraints in problem (13) are convex, except for (8b) and (10a), which are bi-linear in the decision variable V(𝐱),b(𝐱),p(𝐱),q(𝐱),s(𝐱)𝑉𝐱𝑏𝐱𝑝𝐱𝑞𝐱𝑠𝐱V(\mathbf{x}),b(\mathbf{x}),p(\mathbf{x}),q(\mathbf{x}),s(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ) , italic_p ( bold_x ) , italic_q ( bold_x ) , italic_s ( bold_x ), and hence cannot be directly handled by convex optimization. To remedy this, we resort to bilinear alternation, a common technique in SOS-based controller design [36, 41]. Where we alternate between

  1. 1.

    Lagrangian searching: fix V(𝐱),b(𝐱)𝑉𝐱𝑏𝐱V(\mathbf{x}),b(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ), search for the Lagrangian multipliers p(𝐱),q(𝐱),s(𝐱)𝑝𝐱𝑞𝐱𝑠𝐱p(\mathbf{x}),q(\mathbf{x}),s(\mathbf{x})italic_p ( bold_x ) , italic_q ( bold_x ) , italic_s ( bold_x ).

  2. 2.

    Update CLF-CBF: fix the Lagrangian multiplier, search for V(𝐱),b(𝐱)𝑉𝐱𝑏𝐱V(\mathbf{x}),b(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ) while maximizing a surrogate function of γ(𝒞𝒟)𝛾𝒞𝒟\gamma(\mathcal{C}\cap\mathcal{D})italic_γ ( caligraphic_C ∩ caligraphic_D ).

Step 1 is the verification problem (8) and (10) discussed in the previous subsection. In step 2, we consider two different choices of objective function γ(𝒞𝒟)𝛾𝒞𝒟\gamma(\mathcal{C}\cap\mathcal{D})italic_γ ( caligraphic_C ∩ caligraphic_D )

  • Maximize the volume Vol(𝒞𝒟)Vol𝒞𝒟\text{Vol}(\mathcal{C}\cap\mathcal{D})Vol ( caligraphic_C ∩ caligraphic_D ).

  • Given a set of predefined “candidate states” 𝐱(1),,𝐱(L)superscript𝐱1superscript𝐱𝐿\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(L)}bold_x start_POSTSUPERSCRIPT ( 1 ) end_POSTSUPERSCRIPT , … , bold_x start_POSTSUPERSCRIPT ( italic_L ) end_POSTSUPERSCRIPT, we want the compatible region 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D to cover as many “candidate states” as possible.

We next present how to search for V(𝐱),b(𝐱)𝑉𝐱𝑏𝐱V(\mathbf{x}),b(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ) to optimize these two objectives respectively, while fixing the Lagrangian multipliers.

IV-B1 Maximize volume

To maximize the volume of the compatible region, we need to solve the following optimization problem

maxV(𝐱),b(𝐱)Vol(𝒞𝒟)subscript𝑉𝐱𝑏𝐱Vol𝒞𝒟\displaystyle\max_{V(\mathbf{x}),b(\mathbf{x})}\;\text{Vol}(\mathcal{C}\cap% \mathcal{D})roman_max start_POSTSUBSCRIPT italic_V ( bold_x ) , italic_b ( bold_x ) end_POSTSUBSCRIPT Vol ( caligraphic_C ∩ caligraphic_D ) (14a)
s.t V(𝟎)=0,V(𝐱) SOSformulae-sequence𝑉00𝑉𝐱 SOS\displaystyle V(\mathbf{0})=0,V(\mathbf{x})\in\text{ SOS}italic_V ( bold_0 ) = 0 , italic_V ( bold_x ) ∈ SOS (14b)
Constraint (8b),(10a).Constraint italic-(8bitalic-)italic-(10aitalic-)\displaystyle\text{Constraint }\eqref{eq:verify_S-procedure_constraint},\eqref% {eq:cbf_safe_constraint}.Constraint italic_( italic_) , italic_( italic_) . (14c)

Directly maximing the volume of the semi-algebraic set Vol(𝒞𝒟)Vol𝒞𝒟\text{Vol}(\mathcal{C}\cap\mathcal{D})Vol ( caligraphic_C ∩ caligraphic_D ) can be challenging333There exists some work to compute the volume of a given basic semi-algebraic set through a sequence of semidefinite programs with increasing sizes [42], but cannot be directly applied to maximize volume of the basic semi-algebraic set while searching for its defining polynomials., hence we seek an alternative approach to grow the compatible region, as shown in Appendix VII-A.

IV-B2 Cover many candidate states

Alternatively we can grow the compatible region 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D to cover the candidate states 𝐱(1),,𝐱(L)superscript𝐱1superscript𝐱𝐿\mathbf{x}^{(1)},\ldots,\mathbf{x}^{(L)}bold_x start_POSTSUPERSCRIPT ( 1 ) end_POSTSUPERSCRIPT , … , bold_x start_POSTSUPERSCRIPT ( italic_L ) end_POSTSUPERSCRIPT. We know that the candidate state 𝐱(i)𝒞𝒟superscript𝐱𝑖𝒞𝒟\mathbf{x}^{(i)}\in\mathcal{C}\cap\mathcal{D}bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ∈ caligraphic_C ∩ caligraphic_D iff V(𝐱(i))1𝑉superscript𝐱𝑖1V(\mathbf{x}^{(i)})\leq 1italic_V ( bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) ≤ 1 and b(𝐱(i))0𝑏superscript𝐱𝑖0b(\mathbf{x}^{(i)})\geq 0italic_b ( bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) ≥ 0. Hence we can design the objective function as

minV(𝐱),b(𝐱)i=1Lc1ReLU(V(𝐱(i))1)+c2ReLU(b(𝐱(i))),\displaystyle\min_{V(\mathbf{x}),b(\mathbf{x})}\sum_{i=1}^{L}c_{1}\text{ReLU}(% V(\mathbf{x}^{(i)})-1)+c_{2}\text{ReLU}(-b(\mathbf{x}^{(i))}),roman_min start_POSTSUBSCRIPT italic_V ( bold_x ) , italic_b ( bold_x ) end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_L end_POSTSUPERSCRIPT italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ReLU ( italic_V ( bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) - 1 ) + italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ReLU ( - italic_b ( bold_x start_POSTSUPERSCRIPT ( italic_i ) ) end_POSTSUPERSCRIPT ) , (15)

where c1,c2>0subscript𝑐1subscript𝑐20c_{1},c_{2}>0italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT > 0 are given positive weights, and Eq (15) penalizes the violation of x(i)𝒞𝒟superscript𝑥𝑖𝒞𝒟x^{(i)}\notin\mathcal{C}\cap\mathcal{D}italic_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ∉ caligraphic_C ∩ caligraphic_D. To avoid arbitrary scaling of CBF b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) (if b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ) is a valid CBF, the scaling it as kb(𝐱)𝑘𝑏𝐱k*b(\mathbf{x})italic_k ∗ italic_b ( bold_x ) by any positive constant k𝑘kitalic_k is still a valid CBF, and the cost function becomes unbounded under infinite scaling), we impose an additional constraint b(𝟎)1𝑏01b(\mathbf{0})\leq 1italic_b ( bold_0 ) ≤ 1. As a result, the optimization problem is written as

Objective (15)Objective italic-(15italic-)\displaystyle\text{Objective }\eqref{eq:candidate_states_cost}Objective italic_( italic_) (16a)
s.t V(𝟎)=0,V(𝐱) SOSformulae-sequence𝑉00𝑉𝐱 SOS\displaystyle V(\mathbf{0})=0,V(\mathbf{x})\in\text{ SOS}italic_V ( bold_0 ) = 0 , italic_V ( bold_x ) ∈ SOS (16b)
Constraint (8b),(10a)Constraint italic-(8bitalic-)italic-(10aitalic-)\displaystyle\text{Constraint }\eqref{eq:verify_S-procedure_constraint},\eqref% {eq:cbf_safe_constraint}Constraint italic_( italic_) , italic_( italic_) (16c)
b(𝟎)1𝑏01\displaystyle b(\mathbf{0})\leq 1italic_b ( bold_0 ) ≤ 1 (16d)

The optimization problems (14) and (16) are convex optimization problems when searching over V(𝐱),b(𝐱)𝑉𝐱𝑏𝐱V(\mathbf{x}),b(\mathbf{x})italic_V ( bold_x ) , italic_b ( bold_x ).

To summarize, we outline our synthesis algorithm in Algorithm 1

Algorithm 1 Synthesize compatible CLF-CBF
1:Given system dynamics (1), positive constants κV,κbsubscript𝜅𝑉subscript𝜅𝑏\kappa_{V},\kappa_{b}italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT , italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT and unsafe region 𝒳usubscript𝒳𝑢\mathcal{X}_{u}caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT in (9).
2:Initialize V(0)(𝐱),b(0)(𝐱)superscript𝑉0𝐱superscript𝑏0𝐱V^{(0)}(\mathbf{x}),b^{(0)}(\mathbf{x})italic_V start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT ( bold_x ) , italic_b start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT ( bold_x ). i=0𝑖0i=0italic_i = 0
3:while i<MaxIter𝑖MaxIteri<\text{MaxIter}italic_i < MaxIter do
4:     Fix V(i)(𝐱),b(i)(𝐱)superscript𝑉𝑖𝐱superscript𝑏𝑖𝐱V^{(i)}(\mathbf{x}),b^{(i)}(\mathbf{x})italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ), solve (8) and (10) to find the Lagrangian multipliers p(i)(𝐱),q(i)(𝐱),s(i)(𝐱,𝐲)superscript𝑝𝑖𝐱superscript𝑞𝑖𝐱superscript𝑠𝑖𝐱𝐲p^{(i)}(\mathbf{x}),q^{(i)}(\mathbf{x}),s^{(i)}(\mathbf{x},\mathbf{y})italic_p start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_q start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_s start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x , bold_y ).
5:     Fix p(i)(𝐱),q(i)(𝐱),s(i)(𝐱,𝐲)superscript𝑝𝑖𝐱superscript𝑞𝑖𝐱superscript𝑠𝑖𝐱𝐲p^{(i)}(\mathbf{x}),q^{(i)}(\mathbf{x}),s^{(i)}(\mathbf{x},\mathbf{y})italic_p start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_q start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_s start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x , bold_y ), find CLF-CBF V(i+1)(𝐱),b(i+1)(𝐱)superscript𝑉𝑖1𝐱superscript𝑏𝑖1𝐱V^{(i+1)}(\mathbf{x}),b^{(i+1)}(\mathbf{x})italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) , italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) through solving either (14) or (16).
6:     ii+1𝑖𝑖1i\leftarrow i+1italic_i ← italic_i + 1.
7:end while

In line 2 of Algorithm 1, we can initialize the CLF/CBF in many ways, for example a good candidate is to linearize the dynamics around the equilibrium state and use the LQR cost-to-go to design the initial guess.

With a feasible initial guess V(0)superscript𝑉0V^{(0)}italic_V start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT and b(0)superscript𝑏0b^{(0)}italic_b start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT, by induction, the CLF V(i)superscript𝑉𝑖V^{(i)}italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT and CBF b(i)superscript𝑏𝑖b^{(i)}italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT are also compatible in each iteration.

V Numerical Simulation

In this section, we evaluate our proposed exact verification method and compatible CLF/CBF synthesis approach. We demonstrate that our verification can differentiate compatible and incompatible CLF/CBF by solving convex optimization problems. We show that our proposed synthesis approach construct CLF/CBF candidates by enlarging the compatible region while ensuring the compatibility. All case studies are written in Python based on Drake [43] and MOSEK [44], and are conducted on a laptop with an Intel Core i5 6300HQ CPU and 8GB RAM. The detailed parameter settings can be found in our code.

V-A Verification

We evaluate the proposed verification framework using the 2-D first order integrator example mentioned in [32]. In order to show the framework’s capability of differentiating incompatible and compatible CLF-CBF, we first construct an incompatible CBF and CLF and show that they fail to pass the verification. We then verify a compatible CBF/CLF pair.

We evaluate our verification approach on the 2D first-order integrator 𝐱˙=𝐮˙𝐱𝐮\dot{\mathbf{x}}=\mathbf{u}over˙ start_ARG bold_x end_ARG = bold_u, where 𝐱2𝐱superscript2\mathbf{x}\in\mathbb{R}^{2}bold_x ∈ blackboard_R start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT, 𝐮𝒰2𝐮𝒰superscript2\mathbf{u}\in\mathcal{U}\subset\mathbb{R}^{2}bold_u ∈ caligraphic_U ⊂ blackboard_R start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. The unsafe region 𝒳usubscript𝒳𝑢\mathcal{X}_{u}caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT is represented by 𝒳u={𝐱|𝐱12+(𝐱23)21.520}subscript𝒳𝑢conditional-set𝐱superscriptsubscript𝐱12superscriptsubscript𝐱232superscript1.520\mathcal{X}_{u}=\{\mathbf{x}\;|\;\mathbf{x}_{1}^{2}+(\mathbf{x}_{2}-3)^{2}-1.5% ^{2}\leq 0\}caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = { bold_x | bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ( bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - 3 ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - 1.5 start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ≤ 0 }. We also consider the linear input constraint 𝒰={𝐮||𝐮1|3,|𝐮2|3}𝒰conditional-set𝐮formulae-sequencesubscript𝐮13subscript𝐮23\mathcal{U}=\{\mathbf{u}\;|\;|\mathbf{u}_{1}|\leq 3,|\mathbf{u}_{2}|\leq 3\}caligraphic_U = { bold_u | | bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT | ≤ 3 , | bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT | ≤ 3 }. We let parameters κV=0.01subscript𝜅𝑉0.01\kappa_{V}=0.01italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT = 0.01 and κb=0.01subscript𝜅𝑏0.01\kappa_{b}=0.01italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT = 0.01.

V-A1 Incompatible Example

In this example, we use the following given pair of incompatible CLF and CBF:

CLF: V(𝐱)=0.05𝐱12+0.0125𝐱22CLF: 𝑉𝐱0.05superscriptsubscript𝐱120.0125superscriptsubscript𝐱22\displaystyle\text{CLF: }V(\mathbf{x})=0.05\mathbf{x}_{1}^{2}+0.0125\mathbf{x}% _{2}^{2}CLF: italic_V ( bold_x ) = 0.05 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 0.0125 bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT
CBF: b(x)=𝐱12+(𝐱23)21.52.CBF: 𝑏𝑥superscriptsubscript𝐱12superscriptsubscript𝐱232superscript1.52\displaystyle\text{CBF: }b(x)=\mathbf{x}_{1}^{2}+(\mathbf{x}_{2}-3)^{2}-1.5^{2}.CBF: italic_b ( italic_x ) = bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ( bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - 3 ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - 1.5 start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (17)

The incompatibility is checked by finding a state 𝐱^=[0,5]T^𝐱superscript05𝑇\hat{\mathbf{x}}=[0,5]^{T}over^ start_ARG bold_x end_ARG = [ 0 , 5 ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT at which there does not exist 𝐮𝒰𝐮𝒰\mathbf{u}\in\mathcal{U}bold_u ∈ caligraphic_U satisfying CLF and CBF constraints. We then give this pair of CLF-CBF to the verification SOS program. The degrees of the Lagrangian polynomials are set to be 2222. The convex optimization (8) reports infeasibility, which is consistent with the incompatible state [0,5]Tsuperscript05𝑇[0,5]^{T}[ 0 , 5 ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT.

V-A2 Compatible Example

We use the idea of CLBF [3] and give the verification framework a CLBF pair:

CLF: V(𝐱)=𝐱12+𝐱22CLF: 𝑉𝐱superscriptsubscript𝐱12superscriptsubscript𝐱22\displaystyle\text{CLF: }V(\mathbf{x})=\mathbf{x}_{1}^{2}+\mathbf{x}_{2}^{2}CLF: italic_V ( bold_x ) = bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT
CBF: b(𝐱)=1V(𝐱).CBF: 𝑏𝐱1𝑉𝐱\displaystyle\text{CBF: }b(\mathbf{x})=1-V(\mathbf{x}).CBF: italic_b ( bold_x ) = 1 - italic_V ( bold_x ) . (18)

In this example, the polynomial degrees for compatible Lagrangian polynomials are set to be 2222. The solver solves the verification SOS program successfully, which certifies the compatibility of the CLF and CBF in (V-A2) are compatible, and the given CBF is correct.

The results for these two examples show that our proposed verification approach can verify compatibility of CBF-CLF, while also differentiating between compatible and incompatible CBF-CLF pairs.

V-B Synthesis

We next evaluate our proposed bilinear alternation synthesis method. We investigate a linear example, a nonlinear example [45] and a power converter example [33]. We set parameters κV=0.01subscript𝜅𝑉0.01\kappa_{V}=0.01italic_κ start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT = 0.01, and κb=0.01subscript𝜅𝑏0.01\kappa_{b}=0.01italic_κ start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT = 0.01. Since the compatible region may infinitely enlarged if 𝒳ssubscript𝒳𝑠\mathcal{X}_{s}caligraphic_X start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT is an open set, then the synthesis loop may not terminate. Hence, we set maximum number of iterations as a hard stop** condition (MaxIter=25) during experiments.

V-B1 Linear Example

For the linear toy example, we use the following system dynamics:

[𝐱˙1𝐱˙2]=[1223][𝐱1𝐱2]+[1001][𝐮1𝐮2].matrixsubscript˙𝐱1subscript˙𝐱2matrix1223matrixsubscript𝐱1subscript𝐱2matrix1001matrixsubscript𝐮1subscript𝐮2\begin{bmatrix}\dot{\mathbf{x}}_{1}\\ \dot{\mathbf{x}}_{2}\end{bmatrix}=\begin{bmatrix}1&2\\ -2&3\end{bmatrix}\begin{bmatrix}\mathbf{x}_{1}\\ \mathbf{x}_{2}\end{bmatrix}+\begin{bmatrix}1&0\\ 0&1\end{bmatrix}\begin{bmatrix}\mathbf{u}_{1}\\ \mathbf{u}_{2}\end{bmatrix}.[ start_ARG start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] = [ start_ARG start_ROW start_CELL 1 end_CELL start_CELL 2 end_CELL end_ROW start_ROW start_CELL - 2 end_CELL start_CELL 3 end_CELL end_ROW end_ARG ] [ start_ARG start_ROW start_CELL bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] + [ start_ARG start_ROW start_CELL 1 end_CELL start_CELL 0 end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL 1 end_CELL end_ROW end_ARG ] [ start_ARG start_ROW start_CELL bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] . (19)

The obstacle is represented as 𝒳u={𝐱|𝐱1+𝐱2+30}subscript𝒳𝑢conditional-set𝐱subscript𝐱1subscript𝐱230\mathcal{X}_{u}=\{\mathbf{x}\;|\;\mathbf{x}_{1}+\mathbf{x}_{2}+3\leq 0\}caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = { bold_x | bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + 3 ≤ 0 } . We construct a compatible CBF and CLF using a heuristic method that solves a linear quadratic regulator (LQR) problem in a neighborhood of an equilibrium point to initialize CLF/CBF. We set the cost matrices of LQR as Q=I2,R=I2formulae-sequence𝑄subscript𝐼2𝑅subscript𝐼2Q=I_{2},R=I_{2}italic_Q = italic_I start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_R = italic_I start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, where I2subscript𝐼2I_{2}italic_I start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is 2×2222\times 22 × 2 identity matrix.

Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Figure 1: This figure presets the compatible CLF-CBF synthesis results for all the investigated examples. In these plots, unsafe regions (UR) are marked as red, initial compatible regions (ICR) are marked as gray, initial compatible boundaries (ICB) are marked as dashed lines, synthesized compatible regions (SCB) are marked as green, and synthesized compatible boundaries (SCB) are marked as solid lines. The compatible regions are enlarged for all the investigated examples. Figure 1(a) and 1(b) show the results for linear example and nonlinear example, respectively. In these two examples, the synthesis loop stops after maximum number of iterations (25 iterations). Figure 1(c) shows the synthesis result for power converter example. The synthesis stops after 7 iterations because the compatible region can not be enlarged further according to optimization (16)

Figure 1(a) shows the initial compatible region and the compatible region after synthesis. We observe that our alternating synthesis method can enlarge the compatible region and incorporates the initial compatible region. The synthesis loop stops after maximum number of iterations.

V-B2 Nonlinear Example

In this example, the following dynamics [21] is used:

[𝐱˙1𝐱˙2]=[0𝐱1+𝐱136]+[11][u].matrixsubscript˙𝐱1subscript˙𝐱2matrix0subscript𝐱1superscriptsubscript𝐱136matrix11matrix𝑢\begin{bmatrix}\dot{\mathbf{x}}_{1}\\ \dot{\mathbf{x}}_{2}\end{bmatrix}=\begin{bmatrix}0\\ -\mathbf{x}_{1}+\frac{\mathbf{x}_{1}^{3}}{6}\end{bmatrix}+\begin{bmatrix}1\\ -1\end{bmatrix}\begin{bmatrix}u\end{bmatrix}.[ start_ARG start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] = [ start_ARG start_ROW start_CELL 0 end_CELL end_ROW start_ROW start_CELL - bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + divide start_ARG bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT end_ARG start_ARG 6 end_ARG end_CELL end_ROW end_ARG ] + [ start_ARG start_ROW start_CELL 1 end_CELL end_ROW start_ROW start_CELL - 1 end_CELL end_ROW end_ARG ] [ start_ARG start_ROW start_CELL italic_u end_CELL end_ROW end_ARG ] . (20)

We pick 𝐱eq=[0,0]T,ueq=0formulae-sequencesubscript𝐱𝑒𝑞superscript00𝑇subscript𝑢𝑒𝑞0\mathbf{x}_{eq}=[0,0]^{T},u_{eq}=0bold_x start_POSTSUBSCRIPT italic_e italic_q end_POSTSUBSCRIPT = [ 0 , 0 ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , italic_u start_POSTSUBSCRIPT italic_e italic_q end_POSTSUBSCRIPT = 0 as the equilibrium point and linearize the system around this point to compute the LQR. The obstacle for this example is the same as linear toy example. The cost matrices of LQR are set as Q=I2,R=1formulae-sequence𝑄subscript𝐼2𝑅1Q=I_{2},R=1italic_Q = italic_I start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_R = 1.The synthesis results for this example are shown by Figure 1(b). We observe that the proposed alternating synthesis can enlarge the compatible region in this example.

V-B3 Power Converter Example

The dynamical model of the power converter is given in [33] as follows

[𝐱˙1𝐱˙2𝐱˙3]=[0.05𝐱157.9𝐱2+0.00919𝐱31710𝐱1+314𝐱30.271𝐱1314𝐱2]+[0.0557.9𝐱257.9𝐱31710+1710𝐱1001710+1710𝐱1][𝐮1𝐮2].matrixsubscript˙𝐱1subscript˙𝐱2subscript˙𝐱3matrix0.05subscript𝐱157.9subscript𝐱20.00919subscript𝐱31710subscript𝐱1314subscript𝐱30.271subscript𝐱1314subscript𝐱2matrix0.0557.9subscript𝐱257.9subscript𝐱317101710subscript𝐱10017101710subscript𝐱1matrixsubscript𝐮1subscript𝐮2\begin{bmatrix}\dot{\mathbf{x}}_{1}\\ \dot{\mathbf{x}}_{2}\\ \dot{\mathbf{x}}_{3}\end{bmatrix}=\begin{bmatrix}-0.05\mathbf{x}_{1}-57.9% \mathbf{x}_{2}+0.00919\mathbf{x}_{3}\\ 1710\mathbf{x}_{1}+314\mathbf{x}_{3}\\ -0.271\mathbf{x}_{1}-314\mathbf{x}_{2}\end{bmatrix}+\\ \begin{bmatrix}0.05-57.9\mathbf{x}_{2}&-57.9\mathbf{x}_{3}\\ 1710+1710\mathbf{x}_{1}&0\\ 0&1710+1710\mathbf{x}_{1}\end{bmatrix}\begin{bmatrix}\mathbf{u}_{1}\\ \mathbf{u}_{2}\end{bmatrix}.start_ROW start_CELL [ start_ARG start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL over˙ start_ARG bold_x end_ARG start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] = [ start_ARG start_ROW start_CELL - 0.05 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - 57.9 bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + 0.00919 bold_x start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL 1710 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + 314 bold_x start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL - 0.271 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - 314 bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] + end_CELL end_ROW start_ROW start_CELL [ start_ARG start_ROW start_CELL 0.05 - 57.9 bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL start_CELL - 57.9 bold_x start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL 1710 + 1710 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL start_CELL 0 end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL 1710 + 1710 bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] [ start_ARG start_ROW start_CELL bold_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG ] . end_CELL end_ROW (21)

The unsafe region is presented as:

𝒳u={𝐱|\displaystyle\mathcal{X}_{u}=\{\mathbf{x}|caligraphic_X start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT = { bold_x | 𝐱1+0.20,𝐱1+0.80,formulae-sequencesubscript𝐱10.20subscript𝐱10.80\displaystyle-\mathbf{x}_{1}+0.2\leq 0,\mathbf{x}_{1}+0.8\leq 0,- bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + 0.2 ≤ 0 , bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + 0.8 ≤ 0 ,
(𝐱20.001)2𝐱32+1.220}.\displaystyle-(\mathbf{x}_{2}-0.001)^{2}-\mathbf{x}_{3}^{2}+1.2^{2}\leq 0\}.- ( bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT - 0.001 ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - bold_x start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 1.2 start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ≤ 0 } . (22)

The equilibrium point of the system is 𝐱eq=[0,0,0]T,𝐮eq=[0,0]Tformulae-sequencesubscript𝐱𝑒𝑞superscript000𝑇subscript𝐮𝑒𝑞superscript00𝑇\mathbf{x}_{eq}=[0,0,0]^{T},\mathbf{u}_{eq}=[0,0]^{T}bold_x start_POSTSUBSCRIPT italic_e italic_q end_POSTSUBSCRIPT = [ 0 , 0 , 0 ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , bold_u start_POSTSUBSCRIPT italic_e italic_q end_POSTSUBSCRIPT = [ 0 , 0 ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT. We linearize the system near the equilibrium point and compute the LQR. We set the cost matrices of LQR as Q=I3,R=I2formulae-sequence𝑄subscript𝐼3𝑅subscript𝐼2Q=I_{3},R=I_{2}italic_Q = italic_I start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , italic_R = italic_I start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, where I3subscript𝐼3I_{3}italic_I start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT is 3×3333\times 33 × 3 identity matrix. The initialized and synthesised compatible regions for power converter example are shown by Figure 1(c). The proposed synthesis method enlarges the compatible region for the power converter. The syntehsis loop stops after 7 number of iterations because the compatible region can not be enlarged further according to optimization problem (16). The returned CLF-CBF are verified to be compatible. Together with Figure 1(a) and Figure 1(b), we can conclude that the proposed alternating synthesis method enlarges the compatible region and returns compaitble CLF-CBF for all the investigated examples.

VI Conclusion

In this paper, for control affine systems both with and without input limits, we studied the verification and synthesis of compatible CBF and CLF independent from any nominal controllers. We presented sufficient and necessary conditions for compatible CBF and CLF via Farkas’ Lemma and algebraic-geometric Positivstellensatz, and demonstrated that these conditions can be checked by solving an SOS program. In order to reduce the number of SOS polynomials in the SOS program, we further simplified the necessary and sufficient condition using S-procedure and formulated a more tractable SOS program for compatibility verification. We next proposed an alternating method to synthesize compatible CLF and CBFs based on the verification framework. In each iteration, the algorithm first takes the CLF and CBF from the previous iteration and computes the Lagrangian polynomials by solving the verification SOS program. Then, it takes the Lagrangian polynomials and updates the CLF and CBF to obtain a larger compatible region. Finally, we evaluated our proposed approach with a linear system, a nonlinear system and nonlinear power converter. In our future work, we will extend the verification and synthesis framework to high-relative degree and non-convex scenarios.

References

  • [1] Department of Homeland Security, Department of Homeland Security Cyber-Physical Systems Page, Jan 2022. [Online] Available: https://www.dhs.gov/science-and-technology/cpssec [Accessed: Jan 2022].
  • [2] B. Li, S. Wen, Z. Yan, G. Wen, and T. Huang, “A survey on the control Lyapunov function and control barrier function for nonlinear-affine control systems,” IEEE/CAA Journal of Automatica Sinica, vol. 10, no. 3, pp. 584–602, 2023.
  • [3] R. K. Fachri, M. Z. Romdlony, and M. R. Rosa, “Multiple waypoint navigation for mobile robot using control Lyapunov-barrier function (CLBF),” in 2022 IEEE International Conference on Cybernetics and Computational Intelligence (CyberneticsCom), pp. 230–235, IEEE, 2022.
  • [4] M. H. Cohen, T. G. Molnar, and A. D. Ames, “Safety-critical control for autonomous systems: Control barrier functions via reduced-order models,” Annual Reviews in Control, vol. 57, p. 100947, 2024.
  • [5] A. D. Ames, J. W. Grizzle, and P. Tabuada, “Control barrier function based quadratic programs with application to adaptive cruise control,” in 53rd IEEE Conference on Decision and Control, pp. 6271–6278, IEEE, 2014.
  • [6] X. Fan, Y. Guo, H. Liu, B. Wei, and W. Lyu, “Improved artificial potential field method applied for AUV path planning,” Mathematical Problems in Engineering, vol. 2020, pp. 1–21, 2020.
  • [7] X. Chen and S. Sankaranarayanan, “Reachability analysis for cyber-physical systems: Are we there yet?,” in NASA Formal Methods Symposium, pp. 109–130, Springer, 2022.
  • [8] D. Lee and C. J. Tomlin, “A Hopf-Lax formula in hamilton–jacobi analysis of reach-avoid problems,” IEEE Control Systems Letters, vol. 5, no. 3, pp. 1055–1060, 2020.
  • [9] M. Schwenzer, M. Ay, T. Bergs, and D. Abel, “Review on model predictive control: An engineering perspective,” The International Journal of Advanced Manufacturing Technology, vol. 117, no. 5, pp. 1327–1349, 2021.
  • [10] A. D. Ames, S. Coogan, M. Egerstedt, G. Notomista, K. Sreenath, and P. Tabuada, “Control barrier functions: Theory and applications,” in 2019 18th European control conference (ECC), pp. 3420–3431, IEEE, 2019.
  • [11] S. Prajna, A. Jadbabaie, and G. J. Pappas, “A framework for worst-case and stochastic safety verification using barrier certificates,” IEEE Transactions on Automatic Control, vol. 52, no. 8, pp. 1415–1428, 2007.
  • [12] A. M. Lyapunov, “The general problem of the stability of motion,” International journal of control, vol. 55, no. 3, pp. 531–534, 1892.
  • [13] E. D. Sontag, “A Lyapunov-like characterization of asymptotic controllability,” SIAM journal on control and optimization, vol. 21, no. 3, pp. 462–471, 1983.
  • [14] J. Zeng, B. Zhang, and K. Sreenath, “Safety-critical model predictive control with discrete-time control barrier function,” in 2021 American Control Conference (ACC), pp. 3882–3889, IEEE, 2021.
  • [15] M. H. Cohen and C. Belta, “High order robust adaptive control barrier functions and exponentially stabilizing adaptive control Lyapunov functions,” in 2022 American Control Conference (ACC), pp. 2233–2238, IEEE, 2022.
  • [16] J. Choi, F. Castaneda, C. J. Tomlin, and K. Sreenath, “Reinforcement learning for safety-critical control under model uncertainty, using control Lyapunov functions and control barrier functions,” arXiv preprint arXiv:2004.07584, 2020.
  • [17] C. Dawson, S. Gao, and C. Fan, “Safe control with learned certificates: A survey of neural Lyapunov, barrier, and contraction methods for robotics and control,” IEEE Transactions on Robotics, 2023.
  • [18] S. Liu, C. Liu, and J. Dolan, “Safe control under input limits with neural control barrier functions,” in Conference on Robot Learning, pp. 1970–1980, PMLR, 2023.
  • [19] H. Wang, K. Margellos, and A. Papachristodoulou, “Safety verification and controller synthesis for systems with input constraints,” IFAC-PapersOnLine, vol. 56, no. 2, pp. 1698–1703, 2023.
  • [20] S. Kang, Y. Chen, H. Yang, and M. Pavone, “Verification and synthesis of robust control barrier functions: Multilevel polynomial optimization and semidefinite relaxation,” arXiv preprint arXiv:2303.10081, 2023.
  • [21] H. Dai and F. Permenter, “Convex synthesis and verification of control-Lyapunov and barrier functions with input constraints,” in 2023 American Control Conference (ACC), pp. 4116–4123, IEEE, 2023.
  • [22] A. Clark, “A semi-algebraic framework for verification and synthesis of control barrier functions,” arXiv preprint arXiv:2209.00081, 2022.
  • [23] W. Zhao, T. He, T. Wei, S. Liu, and C. Liu, “Safety index synthesis via sum-of-squares programming,” in 2023 American Control Conference (ACC), pp. 732–737, IEEE, 2023.
  • [24] S. Chen and M. Fazlyab, “Learning performance-oriented control barrier functions under complex safety constraints and limited actuation,” arXiv preprint arXiv:2401.05629, 2024.
  • [25] H. Zhang, Z. Li, H. Dai, and A. Clark, “Efficient sum of squares-based verification and construction of control barrier functions by sampling on algebraic varieties,” in 2023 62nd IEEE Conference on Decision and Control (CDC), pp. 5384–5391, 2023.
  • [26] S. Yang, Y. Chen, X. Yin, and R. Mangharam, “Learning local control barrier functions for safety control of hybrid systems,” arXiv preprint arXiv:2401.14907, 2024.
  • [27] B. Dai, P. Krishnamurthy, and F. Khorrami, “Learning a better control barrier function,” in 2022 IEEE 61st Conference on Decision and Control (CDC), pp. 945–950, IEEE, 2022.
  • [28] W. **, Z. Wang, Z. Yang, and S. Mou, “Neural certificates for safe control policies,” arXiv preprint arXiv:2006.08465, 2020.
  • [29] P. Zhao, R. Ghabcheloo, Y. Cheng, H. Abdi, and N. Hovakimyan, “Convex synthesis of control barrier functions under input constraints,” IEEE Control Systems Letters, 2023.
  • [30] A. Isaly, M. Ghanbarpour, R. G. Sanfelice, and W. E. Dixon, “On the feasibility and continuity of feedback controllers defined by multiple control barrier functions,” IEEE Transactions on Automatic Control, pp. 1–15, 2024.
  • [31] H. Wang, K. Margellos, and A. Papachristodoulou, “Relaxed compatibility between control barrier and lyapunov functions,” in 2024 UKACC 14th International Conference on Control (CONTROL), pp. 125–126, 2024.
  • [32] M. F. Reis, A. P. Aguiar, and P. Tabuada, “Control barrier function-based quadratic programs introduce undesirable asymptotically stable equilibria,” IEEE Control Systems Letters, vol. 5, no. 2, pp. 731–736, 2020.
  • [33] M. Schneeberger, S. Mastellone, and F. Dörfler, “Advanced safety filter based on SOS control barrier and Lyapunov functions,” arXiv preprint arXiv:2401.06901, 2024.
  • [34] M. Schneeberger, F. Dörfler, and S. Mastellone, “SOS construction of compatible control Lyapunov and barrier functions,” arXiv preprint arXiv:2305.01222, 2023.
  • [35] A. Papachristodoulou, J. Anderson, G. Valmorbida, S. Prajna, P. Seiler, P. Parrilo, M. M. Peet, and D. Jagt, “SOSTOOLS version 4.00 sum of squares optimization toolbox for matlab,” arXiv preprint arXiv:1310.4716, 2013.
  • [36] P. A. Parrilo, Structured Semidefinite Programs and Semialgebraic Geometry Methods in Robustness and Optimization. California Institute of Technology, 2000.
  • [37] M. Li and Z. Sun, “A graphical interpretation and universal formula for safe stabilization,” in 2023 American Control Conference (ACC), pp. 3012–3017, IEEE, 2023.
  • [38] G. Blekherman, P. A. Parrilo, and R. R. Thomas, Semidefinite Optimization and Convex Algebraic Geometry. SIAM, 2012.
  • [39] J. Matousek and B. Gärtner, Understanding and Using Linear Programming. Springer Science & Business Media, 2006.
  • [40] E. D. Sontag, “A ‘universal’construction of artstein’s theorem on nonlinear stabilization,” Systems & control letters, vol. 13, no. 2, pp. 117–123, 1989.
  • [41] R. Tedrake, I. R. Manchester, M. Tobenkin, and J. W. Roberts, “LQR-trees: Feedback motion planning via sums-of-squares verification,” The International Journal of Robotics Research, vol. 29, no. 8, pp. 1038–1052, 2010.
  • [42] D. Henrion, J. B. Lasserre, and C. Savorgnan, “Approximate volume and integration for basic semialgebraic sets,” SIAM review, vol. 51, no. 4, pp. 722–743, 2009.
  • [43] R. Tedrake and the Drake Development Team, “Drake: Model-based design and verification for robotics,” 2019.
  • [44] M. ApS, MOSEK Optimization Software Python API Documentation, 2024.
  • [45] W. Tan and A. Packard, “Searching for control Lyapunov functions using sums of squares programming,” sibi, vol. 1, no. 1, 2004.

VII Appendix

VII-A Solving optimization problem (14)

The optimization problem (14) aims at maximizing the volume of the compatible region 𝒞𝒟𝒞𝒟\mathcal{C}\cap\mathcal{D}caligraphic_C ∩ caligraphic_D, which is a complicated basic semi-algebraic set. It is challenging to maximize the volume of the basic semi-algebraic set while searching for its defining polynomials. To remedy this, we consider an alternative approach which doesn’t compute the volume directly.

In Algorithm 1 we iteratively search for the new CLF/CBF (together with the new compatible region). Our intuition is to enlarge the compatible region, such that the new one contains the old compatible region in the previous iteration. Formally, in iteration i𝑖iitalic_i, given the CLF/CBF in the previous iteration as V(i)(𝐱),b(i)(𝐱)superscript𝑉𝑖𝐱superscript𝑏𝑖𝐱V^{(i)}(\mathbf{x}),b^{(i)}(\mathbf{x})italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) (whose compatible region is 𝒞(i)𝒟(i)superscript𝒞𝑖superscript𝒟𝑖\mathcal{C}^{(i)}\cap\mathcal{D}^{(i)}caligraphic_C start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ∩ caligraphic_D start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT), together with the Lagrangian multiplier p(i)(𝐱),q(i)(𝐱),s(i)(𝐱,𝐲)superscript𝑝𝑖𝐱superscript𝑞𝑖𝐱superscript𝑠𝑖𝐱𝐲p^{(i)}(\mathbf{x}),q^{(i)}(\mathbf{x}),s^{(i)}(\mathbf{x},\mathbf{y})italic_p start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_q start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) , italic_s start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x , bold_y ), our goal is to find a new CLF V(i+1)superscript𝑉𝑖1V^{(i+1)}italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT and CBF b(i+1)(𝐱)superscript𝑏𝑖1𝐱b^{(i+1)}(\mathbf{x})italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ). The new compatible region 𝒞(i+1)𝒟(i+1)superscript𝒞𝑖1superscript𝒟𝑖1\mathcal{C}^{(i+1)}\cap\mathcal{D}^{(i+1)}caligraphic_C start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ∩ caligraphic_D start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT will contain the old compatible region, namely

𝐱{𝐱|b(i)(𝐱)0,1V(i)(𝐱)0}b(i+1)(𝐱)tb and 1V(i+1)(𝐱)tV.for-all𝐱conditional-set𝐱formulae-sequencesuperscript𝑏𝑖𝐱01superscript𝑉𝑖𝐱0superscript𝑏𝑖1𝐱subscript𝑡𝑏 and 1superscript𝑉𝑖1𝐱subscript𝑡𝑉\displaystyle\begin{split}\forall\mathbf{x}\in\{\mathbf{x}\;|\;b^{(i)}(\mathbf% {x})\geq 0,1-V^{(i)}(\mathbf{x})\geq 0\}\\ \qquad\Rightarrow b^{(i+1)}(\mathbf{x})\geq t_{b}\text{ and }1-V^{(i+1)}(% \mathbf{x})\geq t_{V}\end{split}.start_ROW start_CELL ∀ bold_x ∈ { bold_x | italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) ≥ 0 , 1 - italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) ≥ 0 } end_CELL end_ROW start_ROW start_CELL ⇒ italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) ≥ italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT and 1 - italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) ≥ italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT end_CELL end_ROW . (23)

where we use the positive scalar tbsubscript𝑡𝑏t_{b}italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT and tVsubscript𝑡𝑉t_{V}italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT to measure the “margin” between the old and new compatible regions, and our goal is to maximize this margin. Similar to the (16), to avoid arbitrary scaling of b(𝐱)𝑏𝐱b(\mathbf{x})italic_b ( bold_x ), we introduce the constraint b(𝟎)1𝑏01b(\mathbf{0})\leq 1italic_b ( bold_0 ) ≤ 1 to avoid the infinite scaling.

We can convert the condition (23) to a SOS constraint through the S-procedure as

b(t+1)(𝐱)tbϕ1(𝐱)b(i)(𝐱)ϕ2(𝐱)(1V(i)(𝐱)) SOSsuperscript𝑏𝑡1𝐱subscript𝑡𝑏subscriptitalic-ϕ1𝐱superscript𝑏𝑖𝐱subscriptitalic-ϕ2𝐱1superscript𝑉𝑖𝐱 SOS\displaystyle\begin{split}b^{(t+1)}(\mathbf{x})-t_{b}-\phi_{1}(\mathbf{x})b^{(% i)}(\mathbf{x})-\\ \;\phi_{2}(\mathbf{x})(1-V^{(i)}(\mathbf{x}))\in\text{ SOS}\end{split}start_ROW start_CELL italic_b start_POSTSUPERSCRIPT ( italic_t + 1 ) end_POSTSUPERSCRIPT ( bold_x ) - italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT - italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) - end_CELL end_ROW start_ROW start_CELL italic_ϕ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) ( 1 - italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) ) ∈ SOS end_CELL end_ROW (24a)
1V(i+1)(𝐱tVψ1(𝐱)b(i)(𝐱)ψ2(𝐱)(1V(i)(𝐱)) SOS\displaystyle\begin{split}1-V^{(i+1)}(\mathbf{x}-t_{V}-\psi_{1}(\mathbf{x})b^{% (i)}(\mathbf{x})-\\ \psi_{2}(\mathbf{x})(1-V^{(i)}(\mathbf{x}))\in\text{ SOS}\end{split}start_ROW start_CELL 1 - italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x - italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT - italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) italic_b start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) - end_CELL end_ROW start_ROW start_CELL italic_ψ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) ( 1 - italic_V start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( bold_x ) ) ∈ SOS end_CELL end_ROW (24b)
ϕ1(𝐱),ϕ2(𝐱),ψ1(𝐱),ψ2(𝐱) SOS,subscriptitalic-ϕ1𝐱subscriptitalic-ϕ2𝐱subscript𝜓1𝐱subscript𝜓2𝐱 SOS\displaystyle\phi_{1}(\mathbf{x}),\phi_{2}(\mathbf{x}),\psi_{1}(\mathbf{x}),% \psi_{2}(\mathbf{x})\in\text{ SOS},italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) , italic_ϕ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) , italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) , italic_ψ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) ∈ SOS , (24c)

and obtain the following optimization problem

maxV(i+1)(𝐱),b(i+1)(𝐱),tb,tV,ϕ1(𝐱),ϕ2(𝐱),ψ1(𝐱),ψ2(𝐱)tb+tVsubscriptsuperscript𝑉𝑖1𝐱superscript𝑏𝑖1𝐱subscript𝑡𝑏subscript𝑡𝑉subscriptitalic-ϕ1𝐱subscriptitalic-ϕ2𝐱subscript𝜓1𝐱subscript𝜓2𝐱subscript𝑡𝑏subscript𝑡𝑉\displaystyle\max_{\begin{subarray}{c}V^{(i+1)}(\mathbf{x}),b^{(i+1)}(\mathbf{% x}),\\ t_{b},t_{V},\\ \phi_{1}(\mathbf{x}),\phi_{2}(\mathbf{x}),\\ \psi_{1}(\mathbf{x}),\psi_{2}(\mathbf{x})\end{subarray}}t_{b}+t_{V}roman_max start_POSTSUBSCRIPT start_ARG start_ROW start_CELL italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) , italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) , end_CELL end_ROW start_ROW start_CELL italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT , italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT , end_CELL end_ROW start_ROW start_CELL italic_ϕ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) , italic_ϕ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) , end_CELL end_ROW start_ROW start_CELL italic_ψ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( bold_x ) , italic_ψ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_x ) end_CELL end_ROW end_ARG end_POSTSUBSCRIPT italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT + italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT (25a)
s.t V(i+1)(𝟎)=0,V(i+1)(𝐱) SOSformulae-sequencesuperscript𝑉𝑖100superscript𝑉𝑖1𝐱 SOS\displaystyle\;V^{(i+1)}(\mathbf{0})=0,V^{(i+1)}(\mathbf{x})\in\text{ SOS}italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_0 ) = 0 , italic_V start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ) ∈ SOS (25b)
Constraint (8b),(10a)Constraint italic-(8bitalic-)italic-(10aitalic-)\displaystyle\text{Constraint }\eqref{eq:verify_S-procedure_constraint},\eqref% {eq:cbf_safe_constraint}Constraint italic_( italic_) , italic_( italic_) (25c)
Constraint (24)Constraint italic-(24italic-)\displaystyle\text{Constraint }\eqref{eq:compatible_region_containment_sos}Constraint italic_( italic_) (25d)
tb0,tV0formulae-sequencesubscript𝑡𝑏0subscript𝑡𝑉0\displaystyle t_{b}\geq 0,t_{V}\geq 0italic_t start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ≥ 0 , italic_t start_POSTSUBSCRIPT italic_V end_POSTSUBSCRIPT ≥ 0 (25e)
b(i+1)(𝟎)1,superscript𝑏𝑖101\displaystyle b^{(i+1)}(\mathbf{0})\leq 1,italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_0 ) ≤ 1 , (25f)

where we add the constraint b(i+1)(𝟎)1superscript𝑏𝑖101b^{(i+1)}(\mathbf{0})\leq 1italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_0 ) ≤ 1 to avoid arbitrary scaling of b(i+1)(𝐱)superscript𝑏𝑖1𝐱b^{(i+1)}(\mathbf{x})italic_b start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT ( bold_x ), which would make the optimization problem unbounded with infinite scaling. The optimization problem (25) is a SOS program.