Semiarid regions are facing overexploitation of groundwater resources to meet irrigation needs. Monitoring the water-energy nexus allows for optimal management of extracted water volumes and consumed energy. The Nabeul region of Tunisia was selected where 14 farmers, whose wells were equipped with smart electricity and water meters (SWEMs), for instant monitoring of pumped water volumes and the electrical energy required for irrigation. Monthly data over a period of eight months were used to study the variations in water volumes and active energy. The analysis of variance classified farmers into four groups based on water volumes and five groups based on active energy. Spatial variability analysis using kriging showed that the northeast zone is the most solicited in terms of water pumping and energy consumption with water volume exceeding 4,000 m3/month and active energy reaching 2,500 kWh/month. The prediction of energy based on water volume using machine learning techniques such as random forest and support vector machine was successfully conducted. The tools generated by the methodology were applied to a chosen case in the region to estimate active energy and validate the results obtained. The implemented framework allows for better management of groundwater resources for irrigation.

  • Irrigation practices require rational management in semiarid regions such as Tunisia.

  • Water supply from groundwater and the energy needed to meet irrigation demands were examined through real-time monitoring.

  • A robust framework integrating combined techniques, including statistical analysis, kriging, and machine learning, has been established to effectively manage water and energy resources in the studied region.

In arid and semiarid regions like Tunisia, agriculture encounters irrigation water management challenges as observed in many regions globally, especially in the Middle East and North Africa (MENA) region (Mohamed et al. 2023). These challenges are exacerbated by climate change projections, which are expected to have adverse effects on water resources across the Western Mediterranean region (IPCC 2023). Population growth and prolonged agricultural seasons will further strain water resources, particularly in northeastern Tunisia, where dwindling water supplies are anticipated due to increased aridity, marked by reduced mean annual precipitation and intensified heat spells leading to greater evapotranspiration (ETP) (Schilling et al. 2020). To address the growing disparity between water supply and demand, Tunisia heavily relies on unsustainable pumping of groundwater resources. This overexploitation has resulted in significant declines in groundwater tables, raising issues of groundwater quality and soil salinization (Hamed et al. 2018).

These water management challenges pose a significant threat to Tunisia's rural areas, undermining food security, economic stability derived from agriculture, and overall socioeconomic development. Agriculture holds a prominent position in Tunisia's economy. Particularly, the Cap Bon area (Nabeul region) immediately requires suitable regulatory frameworks and socioeconomic strategies to promote sustainable agriculture (El Ayni et al. 2013). This necessitates a participatory approach that engages stakeholders effectively to tackle regional water sustainability challenges. Adopting agricultural water management strategies based on the farm-level water-energy nexus presents opportunities for robust stakeholder involvement in data-driven sustainable water resource management processes. In response to the steady rise in diesel prices, a significant shift has occurred among Tunisian farmers from diesel-powered pumps to electric alternatives for groundwater extraction in irrigation practices. The adoption of electric pumps offers several advantages, including significantly lower pumping costs compared to diesel pumps – approximately three times less. In addition, electric pumps entail reduced operational and maintenance expenses while affording greater flexibility in irrigation scheduling and duration management (Aliyu et al. 2018).

Statistical classification of farmers based on analysis of variance (ANOVA) according to water volume and energy provides a valuable framework for understanding agricultural water-energy dynamics. ANOVA enables the identification of significant differences in water volume and energy consumption among different groups of farmers, facilitating targeted interventions for resource management (Su et al. 2021; Khara & Ghuman 2024). By analyzing variations in water volume and energy usage across various farmer categories, ANOVA allows for the classification of farmers into distinct groups based on their irrigation practices and energy utilization patterns. This classification can reveal insights into the efficiency of water and energy usage within agricultural systems and help identify areas for improvement. Through ANOVA-based classification, policymakers and agricultural stakeholders can tailor interventions to address the specific needs of different farmer groups. For instance, farmers with high water and energy consumption levels may benefit from technology adoption or efficiency enhancement programs to reduce resource usage and improve sustainability (Koutridi & Christopoulou 2023). Moreover, ANOVA-based classification can inform policy decisions aimed at incentivizing sustainable agricultural practices. By identifying correlations between water volume, energy consumption, and agricultural productivity, policymakers can design targeted policies to promote resource-efficient farming techniques and mitigate environmental impacts (Jabbari et al. 2023).

