Open-access Modified hybrid particle swarm optimization: multivariate calibration of water supply networks

Otimização por enxame de partículas híbrido modificado: calibração multivariável de redes de abastecimento de água

Abstract

Calibration is essential to ensure the accuracy of hydraulic models, adjusting hydraulic parameters to reliably represent real systems. This work presents the implementation of the Modified Hybrid Particle Swarm Optimization with ‘fmincon’ (PSO-HM) evolutionary search method to propose efficient and robust solutions for large networks. PSO-HM was applied in multivariate and multiobjective calibration, estimating hydraulic parameters based on node pressure and pipeline flow rate, through minimization of the objective function. The methodology was validated with the calibration of the roughness and demand of the Water Distribution Pilot System (WDPS) at the Hydraulic Energy Efficiency Laboratory (LENHS) and the roughness of the C-Town Benchmark network. The calibration algorithm, focused on the local optimal search for roughness and demand, achieved satisfactory results in the dynamic calibration with error 0.016% for pressure and 0.1% for flow. The results demonstrate the computational efficiency and robustness of PSO-HM compared to the genetic algorithm, calibrating hydraulic parameters with low computational cost, even for large supply networks.

Keyworks: Calibration methods; Water distribution systems; Particle swarm optimization; Multivariate optimization; Genetic algorithms

Resumo

A calibração é fundamental para garantir a precisão dos modelos hidráulicos, ajustando os parâmetros hidráulicos para representar sistemas reais de forma confiável. Este trabalho apresenta a implementação do método de busca evolucionário Particle Swarm Optimization Modificado e Híbrido com ‘fmincon’ (PSO-HM) para propor soluções eficientes e robustas para grandes redes. O PSO-HM foi aplicado na calibração multivariável e multiobjetivo, estimando os parâmetros hidráulicos com base na pressão dos nós e na vazão dos dutos, através da minimização da função objetivo. A metodologia foi validada com a calibração da rugosidade e demanda do Sistema Piloto de Distribuição de Água (SPDA) no Laboratório de Eficiência Energética em Hidráulica (LENHS) e da rugosidade da rede de Benchmark C-Town. O algoritmo de calibração, focado na busca ótima local da rugosidade e demanda, alcançou resultados satisfatórios na calibração dinâmica com um erro de 0,016% para a pressão e 0,1% para a vazão. Os resultados demonstram a eficiência computacional e a robustez do PSO-HM em comparação com o algoritmo genético, calibrando parâmetros hidráulicos com baixo custo computacional, mesmo para grandes redes de abastecimento.

Palavras-chave:
Métodos de calibração; Sistemas de distribuição de água; Otimização por enxame de partículas; Otimização multivariável; Algoritmos genéticos

INTRODUCTION

Water supply systems (WSS) are composed of equipment, works and services intended to supply water for domestic, industrial and public consumption (Kumar & Yadav, 2022). The design and dimensioning of these systems are integrated processes that require the collaboration of a specialized multidisciplinary team (Gao, 2017; Meirelles et al., 2017). Despite being widely studied, WSS present non-linearities that complicate their design, analysis and operation, mainly due to their large dimensions, the high number of components and their particularities (Leinæs et al., 2024; Silva et al., 2024).

WSSs are responsible for 3% of global energy consumption, with 90% of this amount being used by pumping systems (Groppo et al., 2019; Zanfei et al., 2020; Gonçalves et al., 2021). In Brazil, data from the National Electric Energy Agency (Agência Nacional de Energia Elétrica, 2023) indicate an accelerated growth in electricity consumption, exceeding the growth rate of the Gross Domestic Product. In addition, poor quality in water distribution, due to leaks, results in losses of more than 40% between the treatment plant and the final consumer, generating an annual loss of $5.1 billion (Instituto Trata Brasil, 2023). These challenges highlight the need for technologies that reduce energy consumption and improve the operational efficiency of WSSs. Furthermore, a good WSS design is crucial, as 70% of the total cost is associated with the pipeline network (Kepa, 2021; Zhao et al., 2022).

Computational models assist in the design and management of a WSS. For the model to accurately represent the real system, it needs to undergo a process of calibration and adjustment of hydraulic parameters. Significant advances in the calibration of hydraulic networks were established in Ostfeld et al. (2012), where 44 researchers developed and compared several hydraulic calibration methods using a benchmark network. In parallel, Wu & Walski (2012) used the benchmark network (C-Town) to propose new approaches to calibrate the model.

Several studies have explored the functionalities of EPANET for designing, calibrating, and simulating (Georgescu et al., 2014, 2015; Dunca et al., 2017; Kepa, 2021). However, EPANET has limitations in calibration, as it does not support multivariate and multiobjective calibration, in addition to using simple optimization algorithms. Thus, to overcome these limitations, researchers have developed hydraulic calibrators, based on genetic algorithms (GA), using EPANET as a hydraulic simulator (Salvino et al., 2015; Boczar et al., 2017; Zhao et al., 2022).

Salvino et al. (2015) developed a multivariate calibration method using multiobjective genetic algorithms (GA), validated in the Water Distribution Pilot System (WDPS) of UFPB and in the network of the city of Maceió, Brazil. The results were promising, meeting the calibration criteria of Walski et al. (2006) and Meirelles et al. (2017). The number of variables in the calibration represents a challenge (Do et al., 2016). Do et al. (2016) pointed out a sensitivity method for the location and types of sensors to optimize the measured variables. In addition, nodal pressures are more valuable for roughness estimation, while flow data are better for demand estimation (Kang & Lansey, 2011).

