写在前面 
原论文:Control Barrier Function Based Quadratic Programs for Safety Critical Systems.
本文为近期阅读的论文(Ames 2017)的笔记。该论文介绍了两种barrier function,即reciprocal barrier function (RBF)和zeroing barrier function (ZBF),目的是将它们扩展为control barrier function (CBF),并以二次规划 (QP)形式与control Lyapunov function (CLF)结合起来,实现带有约束的控制器。
针对给定集合C \mathcal C C  ,如果B ( x ) B(x) B ( x )  在集合边界处无界,即B ( x ) → ∞ B(x)\to \infty B ( x ) → ∞   as x → ∂ C x\to\partial \mathcal C x → ∂ C  ,则称函数B B B  为RBF;如果h ( x ) h(x) h ( x )  在集合边界处为0,即h ( x ) → 0 h(x)\to 0 h ( x ) → 0   as x → ∂ C x\to\partial \mathcal C x → ∂ C  ,则称函数h h h  为ZBF。以上任意一种情况的B B B  或h h h  满足Lyapunov-like条件,则可以保证∂ C \partial \mathcal C ∂ C  的不变性 (forward invariance)。
问题描述 
考虑非线性系统
x ˙ = f ( x ) ( 1 ) \dot x=f(x)\qquad(1)
 x ˙ = f ( x ) ( 1 ) 
其中x ∈ R n x\in\mathbb R^n x ∈ R n  ,假设f f f  是locally Lipschitz。集合C \mathcal C C  对于(1)不变 (forward invariant),如果对每一个x 0 ∈ C x_0\in\mathcal C x 0  ∈ C  ,都有x ( t ) ∈ C x(t)\in\mathcal C x ( t ) ∈ C  ,∀ t ∈ [ 0 , ∞ ) \forall t\in[0,\infty) ∀ t ∈ [ 0 , ∞ )  。
RBF 
问题1:给定闭集C : = { x ∈ R n ∣ h ( x ) ≥ 0 } \mathcal C:=\{x\in\mathbb R^n|h(x)\geq 0 \} C : = { x ∈ R n ∣ h ( x ) ≥ 0 }  ,确定函数B : int  ( C ) → R B:\operatorname{int}(\mathcal C)\to \mathbb R B : i n t ( C ) → R  并构建CBF使得int  ( C ) \operatorname{int}(\mathcal C) i n t ( C )  不变,其中h : R n → R h:\mathbb R^n\to\mathbb R h : R n → R  是连续可微函数。同时假设C \mathcal C C  非空没有孤立点 (isolated point),即int  ( C ) ≠ ∅ \operatorname{int}(\mathcal C)\neq \emptyset i n t ( C )   = ∅  ,int  ( C ) ‾ = C \overline{\operatorname{int}(\mathcal C)}=\mathcal C i n t ( C )  = C  。
 
1. Logarithmic 
选取logarithmic barrier function candidate
B ( x ) = − log  ( h ( x ) 1 + h ( x ) ) ( 2 ) B(x)=-\log\left(\frac{h(x)}{1+h(x)} \right)\qquad (2)
 B ( x ) = − log  ( 1 + h ( x ) h ( x )  ) ( 2 ) 
满足inf  x ∈ int  ( C ) B ( x ) ≥ 0 \inf_{x\in\operatorname{int}(\mathcal C)}B(x)\geq 0 inf  x ∈ i n t ( C )  B ( x ) ≥ 0  ,lim  x → ∂ C B ( x ) = ∞ \lim_{x\to\partial\mathcal C}B(x)=\infty lim x → ∂ C  B ( x ) = ∞  。
设计条件
B ˙ ≤ γ B , ( 3 ) \dot B\leq \frac{\gamma}{B},\qquad (3)
 B ˙ ≤ B γ  , ( 3 ) 
使得B B B  在远离边界时可以增大,越接近边界增大速率越接近于0。
证明:对(2)求导代入条件中,得到h ˙ ≥ γ ( h + h 2 ) log  ( h 1 + h ) \dot h\geq \frac{\gamma(h+h^2)}{\log(\frac{h}{1+h})} h ˙ ≥ log  ( 1 + h h  ) γ ( h + h 2 )   ,由比较引理 (Comparison Lemma)得到,如果x 0 ∈ int  ( C ) x_0\in\operatorname{int}(\mathcal C) x 0  ∈ i n t ( C )  ,那么∀ t ≥ 0 \forall t\geq 0 ∀ t ≥ 0  ,有
h ( x ( t , x 0 ) ) ≥ 1 exp  ( 2 γ t + log  2 ( h ( x 0 ) + 1 h ( x 0 ) ) ) − 1 > 0 h(x(t,x_0))\geq \frac{1}{\exp\left(\sqrt{2\gamma t+\log^2\left(\frac{h(x_0)+1}{h(x_0)}\right)}\right)-1}>0
 h ( x ( t , x 0  ) ) ≥ exp ( 2 γ t + log  2 ( h ( x 0  ) h ( x 0  ) + 1  )  ) − 1 1  > 0 
