# Fault-Tolerant Optimal Consensus Control for Heterogeneous Multi-Agent Systems
## 3 Design and Analysis of Fault-Tolerant Consensus Controllers
\begin{split}\frac{\partial H_{i}(t,e_{i}(t),u_{i}^{f}(t),\eta_{ i}(t))}{\partial u_{i}^{f}(t)}&=2H(I_{k}-\mathcal{P}_{i})u_{i}(t)+(a_{0i} +|\mathcal{N}_{i}|)B^{T}\eta_{i}(t)\\ \frac{\partial H_{i}(t,e_{i}(t),u_{i}^{f}(t),\eta_{i}(t))}{\partial e _{i}(t)}&=\sum\limits_{j\in\mathcal{N}_{i}}2Q(x_{i}(t)-x_{j}(t)+a _{0i}(x_{i}(t)-x_{0}(t)))+A^{T}\eta_{i}(t).\end{split}  \tag{21}\]  
Therefore, the optimal fault-tolerant controller is obtained:  
\[\left\{ \begin{array}{l}u_{i}^{*}(t)=-\frac{|\mathcal{N}_{i}|+a_{0i}}{2}(I- \mathcal{P}_{i})^{-1}H^{-1}B^{T}\eta_{i}^{*}(t)\\ \eta_{i}^{*}(t)=-\sum\limits_{j\in\mathcal{N}_{i}}2Q\big{(}x_{i}(t)-x_{j}(t)+ a_{0i}(x_{i}(t)-x_{0}(t))\big{)}-A^{T}\eta_{i}(t)\end{array} \right.,i=1,2,\ldots,n. \tag{22}\]  
Next, the primary analysis focuses on whether the controller represented by Equation (22) can achieve consensus for Equation (14) under actuator faults. With the principles of optimal control theory, the controller Equation (22) satisfies the following:  
\[H_{i}(t,e_{i}^{*}(t),u_{i}^{*}(t),\eta_{i}^{*}(t))=0 \tag{23}\]  
where \(e_{i}^{*}(t),\eta_{i}^{*}(t)\) stand for the optimal consensus error and optimal coefficient of the \(i\) the agent under the optimal fault-tolerant control \(u_{i}^{*}(t)\). For this purpose, the Lyapunov function for the defined Equation (14) is as follows:  
\[V_{i}(e_{i}^{*}(t))=\frac{1}{2}\int_{t}^{\infty}[(u_{i}^{*}(t))^{T}Hu_{i}^{*} (t)+(e_{i}^{*}(t))^{T}Qe_{i}^{*}(t)\Big{]}dt,i=1,2,\ldots,n \tag{24}\]  
where \(H\in R^{m\times m},Q\in R^{n\times n}\) are both symmetric positive definite matrices. According to the properties of positive definite matrices, Equation (24) illustrates a positive definite function. Based on reference [28], the optimal Hamiltonian function \(H_{i}\big{(}t,e_{i}^{*}(t),u_{i}^{*}(t),\eta_{i}^{*}(t)\big{)}\) represented by Equation (19) can be rewritten in the following form:  
\[ \begin{split} H_{i}(t,e_{i}^{*}(t),u_{i}^{*}(t),\eta_{i}^{*}(t))& =(e_{i}^{*}(t))^{T}Qe_{i}^{*}(t)+(u_{i}^{*}(t))^{T}Hu_{i}^{*}(t)\\ &\quad+\frac{\partial V_{i}^{T}(e_{i}^{*}(t))}{\partial e_{i}^{* }(t)}\bigg{(}Ae_{i}(t)+\sum\limits_{i=1}^{n}a_{ij}B(u_{i}^{*}(t)-u_{j}^{*}(t)) +a_{0i}Bu_{i}^{*}(t)\bigg{)}\end{split}  \tag{25}\]Therefore, Equations (23) and (25) will be transformed into the following:  
\[ \begin{split}&\frac{\partial V_{i}^{T}\big{(}e_{i}^{*}(t)\big{)}}{ \partial e_{i}^{*}(t)}\bigg{(}Ae_{i}(t)+\sum\limits_{i=1}^{n}a_{ij}B(u_{i}^{*} (t)-u_{j}^{*}(t))+a_{0i}Bu_{i}^{*}(t)\bigg{)}\\ &=-((e_{i}^{*}(t))^{T}Qe_{i}^{*}(t)+(u_{i}^{*}(t))^{T}Hu_{i}^{*}( t)).\end{split}  \tag{26}\]  
Furthermore, by differentiating the Lyapunov function defined by Equation (24), we obtain the following:  
\[\dot{V}_{i}(e_{i}^{*}(t))=\frac{\partial V_{i}^{T}(e_{i}^{*}(t))}{\partial e_{ i}^{*}(t)}\bigg{(}Ae_{i}(t)+\sum\limits_{i=1}^{n}a_{ij}B(u_{i}^{*}(t)-u_{j}^{*}( t))+a_{0i}Bu_{i}^{*}(t)\bigg{)} \tag{27}\]  
According to Equation (26),  
\[\dot{V}_{i}(e_{i}^{*}(t))=-((e_{i}^{*}(t))^{T}Qe_{i}^{*}(t)+(u_{i}^{*}(t))^{T} Hu_{i}^{*}(t)). \tag{28}\]  
Since both matrix \(Q\) and matrix \(H\) are positive definite symmetric matrices, \(\dot{V}_{i}\big{(}e_{i}^{*}(t)\big{)}\) is a negative definite function. According to the Lyapunov stability theory, \(e_{i}^{*}(t)\) will asymptotically converge to zero. \(\square\)  
From the performance index functions, it can be seen that if \(J_{i}\) reaches a minimum value, then the state error between the agents in the \(i\)-th agent's neighbor set \(\mathcal{N}_{i}\) and the \(i\)-th agent also reaches a minimum value. Furthermore, according to Assumption 1, it can be obtained that if all \(J_{i}\) reach minimum values, the entire multi-agent system's state can achieve consensus. Therefore, from Theorem 1, it can be concluded that the controller \(u_{i}^{*}\) can achieve consensus on the state of the system (14). According to Theorem 1, performance index functions are defined for each UAV and UGV as follows:  
\[