You are on page 1of 110

OPTIMAL DESIGN AND EXPANSION OF

WATER DISTRIBUTION SYSTEMS USING


GENETIC ALGORITHM

by
A. Murat KAHRAMAN

September, 2003
İZMİR
OPTIMAL DESIGN AND EXPANSION OF
WATER DISTRIBUTION SYSTEMS USING
GENETIC ALGORITHM

A Thesis Submitted to the


Graduate School of Natural and Applied Sciences of
Dokuz Eylül University

In Partial Fulfillment of the Requirements for


the Degree of Master of Science in Environmental Engineering,
Environmental Science Program

by
A. Murat KAHRAMAN

September, 2003
İZMİR
I

M.Sc THESIS EXAMINATION RESULT FORM


We certify that we have read this thesis and “OPTIMAL DESIGN AND
EXPANSION OF WATER DISTRIBUTION SYSTEMS USING GENETIC
ALGORITHM” completed by A.Murat KAHRAMAN under supervision of Prof.
Dr. Davut ÖZDAĞLAR and that in our opinion it is fully adequate, in scope and in
quality, as a thesis for the degree of Master of Science.

Prof. Dr. Davut ÖZDAĞLAR

Supervisor

(Committee Member) (Committee Member)

Approved by the
Graduate School of Natural and Applied Sciences

Prof.Dr. Cahit HELVACI


Director
I

ACKNOWLEDGMENTS

I would like to express my gratitude to:

My supervisor, Prof.Dr. Davut ÖZDAĞLAR for his guidance and support during
the course of this study

I would also like to special thank to my friend Mehmet Fatih YÜCE for his
computer programming support and his friendship.

Finally I would like to thank to my family for their patience, trust and endless
support during all my education life.

Environment Engineer
A. Murat KAHRAMAN
II

ABSTRACT

In last decades, rapid increase in world population, urbanization and depletion of


fresh water resources indicates that the optimization of water distribution networks is
an essential element of water resources protection. Although up to now numerous
computer aided tools on hydraulic design of water distribution networks and
optimization methods have been developed. These methods could not be used widely
due to some difficulties in the application of these methods/tools in real-size water
distribution networks.

Optimization of water distribution systems using genetic algorithms gain


acceptance all over the world recent years. Genetic algorithms are powerful
population oriented search algorithm based upon Darwin’s theory “Survival of the
fittest”. The genetic algorithm selects, combines and manipulates possible solutions
in a search for the lower cost network. Many tests of the application of the genetic
algorithm optimization process to real-life network designs have shown that the GA
is effective at finding low cost solutions. The technique has consistently found lower
cost solution than the trial-and-error simulation approach typically used by design
engineers.

This study describes development of a computer program, called SuGA, which


uses Genetic Algorithm for the least-cost design and expansion of water distribution
system. Program was tested with several problems from the literature, comparing
solutions was fairly near for small-scale water distribution systems. SuGA is a
windows program under construction of Microsoft Visual Basic that optimizes water
distribution systems using genetic algorithm. It uses EPANET2 (Distributed by The
U.S. EPA) for hydraulic calculations, and OptiGA (Optiwater) ActiveX control for
Genetic Algorithm optimization. SuGA can be used for new design, expansion or
rehabilitation of existing water distribution systems for optimization.
III

ÖZET

Dünyada hızla nüfusun artmasına karşılık temiz su kaynaklarının giderek


azalması göz önünde bulundurulursa su dağıtım şebekelerinin optimizasyonunun
öneminin arttığı açıktır. Araştırmacılar önce şebeke hidroliğini çözmek için
bilgisayar programları oluşturmuşlar, daha sonra su dağıtım şebekelerinin
optimizasyonu konusunda çeşitli optimizasyon yöntemleri ve bunları kullanan
programlar hazırlamışlardır. Ancak bunların bir çoğu gerçek şebeke sistemlerine
uygulanması çok zor olan teknikler olması sebebiyle piyasalarda yaygın kullanım
alanı bulamamıştır. Son yıllarda ise yeni bir yaklaşım sayabileceğimiz Genetik
Algoritmaların (GAs) şebeke optimizasyonunda kullanımı giderek artmaktadır.
Genetik algoritmalar, çözüm uzayının büyük olduğu her türlü karmaşık problemde
iyi sonuçlar vermektedir.

Günümüzde genetik algoritmalar su dağıtım sistemlerinin dizaynı, genişletilmesi,


rehabilitasyonu, su sızıntılarını minimize etmek için kontrol vanalarının yerleşimi,
karmaşık sistemler için pompa çalışma zamanlarının düzenlenmesi, hazne işletilmesi,
numune alma ve klorlama istasyonlarının yerleşimi, farklı kaynaklardan alınan
suların kalitesinin optimize edilmesi gibi çok geniş bir alanda yaygın olarak
kullanılmaktadır. Avustralya, Kanada ve Amerika’ nın çeşitli eyaletlerinde su
dağıtım şebekelerinin genetik algoritma ile dizaynı, rehabilitasyonu, genişletilmesi,
işletilmesi gibi çalışmalarda %15 ile %50 arası tasarruf sağlanmıştır (Simpson,
2000).

Genetik Algoritmaların yapısı oldukça basittir, Darvin’in “en iyiler hayatta kalır”
prensibine göre işlerler. Basit bir Genetik Algoritmada en iyiyi belirleyen bir
uygunluk fonksiyonu, seçme, çaprazlama ve mutasyon operatörleri bulunur. Genetik
Algoritmalar belirli bir populasyon topluluğu ile başlarlar (populasyonlar genelde ilk
defa rasgele oluşturulur), bir sonraki jenerasyon topluluktaki en iyi bireyler, seçme
havuzunda birbirleriyle çaprazlanmak için çeşitli seçme yöntemlerinden (rulet,
IV

turnuva gibi) biriyle seçilirler, daha sonra en iyi bireyler birbirleriyle eşleştirilerek
daha iyi bireyler oluşması sağlanır ve kuşaklar boyu sürekli en iyiye doğru gidilir.
Genetik Algoritmalar çözümün nerede sonuçlanacağını bilmezler, yakınsamanın
sağlandığı an çözüm olarak kabul edilir. Dolayısıyla genetik algoritmalar en iyi
çözümü vereceğini garanti etmezler, ancak optimum bir sonuç sağlarlar. Çözüm
uzayının trilyonlar olduğu bir kümede en iyi sonucu bulabilmek ayrı bir meseledir!

Bu çalışmaların ışığında, su dağıtım şebekelerinin dizaynı ve genişletilmesinde


kullanılabilecek, genetik algoritma ile optimizasyon yapan SuGA adlı Visual BASIC
ortamlı bir bilgisayar programı hazırlanmıştır. Hazırlanan program, dağıtım
şebekesinin hidrolik hesapları için EPA’nın su dağıtım şebekesi programı
EPANET2’yi, genetik algoritma için de Optiwater firmasının OptiGA adlı ActiveX
denetimini kullanmaktadır.

Hazırlanan program ile her bir boru için dizaynda kullanılabilecek boru çapları ve
fiyatlarını kullanarak, her düğüm noktası için ayrı ayrı verilebilen minimum ve
maksimum basınç ve her boru için ayrı ayrı verilebilen minimum ve maksimum hız
sınırları arasında optimize edilmiş bir şebeke sunabilmektedir. Optimizasyonda hız
ve basınç sınırlarının verilen tolerans sınırlarında aşılmasında verilen bir ceza puanı
ile şebeke toplam maliyeti artırılmakta, böylece hidrolik açıdan uygun bir şebeke
çözümüne ulaşılabilmektedir.

Literatürde yer alan birçok şebeke sistemi hazırlanan program ile hesaplanarak
test edilmiş ve literatürde yer alan çeşitli genetik algoritma ile çözüm yapan
programın sonuçlarına yakın sonuçlar elde edilmiştir. Genetik algoritma ile yapılan
optimizasyonlarda çözüm uzayı çok geniş olduğundan birbirine çok yakın çeşitli
çözümlere ulaşılabilmektedir. Bu nedenle programın tamamen aynı verilerle yeniden
çalıştırılmasıyla yeni bir çözüme daha ulaşılabilmektedir. Bu nedenle de en iyiye
karar verebilmek oldukça güçtür. Ancak bulunan bir çok çözümde mühendisçe iyi bir
yaklaşım olabilmektedir. Hazırlanan program su dağıtım şebekelerinin dizaynında,
mevcut bir şebekenin genişletilmesinde ve hatta rehabilitasyonunda bir mühendis
denetiminde optimizasyon amaçlı kullanılabilir.
V

CONTENTS

ACKNOWLEDGMENTS ........................................................................................ I
ABSTRACT ............................................................................................................ II
ÖZET .....................................................................................................................III
CONTENTS............................................................................................................V
LIST OF TABLES..................................................................................................IX
LIST OF FIGURES .................................................................................................X

CHAPTER ONE
INTRODUCTION

1.1. Introduction ....................................................................................................1

CHAPTER TWO
OPTIMIZATION TECHNIQUES

2.1. Introduction ....................................................................................................3


2.2. Mathematical Optimization Techniques in Water Distribution Systems...........4
2.3. Meta Heuristic Optimization Techniques in Water Distribution Systems.........5

CHAPTER THREE
GENETIC ALGORITHM

3.1. History of Genetic Algorithm..........................................................................6


3.2. What is Genetic Algorithm..............................................................................7
3.3. Simple Genetic Algorithm...............................................................................7
3.3.1. Encoding a chromosome ..............................................................................9
3.3.2. Reproduction................................................................................................9
3.3.3. Selection ......................................................................................................9
3.3.4. Crossover...................................................................................................10
VI

3.3.5. Mutation ....................................................................................................11


3.3.6. Elitism .......................................................................................................12
3.4. Implementation of Genetic Algorithm ...........................................................12
3.5. Some Application of Genetic Algorithm .......................................................14
3.6. Water Distribution Systems and Genetic Algorithms.....................................16
3.6.1. Steps in Using Genetic Algorithms for Network Optimization....................16
3.6.2. Coding Schemes.........................................................................................17

CHAPTER FOUR
EPANET

4.1. What is EPANET..........................................................................................20


4.2. Hydraulic Modeling Capabilities...................................................................21
4.3. Water Quality Modeling Capabilities ............................................................21
4.4. Hydraulics ....................................................................................................22

CHAPTER FIVE
OPTIGA

5.1. Introduction ..................................................................................................24


