Journal of Fluids

Volume 2014, Article ID 979706, 12 pages

http://dx.doi.org/10.1155/2014/979706

## Hydraulic Analysis of Water Distribution Network Using Shuffled Complex Evolution

^{1}Civil Engineering Department, University of Torbat-e-Heydarieh, Torbat-e-Heydarieh, Iran^{2}Civil Engineering Department, Ferdowsi University of Mashhad, Mashhad, Iran

Received 23 September 2013; Revised 16 November 2013; Accepted 1 December 2013; Published 16 January 2014

Academic Editor: Prabir Daripa

Copyright © 2014 Naser Moosavian and Mohammad Reza Jaefarzadeh. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Hydraulic analysis of water distribution networks is an important problem in civil engineering. A widely used approach in steady-state analysis of water distribution networks is the global gradient algorithm (GGA). However, when the GGA is applied to solve these networks, zero flows cause a computation failure. On the other hand, there are different mathematical formulations for hydraulic analysis under pressure-driven demand and leakage simulation. This paper introduces an optimization model for the hydraulic analysis of water distribution networks using a metaheuristic method called shuffled complex evolution (SCE) algorithm. In this method, applying if-then rules in the optimization model is a simple way in handling pressure-driven demand and leakage simulation, and there is no need for an initial solution vector which must be chosen carefully in many other procedures if numerical convergence is to be achieved. The overall results indicate that the proposed method has the capability of handling various pipe networks problems without changing in model or mathematical formulation. Application of SCE in optimization model can lead to accurate solutions in pipes with zero flows. Finally, it can be concluded that the proposed method is a suitable alternative optimizer challenging other methods especially in terms of accuracy.

#### 1. Introduction

A water distribution network is composed of an edge set consisting of pumps, pipes, valves, and a node set consisting of reservoirs and pipe intersections [1]. The equations governing the flows and heads in a water distribution system are nonlinear, and often a Newton iterative solution algorithm is used in which a linearized set of equations is solved at each iteration [2]. The Newton-based global gradient algorithm (GGA) is a popular method used in solving the water distribution System (WDS) equations [3]. Given the nonlinearity of the system of equations, the Newton-based computation of the solution involves an iterative two-step process. The first step includes computing the state variable update, which requires the solution of linear system derived from the Jacobian of the WDS equations. The second step deals with updating estimates of the state variables. The first step is typically the most computationally expensive process within the GGA [4]. Furthermore, some of the pipes in a network, in which the head losses are modeled by the Hazen-Williams formula, have zero flows. In that case, a key matrix in the method becomes singular and the matrix to be inverted becomes ill conditioned [2]. As a result a failure occurs in the computation. On the other hand, there are no options for pressure-driven demand and leakage simulation in the EPANET program. Meanwhile, there is still a chance to develop a new method for water distribution network analysis in these conditions. In this paper an optimization model is introduced for hydraulic analysis of water distribution networks using a metaheuristic algorithm called shuffled complex evolution (SCE) algorithm.

The analysis of hydraulic networks should be treated as an optimization problem, as shown by Arora [5], Hall [6], and Collins et al. [1]. Arora considered a simple two-piped loop whereas Collins et al. build the basis of their approach on rigorous theoretical background and developed nonlinear optimization models, whose solutions yielded the hydraulic network analysis [7]. In this paper the Collins model is minimized through the application of shuffled complex evolution algorithm. There is no need to solve linear systems of equations in this methodology, and handling of pressure-driven demand and leakage simulation can be done in a simple way, so an initial solution vector, which is sometimes critical to the convergence, is not required. Furthermore, the proposed model does not entail any complicated mathematical expression and operation. The Collins model is described in the following section.

#### 2. Cocontent Model Approach

Arora [5] is the first researcher who suggested an approach based on the principle of conservation of energy. According to the principle, “Flow in the pipes of a hydraulic network adjusts so that to minimize the expenditure of the system energy.” Then, Collins et al. [1] proposed a model termed the cocontent model, which is based on equations having the unknown nodal heads as the basic unknowns, that is, based on equations. The unknown pipe flows are expressed in terms of the nodal heads and the known pipe resistances, so that the energy loss in pipe () is given by [7] in which is head loss in pipe , and , for source nodes. is the characteristic parameter of the pipe resistance which depends on roughness length, diameter, and unit of measurement. For example, if the Hazen-Williams equation is used, values and in SI units are defined as , . , , and are the Hazen-Williams coefficient (depending on the pipe material), the diameter, and its length, respectively.

