ISSN 0718-3291 Versión Impresa

ISSN 0718-3305 Versión en línea

Volumen 28 N° 3, Julio - Septiembre 2020

pdf Índice

Modelado de un proceso de tratamiento de agua potable y las variables involucradas utilizando Redes de Petri Coloreadas

Model of a drinking water treatment process and the variables involved using Coloured Petri Nets

Ingeniare. Revista chilena de ingeniería

On-line version ISSN 0718-3305

Ingeniare. Rev. chil. ing. vol.28 no.3 Arica Sept. 2020 


Model of a drinking water treatment process and the variables involved using Coloured Petri Nets

Modelado de un proceso de tratamiento de agua potable y las variables involucradas utilizando Redes de Petri Coloreadas

Jesus Filander Caratar1 

Ruth Edmy Cano1 

José Isidro García1 

11 Universidad del Valle. Escuela de ingeniería Mecánica. Santiago de Cali, Colombia. E-mail:;;


A model that represents the behavior of a critical system or process, such as the drinking water treatment process, is vital for the evaluation of new procedures or their optimization without affecting the real system or risking the population, avoiding economic losses. Due to the complexity in the dynamics of drinking water treatment plants, the use of Coloured Petri Nets is recommended to model the behavior of the variables involved in the process. In this context, this work presents a structured procedure that allows to obtain a model considering a dynamic driven by the occurrence of discrete events and that allows the generation of useful information that can later be used to verify the effectiveness and efficiency of new operating strategies. To evaluate this proposal, a model of the drinking water treatment process of Puerto Mallarino located in Cali, Colombia was developed. Modeling, both the stages of the purification process, and the approximate behavior of the variables involved under the assumption that the changes obey only to the intensity of the raining season.

Keywords: Coloured Petri Nets; modeling; productive systems; water treatment plant


El disponer de un modelo que represente el comportamiento de un sistema o proceso crítico, como lo es el proceso de una planta de purificación de agua, resulta de vital importancia a la hora de evaluar nuevos procedimientos u optimizarlos sin afectar el sistema real o poner en riesgo a la población, evitando así pérdidas económicas. Debido a la complejidad en la dinámica de las plantas de purificación de agua, se recomienda el uso de redes de Petri coloreadas para modelar el comportamiento de las variables involucradas en el proceso. En este contexto, este trabajo presenta un procedimiento estructurado que permite obtener un modelo considerando una dinámica dirigida por la ocurrencia de eventos discretos y que permite la generación de información útil que posteriormente puede ser utilizada para verificar la efectividad y eficiencia de nuevas estrategias de operación de una planta de tratamiento de agua potable. Para evaluar esta propuesta, se desarrolló un modelo de la planta de tratamiento de agua potable de Puerto Mallarino ubicada en Cali, Colombia. Modelando, tanto las etapas del proceso de purificación, como, el comportamiento aproximado de las variables involucradas bajo el supuesto que los cambios obedeces únicamente a los cambios en la intensidad de las estaciones de lluvia.

Palabras clave: Modelado; plana de tratamiento de agua; sistemas productivos; redes de Petri coloreadas


Currently, the population growth in the cities demand a great amount of resources to meet their basic needs, e.g. drinking water, which is vital to the development and welfare. In this context, the performance and efficiency of the processes required to purify the liquid, demand tasks that are specialized in order to meet the requirement for larger amounts of drinking water with an optimal quality.

Consequently, it is advisable to develop different strategies to provide an adequate response to the exigent demands related to potable water production.

One approach to this problem would be to develop a model of drinking water treatment plant, which allows the simulation the system's behavior.

Based in the information provided for the administrative department of planning, Cali-Colombia, the city's population of Cali will grow steadily, approaching 2,496,396 citizens by 2018. Which have as main source of drinking water supply, the "Puerto Mallarino" treatment plant, with a capacity of 6.6 m3/s. Throughout the year, the treatment plant must deal with various factors that affect the quality of the drinking water supplied to the population, for example, the increase in the volume of rainwater. Reason why it is critical to monitor the water properties throughout the purification process during different times of the year.

With the purpose of guarantee an adequate quality of the water supplied to the city, it is necessary a purification process model to simulate its behavior and the variables involved in the process.

