13
see how good it is Can we use this dumb idea? Erm... Sometimes – Yes: If there are only a few possible solutions & you have enough time then such a method could be used For most problems - No: many possible solutions??? with no time to try them all !!! My ‘Boss’ will kick me out ! *Generate a set of random solutions #Repeat Test each solution in the set (rank them) Remove some bad solutions from set Duplicate some good solutions Make small changes to some of them *Until best solution is good enough! A “Less-Dumb” Idea (GA)

Optimization of water distribution systems design parameters using genetic algorithm

Embed Size (px)

DESCRIPTION

Optimization of water distribution systems design parameters using genetic algorithm.

Citation preview

Page 1: Optimization of water distribution systems design parameters using genetic algorithm

• Suppose we have a problem!

• We don’t know how to solve it!

• What can we do?• Can we use a computer to

somehow find a solution for us?

• This would be nice! BUT Can it be done?

Start with a Dream

A Dumb Solution

!

A “blind generate and test” algorithm:

*RepeatGenerate a random

possible solutionTest the solution and see

how good it is

*Until solution is good enough

YES WHY NOT!!!

Can we use this dumb idea?• Erm... Sometimes – Yes:

– If there are only a few possible solutions– & you have enough time– then such a method could be used

• For most problems - No:– many possible solutions???– with no time to try them all !!!– My ‘Boss’ will kick me out !

*Generate a set of random solutions

#Repeat

Test each solution in the set (rank them)

Remove some bad solutions from set

Duplicate some good solutions

Make small changes to some of them

*Until best solution is good enough!

A “Less-Dumb” Idea (GA)

Page 2: Optimization of water distribution systems design parameters using genetic algorithm

Conduit flow optimization of Design Parameters using GAs.

Seminar presentation by Tanay Kulkarni

Guided byDr. (Mrs.)K. C. Khare

Date: 02 April 2013, Dept. of Civil Engineering, SCOE, Pune.

Page 3: Optimization of water distribution systems design parameters using genetic algorithm

continue dreaming…

1

3

2

4

5

6

24.90m3/s

[100.00 m]

2.9

6

3.27.2

5.6

[95.00]

[94.00]

[92.00]

[90.00][94.00]

(300)

(400)

(350)

(300)

(250)

(200)

(200)

1

2

3

6

7

4

5

Real Life Problem!

Optimize for cost & Diameter !

Single source, 7- links WDS with 5 Demand Nodes

Search Space in WDN = NX Where N= no. of commercial available pipes, X= no. of pipes !

Head Loss Equation:h = ѠLQα

CαHWDβ

Where, α & β are exponents and are taken as 1.85 & 4.87 resp. & w= 2.234 x 1012

Hazen-William Eq. but once can use Darcy-Weisbach also.

The critical path: 1-2-4

S Pj = H o – Hj min ; j= 1,…, (M – S)

L Pj

Max. Available friction Slope is defined.

L Pj = Minimum(L Pi + Lij); j = 1,…, (M - S)

NOW WE NEED TO DEFINE THE OBJECTIVE!

Page 4: Optimization of water distribution systems design parameters using genetic algorithm

The Objective Function:

Minimize: f(D1,….,Dx) = ∑ u(Dx) X Lx; x=1,….,X Subjected to constraints

∑ Qx + qj = 0; j=1,…,(M - S)

∑ hx +∑ Ep = 0; y = 1,…,Y

Hj ≥ Hj min; j=1,…,(M - S)

Dx ϵ {Dmin,…,Dmax}; x=1,…,X

X incident on j

x ϵ y

Unit cost Length

Nodal demand

Total no. of nodes

Total no. of Source nodes

Energy added to water by pump

Total no. of Loops

Min. Permissible head at nodes

Total no. of links

Min. & Max. dia of commercially available pipes

Mathematical expression.

Time for penalty!Function defined to penalize the “infeasible solutions” to reduce their fitness.

THUS THE WEAKER SOLUTIONS CAN BE KILLED!

Page 5: Optimization of water distribution systems design parameters using genetic algorithm

Penalty

Death

Static

Dynamic

Annealing

Niched

Self Organizing

Careful analysis in WDN revealed that:optimal solution lie at the boundary of feasible &

infeasible solutions.

Here, Self- organizing penalty function was used and thus the OBJECTIVE FUNCTION became

unconstrained!

The Objective Function Revised:

Minimize: f(D1,….,Dx) = ∑ u(Dx) X Lx + ∑ p X qj X {max (Hjmin – Hj , 0)}

x=1,….,X

Penalty Multiplier!Max violation of each pressure constraint at node j

Penalty? For what?

GRA-NET soft-tool was used! Population size = 60, Crossover % = 0.95, Mutation % = 0.02-0.05,

number of generations = 25!

And the Genetic Algorithm was RUN!

Page 6: Optimization of water distribution systems design parameters using genetic algorithm

• With 14 commercially available pipes, the possible solutions are 147 (=105,413,504).• GA reduces the search space to 57

(=78,125).• With repetition of smallest available sizes it further reduces to 18,000 !!!

Rs. 44,48,250/-1500 evaluations

P3/166 MHz/ 32MB RAM.

1. (400mm)2. (300mm)3. (200mm)4. (300mm)5. (200mm)6. (150mm)7. (150mm)

RESULT IN 9 SECONDS!!!

i.e. 0.074 % of entire search space!i.e. 0.017 % of entire search space!

1

3

2

4

5

6

24.90m3/s

[100.00 m]