Now consider the network of Figure 1, with the known and unknown parameters as shown therein. Let the unknown nodal heads at nodes 1, 2, 3, 4, and 5 be , , , , and , respectively. Herein also consider a ground node with fixed known level , as shown in Figure 1. The nodes 1, 2, 3, and 5 are connected to the ground node with pseudopipes, carrying the known nodal outflows , , , and as shown in Figure 1.

The cocontent optimization model is expressed as where is local loss for valve and is pump head.

The first eight terms of the objective function represent the energy loss in real pipes of the network, respectively, and the last four terms show times the energy loss in the pseudopipes [7]. It should be noted that there are no constraints and therefore an unconstrained model in four decision variables is made. For minimization of optimization model, which is partially differentiating in unknown heads, the node-flow continuity equations are created. Therefore, the solution of the cocontent model gives the values of the unknown heads such that the node-flow continuity relationships are satisfied [7].

By partially differentiating (2) with respect to , , , , and , we get

That is the purely head-based formulations of the network equations. So cocontent model not only minimizes the energy of flow but also preserves water balance in network. For simplicity, can be taken as zero. The general cocontent model can be expressed as

Collins et al. [1] suggested the solution of the NLP optimization of the model. The methods they used were the Frank-Wolfe method, a piecewise linear approximation, and the convex simplex method, which are highly dependent on initial guesses and in some cases converge to an incorrect solution [1].

#### 3. Head Dependent Analysis

In the common approaches, it is presumed that the nodal demands are always satisfied at all demand nodes, irrespective of the available HGL values at demand nodes [7]. But in practice, when the head at a node is insufficient, a reduction in the water flowing from the tap is expected and, at worst, the discharge that can be drafted will be zero, regardless of the actual demand [8]. There are several solutions for these conditions, in the literature. Wagner et al. [9] and Chandapillai [10] suggested a parabolic relationship between required nodal head and minimum head. Their relationships are is the required nodal head. In this situation, applying if-then rules in the optimization model is a simple way in handling the above formulation.

#### 4. Leakage Simulation

Water losses via leakages constitute a major challenge to the effective operation of municipal WDS since they represent not only diminished revenue for utilities but also undermined service quality [11] and wasted energy resources [12]. In order to conduct a more accurate analysis of a WDS, such as a better estimate of flow through the network (with respect to both satisfied demand and losses through leakage), a hydraulic analysis capable of accounting for pressure-driven (also known as head-driven) demand and leakage flow at the pipe level should prove invaluable. To reach this goal, a leakage model is expressed as follows [13]: where is average pressure in the pipe computed as the mean of the pressure values at the end nodes and of the th pipe; and is length of that pipe. Variables and are two leakage model parameters [14]. The allocation of leakage to the two end nodes can be performed in a number of ways [15]. Here the nodal leakage flow is computed as the sum of flows of all pipes connected to node as follows: where . This formulation also easily applies to cocontent model without any mathematical complexity. Numerical example 4 demonstrates hydraulic analysis of a real pipe network in this situations.

#### 5. Application of Shuffled Complex Evolution Algorithm for Minimizing Cocontent Model

This study introduces the shuffled complex evolution (SCE) algorithm for the hydraulic analysis. Since the algorithm was originally developed to solve optimization problems, the hydraulic network analysis was introduced into an optimization problem (cocontent model). One advantage of the SCE algorithm is that it does not need an initial solution vector which must be chosen carefully in many other procedures if numerical convergence is to be achieved. Furthermore, application of SCE algorithm in cocontent model does not require any complicated mathematical expression and operation. In this model, pressure-driven demand and leakage can be simulated easily and there is no failure in computation in zero flow conditions.

##### 5.1. Shuffled Complex Evolution (SCE)

Shuffled complex evolution (SCE) is a simple powerful and population-based stochastic optimization algorithm that outperforms many metaheuristic algorithms in numerical single-objective optimization problems. This method is based on a synthesis of four concepts: combination of deterministic and probabilistic approaches; systematic evolution of a “complex” of points spanning the parameter space, in the direction of global improvement; competitive evolution; complex shuffling [16]. The “complex” is similar to the genetic pool in the GA. The synthesis of these operators makes the SCE method effective and robust and also flexible and efficient [17].

