## 8 Comparison between Centralized MPC and the Genetic Algorithm Approach
The weight on \(T(M)\) is bigger in order to emphasize the set-point following condition, while the same value for \(Q_{y}\) and \(Q_{u}\) have been chosen in order to obtain a good trade-off between the energy used and the smoothness of the control variable (note that a too aggressive control signal might emphasize the uncertainties of the model and therefore some constraints can be violated in practice). The formulation (7) is similar to the standard Quadratic Programming (QP) problem, and can be easily rewritten as:  
\[ \begin{split}&\min_{u}u^{T}Hu+h^{T}u;\\ &\text{subject to }Fu\leq b\end{split}  \tag{9}\]  
where \(H\), \(h\), \(F\) and \(b\) are constant matrices or vectors which defines the problem and the constraints. Given that many of the states \(x\) of the system are unknown, a state observer of the system is required in order to develop the MPC algorithm. The gain matrix \(L\) is selected, based on the eigenvalues of the state matrix, in order to obtain the dynamics of the observer faster than the system dynamics. The simulations that have been carried out to compare the MPC to the genetic algorithm-based strategy are related to the building described in Section 5 when radiators are employed as HVAC system. The first comparison has been done by considering December 10. The results related to two different rooms (namely room 5 and 7) are presented in Figures 15 and 16. The energy consumption of each subsystem and of the total building is shown in Table 9. It is worth stressing that the genetic algorithm set-point signal has been obtained based on the weather conditions of the day before, while the MPC algorithm actually implements the weather conditions of the current day. In this specific case, the energy consumption of the system when it is controlled by the centralized MPC is only 2.64% less with respect to the genetic algorithm case. Figure 15: One day simulation, 10 December, for room 5 (ARMAX model). **Top**: user defined set point \(\tilde{T}_{i}\) (red line), optimized set-point ramp signal \(\tilde{T}_{i}\) (blue line), temperature evolution \(T_{i}\) in case of genetic algorithm set-point signal (green line), temperature evolution \(T_{i}\) in case of MPC (light blue line). **Bottom**: resulting inlet water flow in case of ramp set-point signal (blue line) and in case of MPC (green line). \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Room**} & **GA Performance Index** & **MPC Performance Index** \\  & **Value** (4) **[kg/h]** & **Value** (4) **[kg/h]** \\ \hline
1 & 3317 & 2954 \\
2 & 2048 & 2047 \\
3 & 1896 & 1979 \\
4 & 2173 & 2328 \\
5 & 2168 & 2020 \\
6 & 11,381 & 10,641 \\
7 & 6683 & 6937 \\ Total (J) & 29,667 & 28,905 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Performance index value (4) for each room when both the genetic-based optimization and MPC are applied to the system. In this case, the GA optimization is based on the weather conditions of the day before (December 9) while the MPC uses the weather condition of the day after (10 December)). Figure 16: One day simulation, 10 December, for room 7 (ARMAX model). **Top**: user defined set point \(\hat{T}_{i}\) (red line), optimized set-point ramp signal \(\hat{T}_{i}\) (blue line), temperature evolution \(T_{i}\) in case of genetic algorithm set-point signal (green line), temperature evolution \(T_{i}\) in case of MPC (light blue line). **Bottom**: resulting inlet water flow in case of ramp set-point signal (blue line) and in case of MPC (green line). Even if the GA imposes that the set-point changes with a ramp signal, which has been chosen in order to reduce the convergence time of the algorithm, the performance obtained are comparable with respect to the MPC case. The resulting energy consumption of the Genetic Algorithm case is slightly higher than the MPC; however, the methodology is simpler and computationally lighter.