There is a real-time calibration methodology available in the literature (Zhou et al., 2018). It is multivariate adaptive and considers the variables applicable to the nodes and sections (nodal demand and roughness). Pressure measurements are continuous via a data acquisition system (SCADA) and uses the Kalman filter to optimize the parameters. In large networks, the errors observed for pressure and flow are around 25% and 10%, respectively.

Zanfei et al. (2020) proposed a multi-objective methodology to calibrate roughness and demand in supply systems using GA. The methodology includes four modeling procedures for measurable variables and an evaluation of the results based on repeating the optimization process 100 times, calculating the average of the hydraulic parameters obtained. The comparison between different optimization processes is relevant when the algorithm has random functions. Another methodology uses GA, but with a simulator based on finite elements (Diaz-Ortiz et al., 2023).

The search for more robust optimization algorithms has made their use complex. To this end, Sequential Least Squares Programming (SLSQP) was implemented to calibrate a real urban network in Victoria, Australia and simplify the process (Zhao et al., 2022). Compared with genetic algorithms (GA) and Differential Evolution (DE), SLSQP is up to 10 times more efficient in terms of computational cost while maintaining comparable results. The study formulated decision variables in four different scenarios to characterize the algorithm's search space.

Other methods, such as pressure loss with the least squares method, have been implemented to estimate pipe roughness, due to the difficulty of measuring noisy data on nodal demands or node pressure (Gao, 2017). Research also uses physical phenomenology and mathematical formulations to calibrate water supply networks, focusing on identifying leaks (Berardi & Giustolisi, 2021). Although these methods have lost ground to computational methods, they still achieve good results and are scalable to real urban networks. However, they require mathematical skills from the designer and time available for application.

Leinæs et al. (2024) proposed a methodology to calibrate intermittent WSS hydraulic models that include network pressure-driven leakage modeling. The calibrated variables are roughness and nodal demand. Most of the simulated flows had errors within the range of 11%. In a literature review, Kumar & Yadav (2022) report that several heuristic and metaheuristic methods have been applied to WSS management, including GA and PSO. Furthermore, they emphasize that there is a constant search for methods that reduce the computational cost of optimizing large hydraulic networks.

Metaheuristic algorithms, such as Evolutionary Algorithms (EAs), have been widely applied in the calibration of Water Distribution System (WDS) models since the 1990s (Savic & Walters, 1995). EAs perform well in complex problems with many variables and constraints (Maier et al., 2014). However, they face limitations due to high computational cost, especially in larger problems, such as in the calibration of complex WDS models (Zhang et al., 2018; Kang & Lansey, 2009). In addition, the solution complexity increases due to the frequent resolution of nonlinear hydraulic equations (Rashid & Kumari, 2023) and because the problem has multiple solutions.

In the evolution of computational methods, Letting et al. (2017) presents a detailed process simulation model for water demand estimation using PSO. The best locations to place sensors are those that experience the greatest variability in measurements because of changing nodal demand (Letting et al., 2017). Torkomany et al. (2021) employed PSO for the optimization of the optimal diameter in the design of supply systems. PSO was used to optimize the operating cost of water pumping systems in a multi-objective optimization process (Balekelayi et al., 2022). There is also the implementation of PSO for energy optimization through pressure management by automatic pressure reducing valves (Jafari-Asl et al., 2020). The authors highlight the low computational cost of the method. There are applications of PSO to calibrate water quality parameters in WSS models (Peirovi Minaee et al., 2019; Wang et al., 2023) and rainwater management models (Xue et al., 2020), showing the versatility and robustness of the algorithm's applications.

Artificial neural networks were used to predict the pressure of the network nodes, reducing the degree of freedom and the complexity of the problem, while the PSO adjusts the roughness (Meirelles et al., 2017). The results are still not sufficient to consider the system calibrated, with errors above 9% for pressure. The modified PSO was also used for hydraulic and water quality calibration (Moghaddam et al., 2020) using roughness as a hydraulic variable, resulting in errors of 11%, high for the calibration criteria (Walski et al., 2006; Salvino et al., 2015). In addition, the hydraulic network had small dimensions (100 nodes and sections), not representing large urban hydraulic networks or benchmarks used in the literature.

This work aims to develop a methodology for the calibration of hydraulic parameters based on the PSO-HM algorithm in order to provide a more robust calibration supporting larger degrees of freedom. In the proposed methodology, the minimization of the calibration error and the computational cost are considered. Multivariate and multiobjective calibration are deepened, especially for pressure and flow parameters, increasing the number of calibratable variables and robustness, regardless of the degree of freedom of the optimization problem. The methodology was applied to an experimental system and a benchmark, aiming to reduce the observed error and computational cost in the calibration, in contrast to Zhao et al. (2022), Meirelles et al. (2017) and Moghaddam et al. (2020), who developed calibration algorithms based on pure PSO and with inferior performances to those observed in this work.

METHODOLOGY

Calibration as an optimization problem

Calibration aims to reduce the error between the real system and the computational model, represented by an objective function (OF). The OF is usually the square of the differences between the simulated and collected pressure and flow values and can be adjusted by weights according to literature or the designer's preference. The OF is minimized by optimization methods. Equation 1 was used to calculate the deviation between the model and the real system. The OF assigns weights to each variable, allowing one objective to be prioritized over another or equalizing both when the weights are equal.

min f x = α j = 1 J O P j P P j 2 + β p = 1 P O Q P P Q P 2 (1)

In this context, OPj and PPj represent the observed and predicted pressures at junction j, while OQp and PQp are the observed and predicted flow rates at pipe p. The weights α and β are normalizers used to reconcile the orders of magnitude of the variables. The calculation is performed for different time instants and for different nodes or sections of the network, if there are measurement data available for comparison. In this work, different alpha (0.6) and beta (0.4) weights were used to prioritize pressure measurements in the search for the optimal solution.