In SCE method, each individual represents a feasible solution for the problem. The search within the feasible region is conducted by first dividing the set of current feasible trial solutions into several complexes, each containing equal number of trial solutions. Each complex represents a local area of the whole domain. Concurrent and independent searches within each complex are conducted until each converges to its local optimal value. Each of the complexes, which are now defined by new trial solutions, is collected into a common pool, shuffled by ranking according to their objective function value, and then further divided into new complexes. The procedure is terminated when none of the local optima found among the complexes can improve on the best current local optimum. The SCE method used the downhill simplex method to accomplish local searches. So, shuffled complex evolution tries to balance between a wide scan of a large solution space and deep search of promising locations. It depends mainly on partitioning the solution space into local communities and performing local search within these communities. Then, it shuffles these local communities to perform global search.

The steps of the procedure of SCE, as shown in Figure 2, include the following. Step 1: initialize problem and algorithm parameters. Step 2: samples generation. Step 3: rank solutions. Step 4: partition into complexes. Step 5: start Competitive Complex Evolution (CCE). Step 6: shuffle complexes. Step 7: check the stopping criterion.

###### 5.1.1. Step 1: Initialize the Problem and Algorithm Parameters

In Step 1, the optimization problem is specified as follows: where is an objective function; is the set of each decision variable. In this paper, the objective function is the cocontent model; the unknown heads are the decision variables.

###### 5.1.2. Step 2: Samples Generation

The initial population for the DE is created arbitrarily by the following formula: where denotes a uniformly distributed random value within the range . and are maximum and minimum limits of variable and node . Then the fitness values of all the individuals of population are calculated. The position matrix of the population of generation can be represented as in which is the number of unknown nodes.

###### 5.1.3. Step 3: Rank Solutions

In this step, the s solutions are sorted in order of increasing criterion value, so that the first vector represents the smallest value of the objective function and the last vector indicates the largest value.

###### 5.1.4. Step 4: Partition into Complexes

The solutions are partitioned into complexes, each containing points. The complexes are partitioned such that the first complex contains every ranked point, the second complex contains every ranked point, and so on, where [16].

###### 5.1.5. Step 5: Start Competitive Complex Evolution (CCE)

CCE algorithm is based on the simplex downhill search scheme and is one key component of SCE algorithm. This algorithm is presented as follows.(1)A subcomplex by randomly selecting solutions from the complex according to a trapezoidal probability distribution is constructed. The probability distribution is specified such that the best solution has the highest chance of being selected to form the subcomplex and the worst point has the least chance.(2)The worst solution of the subcomplex is identified and the centroid of the subcomplex without including the worst solution is computed as follows: (3)In this step, reflection operator is used, by reflecting the worst point through the centroid according to the following formula: If the newly generated solution is within the feasible space, go to ; otherwise, randomly generate a point within the feasible space by Equation (9) and go to .(4)If the newly generated solution is better than the worst solution, then it is replaced by the new solution. Otherwise go to .(5)In this step, contraction operator is applied, by computing a solution halfway between the centroid and the worst point: If the contraction solution is better than the worst solution, then it is replaced by the contraction solution. Otherwise, go to . This step is imported from competitive complex evolution (CCE).(6)A solution within the feasible space is generated randomly and the worst solution is replaced by the randomly generated solution.(7)Steps are repeated times and steps are repeated times.

###### 5.1.6. Step 6: Shuffle Complexes

The solutions in the evolved complexes into a single sample population are combined and the sample population is sorted in order of increasing criterion value and is shuffled into complexes.

###### 5.1.7. Step 7: Check the Stopping Criterion

In this section, Steps 3, 4, and 5 are repeated until the termination criterion is satisfied.

It should be noted that the competitive complex evolution (CCE) algorithm is required for the evolution of each complex. Each point of a complex is a potential “parent” with the ability to participate in the process of reproducing offspring. A subcomplex functions like a pair of parents. Use of a stochastic scheme to construct subcomplexes allows the parameter space to be searched more thoroughly. The idea of competitiveness is introduced in forming subcomplexes where the stronger survives better and breeds healthier offspring than the weaker. Inclusion of the competitive measure expedites the search towards promising regions.

