# Simulation of Autonomous Underwater Vehicles (AUVs) Swarm Diffusion
## 2 Materials and Methods
### Vehicle Motion  
Each individual vehicle is programmed to proceed to the vectorial sum of two speeds: The first is purely random, the second is influenced by the proximity of other drones, and has the purpose of removing the vehicle from the others in order to not \"pile them up\" with the others. The final purpose is precisely that of spreading the swarm uniformly at a constant density within a closed volume: In our case, we refer to a surface because the bathymetric variations are very modest compared to the displacement on the horizontal plane. The vehicle proceeds with two speed components, the first is \(\overrightarrow{v}_{random}\): It is a pure casual speed/direction combination. The full expression is:  
\[\overrightarrow{v}_{random}(t)=\left[ \begin{array}{c}{}_{random}v_{x}(t) \\ {}_{random}v_{y}(t)\\ {}_{random}v_{z}(t)\end{array} \right] \tag{24}\]  
Every direction comprises two components  
\({}_{random}v(t-\Delta t)\) is the speed that takes into account the \"history\" of the vehicle  
\(\mathcal{R}(\Delta t)\) is a random zero mean vector  
\(\delta(\Delta t)\) is an algebraic scalar that modifies the direction  
Therefore, the full expression becomes:  
\[\overrightarrow{v}_{random}(t)=\left[ \begin{array}{c}{}_{random}v_{x}(t- \Delta t)+\mathcal{R}_{x}(\Delta t)\cdot\delta_{x}(\Delta t)\\ {}_{random}v_{y}(t-\Delta t)+\mathcal{R}_{y}(\Delta t)\cdot\delta_{y}(\Delta t )\\ {}_{random}v_{z}(t-lll)+\mathcal{R}_{z}(\Delta t)\cdot\delta_{z}(\Delta t) \end{array} \right] \tag{25}\]  
However, we impose than the AUV moves constantly at a defined depth, a sort of bi-dimensional \"moving plane\"; therefore:  
\[\delta_{z}(t)\approx 0 \tag{26}\]  
Due to the negligible movement on the vertical plane, we have:  
\[\overrightarrow{v}_{random}(t)=\left[ \begin{array}{c}{}_{random}v_{x}(t- \Delta t)+\mathcal{R}_{x}(\Delta t)\cdot\delta_{x}(\Delta t)\\ {}_{random}v_{y}(t-\Delta t)+\mathcal{R}_{y}(\Delta t)\cdot\delta_{y}(\Delta t )\\ {}_{n}v_{z}(t-\Delta t)\end{array} \right] \tag{27}\]  
The speed of the single vehicle is influenced by the position of the other vehicles: We define \(\overrightarrow{v}_{ssum}(t)\) as the second component of speed that \"diffuses\" the swarm in the full area as:  
\[\overrightarrow{v}_{ssum}(t)=\left\{ \begin{array}{c}\sum\limits_{i=1}^{n} \frac{|r-r_{i}\beta}{|r-r_{i}|}\\ |r-r_{i}|\leq d_{min}\end{array} \right. \tag{28}\]  
where\(n\) is the full number of drones \(r\) the distance of the considered drone \(r_{i}\) the distance of the ith drone \(d_{min}\) the min _collision_ distance of the drone We mean with _\"minimum collision distance\"_ the minimum distance that, at maximum speed, allows enough time for two drones on a collision course to exchange position and speed data and to elaborate and implement an escape route. Depending on the optical transducer chain, this was set at 50 m. Thus, the total speed of the single vehicle is: \[\overrightarrow{v}_{TOT}(t)=\overrightarrow{v}_{random}(t)+\overrightarrow{v }_{swurm}(t)\] (29) Thus, the complete expression is: \[\overrightarrow{v}_{TOT}(t)=\left\{ \begin{array}{c}\left[\begin{array}{c} r_{random}v_{x}(t-\Delta t)+\mathcal{R}_{x}(\Delta t)\cdot\delta_{x}(\Delta t)\\ \begin{array}{c}r_{random}v_{y}(t-\Delta t)+\mathcal{R}_{y}(\Delta t)\cdot \delta_{y}(\Delta t)\\ \begin{array}{c}i^{2}v_{z}(t-\Delta t)\end{array}\end{array}\end{array} \right]+\left[\begin{array}{c}\sum\limits_{i=1}^{n}\frac{|v_{x}-r_{i}|^{3}}{|v _{x}-r_{i}|}\\ \begin{array}{c}\sum\limits_{i=1}^{n}\frac{|v_{y}-r_{i}|}{|v_{y}-r_{i}|}\\ 0\end{array}\end{array}\right]\\ \left|r-r_{i}\right|\leq d_{min}\end{array} \right.\] (30)  
It is interesting to note that, if the drones were released in a single point and authorized to move in a closed and defined area, behaving in the substance as gas particles that expand, the \(\overrightarrow{v}_{swurm}(t)\) is transitory only.