5.2. Chromosomal Representation........................................................................24
5.3. Initial Population...........................................................................................24
5.4. Fitness Evaluation.........................................................................................25
5.5. Selection .......................................................................................................25
5.5.1. Top mate....................................................................................................25
5.5.2. Roulette rank/cost ......................................................................................25
5.5.3. Tournament................................................................................................26
5.5.4. Random .....................................................................................................26
5.6. Crossover – in optiGA ..................................................................................26
5.6.1. One point ...................................................................................................26
5.6.2. Two points .................................................................................................27
5.6.3. Uniform .....................................................................................................27
5.6.4. Blending ....................................................................................................27
VII

5.6.5. User defined...............................................................................................27


5.7. Mutation – in optiGA....................................................................................28
5.7.1. Flip bit .......................................................................................................28
5.7.2. Random .....................................................................................................28
5.7.3. Min-max ....................................................................................................28
5.7.4. User defined...............................................................................................28
5.8. Termination – in optiGA ...............................................................................29
5.8.1. Maximum generations................................................................................29
5.8.2. Elapsed time ..............................................................................................29
5.8.3. No change in fitness ...................................................................................29

CHAPTER SIX
SUGA

1. Introduction .....................................................................................................30
6.2. About SuGA .................................................................................................31
6.2.1 Installation ..................................................................................................31
6.2.2 Hardware Requirement ...............................................................................31
6.2.3 Software Requirement.................................................................................31
6.2.4. Program Menu ...........................................................................................32
6.2.5 Toolbox ......................................................................................................33
6.2.6 Design Manager ..........................................................................................34
6.2.7. Junctions ....................................................................................................39
6.2.8. Pipes ..........................................................................................................41
6.2.9. Optimization Options .................................................................................43
6.2.10. Genetic Algorithm Options ......................................................................44
6.2.11. Run Design ..............................................................................................47
6.2.12. Results .....................................................................................................49
6.2.13. Compare Results ......................................................................................51
6.3. Implementation of SuGA ..............................................................................54
VIII

CHAPTER SEVEN
CONCLUSION AND RECOMMENDATION

7.1. Conclusion....................................................................................................60
7.2. Recommendations.........................................................................................61

References ...........................................................................................................62

APPENDICES

Appendix A- SuGA Tutorial ................................................................................66


Appendix B1 – Pipes IDs.....................................................................................82
Appendix B2 – Junctions IDs...............................................................................83
Appendix B3 – Pipes Length ...............................................................................84
Appendix B4 – Juntions Demand.........................................................................85
Appendix C1 – Diameters (mm) ..........................................................................86
Appendix C2 – Velocities (m/s) ...........................................................................87
Appendix C3 – Flows (l/s) ...................................................................................88
Appendix C4 – Unit Headloss..............................................................................89
Appendix C5 – Pressure(m) .................................................................................90
Appendix C6 – Head(m) ......................................................................................91
Appendix D1 – Diameters (mm) ..........................................................................92
Appendix D2 – Velocities (m/s)...........................................................................93
Appendix D3 – Flows (l/s) ...................................................................................94
Appendix D4 – Unit Headloss..............................................................................95
Appendix D5 – Pressure(m).................................................................................96
Appendix D6 – Head(m)......................................................................................97
IX

LIST OF TABLES

Table 3.1. Encoding a chromosome ..........................................................................9


Table 3.2. Crossover ...............................................................................................11
Table 3.3. Mutation ................................................................................................11
Table 3.4. A Genetic Algorithm by Hand................................................................13
Table 3.5. Next Generation .....................................................................................13
Table 6.1. Excavation and filling cost table.............................................................35
Table 6.2. Dizayn Group PE-100 pipes cost (Euro) list ...........................................37
Table 6.3. Cost Data for Pipe ..................................................................................55
Table 6.4. Compare SuGA and Final Solution.........................................................56
X

LIST OF FIGURES

Figure 1.1. Percant of Infrastructure Funding Needs by Area ....................................1


Figure 3.1. Simple Genetic Algorithm ......................................................................6
Figure 3.2 Roulette Wheel Selections .....................................................................10
Figure 6.1 Flow Scheme of SuGA ..........................................................................30
Figure 6.2. Program Menu ......................................................................................32
Figure 6.3. Design Manager....................................................................................34
Figure 6.4. Ditch excavation ...................................................................................36
Figure 6.5. Design manager empty form .................................................................38
Figure 6.6. Junctions...............................................................................................39
Figure 6.7. Unselected Junctions.............................................................................40
Figure 6.8. Pipes .....................................................................................................41
Figure 6.9. Unselected Pipes ...................................................................................42
Figure 6.10. Optimization Options ..........................................................................43
Figure 6.11. Genetic Algorithm Options .................................................................45
Figure 6.12. Run Design .........................................................................................47
Figure 6.13. Run Design progress ...........................................................................48
Figure 6.14. Run Design End ..................................................................................49
Figure 6.15. Result Pipes ........................................................................................52
Figure 6.16. Result Junctions ..................................................................................53
Figure 6.17. Compare Results Diameters ................................................................54
Figure 6.18. Compare Results Velocities ................................................................52
Figure 6.19. Compare Results Pressures .................................................................52
1

CHAPTER ONE

INTRODUCTION

1.1. Introduction

As a vital part of water supply systems, water distribution networks represent one
of the largest infrastructure assets of industrial society. The Water Infrastructure
Network (WIN) report Clean and Safe Water for the 21st Century (April 2000)
warns of huge funding shortfalls for replacement of drinking water infrastructure and
needed improvements to meet federal water regulations. The required capital
investment for drinking water systems alone is estimated to be $24 billion per year
for the next 20 years—this amount dwarfs the $13 billion per year that water systems
currently invest for infrastructure capital needs (The optimatics letter, 2001)

Figure 1.1. Percent of Infrastructure Funding Needs by Area

Source: EPA’s 1997 Drinking Water Infrastructure Needs Survey


Optimization Could Save $2B per Year .Genetic algorithm (GA) optimization,
for example, can be applied to develop superior, low-cost solutions for capital
2

improvement plans (CIPs), main replacement plans, and more. Cost savings of 20%
or higher are not uncommon for both small and large distribution systems. (To apply
the optimization does require a hydraulic model of the system.)

Optimization analysis can help utilities reduce transmission, distribution and


storage improvement costs, which amount to more than 60% of total infrastructure
costs (see Figure 1.1). Assuming that cost savings of 25% can be achieved on just
over half of all projects, the potential savings comes to $2 billion per year for the
USA.

Which optimization techniques should be used?

Consider a simple network of 20 pipes, where each pipe could be one of ten
different diameters. Since search space is 1020, even one computer was capable of
evaluating one million scenarios in a second; it would need over three million years
in order to evaluate all of the enumerations. An expansion which considers changes
in pumps, valves, or other variables as well, would take considerably longer.
Evaluation of all possible solutions seems to be impossible even small network
systems. We need powerful optimization technique that can find optimal solution
among enormous search space. Next chapters, we will have answer about this
problem.
3

CHAPTER TWO

OPTIMIZATION TECHNIQUES

2.1. Introduction

Optimization is a mathematical tool, which is central to wide fields such as


engineering, economics, operations research and management science both as a
solution tool and as a modeling device. Optimization problems arise in almost all
aspects of human life.

A water distribution network can have pipes, hydraulic devices (pumps, pressure
reducing valves, etc.), storage tanks or reservoirs. It has to be built to satisfy
demands at given points (nodes) and satisfy pressure and velocity criteria. The funds
needed for the construction, maintenance, and operation of these systems should be
considered that a good compromise between technical aspects and economic aspects.
As such, a great deal of attention must be paid to their planning and management. So
we can say that optimization of water distribution means, minimize sum of the
capital costs plus the operating costs of the water distribution system while the
system satisfies design criteria

In general available techniques for optimization can be classified as follows

Mathematical optimization techniques;


1. Linear Programming (LP)
2. Dynamic Programming (DP)
3. Nonlinear Programming (NLP)
4

Meta Heuristic optimization techniques;


1. Simulated Annealing
2. Tabu Search
3. Evolutionary Algorithms

2.2. Mathematical Optimization Techniques in Water Distribution Systems

The application of optimization procedures to the design of water distribution


networks has been reported since 1950s. The earliest models for water distribution
network design were developed for branched networks (Karmeli et al. 1968; Schaake
and Lai 1969) and later (Schaake and Lai 1969; Liang 1971); the approaches
guaranteed a global optimum but, since they were applicable only to branched
systems, were not useful in practicing engineers working in urban water distribution
network design. The first model for looped systems proposed by Alperovits and
Shamir (1977) and corrected by Quindry et al. (1979), used additional constraints to
ensure that hydraulic consistency was maintained in the loops, i.e., that the algebraic
sum of head losses around a loop be zero.

Quindry et al. (1981) also used a two-step methodology for the optimal design of
looped networks. This use in these two models of a two-step process in an
optimization framework represented a new stage in the development of the
optimization models for network design.

The next major step in the development of design models focused on ways of
incorporating multiple-load patterns into the design procedure. The approaches taken
to handle the multiple loads issue were again two-step procedures, a process
consistent with the complexity of the design problem noted earlier. One of the first
procedures was that of Rowell and Barnes (1982), who in their initial step developed
an optimal (least cost) branched system and then designed cross connections with
sufficient capacity to meet demands with any single broken link. Morgan and Goulter
(1985) proposed a two-step heuristic procedure based on a linear programming
approach to address the requirement for multiple-load cases, a procedure that
5

required an iterative interaction between two stages of the model and was able to
handle simultaneously as many load cases as there were links in the network.

Lansey and Mays (1989) reported on the development of two-step procedure for
the design of water distribution under multiple loading conditions. This work was an
advance over the models of Rowell and Barnes (1982) and Morgan and Goulter
(1985) in that it considered sizing and location of pumps, storage tanks, and valves as
well as pipes. The procedure was still computationally intensive, however, requiring
a large number of iterations between an optimization model and a simulation model,
with the gradient terms considered at each step (Geem, 2000).

2.3. Meta Heuristic Optimization Techniques in Water Distribution Systems

There are relatively many applications of meta-heuristic optimization techniques


especially for water distribution network problems including new design, expansion
design, layout, rehabilitation, pump operation, location of control valve, and
calibration. You can see some author’s paper about optimization of WDS using GA
in the next chapter.

Simulated annealing-based heuristic models have also been developed to obtain


the least-cost design of a looped distribution network. Simulated annealing is a
stochastic optimization method that can work well for large-scale optimization
problems that are cast in discrete or combinatorial form. Loganathan et al. (1995)
applied optimal design approach using SA to the New York network expansion
problem and Cunha and Sousa (1999) applied the same approach to the Hanoi
network design problem.
6

