## 5 Case Analysis and Results
### The Compensation Target Is to Preferentially Compensate for Harmonics  
Based on the previous fundamental current, the 5 th, 7 th, 11 th, and 13 th harmonic current sources are injected. The amplitude and phase of each frequency are shown in Table 4.  
The three-phase current before compensation is shown in Figure 9, for which the harmonic current components of each frequency can be fully compensated. The sum of the harmonic currents of each frequency except the fundamental wave is 15.47 A. The remaining capacity can be used to compensate for the reactive current components in the fundamental wave current. After calculating the optimization algorithm, \(w_{g}=1\), \(w_{r}=0.78\), \(w_{n}=0.56\), and \(w_{z}=0.56\) can be obtained. The reference compensation current after harmonic suppression and fundamental wave reactive power compensation is shown in Figure 10.  
The three-phase current after harmonic suppression and fundamental wave reactive power compensation is shown in Figure 11. The imbalance phenomenon and the inductive  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Current Component** & **Amplitude (A)** & **Phase Angles (\({}^{\circ}\))** \\ \hline
5 th harmonic & 10 & 0, 120, 240 \\
7 th harmonic & 1.5 & 0, 120, 240 \\
11 th harmonic & 1.5 & 0, 120, 240 \\
13 th harmonic & 1.5 & 0, 120, 240 \\
17 th harmonic & 1.5 & 0, 120, 240 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The amplitude values of different current frequencies.  
Figure 8: Output current waveform of power supply side after compensation.  
Figure 10: Harmonic suppression and fundamental reactive power reference compensation three-phase current.  
Figure 9: The three-phase current waveform of the power supply side before compensation.  
reactive power component exist at the same time, and the three-phase current waveform distortion change effect is obvious after compensation.  
The parameters of the PSO algorithm, CF-PSO algorithm, and SA-PSO algorithm are set as follows: the maximum number of iterations is n = 100, the number of variables is \(D\) = 3, the number of particles is \(N\) = 30, learning factor \(c_{1}\) is 2.8, and learning factor \(c_{2}\) is 1.3. In the traditional PSO algorithm, the inertia weight \(w\) is set to 0.729. In the SA-PSO algorithm, the initial temperature \(T_{0}\) is set to 100, and the annealing constant is \(k\) = 0.5. Because of the randomness of the algorithm, each optimization algorithm iterates ten times and takes the average value. The convergence curves of the different algorithms are compared in Figure 12. It can be seen from the figure that these three algorithms can converge to a unified solution, and the optimization accuracy is the same. The fitness value is 1190; that is, the minimum objective function value of line loss after compensation is 1190 A\({}^{2}\). The PSO algorithm converges after 90 iterations, and the convergence speed is the slowest. The CF-PSO algorithm converges almost 25 times in the iteration. The SA-PSO algorithm has the fastest convergence speed, and the number of iterations is about 10 times. Therefore, choosing the SA-PSO algorithm is more appropriate when using an optimization algorithm to solve the optimization model.