Evaluation of quality of groundwater in irrigation using fuzzy logic in the Bafra Plain, Northern Turkey

Article Info Received : 25.05.2019 Accepted : 18.08.2020 The quality of groundwater plays an important role in irrigation management and planning. The most commonly used method when classifying the irrigation water quality is the United States Soil Laboratory (USSL) diagram. Fuzzy logic approach is one of the widely used methods produced more precise and accurate results according to the USSL diagram. A rulebased, fuzzy logic irrigation water quality (FL-IWQ) were evaluated by using electrical conductivity (EC), sodium adsorption ratio (SAR), and residual sodium carbonate (RSC) values of groundwater in irrigation, in Bafra plain. The FL-IWQ defuzzification methodscenter of area (COA), mean of maxima (MOM), least of maxima (LOM), and (SOM) were selected and compared with quality values of groundwater in irrigation. Based on the results of the FL-IWQ defuzzification methods with quality values of groundwater in irrigation, the determination of coefficients for COA, MOM, SOM and LOM were 0.9874, 0.9755, 0,9574 and 0.9453, respectively. Results obtained from FL-IWQ revealed that there has been 93% general agreement with the results obtained from the USSL diagram and RSC classification. The developed fuzzy model produced more reliable results for groundwater in irrigation than that of the USSL-diagram and RSC classification. The study suggests using proposed fuzzy model as a promising alternative to the traditional ones for classifying the quality of groundwater in irrigation under uncertain conditions.


Introduction
Determination of irrigation water quality is an important activity in agricultural water management and planning. The ionic composition of the water has a significant effect on plant growth. Irrigation with insufficient quality water can retard plant growth and contaminate the soil and make the farmland less suitable due to salinity. Complete chemical analysis is required to accurately determine the quality of irrigation water. When analyzing irrigation water, calcium, magnesium, sodium and potassium cations and carbonate, bicarbonate, chlorine, sulfate, nitrate or nitrite salts anions, and boron content should be determined. pH, total salinity, sodium adsorption rate, percent sodium, persistent sodium carbonate also should be determined. Historically, many diagrammatic and graphical techniques have been used to represent the hydrochemical properties of water in determining irrigation water quality (Pipe, 1944;Stiff, 1951;USSL, 1954;Wilcox, 1955;Schoeller, 1962). These can be difficult to interpret, especially under the condition of lacking of precision of irrigation water samples. United States Salinity Laboratory (Richards, 1954) and Wilcox (1955) are the most widely used diagrams. These diagram includes the electrical conductivity and sodium values of the waters. The percentage of soluble sodium (SSP), Kelly's ratio (KR), residual sodium carbonate (RSC), and permeability index (PI) are used, except for the US Salinity Laboratory (USSL), which is widely used to determine the quality of irrigation water.
In spite of the fact that different classification systems have been experienced by many researchers (Laluraj and Gopinath, 2006;Priya and Arulaj, 2011), many uncertainties arise when deciding water quality. In irrigation practices, quality parameters should be interpreted based on the complex data and presented in an understandable and useful way. It is difficult to select inputs and outputs precisely when modeling water quality. In this context, fuzzy logic plays an important role to convert complex input variables to simple output variables. Many studies have used fuzzy logic to arrive at a simple output. Therefore, classification systems that can deal with uncertainty need to emerge with an intuitive approach to produce simple results to deal with the situation. As a mathematical tool, fuzzy logic converts complex expressions into mathematical terms and back into simple outputs (McNeil and Thro, 1994). It has been demonstrated that it can be successful with the fuzzy logic approach in solving complex problems (McKone and Deshpande, 2005). There have been lots of studies focusing on the classification of water quality of fuzzy logic applications, especially on drinking, waste, river water, etc. Hovewer, there has been a few studies on quality of groundwater in irrigation. Recently, the use of fuzzy logic has become widespread in the field of water quality assessment. Ocampo-Duque et al. (2006) examined the water quality of rivers by using a fuzzy logic approach and suggested a water quality index. Mirabbasi et al. (2008) used the Mamdani fuzzy inference system as a decision support system to classify irrigation water quality. Alavi et al. (2010) used an adaptive fuzzy extraction system (ANFIS) instead of the USSL diagram in the assessment of irrigation water quality. Priya (2013) evaluated the quality of irrigation water in the Karunya Basin in India using the Fuzzy Logic approach. Vadiati et al. (2019) performed three different fuzzy logic approaches named Mamdani, Sugeno, and Larsen to determine water quality. The study aimed to develop a fuzzy logic system, to determine the quality of groundwater in irrigation by means of fuzzy logic approach based on the data come from 61 different samples taken from Bafra Plain of Samsun province, Turkey and to classify groundwater in irrigation according to the USSL diagram and RSC.

