ChatGPT can execute real engineering tasks in seconds

Interestingly, ChatGPT showed adaptability in correcting errors. In earlier iterations, the model occasionally left nodes unassigned or created disconnected clusters. However, after refining its own Python code through prompt adjustments, it produced consistent and connected DMAs in subsequent runs, illustrating the self-corrective and learning capacity of prompt-engineered AI systems.


CO-EDP, VisionRICO-EDP, VisionRI | Updated: 24-10-2025 17:34 IST | Created: 24-10-2025 17:34 IST
ChatGPT can execute real engineering tasks in seconds
Representative Image. Credit: ChatGPT

A research team has presented a novel analysis on the use of artificial intelligence (AI) technology for automating one of the most critical processes in urban water management.

Their study, titled "Could ChatGPT Automate Water Network Clustering? A Performance Assessment Across Algorithms," and published in Water examines whether ChatGPT-4 can autonomously perform water network clustering - an essential step in optimizing water distribution systems - traditionally handled by specialized engineers and computational tools.

Revolutionizing water distribution management with AI

The study explores how large language models (LLMs) like ChatGPT can go beyond conversational applications to execute data-driven engineering tasks. Specifically, the researchers tested whether ChatGPT could analyze hydraulic data and segment Water Distribution Networks (WDNs) into District Metered Areas (DMAs), zones that improve leak detection, energy efficiency, and water pressure control.

Using the Parete water network in southern Italy as the base case, the research team tasked ChatGPT-4 with executing three well-established clustering algorithms: k-means, spectral, and hierarchical clustering. The chatbot was given EPANET input files, standard datasets used by hydraulic engineers, and instructed to perform the entire process, including loading the data, running algorithms, visualizing clusters, and computing performance metrics.

Remarkably, ChatGPT autonomously generated working Python scripts, executed the algorithms, and produced results comparable to those obtained by specialized software. It completed the clustering process in a fully automated loop, reading data, assigning clusters, computing balance indices, and even identifying misassigned nodes. The spectral clustering algorithm emerged as the most effective, achieving superior balance between cluster size, demand, and pipe length.

AI matches human-led accuracy in network optimization

The research marks one of the first successful demonstrations of a large language model acting as a functional engineering assistant. ChatGPT's spectral clustering output achieved a Balance Index (Ib) of 1.05, a Demand Balance Index (Id) of 1.58, and a Length Balance Index (Il) of 1.07—figures that closely match those achieved through expert-driven clustering in conventional systems.

To evaluate scalability and robustness, the researchers extended the experiment to a larger, more complex system, the Giugliano in Campania network, comprising 994 demand nodes. Despite the increase in data volume and structural complexity, ChatGPT successfully reproduced the clustering results, maintaining both computational efficiency and internal consistency.

Interestingly, ChatGPT showed adaptability in correcting errors. In earlier iterations, the model occasionally left nodes unassigned or created disconnected clusters. However, after refining its own Python code through prompt adjustments, it produced consistent and connected DMAs in subsequent runs, illustrating the self-corrective and learning capacity of prompt-engineered AI systems.

The team's analysis confirms that ChatGPT is capable of automating the entire clustering pipeline, including data ingestion, algorithmic execution, and validation of outputs, without relying on external plug-ins or API integrations. This result signals a paradigm shift: AI-driven natural language interfaces could soon complement or even replace domain-specific tools in water infrastructure design and monitoring.

Bridging the gap between AI and sustainable urban infrastructure

The authors highlight broader implications for sustainability and digital transformation in urban water management. As cities increasingly adopt smart water networks, automation tools like ChatGPT could accelerate the creation of efficient, leak-resistant systems while reducing engineering costs. By performing repetitive analytical tasks autonomously, AI allows human experts to focus on higher-level design, risk assessment, and policy decision-making.

However, the study also points out the importance of human oversight. While ChatGPT demonstrated strong computational ability, it occasionally produced errors in data handling, particularly in node allocation during hierarchical clustering and in early stages of spectral optimization. Such lapses call for domain expertise in prompt design and output verification.

The authors argue that combining LLMs with hydraulic solvers, real-time sensors, and geographic information systems (GIS) could form the next generation of AI-assisted water management platforms. This integration would allow ChatGPT-like systems to dynamically model pressure zones, detect leaks, and predict pipe failures using both linguistic reasoning and numerical computation.

Moreover, the research points to the potential for democratizing water system analysis. By allowing non-programmers to interact with complex engineering workflows through natural language, ChatGPT could lower the entry barrier for municipalities, small utilities, and developing regions seeking to modernize their infrastructure without investing in specialized software.

  • FIRST PUBLISHED IN:
  • Devdiscourse
Give Feedback