# Energy-Water Management System Based on MPC for a Greenhouse in a Mapuche Indigenous Community
## 1 Introduction  
In managing the energy-water nexus, modeling the relationships between energy and water in uncertain scenarios is essential when considering applications in small settlements that lack proper access to these resources. This is important because the uncertainties can significantly impact the optimal course of action to maintain the sustainability of the nexus. For example, climate change can generate weather conditions that produce water shortages [1], impacting overall crop yields. Additionally, these adverse climate conditions could increase aquifer water extraction to comply with the demand, thus influencing the future availability of water resources. Therefore, in these scenarios, a sustainable management system should incorporate techniques that support efficient water use, such as the use of recycling or treatment plants. Additionally, the total energy cost should be minimized. Therefore, the design of an energy-water management system for efficiently managing the available resources of small settlements should include all characteristics of the community, especially when greenhouses are established [2]. In this work, an energy-water management system (EWMS) based on model predictive control (MPC) is proposed for the Jose Painecura Huenalihueen Mapuche indigenous community. This isolated community is located in southern Chile and is affected by connection failures. Additionally, the connection costs with the central Chilean electricity distribution network are high. When evaluating the performance of an energy-water nexus, it is crucial to maximize efficiency and sustainability [3] while also meeting the demands of each system component. The physical characteristics of the system, such as the maximum volume of water storage, photovoltaic power capacity, and crop surface area, can be manipulated to solve this problem [4]. In [5], a three-layer hierarchical predictive control approach was used for wastewater management. In this approach, an upper layer performed long-term management by sending setpoints to lower layers for short-term actions. In [1], an autonomous greenhouse irrigation system based on photovoltaic power was designed, and the crop yield results were better than those in an unmanaged case. In [6], a photovoltaic irrigation system with no storage tank was considered, and the management system made decisions based on predefined demand requirements. Although the results showed that the system met the irrigation demands, the authors did not evaluate the crop yield or the system's performance in adverse climate conditions. Some solutions have also been based on nonlinear approaches due to the complexity of these systems. For example, in [7], a photovoltaic irrigation system without a water storage tank was proposed. The irrigation deficit for various crops was handled using a genetic algorithm that minimized the cost of a photovoltaic plant. Another example was provided by [8], who used a fuzzy control strategy to optimize PV irrigation for tomato crops according to the estimated water demand. Some works have also studied the possibility of integrating energy-water management systems into the overall grid. For example, in the PV system proposed in [9], with the constraint of minimizing the irrigation deficit, excess energy could be bought or sold to the overall grid, and a model was trained to minimize energy costs. Finally, in [10], a robust control approach was used to optimize the performance of a PV irrigation system connected to an overall grid, where the energy cost and irrigation deficit were minimized considering a worst-case scenario for the future price of energy from the grid. Other factors that people should consider in EWMS design include the economic optimization of the system dimensions. Here, the challenge lies in minimizing implementation and operation costs while complying with the water and energy demands of crops in different climate scenarios.