44
S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Embed Size (px)

Citation preview

Page 1: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

S J van Vuuren

The application of Genetic Algorithms (GAs)

Planning Design and Management of Water Supply Systems

Page 2: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

GA’s - not a solution to all problems !GA’s - not a solution to all problems !

Page 3: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

LayoutLayout

• WhWhat is a at is a GAs?GAs?

• AAn Example of a GAn Example of a GA

• Programming of network problemsProgramming of network problems

• GAs in the Planning Design and Management of Water Supply Systems

• The road ahead

• WhWhat is a at is a GAs?GAs?

• AAn Example of a GAn Example of a GA

• Programming of network problemsProgramming of network problems

• GAs in the Planning Design and Management of Water Supply Systems

• The road ahead

Page 4: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

WhWhat is a Gat is a GA?A?

GA =GA =Search procedure based on the mechanics of natural selection

and natural genetics – survival of the fittests.

GA =GA =Search procedure based on the mechanics of natural selection

and natural genetics – survival of the fittests.

Page 5: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Human Evolution

Page 6: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Natural Evolution A different view

Page 7: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Processes of a GAProcesses of a GA

• Production• Select randomly

• Crossover• Pairs change (Random process)

• Mutation• Protects against loss of useful genetic material (secondary

mechanisms to prevent local optimum)

• Reproduction• Select according to objective function (Best remain)

• Production• Select randomly

• Crossover• Pairs change (Random process)

• Mutation• Protects against loss of useful genetic material (secondary

mechanisms to prevent local optimum)

• Reproduction• Select according to objective function (Best remain)

Page 8: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

How do GAs differ from traditional How do GAs differ from traditional methods (Goldberg)methods (Goldberg)

• Coding of the parameter set, not the parameters themselves.

• Search for a population of points, not a single point.• Use objective functions (payoff) information, not

derivatives or other auxiliary knowledge, to determine the fitness of the solution.

• GAs use probabilistic transition rules notdeterministic rules

• Coding of the parameter set, not the parameters themselves.

• Search for a population of points, not a single point.• Use objective functions (payoff) information, not

derivatives or other auxiliary knowledge, to determine the fitness of the solution.

• GAs use probabilistic transition rules notdeterministic rules

Page 9: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

3 Main types of search methods3 Main types of search methods

• Calculus - Enumerative

• Random

• Genetic algorithm

• Calculus - Enumerative

• Random

• Genetic algorithm

Page 10: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Comparison of Optimization Methods

Page 11: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

ExampleExample

Page 12: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Example of a chromosome Example of a chromosome stringstring

Page 13: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Basics of Basics of a GAa GA

Page 14: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

An Example of a GAAn Example of a GA

MAXIMIZE f(x) = x2 (0 < x < = 31)

CODE x as a finite-length string

Length = 5 in the binary basis

(1x24 + 1x23 + 1x22 + 1x21 + 1x20 = 31)

Select population size - say 4 strings

MAXIMIZE f(x) = x2 (0 < x < = 31)

CODE x as a finite-length string

Length = 5 in the binary basis

(1x24 + 1x23 + 1x22 + 1x21 + 1x20 = 31)

Select population size - say 4 strings

