# Energy-Water Management System Based on MPC for a Greenhouse in a Mapuche Indigenous Community
## 8 Conclusions  
The proposed EWMS design presented in this work was based on an MPC for a greenhouse in a Mapuche indigenous community. The greenhouse design was based on previous information regarding greenhouses implemented in the community. The designed system aimed to maximize crop growth while minimizing water use. For this objective, the system was divided into a water management system (short term) and an energy management system (medium term). The short-term climate prediction was based on the temperature, relative humidity outside the greenhouse, and irradiance dynamics. However, difficulties in predicting wind speed were observed due to the high stochasticity of this variable. The medium-term climate prediction model, in general, displayed higher errors in its predictions than the short-term model. An important detail could be observed concerning the similarities between the dynamics of net radiation and reference evapotranspiration. This behavior might indicate that the net radiation is the most important factor in estimating evapotranspiration in this environment. The climate system used only the opening/closing of windows to control the greenhouse microclimate, as it was based on fuzzy MPC. During the simulations, the system managed to maintain the temperature inside the greenhouse in the desired range of values over 95% of the time. On the other hand, the humidity was maintained at the desired value 87% of the time in the best scenario and 67% in the worst case. Another observation was that compared with manual control, the MPCF provided significantly better temperature and humidity control, with a performance difference of over 20%, the exception being the summer temperature, for which the manual control maintained values in the desired zone only 3% more often. Given that this strategy has worked in previous greenhouses, the problem of not complying with the control objectives all the time was likely related to the model's imprecision; this was further evidenced in the fact that the manual control simulation, which attempted to replicate the farmer's strategy, displayed the same difficulties during the same periods. The results also indicated that humidity was more challenging to control than temperature when only window openness was controlled. Figure 13: Comparison between the daily irrigation \(V_{r}\) and the corresponding objective \(\bar{V}\) for different irrigation scenarios. The actual irrigation is shown by the blue points, and the corresponding objective is represented by the red lines. (**a**) Daily irrigation \(V_{r}\) and the corresponding objective \(\bar{V}\) for the EWMS irrigation case; (**b**) daily irrigation \(V_{r}\) and the corresponding objective \(\bar{V}\) for the manual irrigation case; (**c**) daily irrigation \(V_{r}\) and the corresponding objective \(\bar{V}\) for the combined irrigation case. The simulation for the EMS showed that the proposed controller could successfully provide a daily irrigation volume of 250 L in a real implementation scenario. During this process, the average instances of irrigation in the simulation results were the same as the minimum values required. The system also used solar energy to save 0.9 battery cycles compared to the case in which the farmer's irrigation pattern was simulated. The final simulation results showed that the system successfully irrigated crops while reducing water use. In both scenarios that involved the EWMS, the system achieved a relative yield of over 0.986, reflecting good crop development. The proposed controller produced this result despite the low precision of the medium-term predictions and the fact that during one simulation, one of the systems did not achieve the daily irrigation objective because of the high demand for water and the high minimum volume of stored water. Another observation was that, contrary to the daily irrigation performed by the community, the system did not irrigate the greenhouse on certain days.