The flowchart of the developed methodology (Figure 1) is consolidated in the literature (Zhao et al., 2022; Moghaddam et al., 2020). In the calibration process, the parameters are updated by the simulation model and the optimization algorithm, which returns the adjusted state variables (roughness and nodal demand). Then, the FO evaluates the success of the calibrated computational model and, according to the definitions, continues or terminates the process.

Figure 1
Basic hydraulic calibration algorithm.

A relevant aspect of calibration is the degree of freedom (DOF), which is defined as the difference between the number of parameters to be adjusted and the number of measurements performed. Calibration problems have a significantly high degree of freedom (Moghaddam et al., 2020; Chen et al., 2022), because the number of measurements is much lower than the total number of nodes and pipes. The objective is to build a robust calibration model for complex hydraulic networks with few measurement points and that is effective. Designer’s experience is essential in choosing the best measurement points (Zanfei et al., 2020; Zhao et al., 2022). These aspects were considered in the selection of measurement points, selecting nodes and sections with the greatest variation in measurements and/or the greatest magnitudes of pressure and flow.

After the calibration process of a hydraulic model, it is highly recommended to verify its accuracy through cross-validation, comparing the modeled results with data observed in the field in a different period (Walski, 2017). It is recommended to collect calibration and validation data during peak demand periods (Zhang et al., 2018; Walski, 2017), when the pressure drop is more sensitive to variations in pipe roughness.

Particle swarm optimization

PSO is a metaheuristic algorithm, collective and artificial intelligence, classified as an evolutionary computing method of swarm or natural intelligence. Developed by Kennedy & Eberhart (1995), it is based on the social behavior of groups of animals, where the influence of the leader affects the other members. This phenomenon, Sociocognitive Theory, involves decisions influenced by flock neighbors, combining individual learning and cultural transmission at each iteration. The PSO algorithm initializes particles and, in each iteration, updates their positions and velocities. It calculates fitness, updates the leader and adjusts the best individual and neighborhood fitness, repeating until the stopping criterion is reached (Chart 1).

Chart 1
PSO algorithm pseudocode.

The modified PSO introduces improvements to increase the speed and efficiency of convergence and the accuracy of finding optimal solutions (especially in complex multidimensional problems) (Moghaddam et al., 2020). PSO modifications in this work included:

  1. Moment of Inertia (PSOw): Adds an inertia factor (w) to control the influence of the previous velocities of the particles, helping to balance the exploration and exploitation of the search space (Equation 2), it is also called the social factor;

  2. Constraint Factor (χ): It is a damping factor based on the cognitive and social parameters that adjusts the velocity equation to ensure the convergence of the algorithm, restricting the velocity of the particles and avoiding uncontrolled movements;

  3. Hybridization with other optimization algorithms to select the best features of each one, providing robustness, flexibility and better convergence.

    vpit+1=w.vpit+c1.rand1it.pbestpitxpit+c2.rand2it.gbestpitxpit(2)

v p is the velocity of particle p; c 1 and c 2 are acceleration coefficients; rand is a random function between 0 and 1; pbest p is the best position of particle p; gbest p is the best position in the neighborhood of particle p; it is the current iteration; and w is the inertia weight. Particles use others as a reference, facilitating convergence and the final adjustment of the solution. The inertia weight (w) should decrease over the iterations, favoring local exploration and refinement of the final solution (Macêdo et al., 2021). The balance between global and local search depends on the values of (w).

The update of the position of each particle in each iteration is done, for both approaches, using the following Equation 3, where xp is the position of particle p:

x p i t + 1 = x p i t + v p i t + 1 (3)

To determine the values of the initial and final inertia factors (w), the minimum adaptive neighborhood (f) and the size of the initial (Si) and intermediate (S) swarm, sensitivity analyses were performed with the WDPS network to find the optimal parameters, balancing efficiency and computational cost. To improve the calibration algorithm, modifications were made to the pure PSO:

  • Adaptive Variation of the Inertia Factor (w) and the Constriction Factor (χ); and

  • Hybrid PSO with 'fmincon' (Find Minimum of Constrained Nonlinear Multivariable Function) for global exploration and local exploitation: hybrid function executed with PSO to refine the local search. PSO has an efficient global search, avoiding local minima, the MATLAB® 'fmincon' function does the local refinement to find the best solution. This hybridization aims to obtain an accurate global solution to problems that have several local minimums.

‘Fmincon’ it is an optimization function that solves constrained nonlinear optimization problems. It seeks to minimize an objective function subject to several linear and nonlinear constraints. To find the solution, fmincon uses different methods, such as Sequential Quadratic Programming (SQP), which solves a series of quadratic subproblems, and Interior Methods, which deal with inequality constraints by transforming them into equality constraints through slack variables. In addition, the algorithm implements convergence checking and adaptive parameter adjustment techniques, ensuring an efficient and robust search for the optimal solution in complex problems. Others main characteristics of the ‘fmincon’ hybrid function in this work is:

  • Searches for the minimum of a nonlinear multivariable function with constraints;

  • Use gradient methods to refine the solution of each iteration, taking advantage of its ability to deal with constraints and find local minimum efficiently;

  • Iterative Lagrangian gradient algorithm for subdivisions of the problem for resolution applying SQP. SQP works by solving a series of quadratic programming (QP) subproblems, which approximate the original problem. In each iteration, the QP subproblem is solved to find a search direction, and the solution is iteratively updated until convergence is achieved.