成立,即x ( t , x 0 ) ∈ int  ( C ) x(t,x_0)\in\operatorname{int}(\mathcal C) x ( t , x 0  ) ∈ i n t ( C )  ,∀ t ≥ 0 \forall t\geq 0 ∀ t ≥ 0  。该函数下界收敛于0 。
2. Inverse-type 
选取inverse-type barrier candidate
B ( x ) = 1 h ( x ) 。 B(x)=\frac{1}{h(x)}。
 B ( x ) = h ( x ) 1  。 
同理,有h ( x ( t , x 0 ) ) ≥ 1 2 γ t + 1 h 2 ( x 0 ) > 0 h(x(t,x_0))\geq \frac{1}{\sqrt{2\gamma t+\frac{1}{h^2(x_0)}}}>0 h ( x ( t , x 0  ) ) ≥ 2 γ t + h 2 ( x 0  ) 1   1  > 0  。该函数下界始终大于0 。
3. Reciprocal 
定义1:对动态系统(1),一个连续可微函数B : int  ( C ) → R B: \operatorname{int}(\mathcal C)\to \mathbb R B : i n t ( C ) → R  是集合C \mathcal C C  的RBF,如果存在K \mathcal K K 类函数 α 1 \alpha_1 α 1   、α 2 \alpha_2 α 2   、α 3 \alpha_3 α 3   使得,∀ x ∈ int  ( C ) \forall x\in\operatorname{int}(\mathcal C) ∀ x ∈ i n t ( C )  ,
1 α 1 ( h ( x ) ) ≤ B ( x ) ≤ 1 α 2 ( h ( x ) ) , L f B ( x ) ≤ α 3 ( h ( x ) ) 。 \begin{aligned}
\frac{1}{\alpha_1(h(x))}\leq B(x)&\leq \frac{1}{\alpha_2(h(x))},\\
L_f B(x)&\leq \alpha_3(h(x))。
\end{aligned}
 α 1  ( h ( x ) ) 1  ≤ B ( x ) L f  B ( x )  ≤ α 2  ( h ( x ) ) 1  , ≤ α 3  ( h ( x ) ) 。  
 
定理1:给定动态系统(1)和由连续可微函数h h h  定义的集合C \mathcal C C  ,如果存在B B B  是一个RBF,那么int  ( C ) \operatorname{int}(\mathcal  C) i n t ( C )  对于(1)是不变的。
 
ZBF 
定义2:对于a , b > 0 a,b>0 a , b > 0  ,连续函数α : ( − b , a ) → ( − ∞ , ∞ ) \alpha:(-b,a)\to (-\infty,\infty) α : ( − b , a ) → ( − ∞ , ∞ )  被认为属于扩展K \mathcal K K  类函数 ,如果它严格单调增且α ( 0 ) = 0 \alpha(0)=0 α ( 0 ) = 0  。
 
扩展K \mathcal K K  类函数和K \mathcal K K  类函数区别在于,定义域和值域可以取负数,如果令b = 0 b=0 b = 0  ,值域为[ 0 , ∞ ) [0,\infty) [ 0 , ∞ )  ,那么扩展K \mathcal K K  类函数即K \mathcal K K  类函数。
定义3:对动态系统(1),一个连续可微函数h : R n → R h:\mathbb R^n\to \mathbb R h : R n → R  是集合C \mathcal C C  的ZBF,如果存在扩展K \mathcal K K  类函数α \alpha α  和集合D \mathcal D D  (C ⊆ D ⊂ R n \mathcal C\subseteq \mathcal D\subset \mathbb R^n C ⊆ D ⊂ R n  )使得,∀ x ∈ D \forall x\in\mathcal D ∀ x ∈ D  ,
L f h ( x ) ≥ − α ( h ( x ) ) 。 L_fh(x)\geq -\alpha(h(x))。
 L f  h ( x ) ≥ − α ( h ( x ) ) 。 
 
注意:将h h h  定义在一个比C \mathcal C C  大的集合D \mathcal D D  上可以考虑模型扰动的影响。 
命题1:给定动态系统(1)和由连续可微函数h h h  定义的集合C \mathcal C C  ,如果h h h  是一个定义在D \mathcal D D  上的ZBF,那么int  ( C ) \operatorname{int}(\mathcal  C) i n t ( C )  对于(1)是不变的。
 
