1. Introduction
Water distribution systems (WDSs) are among the major consumers of energy resources. Pump stations are responsible for the majority of energy consumption in WDS, with electricity usage representing the largest proportion, in some cases reaching 90% [
1]. Thus, improving the efficiency of pump station operations can significantly impact the energy efficiency of WDSs as a whole. At the same time, these operations must ensure WDS pressure levels are maintained, and demands are met.
The challenge of improving energy efficiency while maintaining WDS levels of service has attracted the attention of various researchers. Due to the complex dynamics within the hydraulic equations governing water networks, i.e., the nonlinearity and non-convexity of the energy and flow constraints, pump scheduling optimization is a nonpolynomial (NP)-hard problem. To address this problem, many optimization methods have been developed to schedule pump operations, including local search (linear, nonlinear, and dynamic programming), discrete search, global search, and hybrid methods. In the context of real-time pump control in WDSs, Odan et al. [
2] developed an integrated model based on evolutionary optimization, which comprised three sub-models, i.e., demand forecasting tool, hydraulic simulation, and multialgorithm genetically adaptive method. The proposed methodology was implemented in a real case study, and the results demonstrated its capability to achieve a 13% reduction in energy consumption while ensuring the reliability of the water supply. Salomons and Housh [
3] addressed the optimization problem using a practical reduced mixed integer linear program (MILP) formulation. They proposed a real-time pump optimization framework for both fixed- and variable-speed pumps. On the other hand, Bagloee et al. [
4] focused on a large system and introduced a hybrid methodology that incorporates machine learning techniques and optimization algorithms.
These methodologies involve the application of advanced algorithms aimed at determining the optimal pump control settings, taking into account hydraulic dynamics and energy efficiency considerations. Once the optimal configurations are determined, they are communicated to operators (offline control scenario) or control units (real-time control scenario) for implementation. However, despite the potential advantages of these optimized solutions, they may be perceived as a black box to operators, as the mechanism of underlying algorithms may be difficult to comprehend. As a result, operators may opt to return to their original rule-of-thumb settings, which they find more familiar and comfortable. This highlights the importance of engaging operators in the optimization process fully exploiting the benefits of these advanced methodologies.
To address this challenge, large language models (LLMs) offer a promising solution for effectively bridging the gap between advanced automated tasks and operators’ comprehension. ChatGPT [
5], an advanced LLM developed by OpenAI, is a notable example, leveraging its natural language understanding and generation capabilities to assist users in various contexts. Recent applications in the water industry include platforms for managing systems [
6] and communicating with customers [
7]. This study seeks to develop a large language model (LLM)-assisted framework for pump operation. The proposed framework integrates a hydraulic simulator with an LLM model to provide operators with suggestions for future optimized pump control. The effectiveness of the proposed methodology was validated using the EPANET Net 3 example, and the results were compared with those obtained using a genetic algorithm.
2. Materials and Methods
The proposed LLM-assisted framework for pump operation optimization was developed in Python and is illustrated in
Figure 1. The procedure begins by feeding an operator prompt to the LLM, GPT 3.5-turbo. The prompt consists of an explanation of the role of the ChatGPT along with the operator’s requests, i.e., minimizing energy usage while maintaining the desired pressure levels in water networks. This operator-fed prompt is then combined with the original pump control settings planned for the next 24 h and the hydraulic status of the WDS, including minimum pressure levels, tank water level, and energy usage of each pump at each time step, provided by the EPANET [
8] simulator. An open Python toolkit for EPANET known as OWA-EPANET [
9] was used. The constructed prompt is then fed to the LLM unit (ChatGPT). Next, the LLM suggests new pump settings. These new settings are fed to the EPANET simulator again. The hydraulic results of these settings are then once again fed into the LLM unit. This iterative data exchange continues until a minimum feasible energy consumption in the WDS is achieved. The stopping criteria for the process is the maximum number of iterations with no further reduction in energy consumption, set at 15 iterations.
This process of fine-tuning LLM models with minimal data samples, known as few-shot learning [
10], can significantly benefit from the implementation of prompt engineering techniques. In this research, a range of prompts spanning from numerical to conversational dialogues were evaluated. Within the proposed framework, three strategies aimed at enhancing efficiency were investigated: (1) full history and feedback loop, (2) short-term history and no feedback loop, and (3) short-term history and feedback loop.
To compare the LLM-based approach with other traditional approaches, a genetic algorithm (GA) was implemented. The objective function, designed to reflect the optimization goal, incorporates both the primary objective of minimizing energy consumption and penalty terms to enforce constraints on decision variables. The GA was configured with a population size of 100, mutation probability of 0.8, elitism ratio of 0.01, crossover probability of 0.8, and a parent portion of 0.5. Similar to the iterative process within the ChatGPT-assisted framework, the maximum number of iterations for the optimization was set to 50. Additionally, a condition was imposed where the algorithm would terminate if no improvement was observed within 15 consecutive iterations.
The method proposed in this study was applied to the EPANET Net 3 example, which features two water sources and three tanks. For the purposes of this study, the original Net 3 was modified by adding pump efficiency curves to all pumps.
3. Results
The present study examined three different strategies for prompt engineering. The application of Strategy 3 demonstrated a greater reduction in energy consumption, as shown in
Table 1. However, it is noteworthy that Strategy 1 exhibited higher robustness with a lower standard deviation, and the convergence iteration of the first two strategies was lower, indicative of reduced computational requirements.
As an interactive tool, the LLM enables operators to explore and assess the impacts of various pump control settings on system performance. Moreover, it demonstrates the potential to achieve optimal energy consumption levels while maintaining the desired pressure. To illustrate this capability, we compared the performance of the proposed framework in this study with that of a genetic optimization algorithm using an equal maximum number of iterations.
The analysis of the results reveals that the proposed methodology has enhanced performance in the optimization process, supported by its ability to achieve a higher reduction rate with a reduced number of iterations. Notably, the lower average value of solutions (lowest energy consumption across all the iterations) in the application of the AI-assisted framework highlights its robustness.
4. Discussion
The integration of LLMs like ChatGPT with hydraulic simulation tools for optimizing pump scheduling in WDSs shows promising potential. The evaluation of different prompt engineering strategies reveals the need to maintain a balance between energy reduction and solution stability. Strategy 3, integrating the use of the feedback loop and short-term historical dialogues, achieved the highest energy reduction. Comparing the AI-assisted framework with a genetic optimization algorithm highlights the former’s superiority, achieving higher energy reduction with fewer iterations. The rapid convergence and lower average solution value of the AI-assisted framework emphasize its efficiency and reliability in optimizing pump operation decisions within WDSs, along with bridging the gap between advanced automation and operator comprehension.
These findings suggest practical implications for enhancing energy efficiency and system performance in WDSs. The AI-assisted framework offers an intuitive and interpretable approach to pump scheduling optimization, empowering operators to make informed decisions. Further research is essential to fully realize the potential of AI-driven solutions in enhancing the sustainability and resilience of water supply systems. Although the findings demonstrate the efficacy of the proposed methodology within the Net 3 example, extrapolating the results to a larger, more complex system within variable demand patterns presents notable challenges requiring further investigation in future research endeavors. Additionally, the proposed methodology can be further improved by incorporating variable speed pumps.