*3.4. PSO Algorithm*

The successful application of the particle swarm optimization (PSO) algorithm in the optimum design of RC structures has been reported in the literature (e.g., [26–33]). In this paper, the PSO algorithm was used to optimize RCRWs. The algorithm was originally developed by Kennedy and Eberhart [19] in the mid-1990s, and was first applied to simulate the social behavior of fish schooling and bird flocking as part of a socio-cognitive research. The PSO algorithm is considered a metaheuristic algorithm that optimizes a problem by iteratively trying to improve a candidate solution. It solves a problem by having a population of candidate solutions called particles. Each particle moves through the search space and its position is updated according to (a) its local best known position, and (b) the best known position for the whole swarm in the search space. Finally, the objective function is calculated for each particle and the fitness values of the candidate solutions are assessed to discover which position in the search space is the best. The algorithm searches for the optimum by adjusting the trajectory of each particle of the swarm in the multi-dimensional design space, in terms of paths created by positional vectors in a quasi-random manner. After finding the best values of position and velocity in each iteration *k*, these vectors are updated using the following equations:

$$X\_{\rm i,k+1} = X\_{\rm i,k} + \mathcal{V}\_{\rm i,k+1} \tag{39}$$

$$V\_{\rm i,k+1} = w\_{\rm k} V\_{\rm i,k} + c\_1 r\_1 (P\_{\rm i,k} - X\_{\rm i,k}) + c\_2 r\_2 (P\_{\rm g,k} - X\_{\rm i,k})\_{\rm \prime} \tag{40}$$

in which for the *i*-th particle, *<sup>X</sup>*i,k and *<sup>V</sup>*i,k are the current position vector and velocity vector at iteration *k*, respectively; *<sup>P</sup>*i,k is the best position that the particle has visited; *<sup>P</sup>*g,<sup>k</sup> is the global best position obtained so far by all the particles in the population; *r*1 and *r*2 are random numbers drawn from a uniform distribution in the range of [0, 1]; *c*1 and *c*2 are constants, called cognitive and social scaling parameters, and are usually in the range of [0, 2]; *w*k known as the inertia weight, has a pivotal role in updating the position and the velocity vectors. In fact, this parameter is used to stabilize the motion of the particles, making the algorithm converge more quickly. In this paper, a linear weight-updating rule was implemented as follows:

$$w\_{\mathbf{k}} = w\_{\text{max}} - \frac{w\_{\text{max}} - w\_{\text{min}}}{k\_{\text{max}}}k\_{\text{\prime}}\tag{41}$$

in which *w*max and *w*min are the upper and lower bounds of the current weight *w*k; and *k*max is the maximum number of iterations used. Figure 3 shows a schematic view for the PSO algorithm, i.e., how a particle's position is updated from one iteration to another toward finding the global optimum.

**Figure 3.** A schematic view for describing particle swarm optimization (PSO).