证明:对任意x ∈ ∂ C x\in\partial \mathcal C x ∈ ∂ C  ,h ˙ ( x ) ≥ − α ( h ( x ) ) = 0 \dot h(x)\geq -\alpha(h(x))=0 h ˙ ( x ) ≥ − α ( h ( x ) ) = 0  。由Nagumo定理知,集合C \mathcal C C  是不变的。
Nagumo定理:考虑系统x ˙ = f ( x ) \dot x=f(x) x ˙ = f ( x )  ,假设对每个集合D \mathcal D D  中的初始值,系统都有一个全局唯一解。令C ⊆ D \mathcal C\subseteq \mathcal D C ⊆ D  是闭凸集。那么集合C \mathcal C C  对系统是不变的,当且仅当f ( x ) ∈ T C ( x ) f(x)\in T_{\mathcal C}(x) f ( x ) ∈ T C  ( x )  (切锥),∀ x ∈ C \forall x\in\mathcal C ∀ x ∈ C  。
 
因为当x ∈ int  C x\in\operatorname{int} \mathcal C x ∈ i n t C  ,T C = R n T_{\mathcal C}=\mathbb R^n T C  = R n  ,所以只用关心x ∈ ∂ C x\in\partial \mathcal C x ∈ ∂ C  的情况。由于h ( x ) h(x) h ( x )  处处光滑,故切锥为半平面。当x ∈ ∂ C x\in\partial \mathcal C x ∈ ∂ C  ,L f h ( x ) = ∇ h T ( x ) f ( x ) ≥ 0 L_fh(x)=\nabla h^T(x)f(x)\geq 0 L f  h ( x ) = ∇ h T ( x ) f ( x ) ≥ 0  ,即f ( x ) f(x) f ( x )  和梯度夹角小于π 2 \frac{\pi}{2} 2 π   ,所以f ( x ) ∈ T C ( x ) f(x)\in T_{\mathcal C}(x) f ( x ) ∈ T C  ( x )  ,如下图所示。
 
Nagumo定理对非凸 集合也成立,但是唯一解要求必须满足。
命题2:令h : D → R h:\mathcal D\to \mathbb R h : D → R  为定义在开集D ⊆ R n \mathcal D\subseteq \mathbb R^n D ⊆ R n  上的连续可微函数。如果h h h  是系统(1)的ZBF,那么由h h h  定义的集合C \mathcal C C  渐进稳定。
 
命题2告诉我们,即使初始位置在集合C \mathcal C C  之外,也有x x x  渐进收敛于C \mathcal C C  。
两者的联系 
命题3:给定动态系统(1)和由连续可微函数h h h  定义的集合C \mathcal C C  。如果C \mathcal C C  是不变的,那么h ∣ C h|_{\mathcal C} h ∣ C   是C \mathcal C C  上定义的ZBF。
 
命题1和3共同证明,集合C \mathcal C C  是不变的,当且仅当存在一个ZBF。同样的对RBF,也能证明必要性,见原论文的定理2,这里不再详述。
RBF、ZBF和集合不变性的联系如下图所示。
 
CBF构建 
类似于利用Lyapunov函数构建CLF的方法,我们也可以利用RBF和ZBF构建CBF。
RCBF 
考虑仿射控制系统
x ˙ = f ( x ) + g ( x ) u , ( 4 ) \dot x=f(x)+g(x)u,\qquad (4)
 x ˙ = f ( x ) + g ( x ) u , ( 4 ) 
其中f f f  和g g g  局部Lipschitz,x ∈ R n x\in\mathbb R^n x ∈ R n  ,u ∈ U ⊂ R m u\in U\subset\mathbb R^m u ∈ U ⊂ R m  。
定义4:对系统(4)和由连续可微函数h h h  定义的集合C \mathcal C C  ,一个连续可微函数B : int  ( C ) → R B: \operatorname{int}(\mathcal C)\to \mathbb R B : i n t ( C ) → R  是RCBF,如果存在K \mathcal K K 类函数 α 1 \alpha_1 α 1   、α 2 \alpha_2 α 2   、α 3 \alpha_3 α 3   使得,∀ x ∈ int  ( C ) \forall x\in\operatorname{int}(\mathcal C) ∀ x ∈ i n t ( C )  ,
1 α 1 ( h ( x ) ) ≤ B ( x ) ≤ 1 α 2 ( h ( x ) ) , inf  u ∈ U [ L f B ( x ) + L g B ( x ) u − α 3 ( h ( x ) ) ] ≤ 0 。 \begin{aligned}
\frac{1}{\alpha_1(h(x))}\leq B(x)&\leq \frac{1}{\alpha_2(h(x))},\\
\inf_{u\in U}[L_f B(x)+L_g B(x)u&-\alpha_3(h(x))]\leq0 。
\end{aligned}
 α 1  ( h ( x ) ) 1  ≤ B ( x ) u ∈ U inf   [ L f  B ( x ) + L g  B ( x ) u  ≤ α 2  ( h ( x ) ) 1  , − α 3  ( h ( x ) ) ] ≤ 0 。  
