## 2 Materials and Methods
### Control Protocol and Stability Analysis  
In 1987, [PERSON] developed a computer model mimicking animal aggregation and social cohesion in animal groups [30]. This model consists of three steering behaviors--collision avoidance, velocity alignment, and flocking cohesion, which describe how an individual agent maneuvers based on the relative positions and relative velocities of its nearby flock mates. Following this work, several variants on flocking model has been proposed [11; 14; 18; 31; 32], and led to derive decentralized controllers consisting of consensus algorithm and artificial potential field which provably give rise to these collective phenomena. According to the specific UAV model (1), the control protocol of each UAV \(i\), \(i=1,\cdots,N\) is proposed as  
\[ \begin{array}{l}n_{ti}(t)=-\frac{1}{g}t_{i}^{T}(t)\sum\limits_{j\in N_{i}(t)} \left(q_{i}(t)-q_{j}(t)\right)+\frac{1}{g}t_{i}^{T}(t)G-\frac{1}{g}t_{i}^{T}(t )\sum\limits_{j\in N_{i}(t)}\
abla_{p_{ij}(t)}V(\|p_{ij}(t)\|)\\ n_{hi}(t)=-\frac{1}{g}n_{i}^{T}(t)\sum\limits_{j\in N_{i}(t)}\left(q_{i}(t)-q_{ j}(t)\right)+\frac{1}{g}n_{i}^{T}(t)G-\frac{1}{g}n_{i}^{T}(t)\sum\limits_{j\in N _{i}(t)}\
abla_{p_{ij}(t)}V(\|p_{ij}(t)\|)\\ n_{vi}(t)=-\frac{1}{g}n_{i}^{T}(t)\sum\limits_{j\in N_{i}(t)}\left(q_{i}(t)-q_{ j}(t)\right)+\frac{1}{g}n_{i}^{T}(t)G-\frac{1}{g}h_{i}^{T}(t)\sum\limits_{j\in N _{i}(t)}\
abla_{p_{ij}(t)}V(\|p_{ij}(t)\|).\end{array}  \tag{11}\]  
There are three equations in control protocol (11). The first part of each equation is the consensus term, which aims at forcing all the UAVs fly with consistent velocities. The second part of each equation is the gravity term. The third part is the negative gradient of the potential function \(V(\|p_{ij}(t)\|)\), which is used to adjust the relative positions between any two UAVs. The potential function can be divided into a repulsive item and an attractive item, whose definition is given as follows,  
Definition 1: (Potential function): Potential \(V(\|p_{ij}(t)\|)\) is a differentiable, non-negative, radially unbounded function of the distance \(\|p_{ij}(t)\|\) between agents \(i\) and \(j\), such that  
(1) \(V(\|p_{ij}(t)\|)\rightarrow\infty\) as \(\|p_{ij}(t)\|\to 0\);  
(2) \(V(\|p_{ij}(t)\|)\rightarrow\infty\) as \(\|p_{ij}(t)\|\to D\);  
(3) \(V(\|p_{ij}(t)\|)\) attains its unique minimum when agents \(i\) and \(j\) are located at a desired distance between \(0\) and \(D\). Rule (1) of Definition 1 is related to the repulsive item, which forces the UAVs to avoid collision with each other. Rule (2) of Definition 1 is related to the attractive item, which mainly affects the flocking cohesion behavior of these UAVs. Rule (3) of Definition 1 decides the equilibrium distance among individuals. Then, the following theorem can be obtained. Theorem 1: (Three-dimensional Cohesive Flocking): There exists a system consisting of \(N\) UAVs governed by (1). The behavior of each UAV is decided by the protocol (11). The interaction network of the proposed UAV system is assumed to be undirected and connected at the initial time. Then, the following conclusions hold. 1. _Each UAV avoids collision with each other._
2. _The metric interaction network is always connected._
3. _The system asymptotically converge to a consistent configuration that each UAV owns the same speed, the same heading angle, and the same flight-path angle._
4. _The system approaches a cohesive configuration that its total potential is minimized._  
In short, we may ignore the time variable in the following proof process for these time-variant variables. For example, we may use \(N_{i}\) instead of \(N_{i}(t)\). Proof of Theorem 1.: From \(u_{i}=[n_{ti},n_{hi},n_{vi}]^{T}\) and \(H_{i}=[t_{i},n_{i},n_{i}]^{T}\), control protocol (11) can be rewritten as  
\[u_{i}=-\tfrac{1}{g}H_{i}\sum\limits_{j\in N_{i}}(q_{i}-q_{j})+\tfrac{1}{g}H_{i }G-\tfrac{1}{g}H_{i}^{T}\sum\limits_{j\in N_{i}}\
abla_{p_{ij}}V(\|p_{ij}\|) \tag{12}\]  
As \(H_{i}\) is an orthogonal matrix, \(H_{i}^{T}H_{i}=I\).