## 4 Problem Formulation
### Algorithm Results over 24 \(H\)
network load that occurred during the high tariff period, specifically at 9:00 a.m., 12:00 a.m., 2:00 p.m., and 8:00 p.m. For this state, loads from the uncontrollable load models were connected, and PV systems were also present for a large part of the day. The load during this period ranges from 70.4% to a maximum of 74.2%. The observed time interval exhibits significant stochastic load variations and substantial production from the PV systems, which are characteristic of the high tariff period. The presented time interval occurred at 2:00 p.m., and the test network state before and after the optimization process is shown in Figure 12a,b, which are very similar to the other time intervals within this network state. Figure 4:0 The test network state at 2:00 p.m. on the characteristic terminals before (**a**) and after (**b**) the optimization process. The harmonic flow calculation results for the characteristic terminals of the test network before the optimization process show that the first characteristic terminal, KTS 16 0.4 kV, does not have elevated harmonic values. In contrast, the individual harmonic distortions of the odd harmonics at the characteristic terminals 12 and 31 are exceeded. Also, it is noted that while examining harmonics above the 25 th order, an increase in the values of the 29 th harmonic is significant. However, the EN 50160 standard does not define values for harmonics above the 25 th order. The optimization in this state of the test network takes an average of 4:00 h, during which results are obtained that confirm that the method successfully identified the APF's parameters and optimal settings. In this test network state, the optimization process assigns only one APF with a rated current of 45 A to bus 55. The optimization process with a single APF has reduced the \(IHD_{V}\) in all characteristic buses. The results obtained from the characteristic terminals are shown in Figure 12b. The \(IHD_{V}\) levels at the KTS 16 0.4 kV terminal fully complied with the standard requirements. The \(IHD_{V}\) values at the other characteristic terminals, terminal 12 and terminal 31, also decreased. The value of the 25 th harmonic has decreased below the value prescribed by the standard, while the other harmonic orders have also been reduced but not entirely. The lack of complete reduction in the 7 th harmonic arises from the optimization method, which primarily targets harmonics that are multiples of number 3 and then addresses other odd harmonics. Additionally, the physical distance between the bus and the location of the APF contributes to this incomplete reduction. Due to physical constraints and network load, the optimization method could not add a second APF that could cancel the harmonics' effects. The fourth test network state requires considerable energy for the APFs to achieve the desired network condition. Given the constraints of the optimization process and the physical and load network limitations in this state, the performance of the APFs is understandably reduced. As with previous test network states, the results confirmed that the \(THD_{V}\) values in all network buses have been reduced. The reduction in \(THD_{V}\), in relative terms, ranges from 4.38% (bus 74) to 6.89% (bus 53). As anticipated, the most significant relative reduction occurred at bus 53, which is understandable due to the presence of an APF at that bus location. Similarly, to the third network state, it is essential to observe the \(THD_{V}\) values by phase, where it can be noticed that phase A has the highest relative harmonic distortion values, which are very close to 8% \(U_{n}\). The representation of the obtained \(THD_{V}\) values across all buses in the test network is shown in Figure 13a, while Figure 13b shows the \(THD_{V}\) values in phase A. The reduction in \(THD_{V}\) in phase A through the optimization process has been successfully achieved for all buses in phase A with the results ranging from 2.49% to 5.33%.