# Online Learning Based Underwater Robotic Thruster Fault Detection
## 4 Propulsion System Online Modeling
### Multi-Center Particle Swarm Optimization Algorithm with Memory Ability
#### 4.2.1 Initial Population Optimization Based on Historical Optimal Solution and Improved Chaotic Map  
In the PSO algorithm, the initial population is usually generated by randomly selecting values in the search space. For the online optimization problem in this article, it is necessary to optimize the model order and the amount of modeling data many times during the operations of the underwater robot. After each optimization, an optimal solution is obtained. In the next optimization, the previously obtained optimal solution may be close to the optimal solution of this optimization problem. If these optimal solutions are stored as part of the initial population in the next optimization, it can help to optimize the initial population, thus improving the performance of the algorithm. In addition, by introducing the prior knowledge of the control variable-speed model into the historical optimal solution library, the optimization of the joint drive of knowledge and data can be realized.  
The PSO algorithm attempts to distribute the initial population as evenly as possible in the search space, in order to improve the probability of finding the optimal solution. Therefore, we first take a small amount of the initial population as the historical optimal solution, and then randomly select a historical optimal solution to map to the entire search space, as the remaining initial population.  
Tent mapping is a commonly used chaotic map with good ergodicity [42]. Thus, we use tent mapping to map the randomly selected historical optimal solution to the search space. The mathematical expression of tent mapping is:  
\[t_{k+1}=\left\{\begin{array}{ll}2t_{k}&0\leq t_{k}\leq 0.5\\ 2(1-t_{k})&0.5\leq t_{k}\leq 1\end{array}\right. \tag{8}\]  
Tent mapping can be problematic as the value can fall into a fixed point or a small period. In response to this problem, [PERSON] et al. [43] proposed a method to multiply the mapping value by a number in [0,1] when the mapping value falls into a fixed point or a small period. An improved method of random numbers between.  
When optimizing the initial population through tent mapping, the initial value is first mapped from the search space to the [0,1] space. In practical applications, it has been found that the initial value of the mapping into [0,1] may be an approximation of an infinite loop decimal. In this case, although the tent mapping does not fall into a fixed point or a small period, there will be a large number of values within a very close distance, thus affecting the mapping effect. We address this problem by limiting the minimum distance between two adjacent value points. If \(|t_{k+1}-t_{k}|\leq 0.02\), then we take:  
\[t_{k+1}=\left\{\begin{array}{ll}t_{k+1}+0.4 rand&t_{k+1}\leq 0.5\\ t_{k+1}-0.4 rand&t_{k+1}>0.5\end{array}\right. \tag{9}\]  
Figure 2 shows the distribution of value points obtained by 60 iterations in two-dimensional space, using the method in this paper and the method of [43], when the initial value is (0.833333, 0.666667). It can be seen that the too-close value points became more evenly distributed in space. A large number of value points obtained by the method of [43] can be seen to be gathered in a small area.