Material and Methods
The study area lies in the Black Sea coastal region of Samsun (41º30'-41º 45' latitude and 35 º 30'-36º 15' longitude) in Northern Turkey (Figure 1). The soils of study area were formed from alluvium on different elevations. The current climate in the region is semi-humid. Fuzzy Inference System (FIS) were developed and used to determine the quality of the groundwater in irrigation in this study. Membership functions SAR, EC, RSC were developed based on three important parameters, and rules were defined for a Fuzzy Inference System to evaluate irrigation water quality. The fuzzy model was validated using groundwater quality data collected from the Bafra plain. Based on two parameters such as SAR and EC, the FIS classes were elicited. Groundwater samples were collected from the 61 groundwater wells in August of 2007. All samples were filtered with a 0.45µm filter before analysis, sealed in polyethylene bottles, and stored at 4ºC before analysis. Electrical conductivities (EC) of groundwater samples were measured in situ. Calcium (Ca 2+ ) was analyzed titrimetrically, using standard EDTA. Magnesium (Mg 2+ ) was calculated by taking the differential value between TH and Ca 2+ concentrations. Sodium (Na + ) and potassium (K + ) were measured, using a flame photometer. Carbonate (CO3 2-) and bicarbonate (HCO3 2-) were estimated by titrating with HCl. USSL-diagram, which is a well-known diagram for irrigation water classification ( Figure 2) interprets the hydro-chemical analysis of irrigation water. In the diagram, the vertical axis depicts the sodium adsorption ratio (SAR), while the horizontal axis depicts the electrical conductivity (EC). Irrigation water can be classified into the following four categories, based on the EC value:  Low sodium content water can be used in each type of soil S2 Medium sodium content water may produce harmful levels of exchangeable sodium in most soils and will require special soil management such as adding gypsum and organic matters to the soil S3 High sodium content water S4 Very high sodium content water generally unsuitable for irrigation The irrigation waters classification concerning SAR is primarily based on the effect of exchangeable sodium on the soil's physical condition. In relation with Mg and Ca, it is another alternative measure of the sodium content. Although not frequently used, this value may appear in some water quality reports. If the RSC > 2.5, the water is not appropriate for irrigation. Wheras, the water is considered to be safe, if the RSC < 1.25. The research suggests a new method for evaluating irrigation water quality by combining the concentration values of EC and SAR in the USSL-diagram and RSC values through a Mamdani FL-IWQ model. According to the classification of irrigation water EC (Richards, 1954) water having EC from 0 to 5000 S/cm is classified into fourth classes. However, the study area salinity values from 0 to 10840 mS / cm vary. Therefore, the EC value of 5000 S/cm above the water that is added to a separate. This kind of water should not be used strictly for irrigation. Therefore, when creating rules for all groups, this critical value of the irrigation water created by using SAR and RSC was expressed as an "extremely bad".
The following equation was used to calculate the SAR (concentrations are expressed in meq/l): There has been another alternative measure of the sodium content based on Mg and Ca. Although this measure has been used in some water quality reports, it is not widespread. RSC was calculated using the following equation.
If the RSC value, which is calcultated by using above formula, is larger than 1.25, the irrigation water is considered safe. Wheras, the water is not appropriate for irrigation, if the RSC > 2.5.