Mapping of water volume and energy among farmers involves spatially interpolating data to create continuous surface maps representing these variables. Kriging utilizes statistical methods to estimate values at unsampled locations based on nearby observations, providing insights into spatial patterns and variations in water and energy distribution. By generating these maps, stakeholders can visualize hotspots of water and energy usage, aiding in targeted resource allocation and management strategies (Li & Heap 2011). This approach facilitates informed decision-making for sustainable agriculture, enabling efficient utilization of water and energy resources while promoting environmental stewardship and economic viability among farmers (Karami et al. 2018).

Machine learning enhances water and energy consumption management by predicting irrigation requirements, monitoring groundwater, and optimizing resource allocation, leading to more efficient and sustainable agricultural practices (Umutoni & Samadi 2024). A ‘machine learning technique’ refers to a specific method or algorithm used to train models in machine learning (Sarker 2021). These techniques enable computers to learn from data, identify patterns, and make decisions or predictions. Examples include neural networks, decision trees, support vector machines (SVMs), and clustering algorithms. Each technique is suited to different types of problems and data structures (Sarker 2021).

Using machine learning techniques like random forest (RF) and SVM models to analyze water volume and energy among farmers offers predictive insights into resource usage patterns. According to Araújo et al. (2023), RF leverages ensemble learning to assess the importance of various factors influencing water and energy consumption, providing robust predictions. SVM, on the other hand, excels in identifying complex relationships between variables, enhancing accuracy in forecasting (Dey et al. 2024). By employing these machine learning techniques, stakeholders can anticipate future resource demands and implement proactive measures for sustainable management. This approach empowers farmers and policymakers with data-driven strategies to optimize resource allocation, foster resilience, and mitigate environmental impacts in agricultural practices.

The objectives of this study are (i) establishing a framework for the analysis of real-time data on water volumes and energy consumption among farmers in the region; (ii) classifying farmers based on their water and energy consumption patterns; (iii) investigating the spatial variability of water volumes and active energy in the region; and (iv) estimating active energy consumption based on water volumes pumped from groundwater sources.

Study region

The Chiba region falls under the Korba delegation, situated in the Nabeul governorate within Tunisia's Cap Bon. It features a semiarid climate, characterized by mild winters and hot, dry summers, notably influenced by its eastern border along the Mediterranean Sea. Within the study area, the predominant soil cover consists of light to medium texture soils, sandy loamy in composition, with favorable porosity conducive to various crop types. Notably, the region exhibits a noteworthy potential ETP rate, reaching 1,100 mm/year.

In this region, 14 farmers who irrigate their crops with the same groundwater and have similar characteristics in terms of area, crop type, and soil were selected to equip their wells with smart electricity and water meters (SEWMs) (Figure 1). SEWM presents a cost-effective solution for monitoring water abstraction, tracking energy usage, facilitating communication with a control center, timekeeping, and controlling pump operation – all through a single device (Jahromi et al. 2014).
Figure 1

Locations of the 14 farmers (F1–F14) selected within the study area in the Nabeul region of Tunisia.

Figure 1

Locations of the 14 farmers (F1–F14) selected within the study area in the Nabeul region of Tunisia.

Close modal

Methodology

The methodology of this research, as depicted in Figure 2, encompasses several key steps leveraging monitoring data recorded by SEWM of water volumes and active energy for each farmer within the study area:
  • Data preprocessing: Gather and compile monitoring data from SEWM meters for water volumes and active energy across the study area.

  • Statistical classification: Assess the significance of the recorded values (water volume and active energy) among different farmers using statistical analysis techniques like ANOVA.

  • Spatial mapping: Map the distribution of irrigation water volumes and required energy across the study region to analyze spatial variability.

  • Machine learning modeling: Develop predictive models to understand the relationship between energy consumption and water volume for irrigation purposes.

  • Utilize feature engineering to extract relevant features from the data and optimize model performance and validate the models using cross-validation techniques to ensure robustness and generalizability.

Figure 2

Research methodology flowchart.

Figure 2

Research methodology flowchart.

Close modal

Statistical and geostatistical approaches

Analysis of variance

ANOVA is a statistical technique used to compare means among three or more groups to determine if there are statistically significant differences between them. It operates under the assumption that the samples are drawn from populations that follow a normal distribution with equal variances. ANOVA assesses whether there are any significant differences in the means of the groups by analyzing the variance within and between the groups. ANOVA was performed with the Tukey test at a significance level of 95% to compare water volume and active energy between the 14 farmers. The Tukey test, or Tukey's honest significant difference test, is a post hoc analysis used after ANOVA to identify which groups in a dataset differ significantly. Groups that share the same letter in the results are not significantly different from each other, indicating they belong to the same statistical subset.

Kriging

