## 5 Results  
Figure 6 shows two days of operations for the EWMS, where the generation and purchase of energy are seen in the positive semi-plane of the energy, while the consumption of the community, battery charging, and energy sale are along the negative axis. During the daytime, consumption is  
Figure 5: Aquifer recharge estimation (m\({}^{3}\)) for three scenarios: baseline scenario \(S_{0}\) and scenarios \(S_{1}\) and \(S_{2}\), which consider 15% and 30% decreases in rainfall, respectively. Measured rainfall (mm) for \(S_{0}\) is also shown. supplied primarily through photovoltaic generation, with excess energy stored in the battery bank. At night, power is supplied from the battery bank and through the purchase of energy. The dispatch of pumps for water storage is generally distributed throughout the day, along with the excess photovoltaic energy. There is a concentration of pumping action at the end of the day, even though it is necessary to purchase power or discharge the battery bank. This is because the established schedule for irrigation and the capacity of the storage ponds often does not satisfy the daily water demand. Therefore, the EWMS must perform simultaneous pumping and irrigation. Figure 7 shows the individual yields by crop type, minimum expected yields, and water availability based on the rainfall and aquifer recharge. The figure shows the dispatch for all pumps in compliance with the irrigation references using the proposed EWMS-based MPC. Before and immediately after the recharge of the aquifer is predicted to be insufficient, the WMS requires considerably more water for irrigation to cushion the effects of water scarcity on crops. It can be observed that when irrigation occurs, the WMS is useful at maintaining the relative crop yield. When insufficient irrigation causes a decrease in the relative yield, it is still useful in reducing the slope of the yield loss. The pea crop has a higher yield than the established limit, as this crop is planted before the others and has 100 days between planting and harvesting. This avoids times during the year with lesser rainfall. Each period of low recharge impacts the relative crop yields, which eventually exhausts the available water that can be absorbed by the plants and results in a loss of yield or the death of the plant. Figure 6: EWMS operations for microgrids for the baseline scenario (\(S_{0}\)). The scenarios with decreased rainfall of 15% and 30% (\(S_{1}\) and \(S_{2}\), respectively) are shown in Figures 8 and 9. Scenarios \(S_{1}\) and \(S_{2}\) present similar irrigation actions to those of \(S_{0}\) (normal rainfall). There is no irrigation when aquifer recharge is not expected based on the weather forecast. In both cases, similar final yields are observed for all crops, highlighting the lower yield of the pea for scenarios \(S_{1}\) and \(S_{2}\) relative to \(S_{0}\). The potato yield for scenario \(S_{2}\) is slightly lower. This is explained by the lower rainfall and the consequent lower daily available water for extraction. The main differences occur in the daily irrigation peaks, which are lower with less rainfall because of the decreased daily water availability for extraction, as caused by the aquifer's slow recharge. Table 3 lists the operational costs as computed using the EMS objective functions in Equation (12) and the profit obtained when computing the WMS objective functions with Equations (15a) and (15b), as well as the irrigation volumes, for all scenarios. In the scenarios with decreased rainfall (less available water), the higher operating costs of the EMS indicate that the irrigation water requirements cannot be met, which generates high penalties in the objective function. Furthermore, the profit decreases with less rainfall because the crop yields also decrease. Table 3 indicates that scenarios \(S_{1}\) and \(S_{2}\) have lower water extractions from the aquifer, equivalent to 6% and 4.6%, respectively.