The optimization of a Water Distribution Network aims to design the least-cost network under different ranges of hydraulic constraints. The objective function is to minimize the cost and maximize the reliability of the Network.

**Objective Function**

Min Z = \(\sum _{i=1}^{np}Ci( L,D)\) (9)

Where, \(Ci\) is the cost of the network, L is the length of link and D is the diameter of the link.

**Constraint 1**:

\({H}_{j}\ge {H}_{j}^{min}\) j = 1,2,3_________________nd (10)

Hydraulic head \({H}_{j}\) available should be greater than or equal to the minimum required value\({H}_{j}^{min}\)

**Constraint 2**:

Pipe Diameter should be selected from commercially available discrete pipe sizes.

\({D}_{i}\) \(\in\) \({CD}_{k}\) \(\forall i k=1 ,\text{2,3}\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_nc\) (11)

**Constraint 3**:

\({V}_{min}\le {V}_{i}\) \(\le\) \({V}_{max}\) i = 1,2,3_________________________n (12)

Where, \({V}_{min} and \le\) \({V}_{max}\) are the minimum and maximum velocity.

**Constraint 4**:

\({P}_{min}\le P\) \(\le\) \({P}_{max}\) i = 1,2,3_________________________n (13)

Where, \({P}_{min} and {P}_{max}\) are the minimum and maximum pressure.

**Nodal Mass Balance**

Flow that enters and leaves a node should be equal.

\({q}_{j}^{in}\) – ( \({q}_{j}^{out}\) + \({q}_{j}\) ) = 0 j = 1,2,3______________________nd (14)

**Loop Energy Balance**

Head Loss around any loop in a WDN should be zero.

\({\left( {\sum }_{i=1}^{npL}HLi \right)}_{k}\) = 0 k= 1,2,3_____________________nL (15)

## 3.1 Operating Policy Implementation

Open Flow Water Gems is used as a decision tool for water distribution network and it also helps to act on operational strategies and how it should grow as population and operational strategies. Water Gems has several features such as to assess fire flow capacity, design water distribution system, Built and manage Hydraulic Models, identify water loss, develop flushing plans, pipe renewal prioritization, Real time simulation of water networks.

While designing the distribution network is should be kept in mind that it should satisfy all the constraints as specified in the standards of (Central Public Health and Environmental Engineering Organization (CPHEEO). The results obtained after hydraulic simulation in Watergems are imported in ANFIS.

The decision variable taken for ANFIS as an input in each case is Pipe Diameter and operational parameters such as valve settings for each loading conditions and we have only one output as per ANFIS rules. To satisfy the hydraulic constraints such as velocity and pressure as an output parameter. One parameter at a time is taken in ANFIS as an output and keeping the input as Pipe Diameter, Length, Elevation at nodes and operational parameters such as valve settings for each loading conditions in an ANFIS model.

Figure 1 shows the ANFIS layout structure which is split into 5 layers. In layer 1 it identifies input & output variables and decide descriptor for the same. In layer 2 membership function are defined for each input & output variables. In layer 3 it forms a rule base. In layer 4 Rule Evaluation is done and in final layer 5 Defuzzification is carried out.

The parameters for optimization in an ANFIS are the premise parameters which describe the shape of the MFs, and the consequent parameters which describe the overall output of the system.

Rule1: IF *x* is \({A}_{1}\)and *y* is\({ B}_{1}\), THEN \({f}_{1}\)= \({p}_{1}\)*x* + \({q}_{1}\)*y* + \({r}_{1}\) (16)

Rule2: IF *x* is \({A}_{2}\) and *y* is \({ B}_{2}\), THEN \({f}_{2}\)= \({p}_{2}\)*x* + \({q}_{2}\)*y* + \({r}_{2}\) (17)