## 4 Mathematical Implementation of the Problem
### Technical and Economical Constraints
#### HHW constraints
In this building, the best performance is related to the DE method, which has been able to reduce pollution by about 60%, relative to the air pollution index. In general, the DE method has the best performance in terms of pollution reduction, whereas the PSO method has the weakest performance. The electrical and thermal MCP values obtained from the simulation using various methods are shown in Figure 11a,b respectively. For better analysis, the 24-h simulation interval is divided into four 6-h intervals. As shown in Figure 11a, all of the optimization methods have succeeded in reducing the MCP, so that for all time periods, the calculated MCP was lower than the MCP prediction. According to Figure 11a, in the first time interval (00:00-06:00), the best performance has been achieved by the DE method. In this interval, the BAT method has had a weaker performance than the other two methods. The DE method compared with predicted BAT and MCP resulted in 5% and 33% reduction of MCP, respectively. In the second period (18:00-12:00), the best performance was related to the PSO method. In this interval, the lowest MCP reduction was related to the BAT method. The PSO method has a better performance than that of the BAT, which yielded 22%. In addition, the PSO approach compared to the MCP prediction has a 44% decline. In the third period (12:00-18:00), the PSO method has been able to maintain the MCP minimization trend, which is 12% higher than the DE method, which has the lowest reduction, and 39% better than the MCP prediction. In the last period (from 18:00-24:00), the best performance was related to DE. In this range, DE has shown the best performance while the BAT has the weakest performance. DE was 28% and 47% lower than predicted by BAT and MCP, respectively. In general, the PSO and DE methods, with less than 2% difference in performance, have displayed the best results while BAT yielded the weakest. Thermal MCP is shown in Figure 11b. As seen in the first interval, the DE method had the best performance compared to PSO and BAT, so that the DE method was 49% better than the PSO, the latter having the weakest performance. In the second interval, the best performance was related to the BAT method and the weakest associated with the PSO, with a functional difference of about 55%. In the third period, the weakest and strongest performances were related to the BAT and DE methods, respectively. During this time interval, the DE method has shown 38% better performance than the BAT. In the last interval, i.e., the fourth interval, as in the previous interval, the strongest and weakest methods were DE and BAT, respectively. In this range, the DE method is 25% better than BAT. In general, as shown in Figure 11b, the best performance for decreasing the thermal MCP was related to the DE method. The convergence characteristics of the proposed algorithms were compared with each other, as demonstrated in Figure 12. As shown in this figure, each algorithm was executed for 100 iterations as an accuracy validation criterion. This figure indicates that the proposed algorithm based on the BAT method outperforms the other optimization techniques in convergence speed; however, the proposed algorithm based on DE method achieved a better performance from optimality of objective function point of view. The obtained maximum profit for DE and BAT methods are \(\mathcal{E}\)8.5 and \(\mathcal{E}\)7.8, with the corresponding CPU times of 8.085 s and 7.96 s, respectively. According to the results in Figure 11a,b, the most successful method for reducing electric and thermal MCP is the DE method. According to the use of several optimization methods, the standard deviation, minimum and maximum profits and average price of each method (in 50 epochs) are shown separately in Table 1.  
Figure 11: Electrical/thermal MCP profile at a time interval under 24-h operation by different optimization methods. Figure 12: Convergence characteristics of the proposed algorithms.