Currently, the plant uses the variables to make decisions regarding the resources consumption to perform the purification process, considering the changes present in the physicochemical properties of water during the whole process of potabilization. However, the variability of the physicochemical properties of water at the beginning of the process makes the modeling of this process difficult. Different tools could be used to develop models with different approaches to the water purification process, therefore, considering the stages of the purification process from a discrete approach, Petri nets are presented as a tool that allows modeling aspects of the system behavior, providing an intuitive interpretation of the processes due to their iconographic representation.

Several authors report studies related to potable water treatment. In 1 was evaluated the system effectiveness integrating a film activated sludge in the synthetic treatment of greywater and the elimination of nutrients for different organic loads; in 2 was presented theoretical models with a chemical and microbiological point of view. The study made by (3 presents a model of processing wastewater using a formal tool called "Petri nets" in order to make a model of the process of treatment of water contaminated with oil in petroleum and petrochemical processes, in 4-5 models of the purification process of water treatment plants are presented using Petri nets, in 6 a supervisory system for the detection and diagnosis of failures in a water treatment plant using fuzzy engine is presented. However, in references consulted has not been found related information to approaches of this type of system using Coloured Petri Nets modeling (CPN). The advantage offered by the models developed with CPN compared to other types of Petri nets is the possibility of interpreting the values of the variables (such as pH, oxygen, turbidity, etc.) at each change of state during the process of water purification.

Moreover, the use of this formal tool for system modeling improves its understanding, identifies its main features, facilitates improvement strategies with a discrete approach, among others (7. Additionally, it facilitates an interdisciplinary approach in the evaluation and design stages of the system. Thus, considering the dynamics of the water treatment process from a discrete approach, the model was developed using Coloured Petri Nets. For this, a systematic structure to identify, simulate and analyze the system is proposed.

This paper presents a first approach to a quantitative analysis of the variation of water properties as a function of the processes carried out at the Puerto Mallarino potabilization plant, through the use of CPN. Future related projects could use this model as a support tool to evaluate the behavior of the variables involved in the purification process and thereby define the amount of resources required for water treatment in different scenarios to ensure high water supply quality.

This work presents scenarios where water properties are affected only by climatic variations throughout the year (rain and drought seasons), taking into account the historical data provided by the water treatment plant and by the Institute of Hydrology, Meteorology and Environmental Studies (IDEAM). It is structured as follows: Section two describes the conceptual framework. Section three the modeling procedure is presented. Section four shows the obtained model of water treatment plant and finally in section five conclusions are exposed.


Petri nets

Petri nets are a graphical and mathematical representation used in modeling discrete event systems for expressing concurrent, distributed, asynchronous, parallel, deterministic and/or stochastic events (7, some applications in productive systems are shown in (8.

The structure of the petri nets are composed for places, transitions, directed arcs and the behavior of the marks that represent the system dynamics 7, as shown in Figure 1.

Figure 1 Petri nets components. 

Where, places represent reachable states and the transitions the events that can occur under certain conditions according to the relationship defined by the arcs. These arcs have weights, which indicate the necessary amount for that transition to be fired simultaneously, and displays the number of marks generated when a transition leaves.

For example, consider Figure 1. The input places transition T0 are P1 and P2. The associated arc with P1 has a weight of 1 while the associated arc with P2 has a weight of 2. This means that to trigger a change in the system, it is necessary that P1 has at least one mark and P2 has at least two marks in order to enable T0. This transition produces an output in P0 with a weight equal to one when is fired. Figure 2 shows the system after the T0 activation.

Figure 2 Petri net after T0 activation. 

The Petri nets have few but powerful primitive models that create productive models with a discrete approach. For cases where there is a complex system, an explosion of states may occur and would compromise the advantages offered by the graphical environment of the tool. This approach has encouraged the extension of Petri nets to Coloured Petri Nets (CPN).

Coloured Petri Nets

The Coulored Petri Nets combine the advantages of classic Petri nets and high-level programming languages (Standard ML). Using this tool, it can be study the behavior of a modeled system through simulation, verifying properties through the state space method and conduct performance analysis 9. 10 The "CPN" extends the content capacity of discrete information in marks, allowing its definition agree with the concept of color. That is, the colors define the data type of the marks' values, for example: integer, decimal, Boolean, string, unit (this mark is similar as the one use in ordinary networks), and combinations of them. Thus, a CPN model integrates the information in a structure based on regular components of a Petri net (place, transition and arc) while using a high-level abstraction based on the programming of marks' contents.

In addition, this tool allows the definition of hierarchies. Thus, it is possible to encapsulate different levels of abstraction from the model in subnets, whereby a state explosion is avoided. In this work the potable water treatment plant model for Puerto Mallarino, located in Cali (Colombia), is developed and validated, using the freeware software "CPNTOOLS" 11.


The development of the system model was based on a well-structured procedure proposed in 12, which orderly describes the steps to follow in order to develop a model of a productive system, the procedure is shown in Figure 3.

Figure 3 Method for modeling production systems. 

This technique ensures the inclusion of progressive refinements, which are essential to achieve the level of detail required by the system's model.

Collection of information

Information to be modeled should be gathered, such as its performance and its components, the physical devices that are part of the process (sensors, actuators, specialized equipment, chemicals, expert staff, etc.), important variables involved in the process, the environment and the materials or goods to produce.

Also, field visits are necessary to have a roughly idea of the functional parameters of the system. Additionally, it is important to obtain all available documentation manuals, catalogs, books and internet references related to the type of process, specialized personnel, documents, etc.

Definition of variables and system behavior

After determining the required or desired process for the system, all collected information is analyzed and the system variables are set, such as the following example:

  • • Which is the required procedure to tend the specification of the process.

  • • Which devices are used in the execution of each process activity.

  • • Information, signs and data related during activities.

  • • Relationships between each device for tasks performing.

  • • Relationship between the variables involved in the process that allows the evolution of states or make decisions to carry out a process.

  • • Execution times, variables involved in the beginning and end of a process, etc.

Structural modeling

A structural model of the system should be developed; using charts or graphs, the components such as machines and control devices are identified and located in its corresponding position. For this case, the program "CNPTOOLS" is used to represent the steps and components in the process.

The positions of all actuators and control devices are identified for each area in the system. Additionally, at this stage some of the control variables are analyzed and will be taken into account for the execution of each stage.

Functional and conceptual modeling

This stage describes the relationships between devices, signals and system components from a functional perspective. For the development of this model, the previously acquired information should be well-analyzed, in order to conduct an organized model that allows an easy description and understanding of the components. Also, it is important to analyze the variables and functions information that define a particular process.

Model analysis

At this stage, the model analysis through simulation is performed to observe its behavior in different environments and validate its performance with the real system.

The model is refined with processes' simplification that do not affect the model, but makes it more efficient. Through simulation different possible real scenarios are analyzed and then, it is proceeded with the relevant corrections after each scenario.


Following the procedure described in previous section, the model of the Puerto Mallarino treatment plant was developed in CPN showing how the process affects the properties of the water along its route in the plant.

Collection of information

According to the Municipal Companies of Cali (EMCALI), this plant supplies about 60% of Cali's population, where nearly 2,000,000 users depend on this plant to meet their need for drinking water; a process overview is shown in Figure 4.

Figure 4 Puerto Mallarino's potable water treatment plant process. 

Purification process starts in the intake next to the Cauca's river where thick bars stop solids waste from continuing. Then, the water is pumped to the stage of degritting, which has two structures in this process; at this stage activated carbon is applied to remove odors and unwanted flavors from water.

Subsequently, the water is sent through a distribution chamber (CADICAS "Cámara de Distribución de Caudales", in Spanish) to the reactors, where the process of water clarification is carried out using ferric chloride. This act as a coagulant that group particulate matter found in the water and then, in a filtering process with sludge, these grouped particles are caught, and thus cleaning or clarifying the water.

Then, the clarified water continues to the fast filters, which would retain small particles that failed to be caught in the previous process. In this stage, the water has a removal of 96.7% to 99.5% turbidity, the present turbidity should not be higher than 0.15 NTU.

Leaving the fast filters, the water enters the chlorination process allowing further decontamination water from harmful agents, the coagulation pH with ferric chloride range between 5.61 and 6.58 units. To complete the process, lime is applied to stabilize the pH of the water and then it is pumped to users. The model is developed on Coulored Petri Nets which represent the behavior of the system in a normal operation process.


Relevant variables according to location are shown in Table 1.

Table 1 Variables in the plant. 

With the previous data, the analysis of the variables is performed to establish relationship between them and how they affect the process of clarification and purification of water.

As described above, the most important process' variables for each step will be the input and output data of each sub-process held in the plant. Here, the plant operation and equipment are set. Also, actual values of historical records of previous processes are taken to establish the variation of the parameters within the process.

The variation of parameters at the plant entrance for this case is established from climate change in the region where the plant is located, as reported by the IDEAM (The Institute of Hydrology, Meteorology and Environmental Studies). With these climatic changes, it is obtained the turbidity variation and other variables also function of the turbidity, which are useful approximate results to feed the model.

After establishing correlations between variables based on statistical data and the personnel expertise, the structural model is developed.

Structural model

Once the variables to manage within the system and after locating the equipment and devices involved in the production process were obtained, a structural model was developed. It allows the identification of the stages in a previous model, see from Figure 5.

Figure 5 Puerto Mallarino’s potable water treatment plant scheme. 

Functional and conceptual modeling

When the structural model was developed, the conceptual model is raised. This defines the behavior of the functional model and the activities it must perform. Figure 6 presents the conceptual model in a flowchart.

Figure 6 Conceptual model diagram. 

The model functional was developed using CPN, with the software CPNTOOLS. Un additional level of detailed is modeled, integrating internal process steps, see Figure 7. At this stage all the functional relationships of each process are defined, where the behavior of variables and the operations performed on each system component are described.

Figure 7 Model in Cpntools. 

The model shows the different stages that make up the water purification process and progressively the sub-processes and functions that allow describing the process are generated, such as the generation of variables according to climatic season in a month or the ignition of engines in pumping station according the required flow. In this model, the behavior of the variables will be defined taking into account only the rain seasons during a year, that is, other factors that can affect the physical and chemical properties of the water are not considered.

Due to space limitations effects, only were detailed the variables from the generation process, see Figure 8.

Figure 8 Model of climate agent. 

The Figure 8 shows, in a higher abstraction level, the transition "river conditions agent" and the subnets that it contains which are "climate agent" and "river agent", where "river" is a subnet of climate agent. In this case, the subnet "climate agent" defines the month to be modeled that could be a rainy month with high, medium or low intensity or dry weather. After selecting the climatic conditions of the month, the network assigns a number of rainy days with high, medium or low intensity and no rain days. All values assigned to the rainy days are taken from IDEAM's statistical data.

After classifying the type of month, the days and rainfalls, climatic agent enters data to the "river" subnet which is responsible for modeling the behavior of physical-chemical variables of the river. Such behavior was modeled by polynomial functions that fit actual values based on historical data collected on the plant for different rainy seasons. This approach was made due the variations of the variables associated with the physicochemical properties of water present a random behavior that cannot be defined by deterministic functions. At the end, the output variables for "river" will later be detected in the MILAN station, and by doing so, the process of water purification begins. All data were sent to the control room.

Model analysis

In this stage, the model is validated comparing the data obtained by the model with the data of the real system. The seasonal patterns of the variables were compared along time; this is because the experts use these patterns to make decisions.

All the properties of the model are verified to ensure that it is free of locks and all the states are reachable. The model allows to generate data of turbidity for different seasons along year with similar trends as the one reported for Puerto Mallarino treatment plant in its historical data, under the assumption that the change in turbidity obeys only to the intensity of the raining season.

The data of the model are extracted with a tool called monitor, which extracts the data and create a text file that can be exported to a spread sheet for data manipulation.

Figure 9 shows the turbidity behavior for a seasonal pattern with average rainfall (600NTU) and high rainfall (1200NTU) reported in Puerto Mallarino in a given period of time. In a similar way, Figure 10 presents turbidity over a similar period of time thrown by the model in CPN. Where a similar behavior is observed in seasonal patterns for medium and high rainfall seasons. Multiple simulations were carried out to corroborate if the model showed seasonal behaviors similar to the real ones for high, medium and low rain temples for similar periods of time. The results obtained showed that the model allows obtaining data that fit the real data under specific conditions. In this way, the model can be used in subsequent analysis of consumption of inputs for purification, decision making of projects related to the water purification process, etc. However, making a quantitative purchase between the data obtained in the model and the data of the real system is outside the scope of the project, because it is not possible to determine an analytical or numerical solution that allows predicting the composition of the variables present in a river, because the physical-chemical properties of this depend on multiple factors over which there is no control.

Figure 9 Data from real system. 

Figure 10 Data from model. 


Considering the importance of a water treatment system in society, a model that represents its dynamics is an important tool to develop strategies that improve its behavior and resources use, minimizing the risks of an inadequate specification. This article showed a procedure that generate a model to evaluate the variables behavior under different seasonal patterns (high, medium and low rainfall) and identify several stages of the purification process. In this sense, it was observed that the rainy season presents a greater demand in the system functioning with the objective of supplying drinking water. For instance, In case the water in the intake point has severe conditions that exceed the treatment capacity of the plant, it is necessary to close the gates at this point.

In this way, a tool was provided to forecast the inputs in response to certain behavior of the variables involved, failures diagnosis, among others.

In addition, this work could be integrated with other tools to form a simulator for operators training. This scenario will allow the new operator to carry out water purification procedures in diverse meteorological conditions, improving the operator's behavior in the operation of the water treatment system.


Acknowledgments to the Universidad del Valle and Administrative Department of Science, Technology and Innovation - Colciencias to support the development of this work


[1] H. Eslami, M. Hassan Ehrampoush and H. Fallahzadeh., "Biodegradation and nutrients removal from greywater by an integrated fixed-film activated sludge (IFAS) in different organic loadings rates". AMB Express. Vol. 8, Issue 1. 2018.

[2] J.C. Crittenden, R.R. Trussell, D.W. Hand, K.J. Howe and G. Tchobanoglous. "MWH's water treatment: principles and design". In MWH's water treatment: principles and design, 3rd ed., John Wiley & Sons, pp. 1805-1850. 2012.

[3] Y.I. Azimov, I.I. Ismagilov, and S.N. Savdur. "Network Modelling of Functioning System of the Process Module of Oil-Contaminated Wastewater Treatment". Asian Soc. Sci. Vol. 11, Issue 11, pp. 313-317. 2015.

[4] N.F.A.H., Subiono and D. Adzkiya. "Modeling of water treatment plant using timed continuous Petri nets". AIP Conference Proceedings. Vol. 20066, p. 20066. 2017.

[5] D. Panchal and D. Kumar. "Integrated framework for behaviour analysis in a process plant". J. Loss Prev. Process Ind. Vol. 40, pp. 147-161. 2016.

[6] G. Rojas, E. Quiroga, J. Caratar, C. Pinedo and J. Garcia. "Supervisory System for Fault Detection and Diagnosis in Drinking Water Treatment Plants Using Fuzzy Engine". IEEE Latin America Transactions. Vol. 15, Issue 11, pp. 2071-2076. 2017.

[7] T. Murata. "Petri Nets: Properties, Analysis and Applikations". Proceeding of the IEEE. Vol. 77, Issue 4, pp. 541-580. 1989.

[8] K. Jensen, L. M. Kristensen and L. Wells. "Coloured Petri Nets and CPN Tools for modelling and validation of concurrent systems". Int. J. Softw. Tools Technol. Transf. Vol. 9, Issue 3-4, p. 213. 2007.

[9] Q. Zhang and S.J. Stanley. "Real-Time Water Treatment Process Control with Artificial Neural Networks". J. Environ. Eng. Vol. 125, Issue 2, pp. 153-160. 1999.

[10] S. Meghzili, A. Chaoui, M. Strecker and E. Kerkouche. "On the Verification of UML State Machine Diagrams to Colored Petri Nets Transformation Using Isabelle/HOL". Inf. Reuse Integr. (IRI), 2017 IEEE Int. Conf. 2017.

[11] CPN Group. AIS group. "Software de Redes de Petri Coloridas cpn tools". URL:

[12] J.I. Melo Garcia, R.A.G. Morales, F. Junqueira, D.J. Dos Santos Filho and P.E. Miyagi. "Modeling the supervision of manufacturing system considering diagnosis and treatment of fault". IECON Proc. Industrial Electron. Conf., Issue 1, pp. 2168-2173. 2010.

Received: July 11, 2018; Accepted: June 17, 2019

* Autor de correspondencia:


Artículos Relacionados

# Título Ver
Modelado del precio spot de la electricidad en brasil usando una red neuronal autorregresiva (2008)
Juan D. Velásquez, Isaac Dyner, Reinaldo C. Souza
JGOOSE: Una herramienta de ingeniería de requisitos para la integración del modelado organizacional I* con el modelado de casos de uso en UML (2009)
André Abe Vicente, Victor F. A. Santander, Jaelson B. Castro, Ivonei Freitas da Silva, Francisco G. Reyes Matus
Integración de componentes com de MATLAB/SIMULINK en el entorno case XBDK, para el modelado de sistemas de conformación de haz (2009)
Mariano Raboso Mateos, Alberto Izquierdo Fuente, Juan J. Villacorta Calvo, Lara Del Val Puente, Mª Isabel Jiménez Gómez
Karagabi Kmmodel: modelo de referencia para la introducción de iniciativas de gestión del conocimiento en organizaciones basadas en conocimiento (2009)
Alberto de J. González, Caroll Z. Joaquí, Cesar A. Collazos
Modelado, simulación y control del robot para cirugía laparoscópica ‘lapbot’ (2009)
Sergio Alexander Salinas, Oscar Andrés Vivas Albán
Un modelo multifractal simplificado para flujos de tráfico en redes de computadoras de alta velocidad (2013)
Ginno Millán Naveas, Enrique San Juan Urrutia
Análisis de la calidad de la energía en un centro de cómputos (2013)
Juan Antonio Suárez, Guillermo di Mauro, Daniel Anaut, Rubén di Mauro, Jorge L. Strack
Transformación de requisitos representados en esquemas preconceptuales a modelos de interacción de sistemas holónicos (2014)
Carlos M. Zapata, Gloria L. Giraldo, Germán Zapata, Adrián S. Arboleda
Un ambiente de meta-modelado y visualización basado en el paradigma de Zoomable User Interfaces (2015)
Jaime A. Pavlich-Mariscal, Hernan D. Veliz-Quispe, Steven A. Demurjian, Laurent D. Michel
Caracterización experimental y modelación de una bomba de calor reversible para un vehículo eléctrico (2016)
Cristian Cuevas, Vincent Lemort
Modelado de un sistema de refrigeración caracterizado en un rango amplio de condiciones de operación (2016)
Cristian Cuevas, Néstor Fonseca
Contribución a la logística inversa mediante la implantación de la reutilización por medio de las redes de Petri (2017)
L.O. Vega de la Cruz, C.E. Marrero Fornaris, M.C. Pérez Pravia
Modelo de referencia para la integración del modelado de negocio a la ingeniería de requisitos: una propuesta desde la industria del software (2018)
María Claudia Bonfante, Luis Alfredo Blanquicett, Enrique Díaz Infante
Modelado numérico 3D aplicado al análisis de fundaciones con pilotes (2018)
Jean Rodrigo Garcia, Paulo José Rocha de Albuquerque

Otros Artículos

# Título Ver
Análisis de la Viabilidad Financiera de un Sistema Fotovoltaico a una Unidad de Consumo en el Sur de Brasil (2019)
Fabrício Y. K. Takigawa, Edison A. C. Aranha Neto, Rubipiara C. Fernandes, Dyego de Campos, Mauro Cardoso
Juegos serios: apoyo a la participación ocupacional de personas mayores de 50 años basado en sistemas de tutoría inteligente mayores (2014)
Mario A. Bruno, Laura Griffiths
Aumento del índice solar ultravioleta con la altura (2008)
Miguel Rivas A., Elisa Rojas E., Sasha Madronich

Desarrollado por: Cristian Díaz Fonseca -