Objective and Restrictions for solving the problem:

Objective: Minimize the Objective Function (Equation 1).

Subject to:

  1. Conservation of mass: Inputs and outputs must balance at each node;

  2. Conservation of energy: The head loss in a closed circuit must be equal to zero, and the head loss along a path between two reservoirs must be equal to the elevation difference of the reservoirs;

  3. Minimum pressure requirements: Minimum pressure must be provided at network locations for a given set of demands;

  4. Search space is composed of the admissible variation of roughness and demand (Salvino et al., 2015; Meirelles et al., 2017).

Experimental validation methodology (WDPS)

The validation consisted of calibrating a model of an experimental water supply network (Figure 2) and comparing the results with experimental data to verify compatibility with the study objectives. The LPS of the Hydraulic Energy Efficiency Laboratory of the Universidade Federal da Paraíba (UFPB) is an experimental system that includes a 5 HP motor-pump assembly (MP) that drives water from the lower elevation reservoir directly to the water supply network. Up to three pumps can operate simultaneously, feeding the 129 m network with direct and indirect pumping. The nominal flow and pressure of the MP used are 50 m3/h and 17 meters of water column (mca), respectively. The network consists of 26 nodes and 30 sections.

Figure 2
WDPS/LENHS panoramic image.

The supervisory system allows monitoring and tracking of WDPS information. Data is collected by SCADA consisting of sensors and/or equipment, processed, analyzed and stored. The supervisory system remotely manages hydraulic and electrical processes and concentrates information on reservoirs and components (pressure and flow sensors, electronic valves, frequency converters and transducers). SCADA (Figure 3) monitors pressure, flow, speed, amperage and voltage variables of motors, water levels in reservoirs and node consumption. Transducers and flow meters allow measurement of quantities via 4 to 20 mA analog signals and a remote RS485 network. The supervisory system allows remote activation of pumps and Pressure Reducing Valves (PRVs) to control and simulate routines and various demand patterns in the system.

Figure 3
WDPS hydraulic network seen from the Management Supervisor with pressure and flow measurement points.

The hydraulic analysis shows pressure fluctuations (Figure 4) according to hourly demand proposed by Salvino et al. (2015). The results indicate normality for a typical water supply system, mainly because there is no active or passive pressure control in the MPs or PRVs.

Figure 4
Hydraulic analysis of WDPS pressures with hourly demand variation.

In the WDPS network calibration, two situations were considered: calibration of the roughness of the pipelines, and multivariable calibration of the roughness and demand of the nodes.

Despite being versatile and robust, PSO has several parameters that need to be tuned. Simulations in the network WDPS and sensitivity analyses were performed on the most important parameters of the algorithm PSO-HM. The moment of inertia is represented by an interval that varies adaptively from the beginning to the end of the optimization process. Thus, six intervals were analyzed to verify the lowest fitness return (Figure 5). The swarm size is a multiple of the total calibrated variables (Figure 6a) and the minimum adaptive neighbor represents the particles that can be modified at each iteration (Figure 6b).

Figure 5
Sensitivity analysis for Adaptive Inertia (w) PSO-HM algorithm.
Figure 6
Sensitivity analysis of swarm size and minimum adaptive neighborhood for the PSO-HM algorithm.

A total of 10 runs with different random seeds were performed for each combination of optimization parameters for statistical analysis. Sensitivity analyses of three parameters in each algorithm resulted in a total of more than 1,000 optimization runs. For a fair comparison between the optimization methods, the same stopping criterion (convergence), defined by FO (Equation 1), was used, occurring when FO(x) ≈ 0 or the computational cost was reached, which is represented by the execution time.

Benchmark: C-Town

The C-Town network is a hypothetical network with 429 pipes, 388 nodes, 1 reservoir, 7 tanks, 4 valves and 5 pumping stations with a total of 11 pumps. The network is divided into 5 district meter areas (DMAs) (Figure 7). The pipes are made of cast iron, their diameter ranges from 51 to 610 mm, and their length ranges from 4.3 to 1280.3 m. The base demand of the 334 nodes with consumption varies from 0.0004 to 4.2 l/s. Each DMA has a specific demand pattern and water losses are not considered. This benchmark was calibrated by the roughness of the pipelines and aims to evaluate the PSO-HM and compare it with results from the literature.

Figure 7
Components and DMAs of the C-Town network.

Finally, a comparison is made with the GA calibration and with the data obtained from the WDPS and the C-Town benchmark.

RESULTS

The results of the PSO-HM method are evaluated and discussed in the calibration of the variables, isolated or cumulatively, of roughness and nodal demand.

WDPS

The implementation of PSO-HM had significant results, with average relative errors of 0.016% for pressure, against 2.4% for AG, and 0.1% for flow, against 2.2% for AG (Figures 8, 9 and 10). The heat maps for the nodes and reference sections were obtained for AG and PSO-HM (Figure 10). The pressure and flow time series presented good adjustments and absence of punctual disturbances for PSO-HM (Figure 9), highlighting the homogeneity of the results for all points of the calibrated variable. The convergence of the optimization was gradual and fast (Figure 11). The results were achieved with a reduced computational cost (1.0h), approximately four times lower than the cost using AG.

Figure 8
Pressure (mca) at nodes references and Flow (L/s) at tubes references for 13 hours.
Figure 9
Time series of pressures at nodes PT-01 and PT-04 and in reference sections.
Figure 10
Heat map of pressure values at nodes and flow in reference sections with AG and PSO-HM calibration.
Figure 11
Convergence of the PSO-HM objective function.

