Estimation of Chlorine Concentration in Water Distribution Systems Based on a Genetic Algorithm
Abstract
:1. Introduction
2. The Genetic Algorithm
- Creation: An initial population is created and distributed as uniformly as possible across a pre-defined search area.
- Selection: A selection mechanism is used to assign a probability for each individual in the population that their genes will prevail to the next generation. This selection mechanism is commonly a fitness/cost function computed for each individual, where the fittest individuals are awarded a higher probability.
- Cross-over: Once the fittest individuals are selected, the cross-over stage takes place to create the following generation. For this purpose, the genes of two parent solutions are recombined to create two new offspring solutions.
- Mutation: The last evolutionary stage is the random mutation of some of the genes in the newly-created population. This random mutation serves two purposes: (1) it stops the population from becoming uniform and helps maintain some level of diversity in the individuals; (2) it prevents the algorithm from failing to find locally-optimal solutions instead of the desired global optimal.
3. Reaction Zones within a Pipeline
3.1. Bulk Reactions
3.2. Wall Reactions
4. Proposed Methodology
4.1. Estimation of and
Pseudocode 1: GA-driven calibration for and reaction coefficients |
INPUT: Array : |
where columns , , …, contain the chlorine concentration at nodes with a sensor and m denotes the number of samples. |
LOAD into memory the .inp file of the WDS. |
SET the quality time-step in the .inp file for simulation as the sampling rate of the measurements. |
CREATE the array of sensed nodes . |
DECLARE the GA parameters: population size , maximum generations , minimum tolerance , |
lower and upper search area bounds. |
CREATE the initial population ; |
IF |
FOR each |
SET and in the .inp file. |
COMPUTE the water-quality time series with help of the EPANET-MATLAB Toolkit |
BUILD the array similarly as . |
FOR |
FOR |
= |
END FOR |
END FOR |
INITIALIZE mse |
FOR |
= |
END FOR |
END FOR |
CHOOSE the values that provide the lowest . |
IF lowest |
CREATE new population , and CONTINUE. |
ELSE |
END ALGORITHM |
END IF |
ELSE |
END ALGORITHM |
END IF |
OUTPUT: Values for and that minimize . |
4.2. Analysis of the Minimal Chlorine Concentration in the WDS
- First, the calibrated and values are set into an .inp file as the actual bulk and wall reaction coefficients of the pipeline.
- Then, a GA is set to minimize the value corresponding to the chlorine concentration at the input as a restriction is also satisfied: that , where is the overall minimal required chlorine concentration in the WDS.
- By setting a proposed value to the model and performing the simulation of the chlorine decay, matrix and vector are obtained as previously explained.
- Then, the fitness of a given value is defined as follows:
- (a)
- If then a very low fitness is assigned to ;
- (b)
- If then the fitness of is defined as the difference between the two values.
- The search process continues until a ( value is found that minimizes the difference between and .
Pseudocode 2: GA-driven calibration for minimal required value |
INPUT: |
LOAD into memory the .inp file with the previously calibrated and values. |
DEFINE the population size , the maximum generations and the minimum tolerance . |
DEFINE the lower () and upper bound () for the search area as stated by the normativity. |
CREATE the initial population ; |
IF |
FOR each |
ASSIGN to the model. |
PERFORM the water-quality simulation with help of the EPANET-MATLAB Toolkit |
CREATE matrix . |
IF |
Error (Very high value) |
ELSE IF |
Error |
END IF |
END FOR |
CHOOSE the values that provide the lowest Error. |
IF lowest Error . |
CREATE new population , and CONTINUE. |
ELSE |
END ALGORITHM |
ELSE |
END ALGORITHM |
END IF |
OUTPUT: Optimal value for that ensures . |
5. Simulation Results
Discussion of the Results
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Omer, N.H. Water quality parameters. Water-Qual.-Sci. Assess. Policy 2019, 18, 1–34. [Google Scholar]
- Davis, M.L. Water and Wastewater Engineering: Design Principles and Practice; McGraw-Hill Education: New York, NY, USA, 2010. [Google Scholar]
- Langowski, R.; Brdys, M. Monitoring of chlorine concentration in drinking water distribution systems using an interval estimator. Int. J. Appl. Math. Comput. Sci. 2007, 17, 199. [Google Scholar] [CrossRef]
- García-Ávila, F.; Avilés-Añazco, A.; Ordoñez-Jara, J.; Guanuchi-Quezada, C.; del Pino, L.F.; Ramos-Fernández, L. Modeling of residual chlorine in a drinking water network in times of pandemic of the SARS-CoV-2 (COVID-19). Sustain. Environ. Res. 2021, 31, 1–15. [Google Scholar] [CrossRef]
- Nono, D.; Odirile, P.T.; Basupi, I.; Parida, B.P. Assessment of probable causes of chlorine decay in water distribution systems of Gaborone city, Botswana. Water SA 2019, 45, 190–198. [Google Scholar] [CrossRef] [Green Version]
- World Health Organization. Principles and Practices of Drinking-Water Chlorination: A Guide to Strengthening Chlorination Practices in Small-to Medium Sized Water Supplies. 2017. Available online: https://apps.who.int/iris/handle/10665/255145 (accessed on 11 January 2023).
- Secretaría de Gobernación, México. NOM-127-SSA1-1994, Salud Ambiental. Agua Para Uso y Consumo Humano. Límites Permisibles de Calidad y Tratamientos a Que debe Someterse el Agua Para su Potabilización. Diario Oficial de la Federación. 2000. Available online: https://www.dof.gob.mx/nota_detalle.php?codigo=2063863&fecha=31/12/1969#gsc.tab=0 (accessed on 11 January 2023).
- Males, R.M.; Grayman, W.M.; Clark, R.M. Modeling water quality in distribution systems. J. Water Resour. Plan. Manag. 1988, 114, 197–209. [Google Scholar] [CrossRef]
- Rossman, L.A.; Clark, R.M.; Grayman, W.M. Modeling chlorine residuals in drinking-water distribution systems. J. Environ. Eng. 1994, 120, 803–820. [Google Scholar] [CrossRef]
- Clark, R.M.; Rossman, L.A.; Wymer, L.J. Modeling distribution system water quality: Regulatory implications. J. Water Resour. Plan. Manag. 1995, 121, 423–428. [Google Scholar] [CrossRef]
- Park, K.; Kuo, A.Y. A multi-step computation scheme: Decoupling kinetic processes from physical transport in water quality models. Water Res. 1996, 30, 2255–2264. [Google Scholar] [CrossRef]
- Hua, F.; West, J.; Barker, R.; Forster, C. Modelling of chlorine decay in municipal water supplies. Water Res. 1999, 33, 2735–2746. [Google Scholar] [CrossRef]
- Islam, M.R.; Chaudhry, M.H.; Clark, R.M. Inverse modeling of chlorine concentration in pipe networks under dynamic condition. J. Environ. Eng. 1997, 123, 1033–1040. [Google Scholar] [CrossRef]
- Islam, M.R.; Chaudhry, M.H. Modeling of constituent transport in unsteady flows in pipe networks. J. Hydraul. Eng. 1998, 124, 1115–1124. [Google Scholar] [CrossRef]
- Monteiro, L.; Figueiredo, D.; Dias, S.; Freitas, R.; Covas, D.; Menaia, J.; Coelho, S. Modeling of chlorine decay in drinking water supply systems using EPANET MSX. Procedia Eng. 2014, 70, 1192–1200. [Google Scholar] [CrossRef] [Green Version]
- Fisher, I.; Kastl, G.; Sathasivan, A. New model of chlorine-wall reaction for simulating chlorine concentration in drinking water distribution systems. Water Res. 2017, 125, 427–437. [Google Scholar] [CrossRef] [PubMed]
- Madzivhandila, V.A.; Chirwa, E. Modeling chlorine decay in drinking water distribution systems using aquasim. Chem. Eng. Trans. 2017, 57, 1–6. [Google Scholar]
- Nejjari, F.; Puig, V.; Pérez, R.; Quevedo, J.; Cuguero, M.; Sanz, G.; Mirats, J. Chlorine decay model calibration and comparison: Application to a real water network. Procedia Eng. 2014, 70, 1221–1230. [Google Scholar] [CrossRef] [Green Version]
- Minaee, R.P.; Afsharnia, M.; Moghaddam, A.; Ebrahimi, A.A.; Askarishahi, M.; Mokhtari, M. Calibration of water quality model for distribution networks using genetic algorithm, particle swarm optimization, and hybrid methods. MethodsX 2019, 6, 540–548. [Google Scholar] [CrossRef] [PubMed]
- Mirjalili, S.; Mirjalili, S. Genetic algorithm. In Evolutionary Algorithms and Neural Networks: Theory and Applications; Springer: Berlin/Heidelberg, Germany, 2019; pp. 43–55. [Google Scholar]
- Katoch, S.; Chauhan, S.S.; Kumar, V. A review on genetic algorithm: Past, present, and future. Multimed. Tools Appl. 2021, 80, 8091–8126. [Google Scholar] [CrossRef] [PubMed]
- Rossman, L.A.; Woo, H.; Tryby, M.; Shang, F.; Janke, R.; Haxton, T. EPANET 2.2 User Manual; Technical Report EPA/600/R-20/133; U.S. Environmental Protection Agency: Washington, DC, USA, 2020. [Google Scholar]
- Eliades, D.G.; Kyriakou, M.; Vrachimis, S.; Polycarpou, M.M. EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB. In Proceedings of the 14th International Conference on Computing and Control for the Water Industry (CCWI), Amsterdam, The Netherlands, 7–9 November 2016. [Google Scholar] [CrossRef]
Model | Parameters |
---|---|
First-order decay | , , |
First-order saturation growth | , , |
Zero-order kinetics | , , |
No reaction | , |
Head-Loss Model | Wall Reaction Coefficient |
---|---|
Hazen–Williams | |
Darcy–Weisbach | |
Chezy–Manning |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gómez-Coronel, L.; Delgado-Aguiñaga, J.A.; Santos-Ruiz, I.; Navarro-Díaz, A. Estimation of Chlorine Concentration in Water Distribution Systems Based on a Genetic Algorithm. Processes 2023, 11, 676. https://doi.org/10.3390/pr11030676
Gómez-Coronel L, Delgado-Aguiñaga JA, Santos-Ruiz I, Navarro-Díaz A. Estimation of Chlorine Concentration in Water Distribution Systems Based on a Genetic Algorithm. Processes. 2023; 11(3):676. https://doi.org/10.3390/pr11030676
Chicago/Turabian StyleGómez-Coronel, Leonardo, Jorge Alejandro Delgado-Aguiñaga, Ildeberto Santos-Ruiz, and Adrián Navarro-Díaz. 2023. "Estimation of Chlorine Concentration in Water Distribution Systems Based on a Genetic Algorithm" Processes 11, no. 3: 676. https://doi.org/10.3390/pr11030676
APA StyleGómez-Coronel, L., Delgado-Aguiñaga, J. A., Santos-Ruiz, I., & Navarro-Díaz, A. (2023). Estimation of Chlorine Concentration in Water Distribution Systems Based on a Genetic Algorithm. Processes, 11(3), 676. https://doi.org/10.3390/pr11030676