RCBF B B B  局部Lipschitz连续,如果α 3 \alpha_3 α 3   和∂ B ∂ x \frac{\partial B}{\partial x} ∂ x ∂ B   都局部Lipschitz连续。
 
给定RCBF B B B  ,∀ x ∈ int  ( C ) \forall x\in \operatorname{int}(\mathcal C) ∀ x ∈ i n t ( C )  ,定义集合
K rcbf  ( x ) = { u ∈ U ∣ L f B ( x ) + L g B ( x ) u − α 3 ( h ( x ) ) ≤ 0 } 。 K_{\operatorname{rcbf}}(x)=\{u\in U|L_fB(x)+L_g B(x)u-\alpha_3(h(x))\leq 0 \}。
 K r c b f  ( x ) = { u ∈ U ∣ L f  B ( x ) + L g  B ( x ) u − α 3  ( h ( x ) ) ≤ 0 } 。 
推论1:考虑集合C \mathcal C C  ,令B B B  是系统(4)的RCBF。那么任意局部Lipschitz连续的控制器u : int  ( C ) → U u:\operatorname{int}(\mathcal C)\to U u : i n t ( C ) → U  使得u ( x ) ∈ K rcbf  ( x ) u(x)\in K_{\operatorname{rcbf}}(x) u ( x ) ∈ K r c b f  ( x )  都能保证集合int  ( C ) \operatorname{int}(\mathcal C) i n t ( C )  的不变性。
 
ZCBF 
定义5:对系统(4)和由连续可微函数h : R n → R h:\mathbb R^n\to \mathbb R h : R n → R  定义的集合C \mathcal C C  ,h h h  是定义在集合D \mathcal D D  上(C ⊆ D ⊂ R n \mathcal C\subseteq \mathcal D\subset \mathbb R^n C ⊆ D ⊂ R n  )的ZCBF,如果存在扩展K \mathcal K K  类函数α \alpha α  使得,
sup  u ∈ U [ L f h ( x ) + L g h ( x ) u + α ( h ( x ) ) ] ≥ 0 。 \sup_{u\in U}[L_f h(x)+L_g h(x)u+\alpha(h(x))]\geq 0 。
 u ∈ U sup  [ L f  h ( x ) + L g  h ( x ) u + α ( h ( x ) ) ] ≥ 0 。 
ZCBF h h h  局部Lipschitz连续,如果α \alpha α  和∂ h ∂ x \frac{\partial h}{\partial x} ∂ x ∂ h   都局部Lipschitz连续。
 
给定ZCBF h h h  ,∀ x ∈ D \forall x\in \mathcal D ∀ x ∈ D  ,定义集合
K zcbf  ( x ) = { u ∈ U ∣ L f h ( x ) + L g h ( x ) u + α ( h ( x ) ) ≥ 0 } 。 K_{\operatorname{zcbf}}(x)=\{u\in U|L_f h(x)+L_g h(x)u+\alpha(h(x))\geq 0 \}。
 K z c b f  ( x ) = { u ∈ U ∣ L f  h ( x ) + L g  h ( x ) u + α ( h ( x ) ) ≥ 0 } 。 
推论2:考虑集合C \mathcal C C  ,令h h h  是集合D \mathcal D D  上的ZCBF。那么任意局部Lipschitz连续的控制器u : D → U u:\mathcal D\to U u : D → U  使得u ( x ) ∈ K zcbf  ( x ) u(x)\in K_{\operatorname{zcbf}}(x) u ( x ) ∈ K z c b f  ( x )  都能保证集合C \mathcal C C  的不变性。
 
