## 3 Power Allocation of SCO\(-\)AN
### SQP and ISQP Algorithm  
\(\mu\) and \(\lambda\) are Lagrange multipliers. To optimize the problems above, the following conditions must be satisfied:  
\[ \begin{array}{ll}\frac{\partial L}{\partial X}\Big{|}_{x=x^{*}}=0&(a)\\ \lambda_{j}\
eq 0,&(b)\\ u_{k}\geq 0,&(c)\\ u_{k}g_{k}(x*)=0,&(d)\\ h_{i}(x*)=0&i=1&(e)\\ g_{j}(x*)=0,&j=1,2,3,4&(f)\end{array}  \tag{51}\]  
(51) are Karush-Kuhn-Tucker conditions (KKT conditions). (a) is a necessary condition when the extreme value of Lagrange function is taken; (b) is a Lagrange coefficient constraint; (c) is an inequality constraint case; (d) is the complementary relaxation condition; (e) and (f) are the original constraints. The KKT condition is a necessary condition for the optimal solution. Condition (c) constructs the \(L(x,\lambda,\mu)\) function and the condition \(L(x,\lambda,\mu)\leq f(x)\) should be satisfied. In \(L(x,\lambda,\mu)\), \(\mu\) is 0, so \(\lambda\) is less than or equal to 0. A quadratic polynomial is used to approximate \(f(x,y)\). By expanding the quadratic polynomial into a positive definite quadratic form, the following quadratic programming subproblem is obtained:  
\[ \begin{array}{ll}\min&\frac{1}{d}d^{T}\mathbf{B}_{d}d+\
abla f(x_{k},y_{k})^ {T}d\\ s.t&\tilde{h}(x_{k},y_{k})+\mathbf{A}_{k}^{c}d=0\\ &g(x_{k},y_{k})+\mathbf{A}_{k}^{c}d\geq 0,\end{array}  \tag{52}\]  
where \(\mathbf{A}_{k}^{c}=\
abla h(x_{k},y_{k})\), \(\mathbf{A}_{k}^{c}=\
abla g(x_{k},y_{k})_{k}\) is a positive definite matrix, and \(d_{k}\) is optimal solution of quadratic programming subproblems. Let \(x^{*}\) denote the KKT point of the optimization constraint problem and \(\lambda^{*},\mu^{*}\geq 0\) be its corresponding Lagrange multiplier vectors. For \(x^{*}\), the following conditions should be satisfied:  
1. The Jacobi matrix of \(L(x,\lambda,\mu)\) is row full rank. 2. The strict complementary relaxation condition should be satisfied; that is, \(g_{i}(x^{*})\geq 0\), \(\lambda_{i}^{*}\geq 0\), \(g_{i}(x^{*})\lambda_{i}^{*}=0\), and \(g_{i}(x^{*})+\lambda_{i}^{*}>0\). 3. A sufficient second-order optimality condition should be satisfied, that is, for any vector \(d\
eq 0\) that satisfies \(\mathbf{A}(x^{*})d=0\), the following condition is satisfied:  
\[d^{T}\mathbf{B}(x^{*},y^{*},\mu^{*},\lambda^{*})d>0, \tag{53}\]where \(\textbf{B}(x,y,\mu,\lambda)\) is a positive definite matrix, at the beginning of the iteration, \(\textbf{B}(x,y,\mu,\lambda)\) is usually set as the identity matrix. If \((x_{k},y_{k},\mu_{k},\lambda_{k})\) is close to \((x^{*},y^{*},\mu^{*},\lambda^{*})\) sufficiently, the quadratic programming sub-problem of (53) has a local minimum point \(d^{*}\). The corresponding effective constraint index set is the same as the effective constraint index set of the original problem at \((x^{*},y^{*})\). Using the KKT conditions, (52) is equivalent to:  
\[H_{1}(d,\mu,\lambda)=\textbf{B}_{k}-(\textbf{A}_{k}^{\Gamma})^{T}\mu-(\textbf{ A}_{k}^{\Gamma})^{T}\lambda+\
abla f(x_{k},y_{k}), \tag{54}\]  
\[H_{2}(d,\mu,\lambda)=h(x_{k},y_{k})+(\textbf{A}_{k}^{\varepsilon})^{T}d, \tag{55}\]  
\[\lambda\geq 0,g(x_{k},y_{k})+\textbf{A}_{k}^{\Gamma}d\geq 0,\lambda[g(x_{k},y _{k})+\textbf{A}_{k}^{\Gamma}d]=0, \tag{56}\]  
Note that Formula (20) and (23) are linear complementarity problems. We define smooth FB-function:  
\[\varphi(\varepsilon,a,b)=a+b-\sqrt{a^{2}+b^{2}+2\varepsilon^{2}}, \tag{57}\]  
where \(\varepsilon>0\) is a smooth parameter, and  
\[\Phi(\varepsilon,d,\lambda)=(\varphi_{1}(\varepsilon,d,\lambda),\varphi_{2} (\varepsilon,d,\lambda)\ldots\varphi_{m}(\varepsilon,d,\lambda))^{T}, \tag{58}\]  
in (32),  
\[ \begin{array}{l}\varphi_{i}(\varepsilon,d,\lambda)=\lambda_{i}+[g_{i}(x_{k},y_{k})+(A_{k}^{\Gamma})d]\\ \qquad\qquad\qquad-\sqrt{\lambda_{i}^{2}+\left[g_{i}(x_{k},y_{k})+(\textbf{A}_ {k}^{\Gamma})_{i}d\right]^{2}+2\varepsilon^{2}},\end{array}  \tag{59}\]  
where \((A_{k}^{\Gamma})_{i}\) is the i-th row of \(\textbf{A}_{k}^{\Gamma}\). (18) and (19), (21) and (22) are equivalent to  
\[H(z):=H(\varepsilon,d,\mu,\lambda)=\left(