## 4 Problem Formulation
### Algorithm Results over 24 \(H\)  
The co-simulation model for determining the optimal placement of APFs in the LV distribution network was performed according to the algorithm described in Section 4.2. where the algorithm takes into account only commercially available filters, i.e., filters with rated currents size of 30 A, 45 A, 60 A, and 70 A, and as such are in the database of available APF models. The optimal locations of APFs in the test network are algorithm results over a 24 h period in which more than two APFs were not used. The algorithm could not place an APF during certain periods of the day. The results for the first and second selected locations where the algorithm positioned an APF are shown in Figure 4a,b. The algorithm's results for choosing the first location for APF placement indicate that bus 41 was the most frequently chosen with the APF being placed there eight times. In relative terms, this means the algorithm assigned the APF to this bus in 33.33% of cases. The second most frequently selected location for the first APF was bus number 74, which was chosen four times, representing 16.67% of cases. It is important to note that in the results for the first location selection, the algorithm decided five times, or in 20.83% of cases, that due to the network's state, it was impossible to connect the APF to the test network. This inability to use the APF in the test network, as depicted in Figure 4a, is labeled as \"No selection\" and is marked in red on the graph. This outcome represents a network condition where the network load exceeds 90%, categorizing it as an overloaded state of the test network. After selecting the first location, if possible, the algorithm searches for a location to place a second APF and adjusts the filter's optimal settings using the PSO method. The algorithm's results for determining the possible location for the second APF placement are shown in Figure 4b. The algorithm's placement results for selecting the location for the second APF indicate that the algorithm most frequently positioned the second APF at bus number 25 (8 times), accounting for 33.33% of cases. When selecting the location for the second APF, the algorithm determined nine times that the integration of a second APF was not feasible due to network loading. As in the case of locating the first APF location, the impossibility of connecting the second APF to the test network was marked with red color and labeled as \"No selection\" in Figure 4b. Observing the \"No Selection\" outcomes from the results for the first and second APFs locations, only four time intervals are possible where only one APF can be positioned in the test network. This result defines a new state of the network. The results obtained for the distribution of APFs in the test network, using the algorithm for the optimal location of the APF, were performed over one day, i.e., within 24 observed time intervals, and are shown alongside the daily load diagram of the feeder in Figure 5. The determination of APF positions, considering the capabilities of the test network for setting optimal parameters of APF, will be observed at characteristic moments during specific network states. All defined network states will be examined while the optimization method is evaluated. The optimization procedure for determining the location and capacity of the APF would be assessed over five periods that occurred during one day (across 24 different network states). The results of all five test network states are explained and presented in graphs before and after the optimization process. Each column in the graphical representation represents the relative amount of each harmonic order (1-40) in each phase. In the graphical representation of the harmonic spectrum at key buses, the numerical values indicate levels of harmonics that exceed the limits specified by the EN 50160 standard.