The advances with PSO-HM were significant, since small errors in hydraulic parameters can result in large differences in simulations, such as in a cumulative process. This is especially critical in energy and operational management, where models cannot deviate from desired values. The objective function (OF) is a parameter of great relevance in this study, since, to consider a system calibrated, the pressure and flow values must meet the criteria in Chart 1. Achieving these values is quite difficult with conventional hydraulic calibration methods, such as the least squares method or linear/nonlinear regression.

Multi-objective calibration

The calibration was performed considering both the roughness of the sections and the demand of the nodes. The PSO-HM parameters were tested through parameterization studies and analyses similar to the previous calibration. To force the algorithm to find better local minima, it was necessary to reduce the value of the objective function (FO) using a search mechanism ('fmincon'). Local minimum without refinement benefit the minimization of the pressure or flow error, resulting in high relative errors for one of the two.

The calibration showed that PSO-HM is effective in multivariate and multiobjective calibration, converging quickly. The average relative errors were 0.11% for pressure, against 0.59% for AG, and 0.55% for flow, against 4.81% for AG (Figure 12), consistent with a calibrated system. The heat maps illustrate the percentage error for pressure and flow considering a 24-hour simulation demand pattern. PSO-HM minimized the point error, such as the entire 24-hour simulated period for all reference points (sensors) used in the calibration for the entire simulated period (Figure 13). The computational cost was 6h of processing.

Figure 12
Time series of pressures at nodes PT-01 and PT-04 and flow in pipes FT-04 and FT-08.
Figure 13
Heat map of pressure and flow errors for AG and PSO-HM.

C-Town

C-Town is a benchmark network for hydraulic studies. Ostfeld et al. (2012) show the relevance of the network for the study of calibration algorithms. In this work, multivariate and multiobjective calibration was performed considering the roughness variable. The values of the PSO-HM parameters were tested by preliminary parameterization and sensitivity studies and analyses.

The average relative errors were 0.41% for pressure, against 1.19% for AG (Figure 14a) and 11.73% for flow, against 12.54% for AG (Figure 14b) using as reference the data from the final 72 hours, which were not used in the calibration (cross-validation). The results fit the network into the calibration requirements. Certain nodes and sections present errors above the average, which occur due to network nonlinearities that limit the adjustment process by the optimization algorithms in specific nodes or sections (Figure 15). The computational cost to calibrate a large hydraulic model such as C-Town was 24h (Figure 16), one of the reasons being the extension of the network and the large number of nodes and sections.

Figure 14
Heat map of pressure and flow errors for AG and PSO-HM for a period of 96 hours and all reference nodes and sections. Data from the initial 24 hours were used for calibration and data from the other 72 hours were used for cross-validation.
Figure 15
Time series of pressures at the six nodes that presented the highest average errors, as can be seen in the heat maps. The simulation period comprises 96 hours, however only the data relating to the initial 24 hours were used in the calibration, the remaining data correspond to cross-validation.
Figure 16
Convergence of FO for PSO-HM and AG in the calibration of the C-Town network.

The mean relative error for pressure was 0.41%, the SSRE (Maximum sum of squared relative errors) was 0.0009, against 0.630, the best result in Ostfeld et al. (2012).

The computational cost of calibrating two associated parameters grows exponentially in large supply networks. Therefore, it is convenient to calibrate parameters that return the best result given the computational cost, unless it is really necessary to perform a multi-parameter calibration. For C-Town, it was sufficient to calibrate the commonly used roughness.

Discursions

Based on the results, technical considerations were made to deepen the understanding of the developed hybrid optimization algorithm and the use of the EPANET-MATLAB library:

  1. The computational cost of GA is higher than PSO (Kumar & Yadav, 2022), however PSO and GA have mechanisms to avoid local optima (Wang et al., 2023);

  2. The larger the search space, the larger the size of the swarm or population must be, however, the computational cost increases, so a study must be carried out to balance this and that;

  3. As disadvantages, it was observed that the optimal local search of PSO is weak. Thus, 'fmincon' performs the function of refining the local search, which is important, mainly, in the last iterations;

  4. The hybridization that resulted in the PSO-HM proved to be a practical tool that enables the calibration of large-scale urban networks;

  5. In contrast to GA, PSO-HM may have the disadvantage of premature convergence, which is why high populations should be implemented for higher degrees of freedom. Because of this, PSO-HM may have difficulty finding optimal solutions due to the exponential increase in the search space. In addition, its performance depends on the tuning of the parameters and must be evaluated for each hydraulic network;

  6. The computational speed is reduced due to the limitations of the EPANET code, which works as a simulation engine to calculate the hydraulic responses of the tested parameters;

  7. A computer with simple hardware was used to perform the calibrations and simulations (Intel i5 1135G7, 20GB RAM DDR4 and SSD NVME).

Among the advantages of PSO that justify its use in this work are:

  1. Insensitivity to scaling of design variables;

  2. Easily parallelized for concurrent processing;

  3. Few parameterizable algorithm parameters; and

  4. Very efficient global search algorithm.

CONCLUSIONS

The PSO-HM algorithm has proven to be an effective option for the calibration of large Water Distribution Networks (WDNs) models. Both PSO-HM and GA were applied under the same conditions to two networks, one experimental and the other a benchmark proposed in the literature. The validation of both algorithms was performed through two studies: one using the hydraulic laboratory network, known as the Water Distribution Pilot System (WDPS), and the other using a benchmark from the literature (C-Town).

The development of the algorithm and calibration code resulted in a set of robust functions and procedures for the dynamic calibration of roughness and nodal demand. The results obtained were superior to those observed by Salvino et al. (2015), who used an AGM. The validation of the calibration algorithm by PSO-HM presented an error of 0.016% for pressure and 0.1% for flow, surpassing the AGM developed by Salvino et al. (2015). Using the parameters in the literature, it can be considered that the system was completely calibrated, presenting results above expectations for the calibration of roughness and demand (section 4.1.1).