Development of the fuzzy-rule model
FL-IWQ rules were modeled using the MATLAB® 2010Rb version and the Fuzzy Logic Tool Box Mamdani system. Membership functions and rules for the fuzzy inference system were developed through the examination and interpretation of data observed from the Bafra plain groundwater. Figure 2 shows the block diagram explaining the FL-IWQ modeling. Identifying the fuzzy input and output variables was the first step in designing the FL-IWQ. Selected three inputs were the difference of RSC, EC, and SAR. The irrigation water quality was defined as a single fuzzy output variable. In second step, the range (universe of discourse) of the inputs and output variables was elicited by examining data. RSC, EC, SAR and IWQ values belonging Bafra plain varied between (-17.8 to 15.2), (0-10840 S/cm), (0-35) and (1-6), respectively. Membership functions were selected as trapezoidal and triangle, depending on the intervals chosen in many fuzzy applications. As shown in Figure 4a, RSC consists of three membership functions represented by triangular shapes. The EC consisted of five trapezoidal membership functions while that of Sodium Adsorption Rate (SAR) were four trapezoidal membership functions. Irrigation water quality (IWQ) had six trapezoidal membership functions. They were shown in Figure 4b. Figure 4 (c -d) showed membership functions for RSC and irrigation water quality. Totally 60 rules were created according to the Mamdani system.

Fuzzification
The measured input values that were transformed into FL-IWQ values were depicted Figure 4. Three input measurements, which were 3690 µS/cm, 5, 96, and -2, 8 of EC, SAR, and RSC respectively, used to clarify the situation. The intersection of the value of 5,96 and both low and medium SAR membership produced 48 % grade in the low set and a 52 % grade in the medium set. The value of 3690 µS/cm intersected the very high SAR membership sets. The value of RSC (-2, 8) has a full (100%) grade in the low set and 0% membership in the rest of the sets. The values of EC and SAR intersected two fuzzy sets.

Fuzzy rules
For writing rules, fuzzification permits the use of literal names rather than actual numbers. As there were five EC, four SAR, and three residual sodium carbonate (RSC) categories, a set of 60 rules were developed.
The matrices of category named representing IWQ rules at low, medium, and high residual sodium carbonate (RSC) were depicted in Tables 3-5.  Table 4. Rules for irrigation water quality (IWQ) at medium residual sodium carbonate Table 5. Rules for irrigation water quality (IWQ) at high residual sodium carbonate Each of the rule had a premise consisting of three antecedents connected by 'AND' operator, and at the end consisting of a single IWQ consequence. Through the fuzzification process, the antecedent expressions were replaced by membership grades (µ). A maximum combination of eight rules could fire at a time, since each of the input membership function was restricted to only two values (µ). Example of a subset of these rules were given below: 1. IF EC is low AND SAR is low AND RSC is low THEN IWQ is VG.

IF EC is mid AND SAR is low AND RSC is mid THEN IWQ is GD 3. IF EC is high AND SAR is mid AND RSC is mid THEN IWQ is MD 4. IF EC is very high AND SAR is high AND RSC is high THEN IWQ is VB
In this list, the FL-IWQ rule order did not affect the final irrigation water quality value. Ensuring a FL-IWQ value between one and six for any input condition was the solely objective.

Rule evaluation and aggregation
Irrigation water quality (IWG) values were determined from rules satisfied during the evaluation process by using the MIN-MAX inference method. The consequent fuzzy union was restricted to the minimum of the predicate truth, while the output fuzzy region was updated by taking the maximum of the minimized fuzzy sets. The minimum operator limits certainty of the overall irrigation water quality (IWQ) was the least certain input observation. The final IWQ membership function was obtained using the MAX composition procedure.

Defuzzification
Each of the center of area or the center of gravity (COA), the mean of maxima (MOM), least of maxima (LOM), and (SOM) defuzzification methods were tested. To test FL-IWG, independent comparisons were performed for EC, SAR, and RSC.

Model evaluation indicators
Scatter plot and Taylor diagram were used for exploring the accuracy and performance of the fuzzy logic mamdani approach. The scatter plot reflected the distribution of expert and fuzzy logic model points along with the 1: 1 axis. Since the correlation coefficient (r), RMSE, and standard deviation (SD) could be obtained, the Taylor