6

3.27.2

5.6

[95.00]

[94.00]

[92.00]

[94.00]

(300)

(400)

(350)

(300)

(250)

(200)

(200)

1

2

3

6

7

4

5

Page 7: Optimization of water distribution systems design parameters using genetic algorithm

DedicationI dedicate this seminar of mine to Mr. Pramod Bhave for his beautiful contribution

to the field of Hydraulics Engineering.

“Dream Works!!!”- Steven Spielberg

References• Mahendra Kadu, Rajesh Gupta, Pramod Bhave,”Optimal Design of Water

Networks Using a Modified Genetic Algorithm with Reduction in Search Space”, JWRPM 134(2) © ASCE/ MARCH/APRIL 2008 / 147-159.

• S. N. Sivanandanam, S. N. Deepa, “Introduction to Genetic Algorithm”,ISBN 978-3-540-73189-4 ©Springer- Verlag Berlin Heidelberg 2008.

• Prashant Shinde, K. C. Khare, ”Optimization of Water Distribution Network”, Seminar Report ©SCOE-DCE 2011

Thank you!

Page 8: Optimization of water distribution systems design parameters using genetic algorithm

Genetic Algorithms - History• Pioneered by John Holland in the 1970’s• Got popular in the late 1980’s• Based on ideas from Darwinian Evolution• Can be used to solve a variety of problems that are not easy to solve

using other techniques

BACK-UP!!!

Evolution in the real world• Each cell of a living thing contains chromosomes - strings of DNA• Each chromosome contains a set of genes - blocks of DNA• Each gene determines some aspect of the organism (like eye colour)• A collection of genes is sometimes called a genotype• A collection of aspects (like eye colour) is sometimes called a phenotype• Reproduction involves recombination of genes from parents and then

small amounts of mutation (errors) in copying • The fitness of an organism is how much it can reproduce before it dies• Evolution based on “survival of the fittest”

Page 9: Optimization of water distribution systems design parameters using genetic algorithm

The MetaphorNature Genetic Algorithm

Environment Optimization problem

Individuals living in that environment

Feasible solutions

Individual’s degree of adaptation to its surrounding environment

Solutions quality (fitness function)

Nature Genetic Algorithm

A population of organisms (species)

A set of feasible solutions

Selection, recombination and mutation in nature’s evolutionary process

Stochastic operators

Evolution of populations to suit their environment

Iteratively applying a set of stochastic operators on a set of feasible solutions

Pipe Diameter (mm)

Unit Cost in Rupees

150 1115

200 1600

250 2154

300 2780

350 3475

400 4255

450 5172

500 6092

600 8189

700 10670

750 11874

800 13261

900 16151

1000 19395

Commercially available pipe sizes and their costs

Page 10: Optimization of water distribution systems design parameters using genetic algorithm

Advantages :A GA has a number of advantages.

#It can quickly scan a vast solution set.

# Bad proposals do not effect the end solution negatively as they are simply discarded.

#The inductive nature of the GA means that it doesn't have to know any rules of the problem - it works by its own internal rules.

#This is very useful for complex or loosely defined problems.

Disadvantages :

• A practical disadvantage of the genetic algorithm involves longer running times on the computer.  Fortunately, this disadvantage continues to be minimized by the ever-increasing processing speeds of today's computers.  

• If we have a hammer, all problems looks like a nail!!!

Page 11: Optimization of water distribution systems design parameters using genetic algorithm

GA in Classes of Search TechniquesSearch Techniqes

Calculus Base

Techniques

Guided random search techniques Enumerative Techniques

BFSDFS Dynamic Programming

Tabu SearchHill Climbing

Simulated Annealing

Evolutionary Algorithms

Genetic Programming Genetic Algorithms

Fibonacci Sort

Page 12: Optimization of water distribution systems design parameters using genetic algorithm

Distribution tree or sub tree

Path/ sub-pathserial number

Path Length of path(m)

HGL at Source of Path (m)

HGL at End of Path (m)

Max. available friction loss (m)

Slope of path

(a) Distribution tree

1 1 1-2 300 100.00 95.00 5.00 0.01667

2 1-3 400 100.00 94.00 6.00 0.01500

3 1-2-4 500 100.00 94.00 6.00 0.01200

4 1-2-5 550 100.00 92.00 8.00 0.01454

5 1-2-5-6 750 100.00 90.00 10.00 0.01333

(b) Distribution sub-tree

1.1 2 2-5 250 96.40 92.00 4.40 0.01760

3 2-5-6 450 96.40 90.00 6.40 0.01422

S Pj = H o – Hj min ; j= 1,…, (M – S)

L Pj

Column 7:Max. available friction loss (m) = HGL @ Source of path – HGL @ End of Path

Determination of Critical Path & Critical Sub-paths

Page 13: Optimization of water distribution systems design parameters using genetic algorithm

Link number

Length(m)

Head Loss(m)

Discharge (m3 / s)

Diameter (m) Candidate Diameters (mm)

1 300 3.60 12.366 348.37 250, 300, 350, 400, 450

2 400 6.00 6.934 267.11 150, 200, 250, 300, 350

3 200 2.40 2.900 200.81 150, 150, 200, 250, 300

4 250 3.56 8.472 291.41 200, 250, 300, 350, 400

5 200 2.85 3.200 201.30 150, 150, 200, 250, 300

6a 350 2.40 0.994 - 150, 150, 150, 200, 250

7a 300 1.16 0.728 - 150, 150, 150, 200, 250