Kriging is a geostatistical interpolation technique used for spatial mapping, particularly in situations where data points are irregularly distributed across a geographic area. It estimates values at unsampled locations by considering the spatial correlation or autocorrelation between nearby data points (Li & Heap 2014). Kriging assumes that the spatial correlation structure follows a linear model, where the degree of correlation decreases with increasing distance between points. In Kriging, a variogram is computed to model the spatial correlation. This variogram quantifies the degree of spatial dependence as a function of distance and is used to predict values at unmeasured locations. The linear model within kriging incorporates variogram parameters to estimate values at unsampled locations based on weighted averages of neighboring data points (Alcaras et al. 2022). Surfer Golden Globe software is a popular tool for geospatial analysis and visualization that includes kriging functionality. With Surfer, users can create variograms, perform kriging interpolations, and generate contour maps or surface plots to visualize the spatial distribution of data (Štular et al. 2023). Surfer's user-friendly interface and comprehensive features make it a valuable tool for researchers, engineers, and geospatial professionals involved in mapping, exploration, and environmental analysis. By leveraging kriging within Surfer, users can produce accurate and informative maps that aid in decision-making processes across various industries, from environmental monitoring to resource management. Surfer software was used to generate maps of water volumes and active energy each month using ordinary kriging with a linear model.

Machine learning

Machine learning techniques offer a powerful framework for modeling irrigation water volume and energy consumption, capable of capturing complex relationships and providing accurate predictions. Two machine learning techniques were used to estimate the active energy from the water volumes extracted from groundwater resources in the region of study. Calibration and validation processes were performed using a 50–50% ratio of the collected data (Joseph 2022).

Random forest

RF is an extension of regression trees that leverages the power of ensemble learning, combining multiple individual regression trees to improve predictive accuracy and robustness. The theoretical foundation of RF builds upon the concepts of bagging and random feature selection. Bagging involves repeatedly sampling subsets of the training data with replacement and fitting a regression tree to each subset (Khan et al. 2024). This process introduces diversity among the trees, reducing the variance of the ensemble model. RF further enhances diversity by selecting a random subset of predictor variables at each split when constructing each tree. In the context of water volume and energy modeling, RF offers several advantages. First, it can handle a larger number of predictor variables and complex interactions more effectively, allowing for a more comprehensive representation of the underlying relationships in the data. Second, RF automatically assesses variable importance, enabling insights into which predictors contribute most significantly to predicting water volume and energy dynamics (Brunner et al. 2018).

Support vector machine

SVMs are a popular machine learning method used for classification and regression tasks, including the modeling of water volume and energy dynamics. The theoretical foundation of SVMs lies in the concept of finding the optimal hyperplane that maximally separates data points in a high-dimensional space, while also minimizing classification error or regression error. For water volume and energy modeling, SVMs can effectively capture nonlinear relationships between predictor variables. By finding the optimal hyperplane in the transformed feature space, SVMs can provide accurate predictions even in cases where the relationships are nonlinear or non-monotonic (Ahmed et al. 2024).

Statistical evaluation of the modeling results

The machine learning technique predictions are compared against the actual energy consumption values in both the calibration and validation processes on a ratio of 50–50% data between the two aforementioned processes. In this study, evaluation metrics, namely, root mean squared error (RMSE) and R-squared (R2) or the coefficient of determination, are computed to quantify the models' predictive capabilities and assess their effectiveness (Harrou et al. 2023).

Water volume and active energy monitoring data

Water volume

The graphical representation depicted in Figure 3 delineates the intricate fluctuations observed in the quantities of groundwater extracted across the study area on a monthly basis. Upon examination of the measured curves, several notable patterns become apparent:
  • A distinctive pattern emerges with two prominent peaks discernible in the data, occurring consistently in the months of October and February, irrespective of the individual farmers involved. These peaks likely correspond to periods of heightened demand for water, possibly coinciding with critical stages of crop growth or specific agricultural activities.

  • According to the distribution of water volume values among the farmers, it becomes evident that Farmers F11 and F14 consistently report the highest volumes of extracted groundwater. This observation may reflect differences in agricultural practices, land management techniques, or perhaps the land surface undertaken by these particular farmers.

  • The remaining farmers generally exhibit lower water volume values in comparison, indicating variations in resource utilization or agricultural needs across the region. However, it is noteworthy that Farmers F5, F7, and F9 stand out as exceptions, showcasing intermediate water volume values. This suggests a nuanced interplay of factors influencing water usage among different agricultural stakeholders.

  • A distinct decrease in the practice of irrigation is noticeable during the months of November, December, and January. This temporal trend may be attributed to seasonal variations in precipitation levels, crop requirements, or possibly regulatory constraints imposed on water usage during certain periods.