CHAPTER THREE

GENETIC ALGORITHM

3.1. History of Genetic Algorithm

In the 1950s and the 1960s several computer scientists independently studied
evolutionary systems with the idea that evolution could be used as an optimization
tool for engineering problems (Mitchell, 1996). The first person who proposed
genetic algorithms (GAs) as computer programs that mimic the evolutionary process
in nature is John Holland, in early 1970s. Holland's book "Adaptation in Natural
and Artificial Systems" published in 1975. His genetic algorithm is commonly
called the Simple Genetic Algorithm or SGA, shown in figure 3.1

Simple Genetic Algorithm()


{
Initialize population;
Evaluate population;
While termination criterion not reached
{
Select solutions for next population;
Perform crossover and mutation;
Evaluate population;
}
}

Figure 3.1. Simple Genetic Algorithm

When David Goldberg present “Steady state and transient optimization of gas
pipeline using genetic algorithm, 1983” named thesis, GAs became more popular. In
7

1992 John Koza has used genetic algorithm to evolve programs to perform certain
tasks. He called his method "genetic programming" (GP).

3.2. What is Genetic Algorithm

Genetic algorithms (GAs) are optimization techniques based on the concepts of


natural selection and genetics. Genetic algorithms are inspired by Darwin's theory of
evolution. In this approach, the variables are represented as genes on a chromosome.
Solution to a problem solved by genetic algorithms uses an evolutionary process (it is
evolved). GAs features a group of candidate solutions (population) on the response
surface. Through natural selection and the genetic operators, mutation and
recombination, chromosomes with better fitness are found. Natural selection
guarantees that chromosomes with the best fitness will propagate in future
populations. Using the recombination operator, the GA combines genes from two
parent chromosomes to form two new chromosomes (children) that have a high
probability of having better fitness than their parents. Mutation allows new areas of
the response surface to be explored. This is repeated until some condition (for
example number of populations or improvement of the best solution) is satisfied.

3.3. Simple Genetic Algorithm

The mechanics of a simple genetic algorithm are surprisingly simple, involving


nothing more complex than copying strings and swapping partial strings (Goldberg,
1989).

Given a clearly defined problem to be solved and a bit string representation for
candidate solutions, a simple GA works as follows (Mitchell, 1996):

1. Start with a randomly generated population of n l-bit chromosomes


(candidate solutions to a problem).
2. Calculate the fitness f(x) of each chromosome x in the population.
3. Repeat the following steps until n offspring have been created:
8

a. Select a pair of parent chromosomes from the current population, the


probability of selection being an increasing function of fitness. Selection
is done "with replacement," meaning that the same chromosome can be
selected more than once to become a parent.
b. With probability Pc (the "crossover probability" or "crossover rate"),
cross over the pair at a randomly chosen point (chosen with uniform
probability) to form two offspring. If no crossover takes place, form two
offspring that are exact copies of their respective parents. (Note that here
the crossover rate is defined to be the probability that two parents will
cross over in a single point. There are also "multi-point crossover''
versions of the GA in which the crossover rate for a pair of parents is the
number of points at which a crossover takes place.)
c. Mutate the two offspring at each locus with probability pm (the mutation
probability or mutation rate), and place the resulting chromosomes in the
new population. If n is odd, one new population member can be discarded
at random.
4. Replace the current population with the new population
5. Go to step2

Each iteration of this process is called a generation. A GA is typically iterated


for anywhere from 50 to 500 or more generations. The entire set of generations is
called a run. At the end of a run there are often one or more highly fit chromosomes
in the population. Since randomness plays a large role in each run, two runs with
different random-number seeds will generally produce different detailed behaviors.
GA researchers often report statistics (such as the best fitness found in a run and the
generation at which the individual with that best fitness was discovered) averaged
over many different runs of the GA on the same problem. 3.3

Basic components of simple genetic algorithm are as follows (Obitko, 1998).


9

3.3.1. Encoding a chromosome

A chromosome should in some way contain information about solution that it


represents. The most used way of encoding is a binary string. A chromosome then
could look like this:

Table 3.1. Encoding a chromosome

Chromosome 1 1101100100110110

Chromosome 2 1101111000011110

Each chromosome is represented by a binary string. Each bit in the string can
represent some characteristics of the solution. Another possibility is that the whole
string can represent a number.

Of course, there are many other ways of encoding. The encoding depends mainly
on the solved problem. For example, one can encode directly integer or real numbers;
sometimes it is useful to encode some permutations and so on.

3.3.2. Reproduction

During reproduction, recombination (or crossover) first occurs. Genes from


parents combine to form a whole new chromosome. The newly created offspring can
then be mutated. Mutation means that the elements of DNA are a bit changed. These
changes are mainly caused by errors in copying genes from parents.

The fitness of an organism is measured by success of the organism in its life


(survival).

3.3.3. Selection

Parents are selected according to their fitness. The better the chromosomes are,
the more chances to be selected they have. Imagine a roulette wheel where all the
chromosomes in the population are placed. The size of the section in the roulette
10

wheel is proportional to the value of the fitness function of every chromosome - the
bigger the value is, the larger the section is. See the following picture for an example.

Figure 3.2. Roulette Wheel Selections

A marble is thrown in the roulette wheel and the chromosome where it stops is
selected. Clearly, the chromosomes with bigger fitness value will be selected more
times.

This process can be described by the following algorithm.

1. [Sum] Calculate the sum of all chromosome fitness’s in population - sum S.


2. [Select] Generate random number from the interval (0, S) - r.
3. [Loop] Go through the population and sum the fitness’s from 0 - sum s.
When the sum s is greater then r, stop and return the chromosome where you
are.

Of course, the step 1 is performed only once for each population.

3.3.4. Crossover

After we have decided what encoding we will use, we can proceed to crossover
operation. Crossover operates on selected genes from parent chromosomes and
creates new offspring. The simplest way how to do that is to choose randomly some
11

crossover point and copy everything before this point from the first parent and then
copy everything after the crossover point from the other parent.

Crossover can be illustrated as follows: ( | is the crossover point):

Table 3.2. Crossover

Chromosome 1 11011 | 00100110110

Chromosome 2 11011 | 11000011110

Offspring 1 11011 | 11000011110

Offspring 2 11011 | 00100110110

There are other ways how to make crossover, for example we can choose more
crossover points. Crossover can be quite complicated and depends mainly on the
encoding of chromosomes. Specific crossover made for a specific problem can
improve performance of the genetic algorithm.

3.3.5. Mutation

After a crossover is performed, mutation takes place. Mutation is intended to


prevent falling of all solutions in the population into a local optimum of the solved
problem. Mutation operation randomly changes the offspring resulted from
crossover. In case of binary encoding we can switch a few randomly chosen bits
from 1 to 0 or from 0 to 1. Mutation can be then illustrated as follows:

Table 3.3. Mutation

Original offspring 1 1101111000011110

Original offspring 2 1101100100110110

Mutated offspring 1 1100111000011110

Mutated offspring 2 1101101100110110


12

The technique of mutation (as well as crossover) depends mainly on the encoding
of chromosomes. For example when we are encoding permutations, mutation could
be performed as an exchange of two genes.

3.3.6. Elitism

The idea of the elitism has been already introduced. When creating a new
population by crossover and mutation, we have a big chance, that we will loose the
best chromosome.

Elitism is the name of the method that first copies the best chromosome (or few
best chromosomes) to the new population. The rest of the population is constructed
in ways described above. Elitism can rapidly increase the performance of GA,
because it prevents a loss of the best found solution.

3.4. Implementation of Genetic Algorithm

An example taken from (Goldberg, 1989) facilitates understanding of genetic


algorithm. Consider the problem of maximizing the function f(x) = x2, where x is
permitted to vary between 0 and 31. With a five bit (binary digit) unsigned integer
we can obtain numbers between 0 (00000) and 31 (11111). We now simulate a single
generation of a genetic algorithm with reproduction, crossover and mutation. To start
of we select an initial population. We select a population of size 4 by tossing a fair
coin 20 times.
13

Table 3.4. A Genetic Algorithm by Hand

STRING INITIAL X VALUE F(X) PSELECT EXPECTED ACTUAL


NO POPULATION INTEGER X2 FI/ΣF COUNT COUNT
(RANDOM)
1 01101 13 169 0,14 0,58 1
2 11000 24 576 0,49 1,97 2
3 01000 8 64 0,06 0,22 0
4 10011 19 361 0,31 1,23 1
Sum 1170 1,00 4,00 4,0

Average 293 0,25 1,00 1,0

Max 576 0,49 1,97 2,0

We select the mating pool of the next generation by spinning the weighted
roulette wheel four times. Actual simulation of this process using coin tosses has
resulted in string 1 and string 4 receiving one copy in the mating pool, string 2
receiving two copies, and string 3 receiving no copies as shown in table 3.5
Comparing this with the expected number of copies (n.pselecti) we have obtain what
we should expect: the best get more copies, the average stay even, and the worst die
off.

Table 3.5. Next Generation

MATING POOL MATE CROSSOVER NEW X F(X)


STRING

AFTER RANDOMLY SITE POPULATION VALUE X2


NO

REPRODUCTION SELECTED

1 01101 2 4 01100 12 144


2 11000 1 4 11001 25 625
3 01000 4 2 11011 27 729
4 10011 3 2 10000 16 256

Sum 1754

Average 439

Max 729

With an active pool of strings looking for mates, simple crossover proceeds in
two steps: (1) strings are mated randomly, using coin tosses to pair off the happy
14

couples, and (2) mated string couples cross over, using coin tosses to select the
crossing sites. Referring again to table 3.5, random choice of mates has selected the
second string in the mating pool to be mated with the first. With a crossing site of 4,
the two strings 01101 and 11000 cross and yield two new strings 01100 and 11001.
The remaining two strings in the mating pool are crossed at site 2.

The last operator, mutation, is performed on a bit-by-bit basis. We assume that


the probability of mutation in this test 0,001. With 20 transferred bit position we
should expect 20*0,001 = 0,02 bits to undergo mutation during a given generation.
Simulation of this process indicates that no bits undergo mutation for this probability
value.

Following reproduction, crossover and mutation, the new population is ready to


be tested. To do this, we simply decode the new strings created by the simple genetic
algorithm and calculate the fitness function values from the x values thus decoded.
The population average fitness has improved from 293 to 439 in one generation. The
maximum fitness has increased from 576 to 729 during that same period. Although
random processes help cause these happy circumstances, we start to see that this
improvement is no fluke. The best string of the first generation (11000) receives two
copies because of its high, above-average performance. When this combines at
random with the next highest string (10011) and is crossed at location 2 (again at
random), one of the resulting strings (11011) proves to be a very good choice indeed.