For C-Town, the results were consistent, especially considering the dimensions and complexity of the system. The mean relative error for pressure was 0.41%, the SSRE was 0.0009, against 0.630 by Ostfeld et al. (2012). The calibration using the GA developed in this study presented superior results compared to the AGM by Salvino et al. (2015). There was also an improvement in computational cost, although this is not an ideal parameter for comparison due to the time lapse between the studies and the computational advances that occurred in that period. The calibration by PSO-HM presented superior results, especially in terms of computational cost, when compared to the GA developed here.

The PSO -HM demonstrated greater speed and consistency in convergence. Based on the results, it is concluded that both models are effective, with emphasis on the more efficient PSO-HM. It is important to highlight the issue of stagnation of the algorithms, which can occur prematurely due to the number of variables, even with a satisfactory population in GA. It is observed that the GA has slow convergence and fast stagnation, requiring a large initial and intermediate population, as well as a high crossover rate. These parameters result in a high computational cost for optimization problems with a large number of variables, especially when this number exceeds hundreds.

ACKNOWLEDGEMENTS

This research was supported by LENHS, Brazilian Power Plants (Centrais Elétricas Brasileiras SA, Eletrobras) and National Council for Scientific and Technological Development (Conselho Nacional de Desenvolvimento Científico e Tecnológico, CNPq).