Results and Discussion
The study evaluated the quality of irrigation water by using fuzzy Mamdani approach based on EC, SAR, and RSC of sample irrigation water and different classification criteria. For this purpose, the water EC, SAR, and RSC values formed according to the 60-rule. The FL-IWQ defuzzification methods was followed using center of area (COA), mean of maxima (MOM), least of maxima (LOM), and (SOM) when comparing quality values of groundwater in irrigation. Groundwater in irrigation was classified by using the values of COA, mom, solid and lom presented in Figure 5.   Table 6 presented the output scores, fuzzy evaluation, IWQ and agreement of evaluation based on the results of the comparative analysis associated with well. The agreement evaluation value was 93%, on average. The model results showed that the wells numbered 1, 20, 25, and 40 were "good" and its agreement varied from 26% to 59%. The range of EC, SAR and RSC values of these wells for EC, SAR and RSC were 1728 S/cm -1798 S/cm, 1.38 -3.45 and -7.50 -0.10, respectively. Based on the EC values, sample irrigation waters were included in to the upper group in terms of salinity, while the reverse was the case for tahe values of SAR and RSC. It was observed that there was a difference in the output results due to EC values. As for the wells numbered 30 and 60, they were included into "Very bad" group and its agreement varied from 86% to 36%. EC, SAR, and RSC values of well 30 were 4500 S/cm, 25, 24, and 14.8, respectively, while that of well numbered 60 were 4780 S/ cm, 13.91, and 8.40, respectively. The EC values of these wells were very close to the upper group limit of 5000 S/cm. There have been different methods used when classfying the irrigation or drinking water worldwide. In general, the values of EC, SAR, RSC, Cl, Na of waters have been used in irrigation water classification. However, different irrigation water classes have been produced according to different parameters in classical methods, resulting in confusion when determining the the quality of the irrigation water and uncertainty arise on whether the water is suitable for irrigation. In some cases, irrigation water is suitable when focusing on the values EC and SAR, while the reverse was the case when focusing on the value of RSC, That is wahy, the study clarified the irrigation water class by evaluating all of these quality parameters together. Classical irrigation water classification methods led to misspesification when the values of water quality parameters are close to the limit values. For example, irrigation water with an EC value of 800 S/cm and water with 2200 S/cm is included into C3 in terms of EC, while its effects on plant yield are very different from C3. Evaluation of agreement between the FL-IWQ obtained outputs and expert knowledge is an important phase in FL-IWQ construction. It means that the system could produce associated with the different conditions that can be presented. Table 6 showed the comparative results of EC, SAR, RSC, and FL-IWQ. The results showed that the FL-IWQ method could rank water quality samples with 93 % general agreement, apart from samples that lie in class's borders. In the FL-IWQ method, according to RSC, SAR, and EC of each water sample, a score assigned to be between (1-6). Figure 6 presented the standard deviation (SD) and correlation coefficient (R) values of observed and modelled estimates comparatively for COA, MOM, LOM, and SOM methods with experiment. This diagram represents. Figure 6 also showed the centered root mean squared error (RMSE) difference (Taylor, 2001). The best estimation model is selected by the point with a higher R and lower RMSE Cemek et al., 2020). It was clear from the evidence obtained Figure 6 that the COA model result was much closer to the data point of experiment compared to the results the other models generated.

Conclusion
Uncertainties in the classification of irrigation water quality make it difficult to decide on the use of groundwater for irrigation for agricultural use. In this study, the center of the area (COA), mean of maxima (MOM), least of maxima (LOM), and (SOM) was used to cope with uncertainty problem. The best results were obtained from COA. It was clear from the light of the research findings that fuzzy logic approach was more appropriate than traditional when classifying irrigation water quality. The study suggests new approach by comabining digitizing groundwater quality samples using fuzzy logic approaches, expert evaluation, and linguistic expressions for deciding the use of irrigation water. Fuzzy logic models produced more consistent results compared to traditional methods. Fuzzy inference method is suitable for irrigation water quality assessment due to its integrated decision-making mechanism based on important irrigation indices. Given the uncertainties in the measurement and analysis of parameters such as EC, SAR, and RSC during model development, this study base revealed a more reliable and flexible method for water quality assessment than traditional methods.