QP设计 
用QP来协调控制效果和安全约束。考虑仿射控制系统
[ x ˙ 1 x ˙ 2 ] = [ f 1 ( x 1 , x 2 ) f 2 ( x 1 , x 2 ) ] + [ g 1 ( x 1 , x 2 ) 0 ] u 。 \begin{bmatrix}
\dot x_1\\
\dot x_2
\end{bmatrix}=\begin{bmatrix}
f_1(x_1,x_2)\\
f_2(x_1,x_2)
\end{bmatrix}+\begin{bmatrix}
g_1(x_1,x_2)\\
0
\end{bmatrix}u。
 [ x ˙ 1  x ˙ 2   ] = [ f 1  ( x 1  , x 2  ) f 2  ( x 1  , x 2  )  ] + [ g 1  ( x 1  , x 2  ) 0  ] u 。 
其中x 1 ∈ X x_1\in X x 1  ∈ X  是可控状态(或输出),x 2 ∈ Z x_2\in Z x 2  ∈ Z  是不可控状态。
ES-CLF 
定义6:连续可微函数V : X × Z → R V:X\times Z\to \mathbb R V : X × Z → R  是ES-CLF(exponetial stabilizing control Lyapunov function),如果存在正常数c 1 , c 2 , c 3 > 0 c_1,c_2,c_3> 0 c 1  , c 2  , c 3  > 0  使得∀ x = ( x 1 , x 2 ) ∈ X × Z \forall x=(x_1,x_2)\in X\times Z ∀ x = ( x 1  , x 2  ) ∈ X × Z  ,下列不等式成立,
c 1 ∥ x 1 ∥ 2 ≤ V ( x ) ≤ c 2 ∥ x 1 ∥ 2 , inf  u ∈ U [ L f V ( x ) + L g V ( x ) u + c 3 V ( x ) ] ≤ 0 。 c_1\|x_1\|^2\leq V(x)\leq c_2\|x_1\|^2,\\
\operatorname{inf}_{u\in U}[L_f V(x)+L_g V(x)u+c_3V(x)]\leq 0。
 c 1  ∥ x 1  ∥ 2 ≤ V ( x ) ≤ c 2  ∥ x 1  ∥ 2 , i n f u ∈ U  [ L f  V ( x ) + L g  V ( x ) u + c 3  V ( x ) ] ≤ 0 。 
 
定义集合
K clf  ( x ) = { u ∈ U ∣ L f V ( x ) + L g V ( x ) u + c 3 V ( x ) ≤ 0 } 。 K_{\operatorname{clf}}(x)=\{u\in U|L_f V(x)+L_g V(x)u+c_3 V(x)\leq 0 \}。
 K c l f  ( x ) = { u ∈ U ∣ L f  V ( x ) + L g  V ( x ) u + c 3  V ( x ) ≤ 0 } 。 
局部Lipschitz控制器u : X × Z → U u:X\times Z\to U u : X × Z → U  满足
u ( x ) ∈ K clf  ( x ) ⇒ ∥ x 1 ( t ) ∥ ≤ c 2 c 1 e − c 3 2 t ∥ x 1 ( 0 ) ∥ 。 u(x)\in K_{\operatorname{clf}}(x) \Rightarrow \|x_1(t)\|\leq \sqrt{\frac{c_2}{c_1}}e^{-\frac{c_3}{2}t}\|x_1(0)\|。
 u ( x ) ∈ K c l f  ( x ) ⇒ ∥ x 1  ( t ) ∥ ≤ c 1  c 2    e − 2 c 3   t ∥ x 1  ( 0 ) ∥ 。 
CLF-CBF QP 
对于RCBF,考虑如下形式的QP问题
u ∗ ( x ) = arg  min  u = ( u , δ ) ∈ R m × R 1 2 u T H ( x ) u + F ( x ) T u s.t.  L f V ( x ) + L g V ( x ) u + c 3 V ( x ) − δ ≤ 0 L f B ( x ) + L g B ( x ) u − α ( h ( x ) ) ≤ 0 \begin{aligned}
\boldsymbol u^*(x)&= {\arg\min}_{\boldsymbol{u}=(u,\delta)\in\mathbb R^m\times \mathbb R} \frac{1}{2}\boldsymbol u^TH(x)\boldsymbol u+F(x)^T\boldsymbol u\\
\operatorname{s.t.} &\quad \begin{aligned}L_fV(x)+L_gV(x)u+c_3 V(x)-\delta&\leq 0\\
L_f B(x)+L_g B(x)u-\alpha(h(x))&\leq 0
\end{aligned}
\end{aligned}
 u ∗ ( x ) s . t .  = arg  min u = ( u , δ ) ∈ R m × R  2 1  u T H ( x ) u + F ( x ) T u L f  V ( x ) + L g  V ( x ) u + c 3  V ( x ) − δ L f  B ( x ) + L g  B ( x ) u − α ( h ( x ) )  ≤ 0 ≤ 0   
