# Energy-Water Management System Based on MPC for a Greenhouse in a Mapuche Indigenous Community
## 7 Simulation Results
### Medium-Term Climate Prediction  
To test the performance of each of the proposed models, their predictions were compared with simulated data. This was because the real greenhouse climate data were not available at the time of this experiment. The simulated data were generated with the greenhouse climate model. The performance metrics of each model are presented in Tables 3 and 4, where it can be observed that, in general, the proposed method displayed high prediction error. The high error was expected due to the complexity of climate prediction at this time scale (a sampling time of one day and a prediction horizon of 28 days), the high stochasticity of the involved variables, and the lack of data. This same problem can be observed in Figures 5 and 6. Another detail that can be observed in the tables is that in some cases, a low RMSE was paired with a high MAPE because of the limited amount of data available, resulting in very different samples at the 1-, 14-, and 28-day steps. Figure 4: One-day predictions of all the climate variables considered for short-term climate prediction in the greenhouse. In each graph, the blue line represents the real data measured at the greenhouse, and the red line shows the corresponding model output. (**a**) Temperature outside the greenhouse \(T_{ext}\): (**b**) relative humidity outside the greenhouse \(RH_{ext}\); (**c**) wind speed outside the greenhouse \(u^{ext}\); (**d**) solar irradiance outside the greenhouse \(I_{r}\). \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & & \multicolumn{3}{c}{**RMSE**} & \multicolumn{3}{c}{**MAPE (\%)**} \\ \hline Variable & Average & 1 day ahead & 14 days ahead & 28 days ahead & 1 day ahead & 14 days ahead & 28 days ahead \\ \(T_{min}\) (\({}^{\circ}\)C) & 10.896 & 3.017 & 2.972 & 2.892 & 21.3 & 20.7 & 22.6 \\ \(T_{max}\) (\({}^{\circ}\)C) & 22.728 & 10.838 & 12.808 & 12.626 & 43.8 & 53.4 & 52.5 \\ \(HR_{min}\) (\%) & 71.277 & 9.282 & 17.420 & 17.217 & 10.2 & 20.3 & 20.3 \\ \(HR_{max}\) (\%) & 97.279 & 11.441 & 17.516 & 18.316 & 9.5 & 15.4 & 16.1 \\ \(u_{2}^{p}\) (m s\({}^{-1}\)) & 0.750 & 1.177 & 0.758 & 0.419 & 46.5 & 56.4 & 54.6 \\ \(Rn\) (m\({}^{\mathrm{M}}\)) & 5.585 & 3.091 & 2.897 & 3.184 & 114.1 & 77.1 & 68.1 \\ \(ETo\) (mm) & 1.671 & 0.628 & 0.898 & 0.996 & 73.5 & 64.4 & 57.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Results for the winter data. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & & & **RMSE** & & & **MAPE (\%)** & \\ \hline Variable & Average & 1 day ahead & 14 days ahead & 28 days ahead & 1 day ahead & 14 days ahead & 28 days ahead \\ \(T_{min}\) (\({}^{\circ}\)C) & 13.4191 & 2.935 & 2.880 & 2.408 & 17.5 & 15.9 & 13.1 \\ \(T_{max}\) (\({}^{\circ}\)C) & 31.848 & 19.664 & 20.062 & 18.026 & 54.7 & 60.2 & 56.9 \\ \(RR_{min}\) (\%) & 65.007 & 20.13 & 18.231 & 13.569 & 42.8 & 24.0 & 16.4 \\ \(RR_{max}\) (\%) & 93.789 & 8.868 & 14.989 & 17.244 & 8.2 & 13.4 & 15.7 \\ \(u_{2}^{p}\) (m s\({}^{-1}\)) & 1.472 & 0.962 & 1.072 & 1.417 & 59.7 & 46.6 & 54.2 \\ \(Rn\) (\(\frac{\text{M}}{\text{m}^{2}\text{Day}}\)) & 18.030 & 6.167 & 4.631 & 4.845 & 29.9 & 25.3 & 23.7 \\ \(ETo\) (mm) & 5.395 & 2.203 & 1.937 & 1.799 & 32.6 & 30.8 & 28.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results for the summer data. Figure 5: Fourteen-day predictions of all the climate variables considered for medium-term climate prediction in the greenhouse. The data considered here correspond only to a simulation using the winter data. In each graph, the blue line represents the simulated data, and the red line shows the corresponding predictions. The predictions were output once per day. (**a**) Minimum greenhouse temperature \(T_{min}\); (**b**) maximum greenhouse temperature \(T_{max}\); (**c**) minimum greenhouse relative humidity \(RH_{min}\); (**d**) maximum greenhouse relative humidity \(RH_{max}\); (**e**) greenhouse wind speed \(u_{2}^{p}\); (**f**) net radiation in the greenhouse \(R_{n}\).