Application of genetic algorithm to optimize a simple Gas network

Published: 11 January 2022| Version 1 | DOI: 10.17632/pby229kpgr.1
Matthew Efe Takerhi


This data contains codes written with Java programming language which contains a Genetic algorithm and a template for gas network, which was used to optimize a simple gas network to determine the optimum gas flow rate and pressure drop.


Steps to reproduce

This code was written for a specific Network, made of five pipes and three nodes, with three demand nodes. The simulation requires the parameter of the simulation such as length and diameter of the pipes, the pressure, and total flow at the supply point. The parameters are specified inside the constructor of the Network class, where the Network class emulates the Gas network composed of all pipes, nodes, loads, source, and loops. The parameters that were used in the simulation were the pressure of 30mbar and total flow at 530. pipe length of 680, 500, 420, 600, and 340 at pipes 1, 2, 3, 4, and 5. Diameter of 150, 100, 150, 100, and 100mm at pipes 1, 2,3, 4, and 5. The Constant Class contains parameters for the genetic algorithm, only some should be changed such as POPULATION_SIZE, CROSSOVER_RATE, MUTATION_RATE, TOURNAMENT_SIZE, NUMBER_OF_GENERATION.


Petroleum Engineering, Natural Gas Engineering