Figure 3

Temporal variation of monthly water volume extracted from groundwater for each farmer.

Figure 3

Temporal variation of monthly water volume extracted from groundwater for each farmer.

Close modal

Active energy

The data presented in Figure 4 reveals a synchronicity between the monthly fluctuations in energy consumption and those in water volumes across all farmers. This alignment suggests a close interrelation between the usage patterns of these vital resources within the agricultural context. Similar to the observed patterns in water volume extraction from groundwater, the peaks in energy consumption coincide notably with the months of October and February. These peaks likely signify periods of heightened activity or specific agricultural operations that necessitate increased energy inputs, mirroring the demands placed on water resources during these times.
Figure 4

Temporal variation of monthly energy consumption for each farmer.

Figure 4

Temporal variation of monthly energy consumption for each farmer.

Close modal

A parallel decline in energy consumption is evident during the months of November, December, and January, echoing the observed decrease in irrigation practices during this period. This temporal consistency in both energy and water consumption patterns underscores the seasonal nature of agricultural activities and the corresponding fluctuations in resource utilization throughout the year.

Statistical classification of the farmers

In Figure 5, the box-and-whisker plots provide a comprehensive view of the distribution of water volumes and energy consumption across farmers in the region. The similarity in the general appearance of the plots for both water volumes and active energy among the farmers indicates a certain level of consistency in their usage patterns. Farmers F11 and F14 exhibit the greatest variation in both water volume and energy consumption. This variability highlights the need for targeted interventions or further investigation into the practices and circumstances driving these fluctuations. In fact, 75% of the values fall between 4,000 and 12,000 m3 for water volumes and between 1,500 and 5,000 kWh for energy. Conversely, Farmers F3, F8, F10, F12, and F13 display the smallest variation in water and energy consumption. For the remaining farmers, the variation in water volumes and energy consumption falls within a moderate range. The variation ranges between 500 and 1,500 m3 for water volumes and between 500 and 1,000 kWh for energy for 75% of the measured data.
Figure 5

Box-and-whisker plots for the measured water volume (a) and active energy (b) for each farmer.

Figure 5

Box-and-whisker plots for the measured water volume (a) and active energy (b) for each farmer.

Close modal

Further analysis using the ANOVA and Tukey test methods, as presented in Table 1, offers insights into the variations among farmers regarding water volumes and energy consumption in the region.

Table 1

Results of ANOVA utilizing Tukey's test to assess the significance of the measured of water volume and active energy across the farmers in the region

Water volume (m3)
Active energy (kWh)
FarmerMean ± SEMean ± SE
F1 1,498.70 ± 756.06 AB 674.61 ± 316.16 AB 
F2 2,349.11 ± 816.64 AB 1,041.71 ± 341.49 AB 
F3 185.89 ± 756.06 092.19 ± 316.16 
F4 3,305.15 ± 707.23 1,035.82 ± 295.74 AB 
F5 3,360.57 ± 756.06 1,523.52 ± 316.16 AC 
F6 1,447.06 ± 707.23 AB 507.88 ± 295.74 
F7 1,572.91 ± 707.23 AB 527.19 ± 295.74 
F8 135.02 ± 894.59 164.53 ± 374.08 
F9 1,928.62 ± 707.23 AB 879.24 ± 295.74 BC 
F10 563.13 ± 816.64 578.51 ± 341.49 BC 
F11 7,878.10 ± 707.23 3,760.52 ± 295.74 
F12 271.49 ± 707.23 198.12 ± 295.74 
F13 102.08 ± 707.23 045.22 ± 295.74 
F14 7,034.79 ± 707.23 2,299.29 ± 295.74 
Water volume (m3)
Active energy (kWh)
FarmerMean ± SEMean ± SE
F1 1,498.70 ± 756.06 AB 674.61 ± 316.16 AB 
F2 2,349.11 ± 816.64 AB 1,041.71 ± 341.49 AB 
F3 185.89 ± 756.06 092.19 ± 316.16 
F4 3,305.15 ± 707.23 1,035.82 ± 295.74 AB 
F5 3,360.57 ± 756.06 1,523.52 ± 316.16 AC 
F6 1,447.06 ± 707.23 AB 507.88 ± 295.74 
F7 1,572.91 ± 707.23 AB 527.19 ± 295.74 
F8 135.02 ± 894.59 164.53 ± 374.08 
F9 1,928.62 ± 707.23 AB 879.24 ± 295.74 BC 
F10 563.13 ± 816.64 578.51 ± 341.49 BC 
F11 7,878.10 ± 707.23 3,760.52 ± 295.74 
F12 271.49 ± 707.23 198.12 ± 295.74 
F13 102.08 ± 707.23 045.22 ± 295.74 
F14 7,034.79 ± 707.23 2,299.29 ± 295.74 