其中,c 3 > 0 c_3>0 c 3  > 0  是常数,α \alpha α  是K \mathcal K K  类函数,H ( x ) ∈ R ( m + 1 ) × ( m + 1 ) H(x)\in \mathbb R^{(m+1)\times(m+1)} H ( x ) ∈ R ( m + 1 ) × ( m + 1 )  正定,F ( x ) ∈ R m + 1 F(x)\in\mathbb R^{m+1} F ( x ) ∈ R m + 1  。
下述定理提供u ∗ ( x ) \boldsymbol u^*(x) u ∗ ( x )  局部Lipschitz连续的充分条件,保证控制器的局部存在性和解的唯一性这些前提条件,从而推论1、2得以应用。
定理3:假设f , g , B , V , H , F f,g,B,V,H,F f , g , B , V , H , F  都局部Lipschitz连续。再假设相对度为1,即L g B ( x ) ≠ 0 L_g B(x)\neq 0 L g  B ( x )   = 0  ,∀ x ∈ int  ( C ) \forall x\in\operatorname{int}(\mathcal C) ∀ x ∈ i n t ( C )  。那么CLF-CBF QP的解u ∗ ( x ) \boldsymbol u^*(x) u ∗ ( x )  在int  ( C ) \operatorname{int}(\mathcal C) i n t ( C )  上局部Lipschitz连续。另外,u ∗ ( x ) \boldsymbol u^*(x) u ∗ ( x )  可以写成一个闭环解析式。
 
证明:令v = u + H − 1 F \boldsymbol v=\boldsymbol u+H^{-1}F v = u + H − 1 F  ,⟨ v , v ⟩ = v T H v \langle \boldsymbol v,\boldsymbol v\rangle=\boldsymbol v^TH\boldsymbol v ⟨ v , v ⟩ = v T H v  ,
A = [ a 1 , a 2 ] = [ L g V L g B − 1 0 ] , b = [ − L f V − c 3 V − L f B + α ( h ) ] + A T H − 1 F 。 A =[a_1,a_2]= \begin{bmatrix}
L_g V&L_g B\\
-1&0
\end{bmatrix},b=\begin{bmatrix}
-L_f V-c_3 V\\
-L_f B+\alpha(h)
\end{bmatrix}+A^TH^{-1}F。
 A = [ a 1  , a 2  ] = [ L g  V − 1  L g  B 0  ] , b = [ − L f  V − c 3  V − L f  B + α ( h )  ] + A T H − 1 F 。 
原QP问题重写为
v ∗ = arg  min  1 2 ⟨ v , v ⟩ s.t.  A T v ≤ b \begin{aligned}
\boldsymbol v^*=&\arg\min \frac{1}{2}\langle \boldsymbol v,\boldsymbol v \rangle\\
\operatorname{s.t.}&\quad A^T\boldsymbol v\leq b
\end{aligned}
 v ∗ = s . t .  arg  min 2 1  ⟨ v , v ⟩ A T v ≤ b  