REFERENCES

  • Agência Nacional de Energia Elétrica – ANEEL. (2023). Anuário estatístico de energia elétrica. Brasília: ANEEL.
  • Balekelayi, N., Woldesellasse, H., & Tesfamariam, S. (2022). Comparison of the performance of a surrogate based gaussian process, NSGA2 and PSO multi-objective optimization of the operation and fuzzy structural reliability of water distribution system: case study for the city of Asmara, Eritrea. Water Resources Management, 36(15), 6169-6185. http://doi.org/10.1007/s11269-022-03347-2
    » http://doi.org/10.1007/s11269-022-03347-2
  • Berardi, L., & Giustolisi, O. (2021). Calibration of design models for leakage management of water distribution networks. Water Resources Management, 35(8), 2537-2551. http://doi.org/10.1007/s11269-021-02847-x
    » http://doi.org/10.1007/s11269-021-02847-x
  • Boczar, T., Adamikiewicz, N., & Stanisławski, W. (2017). Calibration of parameters of water supply network model using genetic algorithm. E3S Web of Conferences, 19, 02007. http://doi.org/10.1051/e3sconf/20171902007
    » http://doi.org/10.1051/e3sconf/20171902007
  • Chen, X., Zhou, X., Xin, K., Liao, Z., Yan, H., Wang, J., & Tao, T. (2022). Sensitivity-oriented clustering method for parameter grouping in water network model calibration. Water Resources Research, 58(5), e2021WR031206. http://doi.org/10.1029/2021WR031206
    » http://doi.org/10.1029/2021WR031206
  • Diaz-Ortiz, J., Alvarado-Medellin, P., Badillo-Almaraz, H., Ramirez-Aguilera, A. M., Ortiz Gomez, R., & Bautista Capetillo, C. (2023). Water distribution system calibration using the Finite Element Method coupled to a Genetic Algorithm. Journal of Water Process Engineering, 54, 104017. http://doi.org/10.1016/j.jwpe.2023.104017
    » http://doi.org/10.1016/j.jwpe.2023.104017
  • Do, N. C., Simpson, A. R., Deuerlein, J. W., & Piller, O. (2016). Calibration of water demand multipliers in water distribution systems using genetic algorithms. Journal of Water Resources Planning and Management, 142(6), 04016044. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000691
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000691
  • Dunca, G., Piraianu, V.-F., Roman, R., Ciuc, P.-O., & Georgescu, S.-C. (2017). Experimental versus EPANET simulation of variable speed driven pumps operation. Energy Procedia, 112, 100-107. http://doi.org/10.1016/j.egypro.2017.03.1070
    » http://doi.org/10.1016/j.egypro.2017.03.1070
  • Gao, T. (2017). Pipe roughness estimation in water distribution networks using head loss adjustment. Journal of Water Resources Planning and Management, 143(5), 04017007. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000752
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000752
  • Georgescu, A. M., Perju, S., Georgescu, S. C., & Anton, A. (2014). Numerical model of a district water distribution system in Bucharest. Procedia Engineering, 70, 707-714. http://doi.org/10.1016/j.proeng.2014.02.077
    » http://doi.org/10.1016/j.proeng.2014.02.077
  • Georgescu, S.-C., Georgescu, A.-M., Madularea, R. A., Piraianu, V.-F., Anton, A., & Dunca, G. (2015). Numerical model of a medium-sized municipal water distribution system located in Romania. Procedia Engineering, 119, 660-668. http://doi.org/10.1016/j.proeng.2015.08.919
    » http://doi.org/10.1016/j.proeng.2015.08.919
  • Gonçalves, J. P., Silva, F. G. B., Silva, A. T. Y. L., & Lourenço, C. A. (2021). Operational strategies aiming at the water and energy sustainability of simulation and sizing of water supply networks. Research, Society and Development, 10(13), e257101321315. http://doi.org/10.33448/rsd-v10i13.21315
    » http://doi.org/10.33448/rsd-v10i13.21315
  • Groppo, G. S., Costa, M. A., & Libânio, M. (2019). Predicting water demand: a review of the methods employed and future possibilities. Water Science and Technology: Water Supply, 19(8), 2179-2198. http://doi.org/10.2166/ws.2019.122
    » http://doi.org/10.2166/ws.2019.122
  • Instituto Trata Brasil. (2023). Statistical yearbook of electric energy. São Paulo. Retrieved in 2023, February 23, from http://tratabrasil.org.br/
    » http://tratabrasil.org.br/
  • Jafari-Asl, J., Sami Kashkooli, B., & Bahrami, M. (2020). Using particle swarm optimization algorithm to optimally locating and controlling of pressure reducing valves for leakage minimization in water distribution systems. Sustainable Water Resources Management, 6(4), 64. http://doi.org/10.1007/s40899-020-00426-3
    » http://doi.org/10.1007/s40899-020-00426-3
  • Kang, D., & Lansey, K. (2009). Real-time demand estimation and confidence limit analysis for water distribution systems. Journal of Hydraulic Engineering, 135(10), 825-837. http://doi.org/10.1061/(ASCE)HY.1943-7900.0000086
    » http://doi.org/10.1061/(ASCE)HY.1943-7900.0000086
  • Kang, D., & Lansey, K. (2011). Demand and roughness estimation in water distribution systems. Journal of Water Resources Planning and Management, 137(1), 20-30. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000086
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000086
  • Kennedy, J., & Eberhart, R. (1995). Particle swarm optimization. In Proceedings of ICNN’95 - International Conference on Neural Networks (Vol. 4, pp. 1942-1948), Perth, WA, Australia. New York: IEEE. http://doi.org/10.1109/ICNN.1995.488968
    » http://doi.org/10.1109/ICNN.1995.488968
  • Kepa, U. (2021). Use of the hydraulic model for the operational analysis of the water supply network: a case study. Water, 13(3), 326. http://doi.org/10.3390/w13030326
    » http://doi.org/10.3390/w13030326
  • Kumar, V., & Yadav, S. M. (2022). A state-of-the-Art review of heuristic and metaheuristic optimization techniques for the management of water resources. Water Science and Technology: Water Supply, 22(4), 3702-3728. http://doi.org/10.2166/ws.2022.010
    » http://doi.org/10.2166/ws.2022.010
  • Leinæs, A., Simukonda, K., & Farmani, R. (2024). Calibration of intermittent water supply systems hydraulic models under data scarcity. Water Science and Technology: Water Supply, 24(5), 1626-1644. http://doi.org/10.2166/ws.2024.075
    » http://doi.org/10.2166/ws.2024.075
  • Letting, L., Hamam, Y., & Abu-Mahfouz, A. M. (2017). Estimation of water demand in water distribution systems using particle swarm optimization. Water, 9(8), 593. http://doi.org/10.3390/w9080593
    » http://doi.org/10.3390/w9080593
  • Macêdo, J. E. S., Azevedo, J. R. G., & Bezerra, S. T. M. (2021). Hybrid particle swarm optimization and tabu search for the design of large-scale water distribution networks. Revista Brasileira de Recursos Hídricos, 26, e11. http://doi.org/10.1590/2318-0331.262120210006
    » http://doi.org/10.1590/2318-0331.262120210006
  • Maier, H. R., Kapelan, Z., Kasprzyk, J., Kollat, J., Matott, L. S., Cunha, M. C., Dandy, G. C., Gibbs, M. S., Keedwell, E., Marchi, A., Ostfeld, A., Savic, D., Solomatine, D. P., Vrugt, J. A., Zecchin, A. C., Minsker, B. S., Barbour, E. J., Kuczera, G., Pasha, F., & Babovic, V. (2014). Evolutionary algorithms and other metaheuristics in water resources: Status, research challenges and future directions. Environmental Modelling & Software, 62, 271-299. http://doi.org/10.1016/j.envsoft.2014.09.013
    » http://doi.org/10.1016/j.envsoft.2014.09.013
  • Meirelles, G., Manzi, D., Brentan, B., Goulart, T., & Luvizotto Junior, E. (2017). Calibration model for water distribution network using pressures estimated by artificial neural networks. Water Resources Management, 31(13), 4339-4351. http://doi.org/10.1007/s11269-017-1750-2
    » http://doi.org/10.1007/s11269-017-1750-2
  • Moghaddam, A., Mokhtari, M., Afsharnia, M., & Minaee, R. P. (2020). Simultaneous hydraulic and quality model calibration of a real-world water distribution network. Journal of Water Resources Planning and Management, 146(6), 06020007. http://doi.org/10.1061/(ASCE)WR.1943-5452.0001209
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0001209
  • Ostfeld, A., Salomons, E., Ormsbee, L., Uber, J. G., Bros, C. M., Kalungi, P., Burd, R., Zazula-Coetzee, B., Belrain, T., Kang, D., Lansey, K., Shen, H., McBean, E., Wu, Z. Y., Walski, T., Alvisi, S., Franchini, M., Johnson, J. P., Ghimire, S. R., Barkdoll, B. D., Koppel, T., Vassiljev, A., Kim, J. H., Chung, G., Yoo, D. G., Diao, K., Zhou, Y., Li, J., Liu, Z., Chang, K., Gao, J., Qu, S., Yuan, Y., Prasad, T. D., Laucelli, D., Vamvakeridou Lyroudia, L. S., Kapelan, Z., Savic, D., Berardi, L., Barbaro, G., Giustolisi, O., Asadzadeh, M., Tolson, B. A., & McKillop, R. (2012). Battle of the water calibration networks. Journal of Water Resources Planning and Management, 138(5), 523-532. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000191
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000191
  • Peirovi Minaee, R., Afsharnia, M., Moghaddam, A., Ebrahimi, A. A., Askarishahi, M., & Mokhtari, M. (2019). Calibration of water quality model for distribution networks using genetic algorithm, particle swarm optimization, and hybrid methods. MethodsX, 6, 123-134. http://doi.org/10.1016/j.mex.2019.03.008
    » http://doi.org/10.1016/j.mex.2019.03.008
  • Rashid, A., & Kumari, S. (2023). Performance evaluation of ANN and ANFIS models for estimating velocity and pressure in water distribution networks. Water Science and Technology: Water Supply, 23(4), 1234-1245. http://doi.org/10.2166/ws.2023.224
    » http://doi.org/10.2166/ws.2023.224
  • Salvino, M. M., Carvalho, P. S. O., & Gomes, H. P. (2015). Multivariate calibration of water supply networks using a multiobjective genetic algorithm. Engenharia Sanitaria e Ambiental, 20(3), 503-512. http://doi.org/10.1590/S1413-41522015020000099484
    » http://doi.org/10.1590/S1413-41522015020000099484
  • Savic, D. A., & Walters, G. A. (1995). Genetic algorithm techniques for calibrating network models. Exeter, UK: University of Exeter. Retrieved in 2023, February 23, from https://www.exeter.ac.uk/media/universityofexeter/emps/research/cws/downloads/Report_95-12.pdf
    » https://www.exeter.ac.uk/media/universityofexeter/emps/research/cws/downloads/Report_95-12.pdf
  • Silva, V. S., Gadeab, A., & Cohim, E. (2024). Stochastic model applied to water demand management in Brazil. Water Science and Technology: Water Supply, 24(3), 692-706. http://doi.org/10.2166/ws.2024.011
    » http://doi.org/10.2166/ws.2024.011
  • Torkomany, M. R., Hassan, H. S., Shoukry, A., Abdelrazek, A. M., & Elkholy, M. (2021). An enhanced multi-objective particle swarm optimization in water distribution systems design. Water, 13(10), 1334. http://doi.org/10.3390/w13101334
    » http://doi.org/10.3390/w13101334
  • Walski, T. (2017). Procedure for hydraulic model calibration. Journal - American Water Works Association, 109(1), 55-61. http://doi.org/10.5942/jawwa.2017.109.0075
    » http://doi.org/10.5942/jawwa.2017.109.0075
  • Walski, T. M., DeFrank, N., Voglino, T., Wood, R., & Whitman, B. E. (2006). Determining the accuracy of automated calibration of pipe network models. Retrieved in 2024, September 1, from http://epanet.com/whitepapers.asp
    » http://epanet.com/whitepapers.asp
  • Wang, Q., Yu, J., & Zhang, X. (2023). Calibration and prediction uncertainty analysis of a hydraulic-water quality coupling model using a modified moth-flame optimizer. Journal of Hydroinformatics, 25(4), 1438-1456. http://doi.org/10.2166/hydro.2023.039
    » http://doi.org/10.2166/hydro.2023.039
  • Wu, Z. Y., & Walski, T. M. (2012). Effective approach for solving battle of water calibration network problem. Journal of Water Resources Planning and Management, 138(5), 435-446. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000193
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000193
  • Xue, F., Tian, J., Wang, W., Zhang, Y., & Ali, G. (2020). Parameter calibration of SWMM model based on optimization algorithm. Computers, Materials & Continua, 65(3), 2189-2199. http://doi.org/10.32604/cmc.2020.06513
    » http://doi.org/10.32604/cmc.2020.06513
  • Zanfei, A., Menapace, A., Santopietro, S., & Righetti, M. (2020). Calibration procedure for water distribution systems: comparison among hydraulic models. Water, 12(5), 1421. http://doi.org/10.3390/w12051421
    » http://doi.org/10.3390/w12051421
  • Zhang, Q., Zheng, F., Duan, H.-F., Jia, Y., Zhang, T., & Guo, X. (2018). Efficient numerical approach for simultaneous calibration of pipe roughness coefficients and nodal demands for water distribution systems. Journal of Water Resources Planning and Management, 144(10), 04018075. http://doi.org/10.1061/(ASCE)WR.1943-5452.0000986
    » http://doi.org/10.1061/(ASCE)WR.1943-5452.0000986
  • Zhao, Q., Wu, W., Simpson, A. R., & Willis, A. (2022). Simpler is better: calibration of pipe roughness in water distribution systems. Water, 14(20), 3276. http://doi.org/10.3390/w14203276
    » http://doi.org/10.3390/w14203276
  • Zhou, X., Xu, W., Xin, K., Yan, H., & Tao, T. (2018). Self-adaptive calibration of real-time demand and roughness of water distribution systems. Water Resources Research, 54(8), 5536-5550. http://doi.org/10.1029/2017WR022147
    » http://doi.org/10.1029/2017WR022147

Edited by

  • Editor-in-Chief:
    Adilson Pinheiro
  • Associated Editor:
    Iran Eduardo Lima Neto

Publication Dates

  • Publication in this collection
    26 May 2025
  • Date of issue
    2025

History

  • Received
    06 Nov 2024
  • Reviewed
    21 Jan 2025
  • Accepted
    03 Mar 2025
location_on
Associação Brasileira de Recursos Hídricos Av. Bento Gonçalves, 9500, CEP: 91501-970, Tel: (51) 3493 2233, Fax: (51) 3308 6652 - Porto Alegre - RS - Brazil
E-mail: rbrh@abrh.org.br
rss_feed Acompanhe os números deste periódico no seu leitor de RSS
Ir para o topo Reportar erro