## 2 A Proposed ASPC Approach for OCRs in a DG-Integrated Distribution Network
### Protection Coordination Algorithms
#### 2.4.2 Hybrid Particle Swarm Optimization and Gravitational Search Algorithm (Hybrid PSO&GSA)  
In the particle swarm optimization algorithm, the feasible solutions are called the particles/agents that fly in the \(d\)-dimensions search space by following the current optimal particles [95]. Let \(s_{i}\) and \(v_{i}\) denote the position and velocity of the \(i\)-th particle, respectively;  
Figure 6: A flow chart of GSA applied to the ASPC approach of OCRs. at each iteration, the velocity of each particle is updated by using its current position, velocity and its distance from the _pbest_ to the _gbest_ as shown in Equation (53). \[ \begin{split}&\
u_{i,d}^{k+1}=\omega*\
u_{i,d}^{k}+C_{1}*rand()* \frac{(\textit{pbest}^{k}_{i}-s_{i,d}^{k})}{\Delta t}+C_{2}*rand()*\frac{( \textit{gbest}^{k}-s_{i,d}^{k})}{\Delta t}\\ &\
u_{i,d}^{k}\in[-\
u_{\max},\
u_{\max}],\
u_{\max}=k_{\max},0.1 \leq k\leq 1\\ & s_{i,d}^{k}\in[-s_{\max},s_{\max}]\\ & v_{i}^{k}=\left(\
u_{i,1}^{k},\
u_{i,2}^{k},\ldots,\
u_{i,d}^{k }\right)\\ & s_{i}^{k}=\left(s_{i,1}^{k},s_{i,2}^{k},\ldots,s_{i,d}^{k} \right)\\ &\textit{pbest}^{k}_{i}=\left(\textit{pbest}^{k}_{i,1}\textit{ pbest}^{k}_{i,2},\ldots,\textit{pbest}^{k}_{i,d}\right)\\ &\textit{gbest}^{k}=\left(\textit{pbest}^{k}_{1},\textit{pbest }^{k}_{2},\ldots,\textit{pbest}^{k}_{N}\right)\end{split}  \tag{53}\]  
where \(\
u_{i,d}^{k}\) is the current velocity of the \(i\)-th particle at the \(k\)-the iteration with the \(d\)-th dimension; \(rand()\) is a random variable in the interval [0, 1]; \(s_{i,d}^{k}\) is the current position of the \(i\)-th particle at the \(k\)-the iteration; \(C_{1}\) and \(C_{2}\) are the acceleration coefficients; \(\textit{pbest}^{k}_{i}\) is the personal best position of the \(i\)-th particle in the \(d\)-dimensions; \(\textit{gbest}^{k}\) is the global best position of all the particles in the \(d\)-dimensions; and \(\Delta t\) is the time step of the algorithm. Moreover, the weighting function \(\omega\) can be expressed by Equation (54). \[\omega=\omega_{\max}-\left(\frac{\omega_{\max}-\omega_{\min}}{\textit{iter}_{ \max}}\right)*iter \tag{54}\]  
where \(\omega_{\max}\) and \(\omega_{\min}\) are the maximum and minimum weighting values, respectively, which are constant; _iter_ is the current iteration number; and \(\textit{iter}_{\max}\) is the maximum number of iterations. The algorithm starts with the \(\omega_{\max}\) value and decreases to the \(\omega_{\min}\) value when the number of iterations increases. In addition, each particle can update its position at the next time step (iteration) by using its current velocity to explore the search space for a better solution as follows:  
\[s_{i,d}^{k+1}=s_{i,d}^{k}+\upsilon_{i,d}^{k+1}*\Delta t \tag{55}\]  
where \(\Delta t\) is commonly set to one in this study. For the minimization value problem, the personal best position, _pbest_, is updated after the \(k\)-th iteration according to Equation (56). \[\textit{pbest}^{k+1}_{i}=\left\{ \begin{array}{lcl}\textit{pbest}^{k}_{i}& \text{ if }&f\left(s_{i}^{k+1}\right)\geq f\left(\textit{pbest}^{k}_{i}\right)\\ s_{i}^{k+1}&\text{ if }&f\left(s_{i}^{k+1}\right)<f\left(\textit{pbest}^{k}_{i} \right)\end{array} \right. \tag{56}\]  
where \(f\) is the fitness/objective function which is referred to Equation (2) in Section 2.2. The agents in the GSA do not share the population information with each other agent, so the PSO algorithm can be integrated with the GSA to improve the global optimal searching capability. In other words, the GSA is to use for the local searching ability while the PSO algorithm is to use for the global searching ability. The velocity of each agent can be updated by the PSO and the acceleration of the agent is calculated by the GSA, therefore, this combination is called a hybrid PSO-GSA.