3.5. Some Application of Genetic Algorithm


This part is taken from (Mitchell, 1996)
Engineering
GAs have been wide variety used in engineering for optimization
Automatic programming
GAs have been used to evolve computer programs for specific tasks, and to
design other computational structures such as cellular automata and sorting networks.
15

Machine learning
GAs have been used for many machine learning applications, including
classification and prediction tasks, such as the prediction of weather or protein
structure. GAs have also been used to evolve aspects of particular machine learning
systems, such as weights for neural networks, rules for learning classifier systems or
symbolic production systems, and sensors for robots.

Economics
GAs have been used to model processes of innovation, the development of
bidding strategies, and the emergence of economic markets.

Immune systems
GAs have been used to model various aspects of natural immune systems,
including somatic mutation during an individual's lifetime and the discovery of
multi-gene families during evolutionary time.

Ecology
GAs have been used to model ecological phenomena such as biological arms
races, host-parasite co evolution, symbiosis, and resource flow.

Population genetics
GAs have been used to study questions in population genetics, such as "Under
what conditions will a gene for recombination be evolutionarily viable?"

Evolution and learning


GAs have been used to study how individual learning and species evolution
affect one another.

Social systems
GAs have been used to study evolutionary aspects of social systems, such as the
evolution of social behavior in insect colonies, and, more generally, the evolution of
cooperation and communication in multi-agent systems.
16

This list is by no means exhaustive, but it gives the flavor of the kinds of things
GAs have been used for, both in problem solving and in scientific contexts. Because
of their success in these and other areas, interest in GAs has been growing rapidly in
the last several years among researchers in many disciplines. The field of GAs has
become a sub discipline of computer science, with conferences, journals, and a
scientific society.

3.6. Water Distribution Systems and Genetic Algorithms

3.6.1. Steps in Using Genetic Algorithms for Network Optimization

The following steps summarize an implementation of a genetic algorithm for


optimizing the design of a water distribution network system (based on Simpson,
Murphy and Dandy 1993; Simpson, Dandy and Murphy 1994):
1. Develop a coding scheme to represent the decision variables to be optimized
and the corresponding lookup tables for the choices for the design variables.
2. Choose the form of the genetic algorithm operators; e.g. population size (say
N=100 or 500); selection scheme - tournament selection or biased Roulette wheel;
crossover type - one-point, two-point or uniform; and mutation type - bit-wise or
creeping.
3. Choose values for the genetic algorithm parameters (e.g. crossover probability
– pc; mutation probability - pm; penalty cost factor K).
4. Select a seed for the random number generator.
5. Randomly generate the initial population of water distribution network
designs.
6. Decode each string in the population by dividing into its sub-strings and then
determining the corresponding decision variable choices (using the lookup tables).
7. For the decoded strings, compute the network cost of each of the designs in the
population.
8. Analyze each network design with a hydraulic solver for each demand loading
case to compute network flows, pressures and pressure deficits (if any).
17

9. Compute a penalty cost for each network where design constraints are
violated.
10. Compute the fitness of each string based on the costs in steps 7 and 9; often
taken as the inverse of the total cost (network cost plus penalty cost).
11. Create a mating pool for the next generation using the selection operator that
is driven by the “survival of the fittest.”
12. Generate a new population of designs from the mating pool using the genetic
algorithm operators of crossover and mutation.
13. Record the lowest cost solutions from the new generation.
14. Repeat steps 6 to 13 to produce successive generations of populations of
designs stop if all members of the population are the same.
15. Select the lowest cost design and any other similarly low cost designs of
different configuration.
16. Check if any of the decision variables have been selected at the upper bound
of the possible choices in the lookup table. If so, expand the range of choices and re-
run of genetic algorithm.
17. Repeat steps 4 to 16 for say, ten different starting random number seeds.
18. Repeat steps 4 to 17 for successively larger and larger population sizes.

Some of the main steps in the genetic algorithm process are now described in
more detail.

3.6.2. Coding Schemes

A genetic algorithm coding scheme is required for each of the design variables
within the water distribution system to be selected as part of the design. Examples of
design variables that may need to be selected include:

1. Diameter, material and class of new pipes.


2. Diameter, material and class of duplicate pipes (that is – pipes in parallel to
existing pipes).
3. The possibility of cleaning or eliminating existing pipes.
18

4. Possible locations of source pumps and/or booster pumps.


5. Sizes of pumps (that is –the rated head and rated discharge)
6. The operating schedule for pumps.
7. Possible locations of storage tanks.
8. Sizes and normal operating levels for the tanks.
9. Possible locations of pressure regulating valves (for example, pressure
reducing valves, pressure sustaining valves, flow control valves)
10. Pressure settings for the pressure regulator valves.

Each decision variable to be selected is coded within a finite-length string.

Genetic algorithm optimization can be applied to the design of the following


systems:

· Urban water distribution systems.


· Piped off-farm irrigation systems.
• Design of new water distribution systems, calibrating existing models, and
locating monitoring stations.
· Expansion of existing systems.
· Rehabilitation of existing systems.
· Optimizing the operation of existing systems.
• Scheduling pumps for large or complex distribution systems.
• Setting operational points for water tanks, pumps, and pressure valves.
• Blending of water sources to meet water quality standards at minimum costs.
• Locating and sizing system storage to meet equalization, fire flow, and
emergency needs most efficiently.
• Optimizing the location of control valves in a water supply network in order
to maximize leakage reduction.

Many different authors presented application of GA over water distribution


systems, some of them are;
19

Simpson et al. (1994) presented a methodology for the application of the GA


technique to the optimization of pipe network design.
Dandy et al. (1996) proposed an improved genetic algorithm for pipe network
optimization.
Savic and Walters (1997) developed a computer model GANET that involves the
application of an area of genetic algorithms to the problem of least-cost design of
water distribution networks.
Halhal et al. (1997) demonstrated the potential of water network rehabilitation
optimization using structured messy GA.
Reis et al. (1997) used genetic algorithm for optimal location of control valves in
pipe Networks
Gupta et al. (1998) presented genetic algorithm for optimization of water
distribution systems
Walters et al. (1998) applied GA to calibration of water distribution network
models.
Montesinos et al. (1999) proposed another modified genetic algorithm for
optimal water network design.
Lippai et al. (1999) demonstrated the use of several commercial optimizers for
the optimal design of water network
Aral et al. (2001) proposed reconstruction of hydraulic management of a WDS
using genetic algorithm.
20

CHAPTER FOUR

EPANET

4.1. What is EPANET

This chapter is taken from EPANET2 user manual; more information can be
found there. EPANET is a computer program that performs extended period
simulation of hydraulic and water quality behavior within pressurized pipe networks.
A network consists of pipes, nodes (pipe junctions), pumps, valves and storage tanks
or reservoirs. EPANET tracks the flow of water in each pipe, the pressure at each
node, the height of water in each tank, and the concentration of a chemical species
throughout the network during a simulation period comprised of multiple time steps.
In addition to chemical species, water age and source tracing can also be simulated.
EPANET is designed to be a research tool for improving our understanding of the
movement and fate of drinking water constituents within distribution systems. It can
be used for many different kinds of applications in distribution systems analysis.
Sampling program design, hydraulic model calibration, chlorine residual analysis,
and consumer exposure assessment are some examples. EPANET can help assess
alternative management strategies for improving water quality throughout a system.

These can include:


· altering source utilization within multiple source systems,
· altering pumping and tank filling/emptying schedules,
· use of satellite treatment, such as re-chlorination at storage tanks,
· targeted pipe cleaning and replacement.

Running under Windows, EPANET provides an integrated environment for


editing network input data, running hydraulic and water quality simulations, and
21

viewing the results in a variety of formats. These include color-coded network maps,
data tables, time series graphs, and contour plots.

4.2. Hydraulic Modeling Capabilities

Full-featured and accurate hydraulic modeling is a prerequisite for doing


effective water quality modeling. EPANET contains a state-of-the-art hydraulic
analysis engine that includes the following capabilities:

· places no limit on the size of the network that can be analyzed


· computes friction head loss using the Hazen-Williams, Darcy-Weisbach, or
Chezy-Manning formulas
· includes minor head losses for bends, fittings, etc.
· models constant or variable speed pumps
· computes pumping energy and cost
· models various types of valves including shutoff, check, pressure regulating,
and flow control valves
· allows storage tanks to have any shape (i.e., diameter can vary with height)
· considers multiple demand categories at nodes, each with its own pattern of
time variation
· models pressure-dependent flow issuing from emitters (sprinkler heads)
· can base system operation on both simple tank level or timer controls and on
complex rule-based controls.

4.3. Water Quality Modeling Capabilities

In addition to hydraulic modeling, EPANET provides the following water quality


modeling capabilities:
· models the movement of a non-reactive tracer material through the network
over time
22

· models the movement and fate of a reactive material as it grows (e.g., a


disinfection by-product) or decays (e.g., chlorine residual) with time
· models the age of water throughout a network
· tracks the percent of flow from a given node reaching all other nodes over time
· models reactions both in the bulk flow and at the pipe wall
· uses n-th order kinetics to model reactions in the bulk flow
· uses zero or first order kinetics to model reactions at the pipe wall
· accounts for mass transfer limitations when modeling pipe wall reactions
· allows growth or decay reactions to proceed up to a limiting concentration
· employs global reaction rate coefficients that can be modified on a pipe-by-
pipe basis
· allows wall reaction rate coefficients to be correlated to pipe roughness
· allows for time-varying concentration or mass inputs at any location in the
network
· models storage tanks as being either complete mix, plug flow, or two-
compartment reactors.
By employing these features, EPANET can study such water quality phenomena
as:
· blending water from different sources
· age of water throughout a system
· loss of chlorine residuals
· growth of disinfection by-products
· tracking contaminant propagation events.

4.4. Hydraulics