A more detailed presentation of the SCE algorithm has been given by Duan et al. [17].

#### 6. Numerical Examples

In this section, the hydraulic analyses for several conditions in some water distribution networks are performed. All computations were executed in MATLAB programming language environment with an Intel(R) Core(TM) 2Duo CPU P8700 @ 2.53 GHz and 4.00 GB RAM. In order to demonstrate the effectiveness of SCE compared with other methods, this study proposes the use of mass balance and energy balance in the network. The average of mass and energy balance is shown by and it is calculated by the following formula:

For Figure 1 and (2) is calculated as follows:

To check the performance of the SCE for the minimization of cocontent model, in all examples, ten optimization runs were performed using different random initial solutions.

##### 6.1. Numerical Example 1

In this part, the verification of the above mentioned model was conducted via numerical simulation based on an extremely simplified network scheme (5 nodes and 7 pipes) schematically shown in Figure 3 [18]. The pipes resistances were , , , , , , and , as reported in Todini [18] for this network.

The SCE technique is applied to solve this problem according to three cases. The bound variables were set between 90 and 100 m. The problem is also solved using the global gradient algorithm (GGA) and the results are compared with those obtained by the SCE. The best, worst, and average solutions of SCE algorithm in three cases are shown in Table 1. As it can be seen in Table 1, in all cases SCE that found the optimal solution more accurately than GGA method. The average number of function evaluation is about 2000 in case 1 and about 100000 in case 3. This shows SCE can converge to global optimum rapidly but reaching high accuracy needs more operations. The convergence process of SCE algorithm has been shown in two forms in Figures 4 and 5. The absolute value of is calculated for each iteration in Figure 4 and the amount of objective function is calculated for each iteration in Figure 5.

##### 6.2. Numerical Example 2

Example 2 considers the symmetric network shown in Figure 6. It has 11 pipes, seven junctions at which the head is unknown, and one fixed head node reservoir at 40 m elevation and all other nodes are at zero elevation. All pipes have diameters, , of 250 mm and lengths, , of 1,000 m. Node 8 has a demand of 80 l/s, and all other nodes have zero demands. In the steady state, this network has zero flows in pipes 2, 6, and 9 because of symmetry. The head loss is modeled by the Hazen-Williams equation, and each pipe has a Hazen-Williams coefficient [2]. When the GGA is used in this network, the iterates trend toward the solution and the flows in pipes 2, 6, and 9 approach zero. As this happens, the Jacobian matrix becomes more and more badly conditioned, and the solution computed becomes ill conditioned [2]. Elhay and Simpson [2] proposed a regularization procedure for the GGA which prevents failure of the solution process provided that a flow in the network is ultimately zero or near zero.

The SCE parameters are set as follows: number of decision variables = 7; number of points in each complex = 15; number of complexes for case 1 = 4, case 2 = 9, and case 3 = 10; number of iterations in inner loop for case 1 = 4, case 2 = 9, and case 3 = 15. The bound variables were set between 25 and 40 m. The previous best solution for this network, when it is simulated using the Elhay algorithm, and the average solution of SCE algorithm are shown in the second and third columns of Table 2, respectively. As can be observed in Table 2, mass and energy balance () in SCE are more accurate than the Elhay algorithm. Table 3 compares the results of applying the SCE algorithm in three cases. The convergence process of SCE algorithm has been shown in two forms in Figures 7 and 8. The absolute value of is calculated for each iteration in Figure 7 and the value of head pressure in node 2, , is calculated for each iteration in Figure 8.

##### 6.3. Numerical Example 3

The simplified water distribution network shown in Figure 9 was used in order to demonstrate the advantages of the proposed model in pressure-driven demand condition. For the sake of simplicity, the same Hazen-Williams roughness coefficient was assumed for all the 14 pipes of identical length of 1000 m, while no local losses have been added. The following diameters have been used in the example: 500 mm (P-2); 400 mm (P-1); 300 mm (P-4, P-7); 250 mm (P-10); 200 mm (P-3, P-5, P-6, and P-13); 150 mm (P-8, P-9, P-11, P-12, and P-14). The nodal demands are listed in the following tables together with the ground elevation . Without loss of generality, in this example, the minimum head requirement has been assumed to be equal to the ground elevation [8]. So the relationship between the required nodal head and minimum head is

