## 4 Numerical Simulation  
In this section, we will present two numerical examples to validate the feasibility of the above theoretical results. In the first case, a multi-agent system is considered, and the follower agents are supposed to track the leader and achieve a diamond time-invariant formation under fixed interaction topology with protocol (6). In the other example, the follower agents will enclose the leader while the leader is moving under switching topology with protocol (19) above. **Case 1. **_Suppose there is a swarm system composed of five UAVs, which consists of four followers and one leader. The communication relationship among them is shown in Figure 2(a). We assume that all UAVs are flying at the same altitude. Similar to the literature [11], \"because the formation tracking discussed in this paper is mainly concerned with the positions and velocities\", the dynamics of the leader and follower quadrotor UAVs in the outer loop can be approximately simplified as formulas (1) and (2). The simplified communication topology is shown in Figure 2(b). A similar simplification is also applied to Case 2. As shown in Figure 3b, we use \"0\" to represent the leader agent, and \"1-4\" to represent the follower agents, respectively. The corresponding Laplacian matrix of the graph G and the leader adjacency matrix F of the graph \(\overline{\text{G}}\) are:  
\[\text{L}=\left[ \begin{array}{cccc}1&0&-1&0\\ 0&1&0&-1\\ -1&0&1&0\\ 0&-1&0&1\end{array} \right]\text{F}=\left[ \begin{array}{cccc}1&0&0&0\\ 0&1&0&0\\ 0&0&0&0\\ 0&0&0&0\end{array} \right]\]  
The matrix H is:  
\[\text{H}=\left[ \begin{array}{cccc}2&0&-1&0\\ 0&2&0&-1\\ -1&0&1&0\\ 0&-1&0&1\end{array} \right]\]  
The dynamics of each follower agent are denoted by:  
\[\dot{x}_{i}(t)=I_{2}\otimes\left[ \begin{array}{cc}0&1\\ 0&0\end{array} \right]x_{i}(t)+I_{2}\otimes\left[ \begin{array}{c}0\\ 1\end{array} \right]u_{i}(t),i=1,2,\cdots N \tag{34}\]  
where \(x_{i}(t)=\left[p_{xi}(t),v_{xi}(t),p_{yi}(t),v_{yi}(t)\right]^{T}\), \(u_{i}(t)=\left[u_{xi}(t),u_{yi}(t)\right]^{T}\). The dynamics of the leader are similar to the followers' and we let the leader agent move in a straight line at a uniform velocity, \(\left[v_{x0}(t),v_{y0}(t)\right]^{T}=\left[1,1\right]^{T}\). The followers  
Figure 3: The interaction graph of the MASs: (**a**) the communication graph among the UAVs, (**b**) the communication graph of simplified model. achieve a diamond formation while tracking the leader, which is a time-invariant formation. The formation vector \(h_{i}\) is described by:  
\[\left[ \begin{array}{cccc}h_{1},h_{2},h_{3},h_{4}\end{array} \right]=\left[ \begin{array}{cccc}-2&-4-\frac{2\sqrt{3}}{3}&-6&-4+\frac{2\sqrt{3}}{3}\\ 0&0&0&0\\ -2&-4+\frac{2\sqrt{3}}{3}&-6&-4-\frac{2\sqrt{3}}{3}\\ 0&0&0&0\\ \end{array} \right]\]  
According to Theorem 1, if we solve the Riccati in Equation (9), we could obtain the symmetric positive definite matrix \(\mathrm{P}\) and the feedback gain matrix \(\mathrm{K}\). \[\mathrm{P}=I_{2}\otimes\left[ \begin{array}{cc}1.1807&1.1441\\ 1.1441&2.7016\end{array} \right]\mathrm{K}=I_{2}\otimes\left[ \begin{array}{ cc}0.4370&1.0320\end{array} \right]\]  
In protocol (6), an important component is the time-varying coupling weight \(c_{ij}(t)\) and \(c_{i}(t)\). We set the initial value of the two weights as 3, which means  
\[c_{ij}(0)=c_{i}(0)=3\]  
Figure 4 shows the tracking error of the follower agents, as the time increases, the tracking error of the followers will approach zero at any bounded initial condition. This means the agents have achieved the desired formation. Figure 4: Tracking error of follower agents: (**a**) the tracking error of \(x\), (**b**) the tracking error of \(y\). First, we should obtain the corresponding solution of Equation (23). \[\mathrm{P}=I_{2}\otimes\left[ \begin{array}{cc}1.5120&2.0362\\ 2.0362&6.1574\end{array} \right]\mathrm{K}=I_{2}\otimes\left[ \begin{array}{ cc}0.2456&0.7426\end{array}