For water volumes, the absence of significant differences among four distinct farmer groups indicates a level of consistency in groundwater usage patterns. This finding suggests that these groups may employ similar irrigation practices or have comparable access to groundwater resources, thereby minimizing disparities in water consumption. Similarly, the lack of significant differences in electrical energy consumption among the five farmer groups highlights a degree of uniformity in energy usage across these categories. However, a significant difference between Farmers F11 and F14 in terms of active energy usage is notable.

Spatial variability of water volume and active energy

The implementation of ordinary Kriging with a linear model stands as a pivotal technique in delineating the nuanced spatial fluctuations observed in both groundwater extraction volumes and active energy across the study area. Through this method, the intricacies of these dynamic systems are elucidated, aiding in a comprehensive understanding of the region's hydrological and energy landscapes. Table 2, detailing the parameters pertinent to the mapping process, underscores the meticulousness of the analysis, further bolstered by the utilization of cross-validation techniques to ensure the robustness of the findings. Notably, the consistently low standard error and coefficient of variation across all months attest to the reliability of the generated maps. Moreover, the discernibly high values of the slope within the linear model underscore the significant trends captured within the dataset. Interestingly, the positive kurtosis coefficient values observed across all maps and months imply a degree of peakedness in the distributions, while the presence of negative skewness values suggests a slight asymmetry toward lower values in the data distribution. This comprehensive evaluation not only enhances our comprehension of the spatial dynamics at play but also highlights the utility of ordinary kriging in unraveling complex environmental phenomena.

Table 2

Geostatistical parameters for the evaluation of data during the grid generation and the cross-validation process for water volume (V) and active energy (E)

