# Online Learning Based Underwater Robotic Thruster Fault Detection
## 4 Propulsion System Online Modeling
### Multi-Center Particle Swarm Optimization Algorithm with Memory Ability
#### 4.2.2 Multi-Center Collaborative Search
For other particles in the population (e.g., particle i), calculate the distance between its current position \(\mathbf{x}_{i}^{k}\) and the population center and auxiliary center:  
\[\left\{ \begin{array}{l}d_{ixg}^{k}=d(\mathbf{x}_{i}^{k},\mathbf{p}_{gbst}^{k})\\ d_{izm}^{k}=d(\mathbf{x}_{i}^{k},\mathbf{p}_{mbst}^{k})\\ d_{izm}^{k}=d(\mathbf{x}_{i}^{k},\mathbf{p}_{mbst}^{k})\\ \end{array} \right. \tag{12}\]  
If \(d_{ixg}^{k}\leq\min(d_{ixm}^{k},d_{ixm}^{k})\)--that is, the distance between particle \(i\) and the center of the population is not greater than the distance from the auxiliary center--set the learning center of particle \(i\) to \(\mathbf{L}_{i}^{k}=\mathbf{p}_{gbst}^{k}\). Otherwise, determine which auxiliary center particle \(i\) is closest to (here, it is assumed to be closest to \(\mathbf{p}_{mbst}^{k}\)), and determine the learning center of particle \(i\), according to the following rules:  
If \(rand\leq\frac{3}{4}\frac{f_{gbst}^{k}}{f_{mbst}^{k}}\), then \(\mathbf{L}_{i}^{k}=\mathbf{p}_{mbst}^{k}\), otherwise \(\mathbf{L}_{i}^{k}=\mathbf{p}_{gbst}^{k}\). Step 6: Select the learning center for all particles in the population, according to the above method. Then, update the speed of each particle as follows:  
\[v_{i,j}^{k+1}=\omega v_{i,j}^{k}+c_{1}r_{1}(p_{\mathit{P}iest,j}^{k}-x_{i,j} ^{k})+c_{1}r_{1}(L_{i,j}^{k}-x_{i,j}^{k}) \tag{13}\]  
After the speed update is completed, the position update and subsequent operations can be performed, according to the standard PSO algorithm. The complete process of the multi-center PSO algorithm with memory capability proposed in this paper is shown in Figure 3.  
Figure 4 shows the position of each particle and the distribution of learning centers in the mid-, late-, and end-stage populations during a certain optimization process. There was a total of 20 particles in the population, with 1 center and 2 auxiliary centers. The left side of the arrow in the figure shows the number of the particle, while the right side is the learning center of the particle during this iteration. Figure 4a shows the mid-search stage. At this time, particle 7 is the global center of the population, and particles 13 and 14 are auxiliary centers. There are 13, 3, and 4 particles in the population learning from particles 7, 13, and 14, respectively. Under the effect of the collaborative search strategy, the particles search extensively in the better area, in order to avoid falling into local optima too quickly. In the late search stage, shown in Figure 4b, the population has roughly converged to a better area and, under the guidance of the population center and the auxiliary center, they search within a smaller range. At the end of the search, shown in Figure 4c, the population is close to convergence and the particles are gathered in the population and auxiliary centers for fine searching. Thanks to the rules for determining the learning center in the collaborative search strategy presented in this article, there may still be particles located in the auxiliary center that leave the auxiliary center to learn from the population center, searching the