因为代价函数是凸的且不等式为线性,所以KKT条件是充要条件。令G = A T H − 1 A = [ a 1 T H − 1 a 1 a 1 T H − 1 a 2 a 2 T H − 1 a 1 a 2 T H − 1 a 2 ] G=A^TH^{-1}A=\begin{bmatrix}a_1^TH^{-1}a_1&a_1^TH^{-1}a_2\\ a_2^TH^{-1}a_1& a_2^TH^{-1}a_2\end{bmatrix} G = A T H − 1 A = [ a 1 T  H − 1 a 1  a 2 T  H − 1 a 1   a 1 T  H − 1 a 2  a 2 T  H − 1 a 2   ]  是Gram矩阵,由于a 1 a_1 a 1   、a 2 a_2 a 2   线性无关,G G G  是正定的。由KKT条件可知,该问题的唯一解是v ∗ = H − 1 A λ \boldsymbol v^*=H^{-1}A\lambda v ∗ = H − 1 A λ  ,其中λ ∈ R 2 \lambda\in\mathbb R^2 λ ∈ R 2  ,且满足
{ 0 ≥ λ , 0 ≥ A T H − 1 A λ − b = G λ − b , 0 = λ T ( A T H − 1 A λ − b ) = λ T ( G λ − b ) 。 \left\{
\begin{aligned}
0&\geq\lambda,\\
0&\geq A^TH^{-1}A\lambda-b=G\lambda-b,\\
0&=\lambda^T(A^TH^{-1}A\lambda-b)=\lambda^T(G\lambda-b)。
\end{aligned}
\right.
 ⎩ ⎪ ⎨ ⎪ ⎧  0 0 0  ≥ λ , ≥ A T H − 1 A λ − b = G λ − b , = λ T ( A T H − 1 A λ − b ) = λ T ( G λ − b ) 。  
可知,若[ G λ − b ] i < 0 [G\lambda-b]_i<0 [ G λ − b ] i  < 0  ,则λ i = 0 \lambda_i=0 λ i  = 0  。(G λ − b G\lambda-b G λ − b  和λ \lambda λ  不可能同时小于0,相互垂直的向量肯定在不同象限或者坐标轴。) 又因为G G G  正定,G 11 > 0 G_{11}>0 G 1 1  > 0  ,且G 11 G 22 − G 12 G 21 > 0 G_{11}G_{22}-G_{12}G_{21}>0 G 1 1  G 2 2  − G 1 2  G 2 1  > 0  。由schur complement condition,G 22 > 0 G_{22}>0 G 2 2  > 0  。
分类讨论:
[ G λ − b ] 1 < 0 [G\lambda-b]_1<0 [ G λ − b ] 1  < 0  ,[ G λ − b ] 2 = 0 [G\lambda-b]_2=0 [ G λ − b ] 2  = 0 
 
[ G λ − b ] 1 = 0 [G\lambda-b]_1=0 [ G λ − b ] 1  = 0  ,[ G λ − b ] 2 < 0 [G\lambda-b]_2<0 [ G λ − b ] 2  < 0 
 
[ G λ − b ] 1 < 0 [G\lambda-b]_1<0 [ G λ − b ] 1  < 0  ,[ G λ − b ] 2 < 0 [G\lambda-b]_2<0 [ G λ − b ] 2  < 0 
 
[ G λ − b ] 1 = 0 [G\lambda-b]_1=0 [ G λ − b ] 1  = 0  ,[ G λ − b ] 2 = 0 [G\lambda-b]_2=0 [ G λ − b ] 2  = 0 
 
 
情况1:将λ 1 = 0 \lambda_1=0 λ 1  = 0  代入[ G λ − b ] 2 = 0 [G\lambda-b]_2=0 [ G λ − b ] 2  = 0  ,解出λ 2 = b 2 / G 22 ≤ 0 \lambda_2=b_2/G_{22}\leq 0 λ 2  = b 2  / G 2 2  ≤ 0  。再将λ 1 = 0 \lambda_1=0 λ 1  = 0  代入[ G λ − b ] 1 = 0 [G\lambda-b]_1=0 [ G λ − b ] 1  = 0  ,得到G 12 b 2 − G 22 b 1 < 0 G_{12}b_2-G_{22}b_1<0 G 1 2  b 2  − G 2 2  b 1  < 0  。即,当G 12 b 2 − G 22 b 1 < 0 G_{12}b_2-G_{22}b_1<0 G 1 2  b 2  − G 2 2  b 1  < 0  ,b 2 ≤ 0 b_2\leq 0 b 2  ≤ 0  时,λ = [ 0 b 2 / G 22 ] \lambda=\begin{bmatrix}0\\b_2/G_{22} \end{bmatrix} λ = [ 0 b 2  / G 2 2   ]  ;
情况2:将λ 2 = 0 \lambda_2=0 λ 2  = 0  代入[ G λ − b ] 1 = 0 [G\lambda-b]_1=0 [ G λ − b ] 1  = 0  ,解出λ 1 = b 1 / G 11 ≤ 0 \lambda_1=b_1/G_{11}\leq 0 λ 1  = b 1  / G 1 1  ≤ 0  。再将λ 2 = 0 \lambda_2=0 λ 2  = 0  代入[ G λ − b ] 2 = 0 [G\lambda-b]_2=0 [ G λ − b ] 2  = 0  ,得到G 21 b 1 − G 11 b 2 < 0 G_{21}b_1-G_{11}b_2<0 G 2 1  b 1  − G 1 1  b 2  < 0  。即,当G 21 b 1 − G 11 b 2 < 0 G_{21}b_1-G_{11}b_2<0 G 2 1  b 1  − G 1 1  b 2  < 0  ,b 1 ≤ 0 b_1\leq 0 b 1  ≤ 0  时,λ = [ b 1 / G 11 0 ] \lambda=\begin{bmatrix}b_1/G_{11}\\ 0 \end{bmatrix} λ = [ b 1  / G 1 1  0  ]  ;
情况3:当b 1 , b 2 > 0 b_1,b_2>0 b 1  , b 2  > 0  时,λ = [ 0 , 0 ] T \lambda=[0,0]^T λ = [ 0 , 0 ] T  ;
情况4:此时λ = G − 1 b ≤ 0 \lambda=G^{-1}b\leq 0 λ = G − 1 b ≤ 0  。
综上所述,对x ∈ int  ( C ) x\in\operatorname{int}(\mathcal C) x ∈ i n t ( C )  ,λ \lambda λ  可写为如下闭环解析形式:
当G 12 min  { b 2 , 0 } − G 22 b 1 < 0 G_{12}\min\{b_2,0\}-G_{22}b_1<0 G 1 2  min { b 2  , 0 } − G 2 2  b 1  < 0  时,λ = [ 0 min  { b 2 , 0 } / G 22 ] \lambda=\begin{bmatrix}0\\\min\{b_2,0\}/G_{22} \end{bmatrix} λ = [ 0 min { b 2  , 0 } / G 2 2   ]  ;当G 21 min  { b 1 , 0 } − G 11 b 2 < 0 G_{21}\min\{b_1,0\}-G_{11}b_2<0 G 2 1  min { b 1  , 0 } − G 1 1  b 2  < 0  时,λ = [ min  { b 1 , 0 } / G 11 0 ] \lambda=\begin{bmatrix}\min\{b_1,0\}/G_{11}\\ 0 \end{bmatrix} λ = [ min { b 1  , 0 } / G 1 1  0  ]  ;其他情况时,λ = [ min  { G 22 b 1 − G 21 b 2 } min  { G 11 b 2 − G 12 b 1 } ] / ( G 11 G 22 − G 12 G 21 ) \lambda=\begin{bmatrix}\min\{G_{22}b_1-G_{21} b_2\}\\ \min\{G_{11}b_2-G_{12}b_1 \}\end{bmatrix}/(G_{11}G_{22}-G_{12}G_{21}) λ = [ min { G 2 2  b 1  − G 2 1  b 2  } min { G 1 1  b 2  − G 1 2  b 1  }  ] / ( G 1 1  G 2 2  − G 1 2  G 2 1  )  。(最后一个情况λ \lambda λ  不可能为0,因为G G G  的行向量线性无关。)
对于ZCBF,考虑如下形式的QP问题
u ∗ ( x ) = arg  min  u = ( u , δ ) ∈ R m × R 1 2 u T H ( x ) u + F T ( x ) u s.t.  L f V ( x ) + L g V ( x ) u + c 3 V ( x ) − δ ≤ 0 − L f h ( x ) − L g h ( x ) u − α ( h ( x ) ) ≤ 0 \begin{aligned}
\boldsymbol u^*(x)&= {\arg\min}_{\boldsymbol{u}=(u,\delta)\in\mathbb R^m\times \mathbb R} \frac{1}{2}\boldsymbol u^TH(x)\boldsymbol u+F^T(x)\boldsymbol u\\
\operatorname{s.t.} &\quad \begin{aligned}L_fV(x)+L_gV(x)u+c_3 V(x)-\delta&\leq 0\\
-L_f h(x)-L_g h(x)u-\alpha(h(x))&\leq 0
\end{aligned}
\end{aligned}
 u ∗ ( x ) s . t .  = arg  min u = ( u , δ ) ∈ R m × R  2 1  u T H ( x ) u + F T ( x ) u L f  V ( x ) + L g  V ( x ) u + c 3  V ( x ) − δ − L f  h ( x ) − L g  h ( x ) u − α ( h ( x ) )  ≤ 0 ≤ 0   
其中,c 3 > 0 c_3>0 c 3  > 0  是常数,α \alpha α  是K \mathcal K K  类函数,H ( x ) ∈ R ( m + 1 ) × ( m + 1 ) H(x)\in \mathbb R^{(m+1)\times(m+1)} H ( x ) ∈ R ( m + 1 ) × ( m + 1 )  正定,F ( x ) ∈ R m + 1 F(x)\in\mathbb R^{m+1} F ( x ) ∈ R m + 1  。同理,我们有关于ZCBF的定理。
定理4:假设f , g , h , V , H , F f,g,h,V,H,F f , g , h , V , H , F  都局部Lipschitz连续。再假设相对度为1,即L g h ( x ) ≠ 0 L_g h(x)\neq 0 L g  h ( x )   = 0  ,∀ x ∈ D \forall x\in\mathcal D ∀ x ∈ D  。那么CLF-CBF QP的解u ∗ ( x ) \boldsymbol u^*(x) u ∗ ( x )  在D \mathcal D D  上局部Lipschitz连续,且解可以写成一个闭环解析式。