## 3 Multiple AUVs-UAVs Control Design
### Flocking and Boids Mode  
One of the most interesting sights in nature is the mutual movement of animals in sets, where each animal has its own speed and direction even though they move along with each others to form a single entity. Following social practices, ants, fish, and bird communities are examples of biological entities in their movements. The first method to simulate these movements was established in 1986 by [PERSON] and referred to as a bird-like object called the Boids model [31]. The Boids model explains birds' movement and organization activities in a flock. These cooperative movements typically follow two basic rules: the need for each agent to remain in the group while avoiding collision with the adjacent agent. In order to explain these rules specifically, [PERSON] split them into three groups to simplify them for computer simulation [32]. Based on the rules of [PERSON] [31], the group \(N\), which consists of n agents, is supposed to represent the whole flock. \[N=\{b_{i},i=0,1,2\ldots n-1\}. \tag{41}\]  
Each \(b_{i}\) boid in the group \(N\) has p position, \(\vec{u}\) unit vector, and \(\vec{v}\) velocity vector in (\(x\),\(y\),\(z\)) plane. The visibility sphere of the \(b_{i}\) boid is described by:  
\[v_{i}=\{b_{j}\in N,\forall b_{j}:|b_{i}-b_{j}|<e,j=0,1,2\ldots m-1\}. \tag{42}\]  
The flocking model of [PERSON] is based on the following three principles:  
Separation : avoiding collision with the adjacent agent. The general equation of the separation rule is as follows [33]:  
\[\vec{S}_{i}=-\sum_{\forall b_{j}\in v_{i}}(b_{i}-b_{j}). \tag{43}\]  
By considering all boids inside one boid's visibility sphere, \(b_{i}\), then link each boid vector to \(b_{i}\). The function for separation is the sum of the corresponding vectors. Alignment: aligning velocity and position with adjacent boids. The general equation of the alignment rule is as follows [33]:  
\[\vec{m}_{i}=\sum_{\forall b_{j}\in V_{i}}\frac{\vec{V}_{i}}{m}, \tag{44}\]  
where the boid's motion is denoted by \(m_{i}\). Cohesion: staying close to the flock's center created by its adjacent boids. Suppose that the flock centering is expressed by \(K_{i}\) for the boid \(b_{i}\). The important step is to obtain the mass center of all visible bodies in the sphere's visibility, \(v_{i}\) as follows:  
\[c_{i}=\sum_{\forall b_{j}\in v_{i}}\frac{\vec{p}_{j}}{m}, \tag{45}\]  
where \(c_{i}\) denotes the mass center of the boids. Therefore, the vector of cohesion displacement is given as follows [33]:  
\[\vec{K}_{i}=c_{i}-p_{i}=\sum_{\forall b_{j}\in v_{i}}\frac{\vec{p}_{j}}{m}-p_ {i}. \tag{46}\]In the above equations, we clarified the rules of Reynolds through simple formulas. Therefore, we utilized the formulas in [32; 34; 35] as follows:  
* Separation: The separation force is utilized for avoiding collision between the UAVs and AUVs, which is defined as follows: \[\overset{\rightharpoonup}{S}_{sep}(m)=\frac{1}{n}\sum_{j=1}^{n}k\xi_{j}^{ \rightharpoonup}(m)\frac{\overset{\rightharpoonup}{p}_{s}(m)-\overline{p}_{j} (m)}{\left\lVert\overset{\rightharpoonup}{p}_{s}(m)-\overline{p}_{j}(m) \right\rVert}\] (47) with \[\xi_{j}(m)= \begin{cases}\frac{1}{\sqrt{\left\lVert\overset{\rightharpoonup}{p }_{s}(m)-\overset{\rightharpoonup}{p}_{j}(m)\right\rVert}}-\frac{1}{\sqrt{d} 0},\\ if\left\lVert\overset{\rightharpoonup}{p}_{s}(m)-\overset{\rightharpoonup}{p}_{ j}(m)\right\rVert\leq d_{0}\\ 0,\ \ \ if\left\lVert\overset{\rightharpoonup}{p}_{s}(m)-\overset{\rightharpoonup}{p}_{ j}(m)\right\rVert>d_{0},\end{cases} \] (48) where the position of agent \(s\) and agent \(j\) is represented by \(p_{s}\) and \(p_{j}\) respectively, \(n\) represents the agent's number, \(k\) represents a positive constant, \(\left\lVert\overset{\rightharpoonup}{p}_{s}(m)-\overline{p}_{j}(m)\right\rVert\) represents the Euclidean distance between the agent \(s\) from the agent \(j\), the separation gain is represented by \(\xi\), and \(d_{0}\) represents the constant distance between the agents.