## 4 Results
### Numerical Results  
To solve each of the objective functions, we examined common scenarios for each of the functions. Figure 8 shows the proposed study system. It was concluded that different scenarios could be used to optimize the location and size of distributed generation resources in different conditions:  
* Scenario 1: Base state;
* Scenario 2: Optimal location of one SPL-CHHP and three SMs;  
Figure 8: The proposed study system.  
Figure 7: Charge/discharge pattern.  
The converged power of CHHP in the different scenarios is illustrated in Figure 14. The base state means the state without the presence of CHHP and SM in the distribution system network. At first, simulations were carried out in the four mentioned scenarios and for two modes (with and without a DR program). The results are given in Table 3. Figures 15 and 16 show the voltage profile and power loss, respectively, in the different scenarios.  
Figure 14: Converged power of CHHP.  
Figure 12: Sun irradiation prediction using LSTM.  
Figure 13: Wind velocity prediction using LSTM.  
In the secondary simulations, for each of Scenarios 2, 3, and 4, three modes were proposed.  
* Mode 1: location of the CHHP in single power factor mode, without locating the SMs;
* Mode 2: location of the CHHP in the adaptive power factor mode, without the presence of SMs;  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Scenario**} & \multirow{2}{*}{**Case**} & \multirow{2}{*}{**Minimum**} & **Power Loss** & **Total Cost** & **Optimal Site** & \multirow{2}{*}{**Optimal pf**} \\  & & **Voltage (p.u.)** & **Reduction** & **(*106)** & **and Size of DGs** & \\ \hline \multirow{2}{*}{Scenario 1} & \multirow{2}{*}{Base Mode} & 0.9038 & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} & \multirow{2}{*}{-} \\  & & B(18) & & & & \\  & & 0.9276 & & & & \\  & Case 1 & B(33) & 44.07 & 1.052 & 1.875(B8) & 1 \\ Scenario 2 & & B(33) & 60.6 & 1.048 & 1.889(B8) & 0.85(B8) \\  & & 0.9586 & & & & \\  & Case 1 & B(31) & 58.68 & 1.030 & 0.905(B13) & 1.00(B13) \\ Scenario 3 & & 0.9724 & & & & \\  & Case 2 & B(25) & 80.6 & 1.012 & 0.808(B16) & 0.84(B16) \\  & & 0.9502 & & & & \\  & & B(31) & 61.77 & 1.001 & (B14)0.799 & 1.00(B25) \\ Scenario 4 & & 0.9475 & & & & 1.00(B31) \\  & Case 2 & B(25) & 86.33 & 0.985 & 0.9(B25) & 0.847(B25) \\  & & & & & & 0.85(B30) & 0.378(B30) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Results in minimize total cost.  
Figure 16: Power loss in the different scenarios.  
Figure 15: Voltage profile.  
* Mode 3: simultaneous location of CHHP in adaptive power factor mode and SMs.  
Table 4 illustrates the results for the objective function of the voltage profile improvement. As can be seen, with increasing number of DGs and penetration of load response programs in the distribution networks, the voltage range in different buses was boosted and had a positive effect on the distribution system losses. Nonetheless, as we expected, the loss reduction in the first objective function in Scenario 4, Mode 3 was greater than that in the second objective function in the same mode. The reason for this is that the objective functions are different.