## 2 A Proposed ASPC Approach for OCRs in a DG-Integrated Distribution Network
### Protection Coordination Algorithms  
#### 2.4.1 Gravitational Search Algorithm (GSA)  
A Gravitational Search Algorithm (GSA) is based on the gravitational force and [PERSON]'s law of motion [94]. By considering a system with \(N\) agents (or \(N\) masses) with the \(d\)-th dimension in a certain search space, the gravitational force from the \(j\)-th agent to the \(i\)-th agent at the \(t\)-th time, \(F^{d}_{ij}(t)\), can be expressed by Equation (38):  
\[F^{d}_{ij}(t)=G(t)\frac{M_{pi}(t)\times M_{aj}(t)}{R_{ij}(t)+\in}\Big{(}x^{d}_{ j}(t)-x^{d}_{i}(t)\Big{)} \tag{38}\]  
where, \(M_{aj}(t)\) is the active gravitational mass regarding to the \(j\)-th agent in the time \(t\); \(M_{pi}(t)\) is the passive gravitational mass regarding to the \(i\)-th agent; \(\in\) is a small constant; \(R_{ij}(t)\) represents the Euclidian distance between the agents \(i\) and \(j\); \(x^{d}_{i}\) and \(x^{d}_{j}\) are the position of the \(i\)-th agent and the \(j\)-th agent at the \(d\)-th dimension, respectively; and \(G(t)\) is a gravitational constant at the time \(t\) as referred to Equation (39). \[G(t)=G_{0}\times\exp(-\pi*iter/_{\max,iter}) \tag{39}\]  
Figure 5: A general flow-chart of the proposed ASPC approach for OCRs in a DG-based distribution network. where \(G_{0}\) and \(\alpha\) are the initial value of gravitational constant and the descending coefficient, respectively, normally selected to 20 and 100; _'iter'_ is the current number of iterations; and _'max_iter'_ is the maximum number of iterations. In other words, \(G(t)\) is a function of the initial value \(G_{0}\) and is gradually decreased with respect to the time to control the search accuracy of the algorithm. The Euclidian distance, \(R_{ij}(t)\), between two agents \(i\) and \(j\) is calculated as the following. \[R_{ij}(t)=\big{|}\big{|}X_{i}(t),\ X_{j}(t)\big{|}\big{|}_{2} \tag{40}\]  
where the position of the \(i\)-th agent and the \(j\)-th agent with \(n\)-dimensions, \(X_{i}\) and \(X_{j}\), can be defined as below:  
\[ \begin{split} X_{i}&=\left(x_{i}^{1},\ldots,x_{i}^ {d},\ldots,x_{i}^{n}\right),i=1,2,\ldots,N\\ X_{j}&=\left(x_{j}^{1},\ldots,x_{j}^{d},\ldots,x_{j }^{n}\right),j=1,2,\ldots,N\\ X&=\left\{X_{1},\ldots,X_{i}\ldots,X_{j},\ldots,X_ {N}\right\}\end{split}  \tag{41}\]  
For the stochastic search algorithm, the total gravity force impacting the \(i\)-th agent at the \(d\)-th dimension, \(F_{i}^{d}(t)\), is the sum of \(d\)-th components of the forces generated from other agents in a set of \(N\) agents with the random weighting factor \(rand_{j}\) in an available interval [0, 1]. \[F_{i}^{d}(t)=\sum_{j=1,j\
eq i}^{N}rand_{j}F_{ij}^{d}(t) \tag{42}\]  
The acceleration of the \(i\)-th agent at the time \(t\) with the \(d\)-th dimension, \(A_{i}^{d}(t)\), can be calculated by:  
\[A_{i}^{d}(t)=\frac{F_{i}^{d}(t)}{M_{ii}(t)} \tag{43}\]  
where \(M_{ii}(t)\) is the inertial mass of the \(i\)-th agent at the time \(t\). For each iteration step, the velocity and position of the \(i\)-th agent are updated by the following equations. \[Vel_{i}^{d}(t+1)=rand_{i}\times Vel_{i}^{d}(t)+A_{i}^{d}(t) \tag{44}\]  
\[X_{i}^{d}(t+1)=X_{i}^{d}(t)+Vel_{i}^{d}(t+1) \tag{45}\]  
where the next velocity of the \(i\)-th agent, \(Vel_{i}^{d}(t+1)\), is the sum of a fraction of its current velocity \(rand_{i}\times Vel_{i}^{d}(t)\) and its acceleration \(A_{i}^{d}(t)\); _'rand\({}_{i}\)'_ is a random variable in the interval [0, 1]; and the next position of the \(i\)-th agent \(X_{i}^{d}(t+1)\) is the sum of its current position, \(X_{i}^{d}(t)\), and its next velocity, \(Vel_{i}^{d}(t+1)\). It is noted that the use of a random variable is to give a randomized search characteristic of the algorithm. The gravitational and inertia masses of the \(i\)-th agent can be calculated by the fitness evaluation which is referred to Equation (2) in Section 2.2. The greater mass is, the more efficient agent is. The better agents will have the higher attractive forces and the slower movement. The gravitational and inertia masses of the agent are assumed to be equal.