# Comparison Study of the PSO and SBPSO on Universal Robot Trajectory Planning
## 2 Materials and Methods
### Serendipity-Based Particle Swarm Optimization
Cluster Analysis consists of evaluating the percentage of the particle's number of a cluster C. If the distance between a particle belongs to C and the gBest particle which is less than a threshold \(\delta\) min, the convergence has occurred, when a percentage of particles in C reach a threshold \(\delta\) max. 3. Objective Slope Function considers the position of particles in search space based on its normalized value and the change rate of objective function which is obtained through Equation (18):

\[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]3 Example of random selection of 8 inspection points around the gBest particle, in a 2D space. This is the result for each of the 4 adjacent points defined. \[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]4

where \(f(\dot{y_{j}})\) s the objective function's fitness value on iteration j, and \(f(\dot{y_{j-1}})\) is the objective function's fitness value on iteration j\(-\)1. A counter is incremented if the value of \(f_{ratio}\) is less than a predefined threshold. ### Computational Experiments

The computational experiments are presented in this section and implementation results of the APF+PSO and APF+SBPSO algorithm are presented to obtain collision-free trajectories as well as the potential surfaces for each algorithm will represent. **A. APF+PSO simulations**

Figure 2 plots a graph of attitudes and generations, where it is feasible to see when the number of particles is equal to 2000 iterations, the best particle, and the average of all particles converge. The potential field parameters found in the simulation of the PSO algorithm for 30 particles and 2000 iterations are presented in \[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]5 Figure 3 shows the lines of the artificial potential field and the collision-free trajectory, in Cartesian space for the simulation performed, using the parameters in Table 1, obtained from the locations of the obstacles. \[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]6 Lines of the potential field by the algorithm of APF for the parameters in \[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]7

\[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]8 PSO graph converging for 30 particles and 2000 Iterations. ### APF+SBPSO simulations

In this section, some functions of benchmark used to evaluate the proposed algorithm and the parameters used are represented. **The Benchmark Functions**

Some functions chosen are often applied in minimization problems to confirm the stagnation and convergence of the algorithm [28]. In [29; 30; 31] and several other PSO studies, the functions are described below:

1. **Sphere function**--characterized by being simple, convex and unimodal. Its main function to evaluate the convergence rate of the search process are represented in Equation (19): \[V_{id}^{(t+1)}=X_{id}^{t}+x_{id}^{(t+1)} \tag{12}\]9 (19)
2. **Rosenbrock function**--has the global minimum in parabolic valley. In this function, the convergence is difficult [32]; this function is represented in Equation (20): \[V_{kd}^{(t+1)}=w.V_{kd}^{t}+\text{C}_{3}\text{-r}_{3}\left(X_{kd}^{t}+X_{best} ^{t}\right) \tag{13}\]0 (20)
3. **Griewank function**--several local minimums regularly distribute and are represented in Equation (21): \[V_{kd}^{(t+1)}=w.V_{kd}^{t}+\text{C}_{3}\text{-r}_{3}\left(X_{kd}^{t}+X_{best} ^{t}\right) \tag{13}\]1 (21)
4. **Rastrigin function**--it is a highly multimodal function; however, the locations of the various local minima are regularly distributed and represented in Equation (22): \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & \(\mathbf{k_{r}}\) & \(\mathbf{K_{a}}\) & \(\mathbf{K_{o}}\) \\ \hline intensity & 2.29 & 5.250 & 0.489 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Values of parameters and intensities founded by PSO for 30 particles and 2000 iterations. Figure 4: The field’s resultant surface. \[f_{4}(x)=\sum_{i=1}^{d}(x_{i}^{2}-10 cos(2\pi x_{i})+10 \tag{22}\]
5. **HappyCat function**--is characterized by being unimodal.