# Novel Faulted-Section Location Method for Active Distribution Networks of New-Type Power Systems
## 4 Genetic Tabu Algorithm
### Fitness Function  
A fitness function reflects the difference between the expected and actual status of the protection action and equipment status information. The fitness function \(F(H)\) can provide feedback on the rationality of the fault hypothesis. The smaller the \(F(H)\) is, the higher the reliability of the fault hypothesis. \(F(H)\) is shown as follows:  
\[minF(H)=w_{1}\sum_{i=1}^{m_{e}}\lvert e_{i}-e_{i}^{\prime}(H)\rvert+w_{2}\sum _{j=1}^{m_{e}}\lvert I_{j}-I_{j}^{\prime}(H)\rvert+w_{3}\left\{\sum_{p=1}^{m_{ l}}l_{p}+\sum_{i=1}^{m_{e}}(o_{i}+r_{i})+\sum_{j=1}^{m_{e}}\sum_{k=1}^{2}A_{j,k}\right\} \tag{25}\]  
\(F(H)\) consists of two parts. The first part is the alarm difference index. This part reflects the difference between the expected and actual status of the fault information:  
\[w_{1}\sum_{i=1}^{m_{e}}\lvert e_{i}-e_{i}^{\prime}(H)\rvert+w_{2}\sum_{j=1}^{ m_{e}}\lvert I_{j}-I_{j}^{\prime}(H)\rvert \tag{26}\]  
1. \(e_{i}\) is the actual status of protection \(i\). \(e_{i}=0\) indicates that the protection is inactive. \(e_{i}=1\) indicates that it is active. \(I_{j}\) is the actual equipment status information of node \(j\). 2. \(e_{i}^{\prime}(H)\) and \(I_{j}^{\prime}(H)\) represent the expected protection action status of protection \(i\), and the expected equipment status information of node \(j\), and are calculated according to the \(H\). 3. \(\lvert e_{i}-e_{i}^{\prime}(H)\rvert\) is the difference between the expected and actual status of protection action information of protection \(i\). \(\lvert I_{j}-I_{j}^{\prime}(H)\rvert\) is the difference between the expected and actual status of equipment status information of node \(j\). The second part of the fitness function is the fault hypothesis minimization index: \[w_{3}\left\{\sum_{p=1}^{m_{l}}l_{p}+\sum_{i=1}^{m_{e}}(o_{i}+r_{i})+\sum_{j=1 }^{m_{e}}\sum_{k=1}^{2}A_{j,k}\right\}\] (27)  
This component shows that, when the alarm difference index is the same, the lower the total number of fault sections, misoperations, and rejection protections, and nodes with error equipment status information, the higher the reliability of the fault hypothesis. To select the case where the alarm discrepancy index is the smallest, set \(w_{1}>w_{3}\), \(w_{2}>w_{3}\). According to the actual reliability of the relay, protection must be more than 99%, and the probability of misoperation and rejection can be selected as 0.1%. According to the statistics of the long-term operation of the active distribution system, the probability of error equipment status information can be selected as 1%. When the probabilities of \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Equipment Status** & **Error Factor \(A_{i,1}\)** & **Error Factor \(A_{i,2}\)** & **Upload Information** \\ \hline \(1\) & \(0\) & \(1\) & \(0\) \\ \hline \(0\) & \(1\) & \(0\) & \(-1\) \\ \hline \(0\) & \(0\) & \(1\) & \(1\) \\ \(1\) & \(0\) & \(-1\) \\ \hline \(-1\) & \(0\) & \(1\) & \(0\) \\ \(1\) & \(0\) & \(1\) & \(1\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Equipment status information error situation. false protection action and error equipment status information are the same, the alarm discrepancy index calculated from the protection action information is the same as the equipment status information. We can obtain the following equation:  
\[0.01^{w_{1}}=0.001^{w_{2}} \tag{28}\]  
\(w_{1}=1.5w_{2}\) is calculated. Therefore, \(w_{1}=150\), \(w_{2}=100\), and \(w_{3}=1\) can be selected. The loss function and cost function of the optimization process are defined. The loss function is used to evaluate the difference between the predicted and true values of the model, which refers to the error of a sample. The cost function is defined on the entire training set, which refers to the average of all sample errors. Since the fault location is optimized according to the difference between the expected and actual status of the fault information, this paper uses the loss function as an absolute value to construct the cost function.