Todini [8] proposed a three-step approach for solving this network and its solution is reported in the 4th column of Table 4. In the proposed method pressure-driven model can be applied in hydraulic analysis without any mathematical formulation. In this situation, an if-then rule is added to cocontent model and optimization process is conducted. The number of decision variables in SCE algorithm is 7; the bound variables were set between 50 and 140 m. ten optimization runs were performed using different random initial solutions for all the cases and the results are illustrated in Table 5. Results confirm that SCE is more accurate compared with Todini algorithm in case 2 and case 3. In Table 4, the best result is shown in bold, and it is considered that the method of SCE has calculated the best value of at 5 nodes while the Todini method has done it at 2 nodes. The convergence process of SCE algorithm has been shown in two forms in Figures 10 and 11. The absolute value of is calculated for each iteration in Figure 10 and the value of head pressure in node 2, , is calculated for each iteration in Figure 11.

##### 6.4. Numerical Example 4

The fourth considered network is a real planned network designed for an industrial area in Apulian Town (Southern Italy). The network layout is illustrated in Figure 12 and the corresponding data are provided in Table 6. With respect to the leakages, they have been assumed to be pressure-driven (see (6)) given that they are implemented in the pressure driven network simulation model as described above [14]. The parameter and , as reported in Giustolisi et al. [14] for this network. Giustolisi et al. [14] proposed a hydraulic simulation model, which fully integrates a classic hydraulic simulation algorithm, such as that of Todini and Pilati [3] found in EPANET 2, with a pressure-driven model that entails a more realistic representation of the leakage. They applied their model in this network. The results are demonstrated in Table 7. In this table, the best result is shown in bold, and it is considered that the method of SCE has calculated the best value of at 14 nodes while the Gistulishi method has done it at 9 nodes. In the proposed method, there is no need to modify the mathematical formulation for hydraulic analysis. An if-then rule is added to cocontent model and the optimization process is performed easily. As you can see in Table 8, SCE found the optimal solution more accurately than the Giustolisi algorithm. The convergence process of SCE algorithm has been shown in two forms in Figures 4 and 5. The absolute value of is calculated for each iteration in Figure 13 and the amount of head pressure in node 20, , is calculated for each iteration in Figure 14.

In general, 4 different pipe networks were considered in this paper and different mathematical formulations were used for the hydraulic analysis of these networks. However, the overall results indicate that the proposed method has the capability of handling various pipe networks problems with no change in the model or mathematical formulation. Application of SCE in cocontent model can result in finding accurate solutions in pipes with zero flows and the pressure-driven demand and leakage simulation can be solved through applying if-then rules in cocontent model. As a result, it can be concluded that the proposed method is a suitable alternative optimizer, challenging other methods especially in terms of accuracy.

#### 7. Conclusions

The objective of the present paper was to provide an innovative approach in the analysis of the water distribution networks based on the optimization model. The cocontent model is minimized using shuffled complex evolution (SCE) algorithm. The methodology is illustrated here using four networks with different layouts. The results reveal that the proposed method has the capability to handle various pipe networks problems without changing in model or mathematical formulation. The advantage of the proposed method lies in the fact that there is no need to solve linear systems of equations, pressure-driven demand and leakage simulation are handled in a simple way, accurate solutions can be found in pipes with zero flows, and it does not need an initial solution vector which must be chosen carefully in many other procedures if numerical convergence is to be achieved. Furthermore, the proposed model does not require any complicated mathematical expression and operation. Finally, it can be concluded that the proposed method is a viable alternative optimizer that challenges other methods particularly in view of accuracy.

#### Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

#### References

