Abstract
The objective of this study was to develop a system capable of evaluating the quality of the water consumed by an urban population using fuzzy logic. The set of factors to be analyzed were total coliforms, fluoride, free residual chlorine, turbidity, and apparent color. The factors selected as indicators of water quality and the system rules were modeled using the INFUZZY tool with help from specialists in this area, using a Great, Good, Acceptable or Inappropriate quality classification. 47 water quality analyses were applied. The results showed that 57.44% of the samples had a water quality classified as Great, 2.12% as Good, 2.12% as Acceptable, and 38.29% as Inappropriate. For each sample, results were in agreement with the evaluated parameters.
INTRODUCTION
According to Pinho (2001), water quality is fundamental for protection of the environment, it is important for population economic and social development, and its quality is characterized by chemical, physical, and biological factors. These factors can be represented by parameters that serve as indicators for quality measurements. The aim of this study was to develop a system capable of evaluating quality. The system received data as water quality indicators and subsequently determined the classification according to the calculated score. Turbidity, pH, and total coliforms were some of the parameters used as indicators of water quality, and have been represented using a scale of 0–100. The scale used in this study was defined according to the scale used previously by Oliveira et al. (2007), in which 80–100 classified water as Optimum, 52–79 as Good, 37–51 as Acceptable, and 0–36 as Inappropriate. To find this score, we used the theory of fuzzy logic.
A fuzzy set is a class of objects. For each object, a degree of pertinence is assigned (ranging from 0 to 1) by means of an association function (Zadeh 1965). Classical logic categorizes information as ‘true’ or ‘false’, whose degree of pertinence is represented as 0 or 1, respectively. In 1965, Zadeh proposed the theory of fuzzy sets as an alternative to the representation of vague or imprecise information, and this is seen as an extension of classical logic. In this case, the degree of pertinence associated with a given set is also limited to values 0 and 1, but the difference is that there can be infinite values within the range [0,1] (Lopes et al. 2014). This study refers to the development of a system capable of evaluating the quality of water consumed by an urban population using fuzzy logic.
Water is indispensable to human beings and is consumed in a larger quantity than all other foods, consequently, hygienic water is a necessity (Freitas et al. 2002). It can also pose a risk to health and can serve as a disease transmitter (Santos et al. 2013). Therefore, it is essential to know how potable this natural resource is, whether it meets the standards of potability, and the limiting quantities of several elements that are acceptable in the supply. These quantities are usually established by decrees, regulations, or specifications (Freitas et al. 2002).
Currently, there are mathematical models based on traditional logic, which are used to represent the classification of bodies of water. These models have limitations, including the inability to work with the imprecise, vague, and nebulous information that is often found in decision making for water quality.
A system that has the capacity to evaluate water quality would have a huge benefit for the population, indicating whether water is within drinking standards and whether it is possible to further improve its quality. If outside the standards, measures are required to reverse the situation.
The INFUZZY tool was used in this study. INFUZZY is a graphical interface software for the modeling of fuzzy system applications (Posselt et al. 2015). Thus, the main objective was to develop a system capable of assessing the quality of water consumed by an urban population using fuzzy logic based on a set of analyzed factors.
Previous studies relating to the evaluation of water quality using fuzzy logic were reviewed. From this review, the following characteristics stood out: the objectives, water quality parameters used, methods of fuzzification, inference and defuzzification, and the tools used. The article by Pereira et al. (2012) proposed a new water quality index (WQI) using fuzzy logic, applying the following parameters: dissolved oxygen, total coliforms, hydrogenation potential, biochemical demand for oxygen, total nitrates, total phosphates, temperature variation, turbidity, and solids. The fuzzification method applied was Gaussian, the inference was by Mamdani, the defuzzification was by Centroid, and the software used was MATLAB.
The study from Oliveira et al. (2014), presented the development of a new RWQI (Raw Water Quality Index) approach using fuzzy logic with the following parameters: manganese, iron, Escherichia coli, algae, cyanobacteria, pH, apparent color, and turbidity. Two fuzzification methods were used, trapezoid at the tips and triangular in the middle. The inference was by Mamdani, the defuzzification technique applied was Centroid, and MATLAB software was used. A study by Kord & Moghaddam (2013) presented water quality classification using the Ardabil Plain Aquifer with special fuzzy logic techniques for modeling and decision making using the water quality parameters of chloride, fluoride, magnesium, calcium, sulfate, total hardness, sodium, pH, nitrates, and total solids dissolved. The trapezoidal fuzzification technique was applied, inference was by Mamdani, Centroid defuzzification was applied, and the FuzMe software was used.
Vadiati et al. (2016) developed a new generalized approach to WQI applying fuzzy logic based on widely accepted WQIs (GQI – Groundwater Quality Index, WQI, and GWQI – Ground Water Quality Index). The water quality parameters used were pH, total dissolved solids, chloride, calcium sulfate, magnesium, total alkalinity, total hardness, nitrate, and fluoride. The trapezoidal technique of fuzzification was used, inference was by Mamdani, Centroid defuzzification was applied, and MATLAB was used. Lermontov et al. (2011) propose a new WQI called INQA (Cloudy Water Quality Index). The water quality parameters used were temperature, pH, dissolved oxygen, biochemical oxygen demand, coliforms, dissolved inorganic nitrogen, total phosphorus, total solids, and turbidity. Two techniques of fuzzification were applied, trapezoidal at the tips and triangular in the middle, the method of inference was Mamdani, and no method of defuzzification was specified. The software used was MATLAB.
The objective of this study was to develop a system capable of evaluating the quality of water consumed by an urban population using fuzzy logic. The applied parameters were total coliforms, fluoride, free residual chlorine, pH, turbidity, and apparent color. The discrete, trapezoidal and ramp to the right methods were used for the fuzzification. The method of inference was Mamdani, defuzzification was by Centroid, and the software used was INFUZZY.
From the literature review, it was observed that the Trapezoidal technique was used in almost all the studies. Only in the study by Pereira et al. (2012) was the Gaussian technique used. Oliveira et al. (2014) and Lermontov et al. (2011) used the triangular function as well as the trapezoidal model. For the inference step, the Mamdani model was the most widely used. Only Kord & Moghaddam (2013) applied the Sugeno model. For the defuzzification process, the Centroid technique was universal. In the study by Lermontov et al. (2011) the defuzzification technique used was not defined. In this study, the discrete, trapezoidal, and ramp to the right techniques were used, the inference was Mamdani, and the method of defuzzification used was Centroid.
The article has been organized into the following sections: section 2 discusses the fuzzy model created and the water quality parameters used; section 3 describes the mapping of the free residual chlorine input and output parameters and the observed results; and section 4 presents the conclusion.
METHODS
Initially, studies were carried out on water quality assessment using fuzzy logic and it was verified that there were already studies in the area. Subsequently, quantitative and qualitative bibliometric analyses were performed. The quantitative analysis applied statistical models to describe the data, and the qualitative research focused on analyzing social realities, avoiding numbers (Bauer & Gaskell 2017). From all the research performed, together with the human experts, it was possible to construct a fuzzy model to evaluate urban water quality from a set of parameters, and 47 water samples were analyzed. The fuzzy model was developed and the results obtained were used to develop fuzzy systems, named INFUZZY, as developed by (Posselt et al. 2015).
The parameters of urban water quality were defined with the help of human experts according to the information found on the CORSAN (sewage state company) website (http://www3.corsan.com.br), which presents the potability limits of each parameter. The website also presents procedures for the control and surveillance of water quality with respect to human consumption and standards of potability, according to the descriptions of the ministerial ordinance N° 2914 of 12th December 2011 (BRAZIL 2011). Table 1 shows the parameters used in this study with their respective classifications.
Water quality parameters with their respective classifications
. | Turbity (UT) . | pH . | Fluorine (mg/l) . | Color (UH) . | Free chlorine (mg/l) . | Total coliforms . |
---|---|---|---|---|---|---|
Great | 0–0.5 | 7–8 | 0.6–0.9 | 0–1.0 | 0.5–1.0 | 0 |
Good | 0.51–1.0 | 6.5–9.0 | 0.91–1.50 | 1.1–5.0 | 0.5–2.0 | 0 |
Acceptable | 1.1–5.0 | 6.0–9.5 | 0–1.50 | 5.1–15.0 | 0.0–5.0 | 0 |
Inappropriate | >5.0 | <6.0 or >9.5 | >1.50 | >15 | >5.0 | >0 |
. | Turbity (UT) . | pH . | Fluorine (mg/l) . | Color (UH) . | Free chlorine (mg/l) . | Total coliforms . |
---|---|---|---|---|---|---|
Great | 0–0.5 | 7–8 | 0.6–0.9 | 0–1.0 | 0.5–1.0 | 0 |
Good | 0.51–1.0 | 6.5–9.0 | 0.91–1.50 | 1.1–5.0 | 0.5–2.0 | 0 |
Acceptable | 1.1–5.0 | 6.0–9.5 | 0–1.50 | 5.1–15.0 | 0.0–5.0 | 0 |
Inappropriate | >5.0 | <6.0 or >9.5 | >1.50 | >15 | >5.0 | >0 |
Source: Adapted from CORSAN and ministerial ordinance N° 2914 of 12th December 2011 together with the human specialists.
RESULTS AND DISCUSSION
Input parameter mapping
Figure 1 shows the mapping of one of the six water quality parameters, free residual chlorine, for the fuzzy sets. The pertinence function applied was trapezoidal for ‘Great’, ‘Good’, ‘Acceptable Minor Presence’, and ‘Acceptable Greater Presence’. For ‘Inappropriate’, the Ramp to the right function was used.
Mapping of the free residual chlorine input parameter for the fuzzy sets.
Output parameter mapping
Figure 2 shows the mapping of the water quality output parameter for the fuzzy sets. More linguistic terms were defined in each classification, so the water quality grade varied within each category. For example, if the total coliform input parameter was ‘Inappropriate’, but the rest of the parameters were ‘Great’, the system would generate the score around 36 as only one parameter setting would be needed to improve the quality of the water. If total coliforms were ‘Inappropriate’ and any other parameter was also ‘Inappropriate,’ the note would decrease further. This was possible by applying more levels (language terms) within the same category.
For the linguistic term ‘Inappropriate Level 4’, the pertinence function used was discrete, and for ‘Great Level 4’ the Ramp to the right was used. For the other terms, the trapezoidal function was applied.
RESULTS
A total of 47 water quality analyses were carried out in the municipalities of Barro Cassal, Candelária, Rio Pardo, Santa Cruz do Sul, and Venâncio Aires, which were provided by the UNISC Analytical Center, who sent all results from May 2014 to June 2017 from customers who spontaneously brought samples for analysis. In total, 192 rules were created using the INFUZZY tool alongside the human specialists. Table 2 shows the results generated by the INFUZZY software.
Results of the samples generated using the INFUZZY tool
. | Total coliforms . | Fluoride . | Free residual chlorine . | pH . | Turbidity . | Apparent color . | Water quality . |
---|---|---|---|---|---|---|---|
1 | 1 | 0.8 | 0.5 | 7.6 | 0.4 | 0.2 | 36.23 |
2 | 0 | 0.8 | 0.8 | 7.8 | 0 | 0 | 100 |
3 | 0 | 0.8 | 5.1 | 7.9 | 0.5 | 0.5 | 36.14 |
4 | 0 | 0.9 | 0.8 | 7.5 | 0.4 | 17 | 36.35 |
5 | 0 | 2 | 0.8 | 7.6 | 0.3 | 0.9 | 36.13 |
6 | 0 | 0.8 | 0.8 | 2 | 0.3 | 0.5 | 36.13 |
7 | 0 | 0.8 | 0.8 | 7.6 | 6 | 0.5 | 36.13 |
8 | 0 | 0.8 | 0.8 | 7.6 | 0.7 | 1.1 | 97.2 |
9 | 0 | 1.3 | 1.5 | 8.8 | 0.4 | 0.9 | 79.51 |
10 | 0 | 1.2 | 1.6 | 8 | 1 | 3 | 85.45 |
11 | 0 | 0.3 | 4.9 | 6.1 | 3 | 7 | 41.64 |
12 | 1 | 0.3 | 4 | 6.05 | 3 | 8 | 20.86 |
13 | 1 | 2 | 6 | 11 | 6 | 18 | 0 |
14 | 0 | 0.8 | 0 | 7.5 | 0 | 0 | 97.15 |
15 | 0 | 0.8 | 0.1 | 7.5 | 0 | 0 | 97.16 |
16 | 0 | 0.8 | 0.19 | 7.5 | 0 | 0 | 97.17 |
17 | 0 | 0.8 | 6 | 7.5 | 0 | 0 | 36.13 |
18 | 1 | 0.8 | 0.8 | 7.7 | 0.11 | 0.15 | 36.13 |
19 | 0 | 0.26 | 0 | 6.69 | 0 | 0 | 89.41 |
20 | 0 | 0.37 | 0.11 | 8.49 | 0 | 0 | 89.13 |
21 | 0 | 0.68 | 0 | 7.49 | 0 | 0 | 95.46 |
22 | 0 | 0.33 | 0 | 9.05 | 0 | 0 | 86.81 |
23 | 0 | 0.47 | 0 | 7.47 | 0 | 0 | 93.78 |
24 | 0 | 0.3 | 0 | 6.86 | 0 | 0 | 92.21 |
25 | 0 | 0.21 | 0.06 | 6.87 | 0 | 0 | 92.65 |
26 | 0 | 0 | 0 | 6.74 | 0.2 | 0 | 89.16 |
27 | 0 | 0.46 | 0 | 6.68 | 0 | 0 | 89.64 |
28 | 0 | 0.28 | 0 | 6.65 | 0 | 0 | 89.03 |
29 | 0 | 0.24 | 0 | 7.34 | 0 | 0 | 93.43 |
30 | 0 | 0.43 | 0.12 | 7.1 | 0 | 0 | 93.74 |
31 | 1 | 0.29 | 0 | 6.63 | 0 | 0 | 36.13 |
32 | 1 | 0.9 | 0 | 9.69 | 3.67 | 2 | 24.9 |
33 | 0 | 0 | 0.24 | 9.04 | 0 | 0 | 87.48 |
34 | 0 | 0 | 0 | 6.84 | 0.39 | 0 | 87.76 |
35 | 0 | 0.84 | 0.21 | 6.69 | 0.59 | 0 | 90.18 |
36 | 0 | 0.9 | 0.08 | 6.7 | 0 | 0 | 89.72 |
37 | 0 | 0.83 | 0.12 | 7.1 | 0 | 0 | 96.56 |
38 | 0 | 0.9 | 1.21 | 7.01 | 0 | 0 | 97.14 |
39 | 1 | 0.15 | 0 | 7.19 | 0 | 0 | 36.13 |
40 | 0 | 0.9 | 0 | 7.22 | 6.04 | 20 | 24.9 |
41 | 1 | 0.56 | 0 | 6.97 | 0 | 0 | 36.26 |
42 | 0 | 0.9 | 1.01 | 5.44 | 0 | 0 | 36.35 |
43 | 0 | 0.86 | 0 | 6.98 | 0 | 0 | 96.7 |
44 | 1 | 0.1 | 0 | 7.59 | 7.46 | 2 | 24.9 |
45 | 0 | 0.9 | 0 | 7 | 0.28 | 0 | 95 |
46 | 1 | 0.28 | 0 | 4.72 | 0 | 0 | 24.9 |
47 | 0 | 0.9 | 1.1 | 8.62 | 0 | 0 | 94.83 |
. | Total coliforms . | Fluoride . | Free residual chlorine . | pH . | Turbidity . | Apparent color . | Water quality . |
---|---|---|---|---|---|---|---|
1 | 1 | 0.8 | 0.5 | 7.6 | 0.4 | 0.2 | 36.23 |
2 | 0 | 0.8 | 0.8 | 7.8 | 0 | 0 | 100 |
3 | 0 | 0.8 | 5.1 | 7.9 | 0.5 | 0.5 | 36.14 |
4 | 0 | 0.9 | 0.8 | 7.5 | 0.4 | 17 | 36.35 |
5 | 0 | 2 | 0.8 | 7.6 | 0.3 | 0.9 | 36.13 |
6 | 0 | 0.8 | 0.8 | 2 | 0.3 | 0.5 | 36.13 |
7 | 0 | 0.8 | 0.8 | 7.6 | 6 | 0.5 | 36.13 |
8 | 0 | 0.8 | 0.8 | 7.6 | 0.7 | 1.1 | 97.2 |
9 | 0 | 1.3 | 1.5 | 8.8 | 0.4 | 0.9 | 79.51 |
10 | 0 | 1.2 | 1.6 | 8 | 1 | 3 | 85.45 |
11 | 0 | 0.3 | 4.9 | 6.1 | 3 | 7 | 41.64 |
12 | 1 | 0.3 | 4 | 6.05 | 3 | 8 | 20.86 |
13 | 1 | 2 | 6 | 11 | 6 | 18 | 0 |
14 | 0 | 0.8 | 0 | 7.5 | 0 | 0 | 97.15 |
15 | 0 | 0.8 | 0.1 | 7.5 | 0 | 0 | 97.16 |
16 | 0 | 0.8 | 0.19 | 7.5 | 0 | 0 | 97.17 |
17 | 0 | 0.8 | 6 | 7.5 | 0 | 0 | 36.13 |
18 | 1 | 0.8 | 0.8 | 7.7 | 0.11 | 0.15 | 36.13 |
19 | 0 | 0.26 | 0 | 6.69 | 0 | 0 | 89.41 |
20 | 0 | 0.37 | 0.11 | 8.49 | 0 | 0 | 89.13 |
21 | 0 | 0.68 | 0 | 7.49 | 0 | 0 | 95.46 |
22 | 0 | 0.33 | 0 | 9.05 | 0 | 0 | 86.81 |
23 | 0 | 0.47 | 0 | 7.47 | 0 | 0 | 93.78 |
24 | 0 | 0.3 | 0 | 6.86 | 0 | 0 | 92.21 |
25 | 0 | 0.21 | 0.06 | 6.87 | 0 | 0 | 92.65 |
26 | 0 | 0 | 0 | 6.74 | 0.2 | 0 | 89.16 |
27 | 0 | 0.46 | 0 | 6.68 | 0 | 0 | 89.64 |
28 | 0 | 0.28 | 0 | 6.65 | 0 | 0 | 89.03 |
29 | 0 | 0.24 | 0 | 7.34 | 0 | 0 | 93.43 |
30 | 0 | 0.43 | 0.12 | 7.1 | 0 | 0 | 93.74 |
31 | 1 | 0.29 | 0 | 6.63 | 0 | 0 | 36.13 |
32 | 1 | 0.9 | 0 | 9.69 | 3.67 | 2 | 24.9 |
33 | 0 | 0 | 0.24 | 9.04 | 0 | 0 | 87.48 |
34 | 0 | 0 | 0 | 6.84 | 0.39 | 0 | 87.76 |
35 | 0 | 0.84 | 0.21 | 6.69 | 0.59 | 0 | 90.18 |
36 | 0 | 0.9 | 0.08 | 6.7 | 0 | 0 | 89.72 |
37 | 0 | 0.83 | 0.12 | 7.1 | 0 | 0 | 96.56 |
38 | 0 | 0.9 | 1.21 | 7.01 | 0 | 0 | 97.14 |
39 | 1 | 0.15 | 0 | 7.19 | 0 | 0 | 36.13 |
40 | 0 | 0.9 | 0 | 7.22 | 6.04 | 20 | 24.9 |
41 | 1 | 0.56 | 0 | 6.97 | 0 | 0 | 36.26 |
42 | 0 | 0.9 | 1.01 | 5.44 | 0 | 0 | 36.35 |
43 | 0 | 0.86 | 0 | 6.98 | 0 | 0 | 96.7 |
44 | 1 | 0.1 | 0 | 7.59 | 7.46 | 2 | 24.9 |
45 | 0 | 0.9 | 0 | 7 | 0.28 | 0 | 95 |
46 | 1 | 0.28 | 0 | 4.72 | 0 | 0 | 24.9 |
47 | 0 | 0.9 | 1.1 | 8.62 | 0 | 0 | 94.83 |
When only a single sample parameter was ‘Inappropriate’, water was classified as ‘Inappropriate’, and with increasing ‘Inappropriate’ parameters, water quality deteriorates. For example, samples 41 and 44 were classified as ‘Inappropriate’, but the quality of sample 44 (score 24.90) was worse than 41 (note 36.26) because, in addition to containing coliforms, the turbidity parameter was also ‘Inappropriate’. Sample 2 was classified as ‘Great’, generating note 100, since all the parameters were optimal. Samples 34 and 35 were classified as ‘Great’ but at 35 (note 90.18) generated a higher value due to the presence of free residual fluoride and chlorine. Sample 34 (note 87.76) showed no presence of these two parameters.
Figure 3 shows the defuzzification graph of sample number 11 generated by the INFUZZY tool. The water was classified as ‘Acceptable’ because the free residual chlorine parameter was high (4.9 mg – L), and the degree of pertinence in relation to the ‘Acceptable’ term was 1. However, in this situation, free residual chlorine also generated a degree of 0.82 relevance to the ‘Inappropriate’ term. It was observed that the system classified the water quality as ‘Acceptable’ and ‘Inappropriate’. The calculated score was 41.64, and according to Table 3, the water was classified as ‘Acceptable’.
CONCLUSION
The range of studies on water quality assessment systems using fuzzy logic is broad, however, further research is required into new parameters and water from different regions. Many studies have led to improvements in these types of applications, and the authors were satisfied with the use of fuzzy set theory for this purpose.
Classification of water quality according to the note
Great | 80–100 |
Good | 52–72.99 |
Acceptable | 37–51.99 |
Inappropriate | 0–36.99 |
Great | 80–100 |
Good | 52–72.99 |
Acceptable | 37–51.99 |
Inappropriate | 0–36.99 |
The reviewed studies analyzed raw, untreated water samples, taken from rivers and subsoil, among others. Therefore, there is a need to evaluate this natural resource in urban regions, as this is the water that reaches the population and is being consumed.
This study has shown that it is possible to evaluate the quality of water consumed by an urban population from a set of factors collected through the use of fuzzy logic. The six water quality parameters considered were: total coliforms, fluoride, free residual chlorine, pH, turbidity, and apparent color.
Several studies that applied fuzzy logic to the evaluation of water quality obtained satisfactory results. This study has shown that the use of diffuse logic to evaluate urban water quality is also efficient. The population will benefit from knowing the quality of the water they are consuming and, if necessary, can assist the decision-making bodies in improving quality of life.
The water quality parameters of the related studies and this study differed from each other. In all the articles reviewed there was a comparison of the results generated through fuzzy logic using traditional mathematical models. In this study, human specialists participated in the modeling and validation of the developed fuzzy system. In all the related studies and the current study, the method of defuzzification applied was Centroid. Only this study applied the discrete and Ramp to the right techniques. In all situations, the application of fuzzy logic was efficient, generating satisfactory results.
For future studies, the outputs generated for new samples of water quality should be analyzed, in order to verify whether the existing rules for new samples or whether it is necessary to include new rules; add other water quality indicators, change the system to include them, and validate the results; create a mobile and/or web version of the INFUZZY tool to make the system available to water supply dealerships to assist in decision making and also to other people who would like to use the software.