**2.4. Prediction algorithm**

**2.3. Optimization algorithm**

80 Water Supply System Analysis - Selected Topics

**Figure 1.** Stages of the optimization model

hydraulic solutions.

The definition of optimal control strategies in water distribution systems, where the rules evaluate the behaviour of the system and make decisions at each time-step, requiring a great computational demand. Among several available optimization methods, the Genetic Algo‐ rithm (GA) was the tool chosen for offering a great flexibility in search space, allied to the possibility of use discrete variables. Besides these advantages, the technique has an easy ma‐

The model developed is composed by two modules that will work as a whole in a way the hydraulic simulation routine is called to simulate each operational alternative scenarios giv‐

Further a Simple Genetic Algorithm (SGA), a Hybrid Genetic Algorithm (HGA) was also de‐ veloped. This algorithm was built from a combination of a conventional GA with a method of correction of solutions and a specialized local search procedure. The goal is to find, in a faster way, feasible solutions, which are difficult to be found by traditional genetic algo‐ rithms due to the tendency that the situation has to generate a high number of impracticable

The flowchart containing the steps of the optimization model is shown in the Figure 1.

nipulation, which makes its connectivity with simulation models easier.

en by the GA, in the search of alternatives with better performance.

The conception of an ANN in order to capture the best energy model domain from a config‐ uration model and economical simulator (CES) in a much more efficient way is based on the following remarks: first of all, a robust data base has to be developed to create the input and output data set that will be used in ANN conception and training; the data has to be ana‐ lysed to determine a structure that fits the problem and then to train and validate the ANN.

**Figure 2.** Flowchart for the developed ANN model.

A flowchart describing the procedures of the designed ANN is shown on Figure 2.

The data used on this study is calculated by means of a CES model that gives an optimized ranking of the best hybrid solution for each particular case, based on an economy analyses for the production and consumption of energy (Figure 2). This data set is organized with the subject that the study is concerned to evaluate the use of hybrid energy solutions in water distribution systems based on micro-hydro, wind turbine and national electric grid. Hence, the range of data is defined in order to adequate the installation of such energy converters. The data range for flow, power head and water levels variation in reservoirs are used in a hydraulic and power simulator (HPS) to determine the power consumed by the pump and the power produced in a micro-hydro turbine installed in a gravity pipe branch whenever there is energy available in the system.

TR Hydraulic Element Violated Constraint k

Energy Efficiency in Water Supply Systems: GA for Pump Schedule Optimization and ANN for Hybrid Energy Prediction

N2 Positive pressure (continuity of supply) 1.80

R2 Water level at 24h greater than the initial level 1.50

B2 Number of actuations 1.50

The values of k represent how the energy cost is increased for a particular type of violated restriction (TR). These values were determined from the amount and importance of con‐ straints in the model. Analyzing the extreme values (1.05 and 1.80), for each node that ex‐ ceed their limits, increases 5% to the value of the objective function. It was adopted the lower value for this violation because, commonly, the number of nodes in a WSS is higher the amount of tanks and pumps. However, as the discontinuity of the supply occurs in the system, it has great importance in the feasibility of the solution consequently a maximum value was adopted for this type of violation, increasing by 80% the cost of energy. Following this logic, the remaining violations have intermediate k values. When the constraint is not

The first stage of the SGA (Figure 1) process is characterized by the generation of operation‐ al rules (randomly), the demand definition and the tariff costs. Next, these variables are used by the hydraulic simulator (i.e. EPANET), which calculates the pressures in the pipe system nodes, the energy consumed and the levels of the tanks, all of them being necessary for the evaluation of the solution. The following stage is characterized by the calculation of the objective function, which is obtained from the total energy cost and from the penalty function, in case of infeasible solution. The process is repeated until the parameters of the

SGA makes use of the penalty method becoming the infeasible solutions into solutions with reduced ability. The genetic operators only diversify the solutions, but do not become them feasible. In this case, it can be confirmed the search process for solutions hydraulically feasi‐ ble, with minimum energy costs, is strongly stochastic. During the process of evaluation of the objective function, the explicit restrictive variables can be evaluated every hour. Thus, at this time interval, it is possible to verify the type of constraints that were violated. Because of this, repair algorithms were created, and every hour they try to correct the solutions gen‐ erated by GA, becoming them hydraulically feasible. The HGA layout of the model is also presented at Figure 3. Hence, each solution generated by GA is passed on to the repair algo‐

operational control meets the hydraulic requirements with the lowest cost possible.

Pressure between the limits (min. and max.) 1.05

http://dx.doi.org/10.5772/50458

83

Water level between the limits (min. and max.) 1.20

Maximum capacity of pump 1.20

N1

R1

B1

**Table 1.** Values of k

Nodes

Tanks

Pumps

violated the coefficient k has the unit value.

**3.2. Hybrid Genetic Algorithm**
