# Fault-Tolerant Optimal Consensus Control for Heterogeneous Multi-Agent Systems
## 3 Design and Analysis of Fault-Tolerant Consensus Controllers  
This section addresses the problem described in Equation (12) by designing and analyzing fault-tolerant consensus controllers of heterogeneous multi-agent fault models. The theoretical effectiveness of the proposed algorithm is subsequently demonstrated. The following describes the performance index parameters for each follower agent:  
\[j_{i}=\int_{0}^{C}\biggl{[}\Big{(}u_{i}^{f}(t)\Big{)}^{T}Hu_{i}^{f}(t)+\sum_{j \in\mathcal{N}_{i}}\big{(}a_{ij}(x_{i}-x_{j})+a_{0i}(x_{i}-x_{0})\big{)}^{T}Q \sum_{j\in\mathcal{N}_{i}}a_{ij}(x_{i}-x_{j})+a_{0i}(x_{i}-x_{0})\biggr{]}dt \tag{13}\]  
where \(i=1,2,\ldots n\), \(C\) represents a constant greater than zero, indicating the integral's upper bound. \(\Big{(}u_{i}^{f}(t)\Big{)}^{T}\) represents the transpose operation of a vector. \(H\) and \(Q\) are both positive definite symmetric matrices. **Theorem 1**. : _Consider a leader-follower multi-agent system:_  
\[\dot{x}_{0} =Ax_{0} \tag{14}\] \[\dot{x}_{i} =Ax_{i}+Bu_{i}^{f}\qquad i=1,2,\ldots,n\]  
_Assume that the leader-follower multi-agent system (14) satisfies Assumptions 1 and 2. For the leader-follower multi-agent system with actuator faults described by Equation (14), the optimal controller \(u_{i}^{*}(t)\), which minimizes the performance index parameters (13), can be represented:_  
\[u_{i}^{*}(t)=-\frac{|\mathcal{N}_{i}|}{2}(I-\mathcal{P}_{i})^{-1}H^{-1}B^{T} \eta_{i}^{*}(t) \tag{15}\]  
_where \(|\mathcal{N}_{i}|\) denotes the number of neighbor agents in the \(i\)-th agent's neighbor set. \(H^{-1}\) represents the positive definite symmetric matrix's inverse matrix in the performance index parameters. Under this optimal controller \(u_{i}^{*}(t)\), the consensus error of the systems (14) can asymptotically converge to zero._  
Proof of Theorem 1.: Define the consensus tracking error of the \(i\)-th agent, shown as follows:  
\[e_{i}(t)=\sum_{j\in\mathcal{N}_{i}}a_{ij}(x_{i}-x_{j})+a_{0i}(x_{i}-x_{0}),\; i=1,2,\ldots,n. \tag{16}\]  
By utilizing the dynamic equation of the system (14), the time derivative of Equation (16) will be obtained:  
\[\dot{e}_{i}(t)=Ae_{i}(t)+\sum_{j\in\mathcal{N}_{i}}a_{ij}B(u_{i}^{f}(t)-u_{j}^ {f}(t))+a_{0i}Bu_{i}^{f}(t) \tag{17}\]  
Furthermore, we assume that the controllers of all agents in \(\mathcal{N}_{i}\) of the \(i\)-th agents are mutually independent. Define the performance index function for the consensus error system described by Equation (16) as follows:  
\[J_{i}=\int_{0}^{T}\biggl{[}\Big{(}u_{i}^{f}(t)\Big{)}^{T}Hu_{i}^{f}(t)+e_{i}^ {T}(t)Qe_{i}(t)\biggr{]}dt. \tag{18}\]  
Define the Hamiltonian parameters:  
\[H_{i}\Big{(}t,e_{i},u_{i}^{f},\eta_{i}\Big{)} =e_{i}^{T}(t)Qe_{i}(t)+\Big{(}u_{i}^{f}(t)\Big{)}^{T}H(t)u_{i}^{f}(t) \tag{19}\] \[+\eta_{i}^{T}(t)\bigg{(}Ae_{i}(t)+\sum_{j=1}^{n}a_{ij}B\Big{(}u_{ i}^{f}(t)-u_{j}^{f}(t)\Big{)}+a_{0i}Bu_{i}^{f}(t)\bigg{)}.\]where \(\lambda_{i}\in R^{n}\) is an auxiliary variable. Performing some mathematical transformations on the Hamiltonian function represented by Equation (19), we can obtain the following expression:  
\[ \begin{split} H_{i}(t,e_{i}(t),u_{i}^{f}(t),\eta_{i}(t))& =e_{i}^{T}(t)Qe_{i}(t)+\Big{(}u_{i}^{f}(t)\Big{)}^{T}Hu_{i}^{f}(t) \\ &\quad+\eta_{i}^{T}(t)(Ae_{i}(t)+\sum\limits_{j\in\mathcal{N}_{i} }(Bu_{i}^{f}(t)-Bu_{j}^{f}(t)))\\ &=\sum\limits_{j\in\mathcal{N}_{i}}x_{i}^{T}(t)Qx_{i}(t)-2\sum \limits_{j\in\mathcal{N}_{i}}x_{i}^{T}(t)Qx_{j}(t)+\Big{(}u_{i}^{f}(t)\Big{)}^ {T}Hu_{i}^{f}(t)\\ &\quad+\sum\limits_{j\in\mathcal{N}_{i}}x_{j}^{T}(t)Qx_{j}(t)\\ &\quad+\eta_{i}^{T}(t)\bigg{(}Ae_{i}(t)+\sum\limits_{i=1}^{N}a_ {ij}B(u_{i}^{f}(t)-u_{j}^{f}(t))+a_{0i}Bu_{i}^{f}(t)\bigg{)}.\end{split}  \tag{20}\]  
By computing the partial derivatives of \(H_{i}\Big{(}t,e_{i}(t),u_{i}^{f}(t),\eta_{i}(t)\Big{)}\) concerning \(u_{i}^{f}(t)\) and \(\eta_{i}(t)\), respectively, we obtain:  
\[