# Particle Swarm Optimization of a Passivity-Based Controller for Dynamic Positioning of Ships
## 4 The PSO Method for DP of Ship
### Convergence to the Optimal Solution Using PSO Method  
In terms of convergence of the function to the optimal solution, optimization methods can be split into two groups; local and global optimization methods. The local optimization could ensure the function/algorithm convergence to the local optimal solution while the global methods could guarantee a convergence to a global solution among multiple local optima. Moreover and based on the local or global convergence condition, optimization techniques can be decomposed into two main methods: the metaheuristic and deterministic methods following their tendency to converge towards a local or global optimum, respectively [44].  
Most metaheuristic methods are naturally or biologically motivated mimicking the behavioral characteristics and/or interactions of living agents such as worms, fish, birds, bees [45]. Metaheuristic methods are gaining popularity in several application domains including in control system, neural network training and function optimization due to their ease of implementation, rapid convergence capability without requiring high mathematical preparation and computational complexity [42; 46]. The most popular metaheuristic methods, which have been used to solve a wide range of real-life optimization problems, are differential evolution, artificial bee colony, particle swarm optimization, genetic algorithm, simulated annealing, gravitational search algorithm and firefly algorithm [44; 46]. On the other hand, deterministic methods follow a definite trajectory to the closest minimum from random initial solution(s), which ensure more accurate results. However, these methods require sophisticated mathematics and extensive computation. They also need a lot of memory for sampling and lengthy simulations [46; 47]. Characterized by the fact that the selected objective function must satisfy the Lipschitz condition, a number of approaches have been proposed in the literature; the DIRECT method and its locally-biased version DIRECT-L, and the approach based on adaptive diagonal curves [46], and the geometric global optimization methods [44].  
To guarantee that our proposed PSO approach converges to the optimal value, we used the PSO algorithm implemented in the Global Optimization Toolbox in Matlab. This toolbox examines several basins of attraction to find the global optima [48]. This Global Optimization Toolbox \"provides functions that search for global solutions to problems that contain multiple maxima or minima. This gives some confidence that particleswarm reports a local minimum and that the final obtained value is the global solution[49]\". Furthermore, and based on the comprehensive discussion and analysis in [44], PSO methods manifest a better performance as well as being less sensitive to the accuracy increment with respect to the other tested metaheuristics. In addition, trial points generated by PSO were distributed in a smarter manner with respect to the other metaheuristics and even better than some global methods [44]. Motivated by these points and due to the fact that PSO method solves the optimization problem in a computationally efficient manner, we have adopted this method among other optimization methods. It's effectiveness will be verified in the next section.