The method used in EPANET to solve the flow continuity and head loss
equations that characterize the hydraulic state of the pipe network at a given point in
time can be termed a hybrid node-loop approach. Todini and Pilatini (1987) and later
Salgado et al. (1988) chose to call it the "Gradient Method". Similar approaches have
been described by Hamam and Brameller (1971) (the "Hybrid Method) and by
Osiadacz (1987) (the "Newton Loop-Node Method"). The only difference between
23

these methods is the way in which link flows are updated after a new trial solution
for nodal heads has been found. Because Todini's approach is simpler, it was chosen
for use in EPANET.
hf = 4,72 C-1,85. q1,85. d-4,87. L
hf = 0,0252 f(ε,d,q). q2. d-5. L
hf = 4,66 n2. q2. d-5,33. L
24

CHAPTER FIVE

OPTIGA

5.1. Introduction

This chapter is taken from OptiGA user manual; more information can be found
at http://www.optiwater.com. OptiGA is an activeX controls for Windows
applications, which can be capable solve complex problems using genetic algorithm.
It has some useful properties, events, methods and functions to construct algorithm
structure. OptiGA present 3 coding scheme binary coding, real coding and integer
coding. Problem parameters (genes) and fitness function (the hearth of the GA) must
be defined selecting one of these coding schemes by the user

5.2. Chromosomal Representation

Each chromosome represents a legal solution to the problem and is composed of


a string of genes. The binary alphabet {0,1} is often used to represent these genes but
sometimes, depending on the application, integers or real numbers are used. In fact,
almost any representation can be used that enables a solution to be encoded as a
finite length string.

5.3. Initial Population

Once a suitable representation has been decided upon for the chromosomes, it is
necessary to create an initial population to serve as the starting point for the genetic
algorithm. This initial population is usually created randomly. From empirical
25

studies, over a wide range of function optimization problems, a population size of


between 30 and 100 is usually recommended.

5.4. Fitness Evaluation

Fitness evaluation involves defining an objective or fitness function against


which each chromosome is tested for suitability for the environment under
consideration. As the algorithm proceeds we would expect the individual fitness of
the "best" chromosome to increase as well as the total fitness of the population as a
whole.

5.5. Selection

We need to select chromosomes from the current population for reproduction. If


we have a population of size 2N, the selection procedure picks out two parent
chromosomes, based on their fitness values, which are then used by the crossover
and mutation operators (described below) to produce two offspring for the new
population. This selection/crossover/mutation cycle is repeated until the new
population contains 2N chromosomes i.e. after cycles. The higher the fitness values
the higher the probability of that chromosome being selected for reproduction.
Here are the selection methods implemented with optiGA:

5.5.1. Top mate

The first parent is selected by the fitness order. The second parent is selected
randomly.

5.5.2. Roulette rank/cost

With this selection method, the chance of a chromosome to be selected is


calculated according to their fitness (cost) or according to their rank.
26

5.5.3. Tournament

With this selection method, a small subset of chromosomes is selected and the
one with the best fitness will become a parent.

5.5.4. Random

This is the simplest method. Parents are simply selected randomly.

5.6. Crossover – in optiGA

After two parents have been selected by the selection method, crossover takes
place. Crossover is an operator that mates the two parents (chromosomes) to produce
two offspring’s. The two newborn chromosomes may be better then their parents and
the evolution process may continue. The crossover in carried out according to the
crossover probability.
Here are the crossover methods implemented by optiGA:

5.6.1. One point

A random crossover point is selected. The first part of the first parents is hooked
up with the second part of the second parent to make the first offspring. The second
offspring is build from the first part of the second parent and the second part of the
first parent (the crossover point is noted by the | sign):

Parent #1: 011101|0101


Parent #2: 100111|0111
Offspring #1: 011101|0111
Offspring #2: 100111|0101
Implemented for binary genes only!
27

5.6.2. Two points

The two point’s crossover operator differs from the one point crossover in the
fact that two crossover points are selected randomly:
Parent #1: 011|101|0101
Parent #2: 100|111|0111
Offspring #1: 011|101|0111
Offspring #2: 100|111|0101
Implemented for binary genes only!

5.6.3. Uniform

In the uniform crossover each bit/gene is selected randomly, either from the first
parent or from the second one:
Parent #1: 0111010101
Parent #2: 1001110111
Offspring #1: 0111010111
Offspring #2: 1001110101

5.6.4. Blending

This crossover operator is a kind of linear combination of the two parents that
uses the following equations for each gene:
Offspring #1 = parent1 – b * (parent1 – parent2)
Offspring #2 = parent2 + b * (parent1 – parent2)
Were b is a random value between 0 and 1.
Implemented for real and integers genes only!

5.6.5. User defined

The user defined crossover method is the most powerful one. With this method
the user may code his own crossover operator, so the sky is the limit.
28

5.7. Mutation – in optiGA

Mutation is the genetic operator that randomly changes one or more of the
chromosome’s gene. The purpose of the mutation operator is to prevent the genetic
population from converging to a local minimum and to introduce to the population
new possible solutions. The mutation is carried out according to the mutation
probability.
Here are the mutation methods implemented by optiGA:

5.7.1. Flip bit

This mutation method simply changes (flips) a randomly selected bit:


Before mutation: 0111010101
After mutation: 0111000101
Implemented for binary genes only!

5.7.2. Random

The random mutation operator exchange’s a random selected gene with a random
value within the range of the gene’s minimum value and the gene’s maximum value.
Implemented for real and integers genes only!

5.7.3. Min-max

The min-max mutation operator exchange’s a random selected gene with the
gene’s minimum value or with the gene’s maximum value, selected randomly.
Implemented for real and integers genes only!

5.7.4. User defined

The user defined mutation method is the most powerful one. With this method
the user may code his own mutation operator, so the sky is the limit.
29

5.8. Termination – in optiGA

The termination method determines when the genetic process will stop evolving.
Here are the termination methods implemented by optiGA:

5.8.1. Maximum generations

The genetic process will end when the specified number of generation’s have
evolved.

5.8.2. Elapsed time

The genetic process will end when a specified time has elapsed.
Note: if the maximum number of generation has been reached before the specified
time has elapsed, the process will end.

5.8.3. No change in fitness

The genetic process will end if there is no change to the population’s best fitness
for a specified number of generations.
Note: if the maximum number of generation has been reached before the specified
number of generation with no changes has been reached, the process will end.
30

CHAPTER SIX

SuGA

6.1. Introduction

SuGA is a windows program under construction of Microsoft Visual Basic that


optimizes water distribution systems using genetic algorithm. SuGA is not a water
distribution network simulation modeler; it performs as a next step after simulation
modeling.
EPANET

SuGA
OptiGA

Random Population
Have Yes
Terminati
Cost Has the
on criteria Generation
been met? Number
Reach Max Selection
Generation
No Crossover
No Mutation

Generation =
Cost = Cost + Yes Generation + 1
Penalty Cost

SOLUTION

Figure 6.1. Flow Scheme of SuGA


31

Before run the program firstly water network data must be entered in EPANET2
and it must be run without any error. Export the network from EPANET2 must be
done as an INP file, so we have the data which is necessary to run the SuGA.

6.2. About SuGA

6.2.1. Installation
SuGA has setup file, so you can easily install it that way you used to windows
programs

6.2.2. Hardware Requirement


SuGA was tested on Pentium IV 1.6 GHz, 256 MB DDR 333 RAM and Pentium
IV 2.2 GHz, 512 MB RD RAM. Both machines showed well performance and
acceptable run time, but of course the more supply CPU and RAM the more
performance on run time.

6.2.3. Software Requirement


SuGA uses EPANET2 (which is freely distributed by the U.S. Environmental
Protection Agency) for hydraulic calculations and OptiGA (which can be found 30
day trial version Genetic Algorithm ActiveX control on http://www.optiwater.com )
for Genetic Algorithm optimization. So you need EPANET2 for drawing network
and entering network data.
32

6.2.4. Program Menu

File Design Options Tools Run Help

Open Design Manager Language Design Index

Save Junctions Results Tutorial


Turkish
Exit Pipes Compare About
English Results

Optimization
Options

GA
Options

Figure 6.2. Program Menu


33

6.2.5. Toolbox

Open
Open file that *.inp (EPANET input file) or *.sga (SuGA project file)

Save
Save file that *.sga (SuGA project file) before run optimization

Design Manager
Displays Design Manager Form

Junctions
Displays Junctions form

Pipes
Displays Pipes form

Optimization Options
Displays Optimization Options form

Genetic Algorithm Options


Displays Genetic Algorithm Options form

Run
Displays Run form

Results
Displays Results form

Compare Results
Displays Compare Results form

Turkish
Translate language to Turkish

English
Translate language to English

Help Displays Help


34

6.2.6. Design Manager

Figure 6.3. Design Manager

Design manager has 3 important column cost for unit pipe length, diameter,
roughness coefficient respectively. These components will be used for pipe design in
water distribution system. You may consider design manager a kind of pipe
catalogue.

How to create pipe’s cost considering distribution systems are shown next
35

Table 6.1. Excavation and filling cost table

POZ NO YAPILAN IŞIN CINSI MIKTARI BR BIRIM FIYAT TUTARI (TL)


14.012/2 El ile her derinlikte toprakta dar derin kazı yapılması 0,080 m³ 5.604.843 448.387,44
14.013/2 El ile her derinlikte küskülük zeminde dar derin kazı yapılması 0,060 m³ 8.070.975 484.258,50
14.015/2 El ile her derinlikte yumuşak kayada dar derin kazı yapılması 0,030 m³ 12.801.223 384.036,69
14.016/2 El ile her derinlikte sert kayada dar derin kazı yapılması 0,020 m³ 16.711.046 334.220,92
14.017/2 El ile her derinlikte çok sert kayada dar derin kazı yapılması 0,010 m³ 24.530.695 245.306,95
151/3 Makine ile her derinlikte toprakta dar derin kazı yapılması 0,320 m³ 2.093.923 670.055,36
156/3 Makine ile her derinlikte küskülükte dar derin kazı yapılması 0,240 m³ 3.463.327 831.198,48
15.010/6 Makine ile her derinlikte yumuşak kayada dar derin kazı yapılması 0,120 m³ 4.316.857 518.022,84
15.014/3 Makine ile her derinlikte sert kayada dar derin kazı yapılması 0,080 m³ 8.632.540 690.603,20
15.018/3 Makine ile her derinlikte çok sert kayada dar derin kazı yapılması 0,040 m³ 9.955.897 398.235,88
15.140/İB-1 Stabilize malzeme ile hendek ve temel dolgusu yapılması 0,100 m³ 2.560.385 256.038,50
14.1714/1 Kazı malzemesinden makine ile hendek ve temel dolgusu yapılması 0,600 m³ 1.858.533 1.115.119,80
15.140/İB-4 Her kategoride kum-çakılın el ile sıkıştırılarak hendek ıslahı, 0,300 m³ 4.627.530 1.388.259
TOPLAM 2 m³ 7.763.743,56

Land Class : Soil : 40% , Sand : 30% , Soft Rock : 15% , Hard Rock : 10% , The Hardest Rock : 5% to be taken
Ditch excavation is done by 20% hand, 80% machine. Excavation and filling cost for 1m³ is found 7.763.744 TL
36

Figure 6.4. Ditch excavation

Excavation and filling cost for 1m and different diameters


1 Euro = 1.600.000 TL

80 mm 1m PE-100 0,713 m3 * 7.763.744 = 5.535.549 TL = 3,46 Euro


100 mm 1m PE-100 0,726 m3 * 7.763.744 = 5.636.478 TL = 3,52 Euro
125 mm 1m PE-100 0,743 m3 * 7.763.744 = 5.768.462 TL = 3,60 Euro
150 mm 1m PE-100 0,762 m3 * 7.763.744 = 5.915.973 TL = 3,70 Euro
200 mm 1m PE-100 0,792 m3 * 7.763.744 = 6.148.885 TL = 3,84 Euro
250 mm 1m PE-100 0,894 m3 * 7.763.744 = 6.940.787 TL = 4,34 Euro
300 mm 1m PE-100 1,001 m3 * 7.763.744 = 7.771.508 TL = 4,86 Euro
400 mm 1m PE-100 1,232 m3 * 7.763.744 = 9.564.933 TL = 5,98 Euro
500 mm 1m PE-100 1,485 m3 * 7.763.744 = 11.529.160 TL = 7,20 Euro
37

Table 6.2. Dizayn Group PE-100 pipes cost (Euro) list

DIZAYN GROUP PE100 PIPES COST LIST


Diameter (mm) PN16 (Euro) PN10 (Euro) PN8 (Euro) PN6 (Euro)
80 3,95 2,75 2,34 1,78
100 6,78 4,68 3,83 2,85
125 10,48 7,12 5,84 4,42
150 15,15 10,30 8,44 6,40
200 26,75 18,14 14,90 11,29
250 41,80 28,17 23 17,67
300 59,34 40,13 32,75 25,20
400 106,83 72,15 59,07 45,21
500 166,98 113,02 92,06 70,63

Total cost for 1m length pipe concerning water distribution systems

80 mm 1m PE-100 3,46 + 2,75 = 6,21 Euro


100 mm 1m PE-100 3,52 + 4,68 = 8,20 Euro
125 mm 1m PE-100 3,60 + 7,12 = 10,72 Euro
150 mm 1m PE-100 3,70 + 10,30 = 14 Euro
200 mm 1m PE-100 3,84 + 18,14 = 21,98 Euro
250 mm 1m PE-100 4,34 + 28,17 = 32,51 Euro
300 mm 1m PE-100 4,86 + 40,13 = 44,99 Euro
400 mm 1m PE-100 5,98 + 72,15 = 78,13 Euro
500 mm 1m PE-100 7,20 + 113,02 = 120,22 Euro
38

Figure 6.5. Design manager empty form

When you open INP file, you see design manager form empty
Design Manager has five components
· ID : An auto generated unique ID
· Description : Free text that described pipes properties
· Cost for unit length : Cost for 1m length pipe considering WDS
· Diameter : Pipe’s diameter
· Roughness Coefficient : Pipe’s roughness coefficient

To add a record, click the “Add Row” button. To remove a record, first select it
by clicking on its row and then click the “Delete Row” button.
39

To enter data or change data, select a record by clicking on its row. The record
ID will be shown on ID textbox, and then you can enter or change data. After data
entry/change click the “Update” button to update it.

You can export the records to a data file in order to use it in another project by
clicking the “Export” button. Click “Import” button to call the data.

Note: You must enter at least two records to design a WDS.

6.2.7. Junctions

With the “junctions” you can specify which junctions in the system have pressure
constraints. Each junction in the system can have a minimum and maximum pressure
constraint.

Figure 6.6. Junctions


40

The table in the figure shows a list of all junctions in the system and their
minimum and maximum pressures allowed. Initial pressure and head are shown on
the 4th and 5th column in the table. Minimum initial pressure value is displayed red
color and maximum initial pressure value is displayed green color which provides
easiness to define pressure constraints for large scaled water distribution systems (If
you consider that initial system is a good solution). So you can set pressure
constraints by clicking “update all minimum pressure” and “update all maximum
pressure” buttons for all junctions or click the row which you want to set pressure
constraints. When you select a row in the table, its value for min and max pressure is
shown on the right side of form. Enter min and max pressure value there. After,
check design box and click “Update” button. You will see the junction ID box color
turn to blue on the first column in the table. That means the selected junction ID will
be placed in design process. If you want some junctions not placed in design
process, select that junctions, unchecked the design box and click the update button
so their color turn to brown (see 24,25,26,27,28 ID).

Figure 6.7. Unselected Junctions


41

6.2.8. Pipes

You must click design manager and enter some pipes and their cost to design
water distribution system before entering pipes menu. When you click pipes menu,
pipes from design manager menu will be placed with checkboxes on the bottom of
pipes form.

Figure 6.8. Pipes

Initial velocity, initial diameter, length, initial flow, initial head loss are shown
on the 4th, 5th, 6th, 7th, 8th column respectively. Minimum initial velocity value is
displayed red color and maximum initial velocity value is displayed green color
which provides easiness to define velocity constraints for large scaled water
distribution systems (If you consider that initial system is a good solution). So you
42

can set velocity constraints by clicking “update all minimum velocity” and “update
all maximum velocity” buttons for all pipes or click the row which you want to set
velocity constraints. When you select a row in the table, its value for min and max
velocity is shown on the left side of form. Enter min and max velocity value there.
After, check design box, check some pipes that you want or click “select all options”
button and then click “Update” button. You will see the pipes ID box color turn to
blue on the first column in the table. That means the selected pipe ID will be placed
in design process. If you want to some pipes not placed in design process, select that
pipes, unchecked the design box and click the update button so their color turn to
brown (see 36,37,38,39 ID).

Figure 6.9. Unselected Pipes


43

6.2.9. Optimization Options

There are seven parameters that control the optimization process of SuGA. Select
the optimization options to edit the optimization parameters.

Figure 6.10. Optimization Options

Penalties
The penalties are the most important parameters for the optimization process. We
use single objective function to implement genetic algorithm, so if the pressure and
velocity constraints are exceeded the program use these penalties
44

Pressure Penalty
The penalty coefficient is that for each unit of pressure exceeding. The default
penalty is 100,000.
Velocity Penalty
The penalty is that for each unit of velocity constraint exceeding. The default
penalty is 100,000.
EPANET Warning Penalty
A penalty so that is introduced when the EPANET reports a warning. You should
consider this penalty value about water network cost. The default penalty is 500,000.
Tolerances
Given pressure and velocity constraints can be very strict for some special points
in water distribution systems. Tolerances are useful for these points to not far away
from solution.
Pressure Tolerance
The tolerance is that for pressure (m) constraints. The default value is 1.
Velocity Tolerance
The tolerance is that for velocity constraints (m). The default value is 0,02.
Max tolerant pressure number at the network
Number of tolerant pressure is that allowed at the network. The default value is 3
Max tolerant velocity number at the network
Number of tolerant velocity is that allowed at the network. The default value is 3

6.2.10. Genetic Algorithm Options


There are thirteen parameters that control the genetic algorithm process of SuGA.
Select the genetic algorithm options to edit the genetic algorithm parameters.
45

Figure 6.11. Genetic Algorithm Options

Selection Type
There are five selection types that can be used in genetic algorithm process
Top mate
The first parent is selected by the fitness order. The second parent is selected
randomly.
Roulette rank/cost
With this selection method, the chance of a chromosome to be selected is
calculated according to their fitness (cost) or according to their rank.

Tournament
With this selection method, a small subset of chromosomes is selected and the
one with the best fitness will become a parent.
46

Random
This is the simplest method. Parents are simply selected randomly.
Crossover Type
There are three crossover types that can be used in genetic algorithm process

One point
A random crossover point is selected. The first part of the first parents is hooked
up with the second part of the second parent to make the first offspring. The second
offspring is build from the first part of the second parent and the second part of the
first parent

Two points
The two point’s crossover operator differs from the one point crossover in the
fact that two crossover points are selected randomly

Uniform
In the uniform crossover each bit/gene is selected randomly, either from the first
parent or from the second one
Population Size
The number of individuals in the genetic population. The default value is 30
Number of Generations
The maximum number of generation in the population is allowed to evolve. The
default value is 1500.
Number of Generations with no change
The maximum number of generation in the population is allowed to evolve with
no change in the best fitness (minimum cost). The default value is 50.
Mutation Probability
The default value is 0,03.
Crossover Probability
The default value is 0,95
47

6.2.11. Run Design


It is time to run design simulation. The only parameter to be set before the “run”
button should be clicked is the “number of genetic runs”. This parameter controls the
number of genetic design process that will be made. Since the genetic algorithm
doesn’t guarantee a global optimum, several runs should be made in order to get a
good solution. The default value is 20 runs.

Figure 6.12. Run Design

Current Genetic Run


The current run out of the “number of genetic runs”
48

Current Generation
The current genetic generation within the current genetic run
Current Best Fitness
The best fitness within the current genetic run. If the current best fitness is
feasible then background of the label will be painted green. If not, the background
will be painted red.
Best Feasible Solution
The best overall feasible solution reached.

Figure 6.13. Run Design progress


49

While the design process is on, the progress bars on the bottom of the form show
its progress.
The run can be stopped by clicking the stop button.

6.2.12. Results

Figure 6.14. Run Design End

When finished run progress or when the program is stopped by you “Results” and
“Compare Results” button will be enabled. You can click them to see the results.
50

Figure 6.15. Results-Pipes

Pipes tab has five columns ID, Design Description, Cost, Min Velocity, and Max
Velocity respectively. Total water distribution network cost is shown at the end of
the table.
51

Figure 6.16. Results-Junctions

Junctions tab has three columns ID, Min Pressure, Max Pressure respectively.
To see the results in EPANET click “Save results to INP file” button.
52

6.2.13. Compare Results

Figure 6.17. Compare Results Diameters

This form compares pipe and junctions data to difference between initial solution
and found solution by SuGA. If the found diameter is same with the initial diameter
than the textbox backcolor will be yellow. If the found diameter is bigger than initial
diameter than the textbox backcolor, which belongs to SuGA, will be red, initial
diameter will be green. Last column compares costs between SuGA and initial. If the
53

SuGA costs higher than initial, the textbox backcolor will be red, if not it will be
green. If two of them are same than the textbox backcolor will be yellow.

Figure 6.18. Compare Results Velocities

Last column compares velocities between SuGA and initial. If the SuGA’s
velocity higher than initial, the textbox backcolor will be green, if not it will be red.
If two of them are same than the textbox backcolor will be yellow.
54

Figure 6.19. Compare Results Pressures

Last column compares pressures between SuGA and initial. If the SuGA’s
pressure higher than initial, the textbox backcolor will be green, if not it will be red.
If two of them are same than the textbox backcolor will be yellow.

6.3. Implementation of SuGA


Example water distribution network system is made to show to how the program
works. In the WDS, nine different diameters (table 6.3) were thought to be used. You
55

can use Appendix A, which contains basic tutorial, to understand running SuGA. The
layout of WDS and WDS’s data such as pipes and junctions ID’s, pipes length and
junctions demand are given Appendices B. You can look Appendices C and D to
compare SuGA’s solution and final solution of this WDS. Solutions contain
diameters, velocities, pressures, flows, heads, and unit headloss. The search space of
this 77 piped WDS, because of nine different diameters, is 977. With assistance of
SuGA, we were able to obtain the following solution represent table 6.4. We run the
program with tournament selection type, two points crossover type, 40 population
sizes, 10.000 generations and 20 runs. Since the program does not make a telescopic
solution, diameters can be distributed unbalanced; some engineering approachment
must be made on the solution by modeler. To achieve this, not spending too much
effort (eliminate lots of trial and error steps), we can find a suitable solution a bit
higher (1314 Euro) than the found by SuGA. The solution data we found with some
engineering approachment is in table 6.4. with comparing results found by SuGA.
So, we see that SuGA is an effective program for finding lower cost solution; SuGA
almost nearly reached this solution at the one of these 20 runs.

Table 6.3. Cost Data for Pipe

DIAMETER COST
(MM) (UNITS)
((MM((MM)
80 6,21
100 8,20
125 10,72
150 14,00
200 21,98
250 32,51
300 44,99
400 78,13
500 120,22
56

Table 6.4. Compare SuGA and Final Solution

Pipe Initial SuGA Initial SuGA Delta Initial SuGA Delta Node Initial SuGA Delta
ID Diameter Diameter Diameter Diameter Cost Velocities Velocities Velocities ID Pressures Pressures Pressures
Cost Cost
10 80 80 2.484 2.484 0 0,49 0,63 0,14 5 28,67 28,70 0,03
11 80 80 2.484 2.484 0 0,60 0,63 0,03 6 27,38 26,62 0,76
12 80 80 2.484 2.484 0 0,69 0,65 0,04 7 25,51 24,54 0,97
23 80 80 2.484 2.484 0 0,69 0,66 0,03 8 23,09 22,36 0,73
24 80 80 2.484 2.484 0 0,60 0,77 0,17 14 31,91 32,50 0,59
25 80 80 2.484 2.484 0 0,49 0,47 0,02 15 30,20 30,85 0,65
36 250 300 13.004 17.996 4992 1,95 1,38 0,57 16 27,72 26,77 0,95
37 250 200 13.004 8.792 -4212 1,24 1,59 0,35 17 25,81 24,72 1,09
38 200 200 8.792 8.792 0 1,54 1,22 0,32 18 23,15 22,54 0,61
39 200 150 8.792 5.600 -3192 1,24 1,42 0,18 24 33,77 34,32 0,55
54 100 100 2.050 2.050 0 1,09 0,97 0,12 25 31,01 32,71 1,70
55 80 80 1.552,5 1.552,5 0 0,77 0,76 0,01 26 28,29 28,87 0,58
57 100 100 2.050 2.050 0 1,09 1,01 0,08 27 25,81 26,08 0,27
58 80 80 1.552,5 1.552,5 0 0,77 0,80 0,03 28 23,30 23,70 0,40
60 150 150 3.500 3.500 0 0,84 1,16 0,32 34 36,51 36,51 0
61 150 100 3.500 2.050 -1450 0,73 0,88 0,15 35 32,07 34,63 2,56
62 80 80 1.552,5 1.552,5 0 0,69 0,83 0,14 36 30,15 30,71 0,56
63 150 150 3.500 3.500 0 0,84 1,25 0,41 37 26,45 28,30 1,85
64 150 80 3.500 1.552,5 -1947,5 0,73 0,85 0,12 38 23,97 23,82 0,15
65 80 80 1.552,5 1.552,5 0 0,69 0,67 0,02 44 33,77 34,13 0,36
57

Table 6.4. Continues

Pipe Initial SuGA Initial SuGA Delta Initial SuGA Delta Node Initial SuGA Delta
ID Diameter Diameter Diameter Diameter Cost Velocities Velocities Velocities ID Pressures Pressures Pressures
Cost Cost
66 80 80 1.552,5 1.552,5 0 0,77 0,76 0,01 45 31,01 32,41 1,40
67 80 80 1.552,5 1.552,5 0 0,41 0,82 0,41 46 28,29 29,30 1,51
68 80 80 1.552,5 1.552,5 0 0,31 0,20 0,11 47 25,81 26,39 0,58
69 80 80 1.552,5 1.552,5 0 0,77 0,52 0,25 48 23,30 23,78 0,48
70 80 100 1.552,5 2.050 497,5 0,41 0,76 0,35 54 31,91 32,11 0,20
71 80 80 1.552,5 1.552,5 0 0,31 0,50 0,19 55 30,20 30,19 0,01
72 80 80 1.552,5 1.552,5 0 0,43 0,85 0,42 56 27,72 28,40 0,68
73 80 80 1.552,5 1.552,5 0 0,03 0,65 0,62 57 25,81 24,62 1,19
74 80 80 1.552,5 1.552,5 0 0,29 0,22 0,07 58 23,15 22,54 0,61
75 80 80 1.552,5 1.552,5 0 0,43 0,78 0,35 65 28,67 28,76 0,09
76 80 80 1.552,5 1.552,5 0 0,03 0,75 0,72 66 27,38 27,56 0,18
77 80 80 1.552,5 1.552,5 0 0,29 0,09 0,20 67 25,51 24,59 0,92
78 80 80 1.552,5 1.552,5 0 0,44 0,17 0,27 68 23,09 22,37 0,72
79 80 80 1.552,5 1.552,5 0 0,20 0,60 0,40 1 21,11 20,05 1,06
80 80 80 1.552,5 1.552,5 0 0,13 0,22 0,09 3 21,61 20,43 1,18
81 80 80 1.552,5 1.552,5 0 0,44 0,09 0,35 9 19,05 19,03 0,02
82 80 80 1.552,5 1.552,5 0 0,20 0,62 0,42 10 21,73 20,76 0,97
83 80 80 1.552,5 1.552,5 0 0,13 0,21 0,08 11 19,35 19,05 0,30
93 80 80 2.484 2.484 0 0,74 0,55 0,19 12 22,48 21,19 1,29
94 80 125 2.484 4.288 1804 0,73 1,17 0,44 13 20,53 19,06 1,47
95 80 125 2.484 4.288 1804 0,70 0,98 0,28 19 21,73 20,77 0,96
96 80 125 2.484 4.288 1804 0,70 0,90 0,20 20 19,35 19,05 0,30
102 80 80 2.484 2.484 0 0,74 0,57 0,17 21 21,61 20,44 1,17
58

Table 6.4. Continues

Pipe Initial SuGA Initial SuGA Delta Initial SuGA Delta Node Initial SuGA Delta
ID Diameter Diameter Diameter Diameter Cost Velocities Velocities Velocities ID Pressures Pressures Pressures
Cost Cost
103 80 150 2.484 5.600 3116 0,73 1,06 0,33 22 19,05 19,03 0,02
104 80 125 2.484 4.288 1804 0,70 1,10 0,40 23 21,11 20,06 1,05
105 80 125 2.484 4.288 1804 0,70 0,95 0,25
111 80 80 2.484 2.484 0 0,57 0,56 0,01
112 125 80 4.288 2.484 -1804 0,92 0,91 0,01
113 125 100 4.288 3.280 -1008 0,80 0,72 0,08
114 100 100 3.280 3.280 0 0,83 0,75 0,08
120 80 80 2.484 2.484 0 0,57 0,61 0,04
121 125 80 4.288 2.484 -1804 0,92 0,58 0,34
122 125 80 4.288 2.484 -1804 0,80 0,87 0,07
123 100 100 3.280 3.280 0 0,83 0,73 0,10
1 300 300 224.950 224.950 0 1,67 1,67 0
2 80 80 2.484 2.484 0 0,62 0,67 0,05
4 100 100 3.280 3.280 0 0,62 0,73 0,11
5 80 100 2.484 3.280 796 0,71 0,59 0,12
6 80 100 2.484 3.280 796 0,55 0,88 0,33
7 80 100 2.484 3.280 796 0,68 0,66 0,02
8 200 150 8.792 5.600 -3192 0,94 1,07 0,13
13 150 125 5.600 4.288 -1312 0,91 0,85 0,06
14 80 100 2.484 3.280 796 0,55 0,89 0,34
15 80 100 2.484 3.280 796 0,68 0,66 0,02
16 100 100 3.280 3.280 0 0,62 0,73 0,11
17 80 100 2.484 3.280 796 0,71 0,59 0,12
59

Table 6.4. Continues

Pipe Initial SuGA Initial SuGA Delta Initial SuGA Delta Node Initial SuGA Delta
ID Diameter Diameter Diameter Diameter Cost Velocities Velocities Velocities ID Pressures Pressures Pressures
Cost Cost
18 80 80 2.484 2.484 0 0,62 0,67 0,05
20 80 80 1.552,5 1.552,5 0 0,38 0,33 0,05
21 100 80 2.050 1.552,5 -497,5 0,20 0,30 0,10
22 100 80 2.050 1.552,5 -497,5 0,54 0,35 0,19
27 100 80 2.050 1.552,5 -497,5 0,54 0,34 0,20
28 100 80 2.050 1.552,5 -497,5 0,20 0,30 0,10
29 80 80 1.552,5 1.552,5 0 0,38 0,33 0,05
31 80 80 1.552,5 1.552,5 0 0,29 0,07 0,22
32 80 80 1.552,5 1.552,5 0 0,60 0,04 0,56
33 80 80 1.552,5 1.552,5 0 0,60 0,04 0,56
34 80 80 1.552,5 1.552,5 0 0,29 0,07 0,22
442.592 441.278 -1314
60

CHAPTER SEVEN

CONCLUSION and RECOMMENDATIONS

7.1. Conclusion

The combinatorial optimization problem of least-cost design of water distribution


networks is formulated by several researchers and it is shown that GAs are
particularly suited to this type of problem (Savic and Walters, 1997). GA does not
provide the absolute answers to the problems that are being investigated, but it is
more a powerful new tool for moving towards the best solution. GAs are not
replacement traditional simulation modeling program, instead, they are performed
next step after hydraulic solver. However, instead of relying on the modeler to
evaluate different scenarios on a trial and error basis, GA optimization automates the
solution search process by instructing the computer to successively generate and
evaluate possible solutions.

This study describes development of a computer program, called SuGA, which


uses Genetic Algorithm for the least-cost design and expansion of water distribution
system. SuGA does not expose telescopic (enlarged diameters from end point to
tank) solution. It needs to be corrected by an engineer, so the final solution may be
higher than solution found by SuGA. Program was tested with several problems from
the literature, comparing solutions was fairly near for small-scale water distribution
systems. In conclusion, SuGA can be used for new design, expansion or
rehabilitation of existing water distribution systems for optimization
61

7.2. Recommendations

SuGA use single objective function, constraints take part inside fitness function
as a penalty. Constraints and pipes can be coded separately in multiobjective
function. Usage of multiobjective function on WDS should be considered.

Binary coding scheme has some disadvantage such as the hamming cliff effect
and redundant values. Real value or Gray coding scheme can be used instead of
binary coding

Simple genetic algorithm is not effective on large-scale water distribution


systems. Several researchers studied on modified genetic algorithm such as
structured messy genetic algorithm, fast messy genetic algorithm, and they give good
solution on large-scale water distribution systems. Developing a new genetic
algorithm which is more suitable for WDS should be investigated.

SuGA does not provide telescopic solution. Adding a function to SuGA can
provide telescopic solution, so it will be helped close to final solution.

SuGA has capable optimal design and expansion of WDS. Other usage of GA on
WDS such as pump scheduling, leakage reduction, water quality control etc. can be
added to SuGA with some developing coding scheme.
62

REFERENCES

1. Alperovits, E., and Shamir, U. (1977). “Design of optimal water distribution


systems.” Water Resour. Res., 13(6), 885-900.
2. Aral M.M., Guan J., Maslia M.L., Sautner J.B. (2001) “Reconstruction of
hydraulic management of a water distribution system using genetic algorithms”
Multimedia Environmental Simulations Laboratory Report No. MESL-01-01
Atlanta, Georgia
3. Cunha, M. da C., and Sousa, J. (1999). “Water distribution network design
optimization: simulated annealing approach.” J. Water Resour. Plng. and
Mgmt., ASCE, 125(4), 215-221.
4. Dandy, G. C., Simpson, A. R. and Murphy, L. J. (1996). “An improved genetic
algorithm for pipe network optimization.” Water Resour. Res., 32(2), 449-458.
5. EPANET2w toolkit
6. Geem, Zong Woo. “Optimal design of water distribution networks using
harmony search” Department of civil and environmental engineering, Korea
University, 2000
7. Goldberg, D. E. (1989). Genetic Algorithms in Search Optimization and
Machine Learning. Addison Wesley, MA, USA.
8. Gupta I., Gupta A., Khanna P. (1998). “Genetic algorithm for optimization of
water distribution systems” National Environmetal Engineering Research
Institute, Nagpur-440020, India
9. Halhal, D., Walters, G. A., Ouazar, D., and Savic, D. A. (1997). “Water
network rehabilitation with structured messy genetic algorithm.” J. Water
Resour. Plng. and Mgmt., ASCE, 123(3), 137-146.
10. Karmeli, D. Gadish, Y. and Meyers, S. (1968). “Design of Optimal Water
Distribution Networks.” J. Pipeline Div., ASCE, 94(1), 1-9.
11. Lansey, K., and Mays, L. (1989). “Optimization Model for Water
Distribution System Design.” J. Hydr. Engrg., ASCE, 115(10), 1401-1418.
63

12. Liang, T. (1971). “Design of Conduit System by Dynamic Programming.” J.


Hydr. Div., ASCE, 97(3), 383-393.
13. Lippai, I., Heaney, J. P., and Laguna, M. (1999). “Robust Water System
Design with Commercial Intelligent Search Optimizers.” Journal of Computing
in Civil Engineering, ASCE, 13(3), 135-143.
14. Loganathan, G. V., Greene, J. J., and Ahn, T. J. (1995). “Design heuristic for
global minimum cost water-distribution systems.” J. Water Resour. Plng. and
Mgmt., ASCE, 121(2), 182-192.
15. Melanie Mitchell, (1996). “An introduction to genetic algorithm” Cambridge,
MA: MIT Press.
16. Montesinos, P., Garcia-Guzman, A., and Ayuso, J. L. (1999). “Water
Distribution Network Optimization using a Modified Genetic Algorithm.”
Water Resour. Res., 35(11), 3467-3473.
17. Morgan, D., and Goulter, I. (1985). “Optimal Urban Water Distribution
Design.” Water Resour. Res., 21(5), 642-652.
18. Obitko, Marek and Slavík, Pavel. Visualization of Genetic Algorithms in a
Learning Environment. In: Spring Conference on Computer Graphics,
SCCG'99. Bratislava: Comenius University, 1999, p. 101-106. ISBN 80-223-
1357-2.
19. Quindry, G., Brill, E., Liebman, J., and Robinson, A. (1979). “Comments on
‘Design of Optimal Water Distribution Systems’ by Alperovits and Shamir.”
Water Resour. Res., 15(6), 1651-1656.
20. Quindry, G., Brill, E., and Liebman, J. (1981). “Optimization of Looped
Water Distribution Systems.” J. Envir. Engrg. Div., ASCE, 107(4), 665-679.
21. Reis, L. F. R., Porto, R. M., and Chaudhry, F. H. (1997). “Optimal location of
control valves in pipe networks by genetic algorithm.” J. Water Resour. Plng.
and Mgmt., ASCE, 123(6), 317-326.
22. Rossman, L. A. (1994). EPANET USERS MANUAL, Risk Reduction
Engineering Laboratory, U.S. Environmental Protection Agency, USA.
23. Rowell, W., and Barnes, J. (1982). “Obtaining Layout of Water Distribution
Systems.” J. Hydr. Div., ASCE, 108(1), 137-148.
64

24. Savic, D. A., and Walters, G. A. (1997). “Genetic algorithms for least-cost
design of water distribution networks.” J. Water Resour. Plng. and Mgmt.,
ASCE, 123(2), 67-77.
25. Schaake, J., and Lai, D. (1969). “Linear Programming and Dynamic
Programming –Application of Water Distribution Network Design.” Report
116, MIT Press, Cambridge, Mass., USA.
26. Simpson, A. R., Murphy, L. J., and Dandy G. C. (1993). “Pipe Network
Optimization using Genetic Algorithms.” Paper presented at ASCE, Water
Resources Planning and Management Specialty Conference, ASCE, Seattle,
USA.
27. Simpson, A. R., Dandy G. C., and Murphy, L. J. (1994). “Genetic algorithms
compared to other techniques for pipe optimization.” J. Water Resour. Plng.
and Mgmt., ASCE, 120(4), 423-443.
28. Simpson, A.R. (2000). "Optimization of design of water distribution systems
using genetic algorithms." Slovenian Society of Hydraulic Research, Seminar
Series, Vol.1, Ljubljana, Slovenia, 10pp.
29. The optimatics letter Issue No:12 (April-June, 2001) Advances in
Optimization for Water Distribution System Design & Operations
30. Walters, G. A., Savic, D. A., Morley, M., de Schaezten, W., and Atkinson, R.
(1998). “Calibration of water distribution network models using genetic
algorithms.”, paper presented at Hydrosoft '98, Italy.
31. http:\\www.optiwater.com
65

APPENDICES

APPENDIX A – SuGA Tutorial


APPENDIX B – Network’s Data
B1 – Pipes IDs
B2 – Junctions IDs
B3 – Pipes Length
B4 – Junctions Demand
APPENDIX C – SuGA’s Solution
C1 – Diameters (mm)
C2 – Velocities (m/s)
C3 – Flows (l/s)
C4 – Unit Headloss
C5 – Pressure (m)
C6 – Head (m)
APPENDIX D – Final Solution
D1 – Diameters (mm)
D2 – Velocities (m/s)
D3 – Flows (l/s)
D4 – Unit Headloss
D5 – Pressure (m)
D6 – Head (m)
66

APPENDIX A-TUTORIAL

The layout of the network with a single source at a 210 m fixed head and eight
pipes arranged two loops. The pipes are all 1000-m long with the assumed Hazen-
Williams coefficient of 130. The node data for this network are summarized in Table
1. The minimum acceptable pressure requirements for nodes 2 to 7 are defined as 30
m above ground level. There are 14 commercially available diameters and Table 2
presents the total cost per one meter of pipe length for different pipe sizes.

Table 1. Nodes Data:

Node Demand(CMH) Elevation(m)


1 -1120 210
2 100 150
3 100 160
4 120 155
5 270 150
6 330 165
7 200 160

Table 2. Cost Data for Pipes:

Diameters Unit
(inch) Cost
1 2
2 5
3 8
4 11
6 16
8 23
10 32
12 50
14 60
16 90
18 130
20 170
22 300
24 550

To solve this problem;

1. Start SuGA and open “tutorial.inp” file


2. You will see the layout of the network shown below
67

3. Enter Design Manager from the “Design Options” menu


68

4. Click the “import” button and select the predefined file named “Tutorial.dat”
located in the tutorial directory:
69

5. Click the “Ok” button


6. To set junctions parameters select “Junctions” from design options menu
70

7. Set the mimimum pressure 30 m by clicking “Update all minimum pressure”


button
71

8. To be placed pressure constraints in design, push “Update all junctions for


design” button
9. Make sure the Junctions ID’s color turn blue
72

10. Click the “Ok” button


11. To set pipes parameters select “Pipes” from design options menu
73

12. Click “Update all pipes for design” button for all pipes to be designed
74

13. Click “Ok” button


75

14. Set Pressure and Velocity Tolerance to small value (0.5)


15. Set Max toleranced pressure and velocity number to 1
16. Click “Ok” button
76

17. Before run the program save the project


18. Select Tournament from Selection Type and two points from Crossover Type
19. Enter the “DESIGN” from the “Run” menu and then set the number of genetic
runs to 20
77

20. Click the “Run” button


78

21. To see Compare Results, click the “Compare Results” button


79

22. To see Velocities click Velocities tab


80

23. To see Pressures click Pressures tab


81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

You might also like