- M. Collins, L. Cooper, R. Helgason, J. Kenningston, and L. LeBlanc, “Solving the pipe network analysis problem using optimization techniques,”
*Management Science*, vol. 24, no. 7, pp. 747–760, 1978. View at Publisher · View at Google Scholar - S. Elhay and A. R. Simpson, “Dealing with zero flows in solving the nonlinear equations for water distribution systems,”
*Journal of Hydraulic Engineering*, vol. 137, no. 10, pp. 1216–1224, 2011. View at Publisher · View at Google Scholar · View at Scopus - E. Todini and S. Pilati, “A gradient algorithm for the analysis of pipe networks,” in
*Computer Applications in Water Supply*, vol. 1 of*System Analysis and Simulation*, pp. 1–20, John Wiley & Sons, London, UK, 1988. View at Google Scholar - A. C. Zecchin, P. Thum, A. R. Simpson, and C. Tischendorf, “Steady-state behaviour of large water distribution systems: the algebraic multigrid method for the fast solution of the linear step,”
*Journal of Water Resources Planning and Management*, vol. 138, no. 6, pp. 639–650, 2012. View at Google Scholar - M. L. Arora, “Flow split in closed loops expending least energy,”
*Journal of the Hydraulics Division*, vol. 102, pp. 455–458, 1976. View at Google Scholar · View at Scopus - M. A. Hall, “Hydraulic network analysis using (generalized) geometric programming,”
*Networks*, vol. 6, no. 2, pp. 105–130, 1976. View at Google Scholar · View at Scopus - P. R. Bhave and R. Gupta, “Analysis of water distribution networks,” in
*Alpha Science International, Technology & Engineering*, 2006. View at Google Scholar - E. Todini,
*A More Realistic Approach to the “Extended Period Simulation” of Water Distribution Networks*, Advances in Water Supply Management, chapter 19, Taylor & Francis, London, UK, 2003. - J. M. Wagner, U. Shamir, and D. H. Marks, “Water distribution reliability: analytical methods,”
*Journal of Water Resources Planning and Management*, vol. 114, no. 3, pp. 253–275, 1988. View at Google Scholar · View at Scopus - J. Chandapillai, “Realistic simulation of water distribution system,”
*Journal of Transportation Engineering*, vol. 117, no. 2, pp. 258–263, 1991. View at Google Scholar · View at Scopus - J. Almandoz, E. Cabrera, F. Arregui, E. Cabrera Jr., and R. Cobacho, “Leakage assessment through water distribution network simulation,”
*Journal of Water Resources Planning and Management*, vol. 131, no. 6, pp. 458–466, 2005. View at Publisher · View at Google Scholar · View at Scopus - A. F. Colombo and B. W. Karney, “Energy and costs of leaky pipes toward comprehensive picture,”
*Journal of Water Resources Planning and Management*, vol. 128, no. 6, pp. 441–450, 2002. View at Publisher · View at Google Scholar · View at Scopus - G. Germanopoulos, “A technical note on the inclusion of pressure dependent demand and leakage terms in water supply network models,”
*Civil Engineering Systems*, vol. 2, no. 3, pp. 171–179, 1985. View at Google Scholar · View at Scopus - O. Giustolisi, D. Savic, and Z. Kapelan, “Pressure-driven demand and leakage simulation for water distribution networks,”
*Journal of Hydraulic Engineering*, vol. 134, no. 5, pp. 626–635, 2008. View at Publisher · View at Google Scholar · View at Scopus - L. Ainola, T. Koppel, K. Tiiter, and A. Vassiljev, “Water network model calibration based on grouping pipes with similar leakage and roughness estimates,” in
*Proceedings of the Joint Conference on Water Resource Engineering and Water Resources Planning and Management (EWRI '00)*, pp. 1–9, Minneapolis, Minn, USA, August 2000. View at Publisher · View at Google Scholar · View at Scopus - Q. Duan, S. Sorooshian, and V. K. Gupta, “Optimal use of the SCE-UA global optimization method for calibrating watershed models,”
*Journal of Hydrology*, vol. 158, no. 3-4, pp. 265–284, 1994. View at Google Scholar · View at Scopus - Q. Y. Duan, S. Sorooshian, and V. K. Gupta, “Shuffled complex evolution approach for effective and efficient global minimization,”
*Journal of Optimization Theory and Applications*, vol. 76, no. 3, pp. 501–521, 1993. View at Publisher · View at Google Scholar · View at Scopus - E. Todini, “On the convergence properties of the different pipe network algorithms,” in
*Proceedings of the Annual Water Distribution Systems Analysis Symposium (ASCE '06)*, pp. 1–16, August 2006. View at Publisher · View at Google Scholar · View at Scopus