Page 15: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Crossover and matingCrossover and matingS T R I N G x f ( x )

)x(f

)x(f

Ave).x(f

)x(f C o p i e si n m a t i n g

p o o l0 1 1 0 1 1 3 1 6 9 0 , 1 4 0 , 5 8 11 1 0 0 0 2 4 5 7 6 0 , 4 9 1 , 9 7 20 1 0 0 0 8 6 4 0 , 0 6 0 , 2 2 01 0 0 1 1 1 9 3 6 1 0 , 3 1 1 , 2 3 1

1170)x(f 1 , 0A v e r a g e = 0 , 2 5

S T R I N G x f ( x ) )x(f

)x(f

Ave).x(f

)x(f C o p i e si n m a t i n g

p o o l0 1 1 0 1 1 3 1 6 9 0 , 1 4 0 , 5 8 11 1 0 0 0 2 4 5 7 6 0 , 4 9 1 , 9 7 20 1 0 0 0 8 6 4 0 , 0 6 0 , 2 2 01 0 0 1 1 1 9 3 6 1 0 , 3 1 1 , 2 3 1

1170)x(f 1 , 0A v e r a g e = 0 , 2 5

Crossover

Mating string 1 with 2, and 3 with 4 and crossover at positions 4

and 3 results in:

Crossover

Mating string 1 with 2, and 3 with 4 and crossover at positions 4

and 3 results in:

Page 16: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

MutationMutation

PROBABILITY OF MUTATION = 0,001PROBABILITY OF MUTATION = 0,001

BITS TO MUTATE IN A GENERATION = 20 X 0,001 = 0,02

No mutation !Summary after one generation

StartSample

Next *generation

Average fitness 293 439Maximum fitness 576 729

Note: *Values after one generation and one crossover

Page 17: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Programming procedure ofGenetic Algorithms (GAs)

An Example

Programming procedure ofGenetic Algorithms (GAs)

An Example

1.1. Problem for the application of Genetic Problem for the application of Genetic Algorithms in water supply systems Algorithms in water supply systems

2. 2. Computer ProgramComputer Program

Page 18: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Example Problem - Genetic Example Problem - Genetic Algorithms in water supply Algorithms in water supply

systems: Layoutsystems: Layout

9 0 110

11

12

13

14

15

L eg en d

D em an d

R eservo ir

P u m p

9 0 2

Page 19: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Solution objectiveSolution objective

For a given demand it is required that we have to:

Determine the pipe diameters that will result in the minimum life cycle cost.

For a given demand it is required that we have to:

Determine the pipe diameters that will result in the minimum life cycle cost.

Page 20: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Calculations Calculations proceduresprocedures

Optimum solution through the use of the GA, while the

pressure/energy requirements be determined through the

use of hydraulic relationships.

Optimum solution through the use of the GA, while the

pressure/energy requirements be determined through the

use of hydraulic relationships.

Page 21: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Flow diagramFlow diagramStart

Possible solution

Hydraulic solution

Cost Calculation

Fitness test

Crossover

mutation

NewNewResults Report

Reproduction

Page 22: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Computer programComputer program

• Two problems can be analyzed :

• Gravity line

• Pump line

• Determine the optimal diameter and pumping time

• Overview of input screens

• Results

Page 23: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Gravitation and Pumping Gravitation and Pumping Systems – Selection ScreenSystems – Selection Screen

Page 24: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Pumping System – Screen P1Pumping System – Screen P1

Page 25: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Pump line details – Screen P2

Page 26: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Pump line energy cost – Screen P3Pump line energy cost – Screen P3

Page 27: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Pump line economic analysis Pump line economic analysis Capital data - Screen P4Capital data - Screen P4

Page 28: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Pump line design parametersPump line design parametersScreen P5Screen P5

Page 29: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Results from the GA analysis Results from the GA analysis Pumping Pipeline – Results 1Pumping Pipeline – Results 1

Page 30: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Results from the GA Results from the GA analysis Pumping Pipeline – analysis Pumping Pipeline –

Results 2Results 2

Page 31: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Results from the GA Results from the GA analysis Pumping Pipeline – analysis Pumping Pipeline –

Results 3Results 3

Page 32: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Results from the GA Results from the GA analysis Pumping Pipeline – analysis Pumping Pipeline –

Results 4Results 4

Page 33: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Network Optimization

Use EPANET to set-up system

•Define pipes that can be changed

•Define a penalty structure/cost on routes which are difficult to change

•Conceptually develop procedure

Page 34: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

EPANET to set-up system

Page 35: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

The application of Genetic Algorithms in the Planning Design and Management of

Water Supply Systems

•WRSM 2000

•Water Resources

Page 36: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

The application of Genetic AlgorithmsWRSM 2000

Automate calibration of WRSM 2000 parameters

Page 37: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

WRSM 2000 – Current process

Page 38: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

The application of Genetic AlgorithmsWRSM 2000

• Optimise calibration on selected monthly flood size

• Procedure will select monthly flood size based on exceedance probability

• Obtain from this, a parameter set that will represent the calibrated flow record

• Develop criteria applicable for this optimisation

Page 39: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

The application of Genetic AlgorithmsWRYM

Optimize water Resources Analyses Procedures

Page 40: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems
Page 41: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

How the GA can be implementedHow the GA can be implemented

Genetic Algorithm(Subroutines)

Yield SearchSubroutine

Water Resources Yield Model (WRYM)

Operating RuleSimulation Results• Yield• Pumping Volumes

Simulation Results & Files*SUM.OUT*PLT.OUT

Supply Results

Network Simulation Subroutines

Target Draft

Genetic AlgorithmResults

• Step-by-step output• Fitness function results

• Optimum solution

Page 42: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

WRC has funded the conceptual assessment of the application of GAs

The application of Genetic Algorithms in The application of Genetic Algorithms in the Planning Design and Management of the Planning Design and Management of Water Supply Systems – December 2004Water Supply Systems – December 2004

Page 43: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Gas = Where from here ?

Development of routines to be included Development of routines to be included in existing modeling proceduresin existing modeling procedures

Page 44: S J van Vuuren The application of Genetic Algorithms (GAs) Planning Design and Management of Water Supply Systems

Thank YouThank You