SlopeGrid data
Cross validation
SECVSkewnessKurtosisSECVSkewnessKurtosis
V (m3September 2020 2.83 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
October 2020 1.67 × 108 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
November 2020 1.16 × 108 6.08 × 10−4 0.12 −0.39 1.53 1.14 × 10−2 3.80 × 10−3 −0.30 1.20 
December 2020 8.56 × 106 2.47 × 10−3 0.39 0.95 2.78 1.12 × 10−2 3.44 × 10−3 −0.60 1.80 
January 2021 9.96 × 106 1.97 × 10−3 0.33 0.62 2.07 5.21 × 102 8.51 × 10−3 0.20 1.30 
February 2021 1.48 × 108 1.62 × 10−3 0.31 1.25 3.90 1.12 × 10−2 3.57 × 10−3 −0.60 1.70 
March 2021 4.65 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
April 2021 6.53 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
E (kWh) September 2020 9.78 × 106 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 3.68 × 10−3 −0.35 1.36 
October 2020 3.40 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 3.68 × 10−3 0.76 3.00 
November 2020 2.53 × 107 6.08 × 10−4 0.10 −0.40 1.50 1.14 × 10−2 3.80 × 10−3 1.56 4.69 
December 2020 1.25 × 106 2.47 × 10−3 0.40 0.90 2.80 1.12 × 10−2 3.44 × 10−3 0.55 1.50 
January 2021 1.53 × 106 1.97 × 10−3 0.30 0.60 2.10 1.19 × 10−2 3.63 × 10−3 −0.52 1.51 
February 2021 2.40 × 107 1.62 × 10−3 0.30 1.30 3.90 1.12 × 10−2 3.57 × 10−3 0.68 2.18 
March 2021 1.12 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 0.94 0.96 2.36 
April 2021 1.24 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 0.85 1.35 3.86 
SlopeGrid data
Cross validation
SECVSkewnessKurtosisSECVSkewnessKurtosis
V (m3September 2020 2.83 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
October 2020 1.67 × 108 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
November 2020 1.16 × 108 6.08 × 10−4 0.12 −0.39 1.53 1.14 × 10−2 3.80 × 10−3 −0.30 1.20 
December 2020 8.56 × 106 2.47 × 10−3 0.39 0.95 2.78 1.12 × 10−2 3.44 × 10−3 −0.60 1.80 
January 2021 9.96 × 106 1.97 × 10−3 0.33 0.62 2.07 5.21 × 102 8.51 × 10−3 0.20 1.30 
February 2021 1.48 × 108 1.62 × 10−3 0.31 1.25 3.90 1.12 × 10−2 3.57 × 10−3 −0.60 1.70 
March 2021 4.65 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
April 2021 6.53 × 107 7.15 × 10−4 0.16 −0.21 1.29 1.07 × 10−2 3.68 × 10−3 −0.40 1.40 
E (kWh) September 2020 9.78 × 106 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 3.68 × 10−3 −0.35 1.36 
October 2020 3.40 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 3.68 × 10−3 0.76 3.00 
November 2020 2.53 × 107 6.08 × 10−4 0.10 −0.40 1.50 1.14 × 10−2 3.80 × 10−3 1.56 4.69 
December 2020 1.25 × 106 2.47 × 10−3 0.40 0.90 2.80 1.12 × 10−2 3.44 × 10−3 0.55 1.50 
January 2021 1.53 × 106 1.97 × 10−3 0.30 0.60 2.10 1.19 × 10−2 3.63 × 10−3 −0.52 1.51 
February 2021 2.40 × 107 1.62 × 10−3 0.30 1.30 3.90 1.12 × 10−2 3.57 × 10−3 0.68 2.18 
March 2021 1.12 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 0.94 0.96 2.36 
April 2021 1.24 × 107 7.15 × 10−4 0.20 −0.20 1.30 1.07 × 10−2 0.85 1.35 3.86 

V: Water volume; E: Active energy; SE: Standard error; CV: Coefficient of variation.

Maps of water volume

The maps in Figure 6 depict the fluctuations in the amounts of groundwater extracted for irrigation, as measured from data collected from 14 farmers within the region. As delineated by Figure 6, the northeastern sector of the region exhibited the highest levels of water volume utilized for irrigation purposes. Notably, a distinct red zone signifies water quantities surpassing 4,000 m3, a trend observed consistently across all months. Furthermore, this red zone extends progressively closer to the central area during the months of January, February, and March, aligning with the peaks recorded by the SEWM. Conversely, groundwater usage for irrigation is notably lower in the northwest region. Meanwhile, the southern area displayed an intermediate level of variability in terms of groundwater utilization for irrigation.
Figure 6

Spatiotemporal variations of water volume for irrigation supply in the region of study.

Figure 6

Spatiotemporal variations of water volume for irrigation supply in the region of study.

Close modal

Maps of active energy

The correlation between the maps depicting variations in electricity consumption and those detailing water volumes within the region is notable. Particularly, the northeast area, home to Farmers F11 and F14, emerges as the epicenter of heightened energy demand. During peak periods, this influence radiates outward, encompassing the entirety of the region, and manifests as a dome of consumption extending toward the central and southern zones. Interestingly, the northeast zone exhibits the least fluctuation in terms of active energy consumption, indicative of a relatively stable pattern, while the southern zone presents values within the average range (Figure 7).
Figure 7

Spatiotemporal variations of active energy for irrigation supply in the region of study.

Figure 7

Spatiotemporal variations of active energy for irrigation supply in the region of study.

Close modal

Spatiotemporal variability maps of pumped water and active energy are critical tools for improving water management in arid areas. By analyzing variations in water extraction and energy use over time and across locations, these maps help identify inefficiencies and optimize resource allocation. Understanding spatiotemporal patterns allows for better prediction of water needs, more efficient irrigation schedules, and reduced energy consumption. In the study region, where groundwater resources are overexploited, these maps support sustainable management by identifying areas of high demand, guiding infrastructure development, and ensuring that water and energy are used effectively to support agricultural and community needs.

Modeling with machine learning

The presentation of Figure 8 includes the comparison between predicted and measured values of active energy across different machine learning techniques – RF and SVM – utilized during both calibration and validation phases. Notably, the observed highly linear correlations between predicted and measured values signify the robustness of the applied methodologies. Furthermore, a subtle advantage is apparent for the RF technique over SVM. This conclusion is further substantiated by the calculation of statistical indices R2 and RMSE in Table 3, which corroborate the graphical representations depicted in Figure 8, affirming the accuracy and reliability of the predictive models.
Table 3

Statistical evaluation of modelling results using machine learning techniques RF and SVM

R2RMSE
Calibration RF 0.89 0.53 
SVM 0.85 0.20 
Validation RF 0.72 0.32 
SVM 0.81 0.20 
R2RMSE
Calibration RF 0.89 0.53 
SVM 0.85 0.20 
Validation RF 0.72 0.32 
SVM 0.81 0.20 
Figure 8

Predicted and measured values of active energy using machine learning techniques RF and SVM: (a) calibration and (b) validation.

Figure 8

Predicted and measured values of active energy using machine learning techniques RF and SVM: (a) calibration and (b) validation.

Close modal

Case of study

For the purpose of validating the methodologies employed to analyze the spatiotemporal variability of water volumes and energy consumption, a farmer was strategically chosen at the central point of the study area, as illustrated in Figure 9.
Figure 9

The location of the farmer used as a case study.

Figure 9

The location of the farmer used as a case study.

Close modal
Through a survey conducted with this farmer, the actual quantities of water utilized for irrigation during the same months were accurately determined. According to the obtained data (depicted in Figure 10):
  • The estimation of active energy quantities was carried out utilizing both RF and SVM machine learning techniques, as delineated in Figure 10. Notably, the disparity between these methodologies remains relatively insignificant, except for the month of April, where a discernible distinction is observed.

  • A comparison between the actual water volumes and those derived from the generated maps was conducted (as illustrated in Figure 11). While the months of December and January exhibit congruence between the two sets of values, significant deviations are noted for the remaining months, with April showcasing a particularly pronounced disparity.

  • Furthermore, the monthly estimates of active energies obtained through RF and SVM techniques were juxtaposed against those interpolated from the maps (illustrated in Figure 12). Interestingly, the disparity between the values appears negligible for the months of November, December, and January. However, substantial deviations are apparent for the other months, notably April.

Figure 10

Measured water volumes and monthly active energy estimated using RF and SVM for the case study.

Figure 10

Measured water volumes and monthly active energy estimated using RF and SVM for the case study.

Close modal
Figure 11

Measured water volumes and monthly volumes generated from maps for the case study.

Figure 11

Measured water volumes and monthly volumes generated from maps for the case study.

Close modal
Figure 12

Monthly active energy generated from maps and estimated active energy estimated by RF and SVM techniques for the case study.

Figure 12

Monthly active energy generated from maps and estimated active energy estimated by RF and SVM techniques for the case study.

Close modal

The observed difference between the measured values and the values generated by the maps and the machine learning techniques for the month of April can be explained by a possible error in the data collected during the survey or by an error in the geostatistical model (kriging) used to generate the contour maps.

Sustainable water and energy management is essential to balance resource use with long-term environmental and societal needs. Overexploitation of these resources can have serious social and economic consequences, including resource depletion, rising costs, and environmental degradation. For communities, it can lead to water scarcity, energy shortages, reduced agricultural productivity, and increased vulnerability to climate change. Economically, it can drive up the cost of water and energy, disproportionately affecting low-income populations. Sustainable practices such as efficient irrigation, renewable energy integration, and conservation efforts are essential to ensure that resources remain available for future generations while supporting economic stability and social well-being.

This study holds significant importance in groundwater resource management within the context of the water-energy nexus. Real-time monitoring of water volumes pumped from aquifers and the electrical energy required to power irrigation networks enables optimal management of groundwater resources. Comparing water volumes with the actual water requirements of crops for farmers allows for saving pumped water quantities and more rational irrigation management at a local scale.

The spatial interpolation of water volume-energy pairs allows for estimating variability at the regional scale as well as comparing variation trends among farmers. The linear model adopted for kriging yielded quite similar results to actual water volumes recorded for certain months. Other models such as the exponential (Jurgens et al. 2016), Gaussian (Nafii et al. 2023), or spherical (Faruki Fahim et al. 2024) model may better reproduce this variability.

Modeling energy as a function of water volume using machine learning techniques like RF and SVM constitutes a robust approach. The obtained models can be improved by feeding them with data series over longer periods and considering other factors such as rainfall and ETP (Bagheri et al. 2023; Ahmed Osman et al. 2024). The above factors can provide a starting point for assessing the impact of climate change scenarios on the water-energy nexus.

The authors acknowledge the support of project PEER (2018, Cycle 7): ‘The use of modeling, monitoring and smart metering for sustainable groundwater management in a Tunisian coastal aquifer’.

All relevant data are included in the paper or its Supplementary Information.

The authors declare there is no conflict.

Ahmed
A. A.
,
Sayed
S.
,
Abdoulhalik
A.
,
Moutari
S.
&
Oyedele
L.
(
2024
)
Applications of machine learning to water resources management: A review of present status and future opportunities
,
Journal of Cleaner Production
,
441
,
140715
.
Ahmed Osman
A. I.
,
Latif
S. D.
,
Wee Boo
K. B.
,
Ahmed
A. N.
,
Huang
Y. F.
&
El-Shafie
A.
(
2024
)
Advanced machine learning algorithm to predict the implication of climate change on groundwater level for protecting aquifer from depletion
,
Groundwater for Sustainable Development
,
25
,
101152
.
Aliyu
M.
,
Hassan
G.
,
Said
S. A.
,
Siddiqui
M. U.
,
Alawami
A. T.
&
Elamin
I. M.
(
2018
)
A review of solar-powered water pumping systems
,
Renewable and Sustainable Energy Reviews
,
87
,
61
76
.
Araújo
S. O.
,
Peres
R. S.
,
Ramalho
J. C.
,
Lidon
F.
&
Barata
J.
(
2023
)
Machine learning applications in agriculture: Current trends, challenges, and future perspectives
,
Agronomy
,
13
(
12
),
2976
.
Bagheri
M.
,
Farshforoush
N.
,
Bagheri
K.
&
Shemirani
A. I.
(
2023
)
Applications of artificial intelligence technologies in water environments: from basic techniques to novel tiny machine learning systems
,
Process Safety and Environmental Protection
,
180
,
10
22
.
El Ayni
F.
,
Manoli
E.
,
Cherif
S.
,
Jrad
A.
,
Assimacopoulos
D.
&
Trabelsi-Ayadi
M.
(
2013
)
Deterioration of a Tunisian coastal aquifer due to agricultural activities and possible approaches for better water management
,
Water and Environment Journal
,
27
(
3
),
348
361
.
Faruki Fahim
A. K.
,
Kamal
A. S. M. M.
&
Shahid
S.
(
2024
)
Modeling spatial groundwater level patterns of Bangladesh using physio-climatic variables and machine learning algorithms
,
Groundwater for Sustainable Development
,
25
,
101142
.
Hamed
Y.
,
Hadji
R.
,
Redhaounia
B.
,
Zighmi
K.
,
Bâali
F.
&
El Gayar
A.
(
2018
)
Climate impact on surface and groundwater in North Africa: A global synthesis of findings and recommendations
,
Euro-Mediterranean Journal for Environmental Integration
,
3
(
1
),
25
.
Harrou
F.
,
Dairi
A.
,
Dorbane
A.
&
Sun
Y.
(
2023
)
Energy consumption prediction in water treatment plants using deep learning with data augmentation
,
Results in Engineering
,
20
,
101428
.
Intergovernmental Panel on Climate Change (IPCC)
(
2023
)
Climate Change 2021 – The Physical Science Basis: Working Group I Contribution to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change
.
Cambridge
:
Cambridge University Press
.
Jahromi
H. N.
,
Hamedani
M. J.
,
Dolatabadi
S. F.
&
Abbasi
P.
(
2014
)
Smart energy and water meter: A novel vision to groundwater monitoring and management
,
Procedia Engineering
,
70
,
877
881
.
Joseph
V. R.
(
2022
)
Optimal ratio for data splitting
,
Statistical Analysis and Data Mining
,
15
(
4
),
531
538
.
Jurgens
B. C.
,
Böhlke
J. K.
,
Kauffman
L. J.
,
Belitz
K.
&
Esser
B. K.
(
2016
)
A partial exponential lumped parameter model to evaluate groundwater age distributions and nitrate trends in long-screened wells
,
Journal of Hydrology
,
543
,
109
126
.
Karami
S.
,
Madani
H.
,
Katibeh
H.
&
Fatehi Marj
A.
(
2018
)
Assessment and modeling of the groundwater hydrogeochemical quality parameters via geostatistical approaches
,
Applied Water Science
,
8
(
1
),
23
.
Khara
D. S.
&
Ghuman
R. S.
(
2024
)
Energy–irrigation conundrum in India's green revolution states
,
Irrigation and Drainage
,
73
(
1
),
270
283
.
Li
J.
&
Heap
A. D.
(
2014
)
Spatial interpolation methods applied in the environmental sciences: A review
,
Environmental Modelling & Software
,
53
,
173
189
.
Mohamed
M. A. E.-H.
,
Moursy
F. I.
,
Darrag
M. H.
&
El-Mahdy
M. E.-S.
(
2023
)
Assessment of long-term trends and mapping of drought events in Tunisia
,
Scientific African
,
21
,
e01766
.
Schilling
J.
,
Hertig
E.
,
Tramblay
Y.
&
Scheffran
J.
(
2020
)
Climate change vulnerability, water resources and social implications in North Africa
,
Regional Environmental Change
,
20
(
1
),
15
.
Štular
B.
,
Lozić
E.
&
Eichert
S.
(
2023
)
Interpolation of airborne LiDAR data for archaeology
,
Journal of Archaeological Science: Reports
,
48
,
103840
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).