*5.3. Comparison of Peak Demand*

In this work, the peak demand was considered in terms of the active power flowing at the slack bus. The higher peak demand represents the higher power flow in the transmission line, so the transmission line of the distribution network needs to be able to support the high power flow in the transmission line. However, if the peak demand can be reduced, the power flow in the transmission line is also decreased. This results in a longer time to improve the transmission line for supporting the higher peak demand in the future. Figure 5 compares the peak demand provided by the base case and presents how the peak demand can be improved after installing a BESS by using GA and PSO. It can be seen in Figure 5 that power flowed in both directions (into and out from the network) for the base case. The maximum active power that was equal to 2.71 MW at 10 p.m. flows into the network, and the maximum active power which was equal to −1.05 MW at 1 p.m. flowed out from the network. After the BESS installation, the active power flow had only one direction (only positive value), which flowed into the distribution network for all 24 h for both GA and PSO. The maximum active power provided by GA was 1.10 MW at 10 a.m. and 1.04 MW at 7 p.m. for PSO, which is depicted in Figure 5. Thus, the BESS installation by using PSO could reduce the peak demand more than that of the GA.

**Figure 5.** Peak demand profile at the slack bus.
