# Simulation of Autonomous Underwater Vehicles (AUVs) Swarm Diffusion
## 2 Materials and Methods
### Reliability of the Swarm
#### 2.4.1 General Reliability  
In this section, we examine the swarm from a reliability point of view, considering it as an entity that performs a series of tasks and is composed by the same members. The general formula used to calculate the reliability of a system of \(N\) items (or drones) is:  
\[R_{sys}(t)=\ 1-\left(1-e^{-\lambda t}\right)^{N} \tag{1}\]  
where:  
\(\lambda\) is the failure rate of the single item (drone). \(t\) is the mission time. Developing with [PERSON]'s binomial:  
\[R_{sys}(t)=\ 1-\left(1-\left( \begin{array}{c}N\\ 1\end{array} \right)e^{-\lambda t}+\left( \begin{array}{c}N\\ 2\end{array} \right)e^{-2\lambda t}-\left( \begin{array}{c}N\\ 3\end{array} \right)e^{-3\lambda t}+\cdots\right) \tag{2}\]  
In explicit form:  
\[R_{sys}(t)=N\,e^{-\lambda t}-\frac{N(N-1)}{2!}\,e^{-2\lambda t}+\frac{N(N-1)(N -2)}{3!}\,e^{-3\lambda t}-\cdots \tag{3}\]  
The definition of \(MTBF\) (Mean Time Between Failures) of the whole system is:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}R_{sys}(t)\ dt \tag{4}\]Thus, the equation becomes:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}\!\!\left(N\,e^{-\lambda t}-\frac{N(N-1)}{2!} \,e^{-2\lambda t}+\frac{N(N-1)(N-2)}{3!}\,e^{-3\lambda t}-\cdots\right)dt \tag{5}\]  
In explicit form:  
\[MTBF_{sys}=\left[-\frac{N}{\lambda}\,e^{-\lambda_{syst}}t\right]_{0}^{\infty}- \left[-\frac{N(N-1)}{2!}\frac{1}{2\lambda}\,e^{-2\lambda t}\right]_{0}^{\infty }+\left[-\frac{N(N-1)(N-2)}{3!}\frac{1}{3\lambda}\,e^{-3\lambda t}\right]_{0}^ {\infty}-\cdots \tag{6}\]  
Thus:  
\[MTBF_{sys}=\frac{N}{\lambda}-\frac{N(N-1)}{2!}\frac{1}{2\lambda}\,+\frac{N(N- 1)(N-2)}{3!}\frac{1}{3\lambda}-\cdots \tag{7}\]  
The expression of reliability for a system with \(n\) components in parallel with sequential operation can then be simply obtained as the probability of having, at most, \(N-1\) failures (drone failed) in the interval \([0,\ldots,t]\) of:  
\[R_{sys}(t)=\frac{\left(\lambda t\right)^{0}}{0!}\cdot e^{-\lambda t}+\frac{ \left(\lambda t\right)^{1}}{1!}\cdot e^{-\lambda t}+\cdots+\frac{\left(\lambda t \right)^{N-1}}{\left(N-1\right)!}\cdot e^{-\lambda t} \tag{8}\]  
Then:  
\[R_{sys}(t)=e^{-\lambda t}\cdot\left(1+\lambda t+\frac{\left(\lambda t\right) ^{2}}{2!}+\cdots+\frac{\left(\lambda t\right)^{N-1}}{\left(N-1\right)!}\right) \tag{9}\]  
The upper limit of the second member is:  
\[\lim_{N\rightarrow\infty}\left(1+\lambda t+\frac{\left(\lambda t\right)^{2}}{ 2!}+\cdots+\frac{\left(\lambda t\right)^{N-1}}{\left(N-1\right)!}\right)=e^{ \lambda t} \tag{10}\]  
therefore, the reliability of the system, as the number of components increases, tends to 1. Finally, regarding the value of the MTBF, we have:  
\[MTBF_{sys_{N}}=\int_{0}^{\infty}e^{-\lambda t}\cdot\left(1+\lambda t+\frac{ \left(\lambda t\right)^{2}}{2!}+\cdots+\frac{\left(\lambda t\right)^{N-1}}{ \left(N-1\right)!}\right)dt \tag{11}\]  
Thus, the solution is:  
\[MTBF_{sys_{N}}=\left[-\frac{1}{\lambda}\cdot e^{-\lambda t}\cdot\sum_{k=0}^{N -1}\frac{\left(\lambda t\right)^{k}}{k!}\,\right]_{0}^{\infty}\,\,\,\,\,- \int_{0}^{\infty}\!\left[-\frac{1}{\lambda}\cdot e^{-\lambda t}\cdot\left( \sum_{k=0}^{N-1}\frac{\left(\lambda t\right)^{k}}{k!}\cdot k\lambda\right) \right]dt \tag{12}\]  
Thus:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}R_{sys}(t)\ dt \tag{4}\]0  
Simplifying:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}R_{sys}(t)\ dt \tag{4}\]1  
Then:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}R_{sys}(t)\ dt \tag{4}\]2
Regroup the first member:  
\[MTBF_{sys}=\int\limits_{0}^{\infty}R_{sys}(t)\ dt \tag{4}\]3  
We then returned to the starting integral, which is, again, solved by parts, obtaining the value 1/\(\lambda\) and lowering the sum by degree.