*4.3. Particle Swarm Optimization (PSO)*

Particle swarm optimization is inspired by the behavior of bird flocking and fish schooling [36]. Initially, the particles are generated with random positions and zero velocity, and the objective function is then evaluated. In the next step, the best positions of each particle, which is called the personal best position (*PPbest*(*i*)), are updated and the best position among all particles, which is called the global best position, is updated (*PGbest*). The velocity and position of each particle can be updated according to the *PPbest*(*i*) and the *PGbest* by the following equations.

$$V\_{P(i)} = wP(i) + c\_1r\_1(P\_{\text{Pbest}}(i) - P(i)) + c\_2r\_2(P\_{\text{Gbest}} - P(i))\tag{20}$$

$$(P(i)\_{n \le \upsilon} = P(i) + V\_{P(i)}) \tag{21}$$

where *VP*(*i*) is the velocity of the *i*th particle; *P*(*i*) is the current position of the *i*th particle; *PPbest*(*i*) is the personal best position of the *i*th particle; *PGbest* is the global best position among all particles; *P*(*i*)*new* is the updated position of the *i*th particle, *w* = 0.9 − (((0.9 − 0.4) ∗*it*)/*itermax*); *it* is the *it*th iteration; *c*<sup>1</sup> = *c*<sup>2</sup> = 2 and *r*1, *r*<sup>2</sup> are random numbers randomly generated between 0 and 1.
