Introduction

Population growth and increasing demand for agricultural products stress limited water resources in arid regions (Sepaskhah et al. 2006). A solution to address limited water supply in agriculture uses wastewater for crop irrigation (Haj Hashemkhani et al. 2014). Urban wastewater consists of wastewater from sanitary appliances or wastewater obtained from washing different parts of the home. These types of wastewater contain a variety of microorganisms, microbes, viruses, and certain types of chemicals, the most common of which are ammonia and some urea (Monzavi 1999). Nutritionally, the wastewater contains three essential elements N, P, K, and micro-nutrients necessary for plant growth. The presence of these elements leads to significant savings in the use of chemical fertilizers (Al-Salem 1998; Asano and Levine 1996; Papadopoulos and Stylianou 1988, 1991). Therefore, the use of wastewater treatment plants can increase the economic benefits of agricultural activities by supplying water and part of the fertilizer needed for crops (Nadafi and Nabizadeh 1996).

The use of urban treated wastewater (UTW) to enhance crop output has been examined using various statistical and experimental methods (Hassanoqli 2002; Safari and Fathi 2008; Hasanpour Darvishi 2010; Rajabisorkhani and Ghaemi 2012; Shafaqkalvang et al. 2015; Safa and Samarasinghe 2011; Trigui et al. 2011; Fortin et al. 2011; Basso et al. 2013; Gonzalez-Sanchez et al. 2014). Alves et al. (2006) investigated the effect of treated wastewater (at four levels of 25, 50, 75, and 100%) and nitrogen (at four levels of 0, 150, 300, and 450 kg/ha) on the chemical properties of soil and cotton plant. The results showed that the effect of different levels of nitrogen on all parameters was significant (N was more important than UTW in the soil chemistry and cotton output). The use of UTW for irrigation significantly alters soil chemistry in sugarcane plots (Blum et al. 2012; Bieloral et al. 1984). Mhaske (2016) found that UTW increased cottonseed yield by 12%, while heavy metal loads did not exceed recommended safe limits. Additionally, UTW can reduce water demand by 20% (Zonemat Kermani et al. 2015). Emami and Choopan (2019) examined the performance of barley under wastewater irrigation using RBF and GFF models of artificial neural network, and concluded that the RBF model had a high potential in estimating the barley yield irrigated with wastewater.

Given that cotton is one of the most important agricultural and industrial products in the world, the cotton cultivation area can be significantly increased in arid regions by proper water resource management, use of unconventional water, and ultimately increase operating efficiency. The purpose of this study is to compare the five levels of water requirement on yield, yield components, and water use efficiency (WUE) of cotton and evaluate the efficiency of the TGO-ANFIS method in estimating its yield.

Materials and methods

Study area

The present study was conducted in a randomized complete block design with five levels of water requirement and three replications in a sandy loam soil in the agricultural lands of Torbat-Heydariyeh located in the south of Khorasan Razavi in Iran during the 2 cropping years of 2013 and 2014. Torbat-Heydariyeh is located at 59° 13' E and 34° 17' E at 1333 m above sea level (Fig. 1). The average annual rainfall and temperature are 260 mm and 21 °C, respectively.

Fig. 1
figure 1

Study area on the map

Site specification and experimental treatments

Varamin cultivar was manually planted for 2 years on the 5th of June. Irrigation was done by the basin irrigation method. Treatments including well water (control treatment) (T1), urban treated wastewater (T2), 50% well water combination and 50% urban treated wastewater (T3), alternating irrigation between well water and urban treated wastewater each watering (T4), and combination of 33% well water and 66% urban treated wastewater (T5) (Fig. 2). Chemical analyses of well water and urban treated wastewater are shown in Tables 1 and 2, respectively (Khasheisiuki et al. 2017). Due to the use of urban treated wastewater and observing the effects of its fertilizer, no fertilizer was used in the treatments. Based on 2-year statistics of the Torbat-Heydariyeh meteorological department and NETWAT software data, the water requirement for cotton was calculated (6340 m3/ha for a crop season). The irrigation interval was considered as 8 days. Irrigations were done simultaneously and the amount of irrigation was delivered to the plots uniformly using a volume meter, and no water came out of the plots. Before the onset of the experiment, all the plots were in similar conditions. The plots had dimensions of 9 m2, and 36 gr of seeds were used. The distances between plots and plants were 40–45 cm and 1 m, respectively. Due to the marginal effect, sampling was performed from the center of the plot (in dimensions of 1 m2).

Fig. 2
figure 2

Schematic of the research design and location of treatments and replications

Table 1 Chemical analysis of well water and urban treated wastewater
Table 2 Chemical and physical analysis at a depth of 0–40 cm

Water-use efficiency (WUE) was calculated using the following equation (Howell et al. 1992):

$$ {\text{WUE}} = \frac{{{\text{Total}}\,{\text{dry}}\,{\text{forage}}\,{\text{yield}}}}{{{\text{Seasonal}}\,{\text{ETa}}}}. $$
(1)

Statistical analysis was performed using SAS 9.2 and Excel 2016 software. Also, the means were compared using Duncan's test at a probability level of 5%.

Tree growth optimization algorithm (TGO)

The TGO algorithm is a new strategy inspired by the growth of trees in nature (Emami and Sharifi 2020). Trees use water, nutrients, and sunlight to grow and develop. In the process of growing, trees compete with each other for the resources they need. Some trees scatter seeds in the environment to survive and expand their territory. Seeds move with the help of wind, birds, and other creatures in the environment. In addition to the seed dispersal mechanism, some new seedlings can germinate with the help of root tubers. The TGO algorithm consists of three operators including growth, seed scattering, and root spreading. The algorithm starts with a set of solutions and until the termination conditions are met, repeatedly updates the initial solutions with its stimuli (growth, seed scattering, and root spreading) to find an optimal set of solutions.

The flowchart of the TGO algorithm is shown in Fig. 3.

Fig. 3
figure 3

Flowchart of TGO algorithm

Adaptive neuro-fuzzy inference system (ANFIS)

ANFIS was developed by Jang (1993). It is an integration of the fuzzy system and the artificial neural networks (ANNs). ANFIS utilizes the advantages of both fuzzy and ANNs. The fuzzy section provides a relation between inputs and outputs, and the best values for parameters related to the membership functions are identified by the neural network. The structure of the ANFIS is determined according to the input data, membership degree, rules, and functions of the output membership function. As shown in Fig. 4, the ANFIS structure consists of five layers including fuzzy layer, product layer, normalized layer, de-fuzzy layer, and total output layer. The dependence level of every input data to different fuzzy domains is identified in the first layer. In the second layer, the input values of each node are multiplied by each other to obtain the weight of the rules. The computation of the weight of rules is carried out in the third layer. The fourth layer is the layer of rules constructed by doing operations on the input signals. The fifth layer shows the output of the network. The objective of this layer is to minimize the difference between the real outputs and the outputs generated by the network.

Fig. 4
figure 4

A big picture of the ANFIS system with two inputs

ANFIS has m input features and n rules. Each rule \(R_{i}\) is represented as follows:

$$ \begin{gathered} \hfill R_{i} :{\text{ if }}(x_{1} \, is \, f_{i1} ){\text{ and }}(x_{j} \, is \, f_{ij} )\,\,\,{\text{and}}\,\,...\,\,\,(x_{m} \,\,is\,\,\,f_{im} )\,,\,\,{\text{then}}\,\,{\text{output}} = \,f_{i} \\ \hfill g_{ij} (x) = \exp \left[ {\frac{1}{2}\left[ {\frac{{x - c_{ij} }}{{\sigma_{ij} }}} \right]^{2} } \right], \\ \end{gathered} $$
(2)

where \(x_{j} \,\) the jth is input, fij is the membership function, fi is the output of rule, and gij is the membership functions in the Gaussian form.

The output of the network is presented as follows:

$$ \begin{aligned} f(x) = \frac{{\sum\nolimits_{i = 1}^{n} {\mu_{i} f_{i} } }}{{\sum\nolimits_{i = 1}^{n} {\mu_{i} } }} \hfill \\ \mu_{{\text{i}}} { = }\prod\limits_{j = 1}^{m} {g(ij)(x_{j} )} , \hfill \\ \end{aligned} $$
(3)

where \(\mu_{{\text{i}}}\) is the activation degree of the rule.

Each node has a function with adjustable parameters.

Five factors should be determined in designing ANFIS that are the type of fuzzy sets, the number of input fuzzy sets, optimization procedure, type of output fuzzy sets, and the number of iterations. In this paper, five shapes of ANFIS are Gaussian, Gbell, trapezoidal, triangular, and trapezoidal. The number of iterations considered for learning the network is 5000. Fuzzy c-means (FCM) clustering algorithm is used to construct a fuzzy inference system (FIS). For optimizing the ANFIS, in this work, the TGO algorithm is used to optimize the membership function parameters.

TGO-ANFIS model

Two structural parameters of the ANFIS system are antecedent and consequent parameters. For tuning these parameters, researchers often used gradient-based methods. The main drawback of the gradient-based methods is the low convergence rate and trapping in local optima. Meta-heuristic algorithms can be used as efficient alternatives to overcome the limitations of gradient-based methods in training the ANFIS model. To train the ANFIS system using the TGO algorithm, two issues need to be determined: strength function and the boundary of variables. In this study, root-mean-square error (RMSE) is used as a strength function for evaluating the performance of the ANFIS system. Assume the following relationship:

$$ {\text{R}}_{{\text{i}}} {\text{: if }}x_{{1}} {\text{ is F}}_{1}^{i} {(}\sigma_{1i} ,\,c_{1i} ){\text{ and }}x_{2} {\text{ is F}}_{2}^{i} {(}\sigma_{2i} ,\,c_{2i} )\,\,{\text{and}}\,\,...\,\,\,x_{k} {\text{ is F}}_{k}^{i} {(}\sigma_{ki} ,\,c_{ki} )\,,\,{\text{then}}\,\,y = s_{1} x_{1} + s_{2} x_{2} + ... + s_{k} x_{k} , $$
(4)

where \(x_{1} ,\,x_{2} ,\,...,\,x_{k}\) are the system input variables, and y is the output variable.The parameters which need to be optimized are \(\sigma ,\,c,\,s_{1} ,\,s_{2} ,\,...,\,s_{k}\) coded as real numbers. To identify the system parameters, first, a forest composed of several trees is initiated. Each tree contains candidate values for the ANFIS parameters. The trees are updated iteratively by three operators including growth, seed scattering, and root spreading. This process iterates for a pre-determined number of generations (Fig. 5).

Fig. 5
figure 5

Flowchart of TGO-ANFIS hybrid method

Input scenarios

To model and predict the yield of cotton, soil characteristics (SC), two levels of irrigation, well water irrigation (WI), and urban treated wastewater (UTW) and meteorological data (MD) were considered as input parameters. Based on the input scenarios, four different input combinations were examined to investigate the most effective input parameters (Table 3). In the dataset used (120 data), 80% of the data were used for training and 20% for testing the hybrid model. Table 4 presents the range of dataset parameters.

Table 3 Input scenarios
Table 4 Dataset range

Results and discussion

Soil quality characteristics

The results of comparing mean salinity, acidity, phosphorus, potassium, and nitrogen traits under experimental treatments are presented in Table 5.

Table 5 Mean comparison of each soil chemical parameter between the experimental treatments (at a depth of 0–40 cm)

The results showed that the effect of irrigation water type on potassium (K), phosphorus (P), nitrogen (N), and salinity ions and acidity were significant, respectively. As the amount of wastewater increases, soil acidity decreases. The decrease in soil acidity in wastewater treatments is due to the decomposition of organic matter in the wastewater, which has led to the production of acidic agents (Abedikupaie et al. 2006; Mojiri et al. 2011; Zonemat Kermani 2015). The levels of N, K, P, and salinity in treatments containing urban treated wastewater showed an increasing trend. This is due to the high concentration of cations such as Na, K, and the presence of various forms of nitrogen in the wastewater. As a result, urban treated wastewater has no destructive effect on soil properties, and soil anions have normal and permissible changes to the standard of irrigation and plant cultivation (Table 6). The results are consistent with the research of Aghabarati et al. 2009; Hosseinpour et al. 2007; Sharma et al. 1999; Jalali et al. 2008; Choopan et al. 2018.

Table 6 Quality standards for treated wastewater used in irrigation (FAO 1989)

Cottonseed weight

Treatments for cottonseed weight were classified into different statistical groups. T2 and T3 treatments and T1, T4, and T5 treatments in the first year and T1, T2, and T5 treatments, T2 and T3 treatments, and T1 and T4 treatments in the second year are not statistically significant. The highest seed weight was measured from T3 (11.97 gr/m3 and 12.46 g/m3), while the lowest seed weight was measured from T4 (9.63 g/m3 and 9.86 g/m3) (Fig. 6). Treatment T4 among wastewater treatments had an increase of 99.6% compared to treatment T1. This can be due to the use of water and wastewater as a whole and the incompatibility of plant growth conditions with this treatment. T3 had 14% higher seed weight than the control (T1).

Fig. 6
figure 6

Cottonseed weight in research treatments

Cotton yield

Cotton weight is one of the most important characteristics of the cotton plant, which results from the demand for total cotton weight and weight of cottonseed, which is obtained by applying the total cotton weight and cottonseed weight. The research treatments were divided into different statistical groups and a statistically significant difference was observed between the treatments (except for treatments T2 and T3). The highest yield was observed in treatment T3 for the first and second years equal to 33.1 g/m2 and 133 g/m2, respectively (Fig. 7). Urban treated wastewater treatments in the second year had a higher yield than the first and control (T1) treatments due to the improvement of soil physical conditions and plant growth.

Fig. 7
figure 7

Cotton yield in research treatments

Number of bolls

According to the results, the treatments were divided into different statistical groups a and b, and a statistically significant difference was observed. There was no significant difference between T1, T2, T4, and T5 treatments, as well as T2 and T3 treatments in the first year, and they were in a statistical group. Treatment T3 had the highest number of bolls with 13.3 and 17.7 in the first and second years (Fig. 8). The lowest number of bolls was observed in treatment T5 in the first year and treatment T1 in the second year with 9 and 8, respectively. The maximum number of bolls was observed in wastewater treatments (T2, T3, T4, and T5), which in the second year increased by 73% compared to the first year. The researchers reported that mild stress during the growing season resulted in better absorption of photosynthetic material through reproductive organs than vegetative organs. This causes more bolls to survive and, as a result, increases the number and weight (White and Raine 2004; Zonemat Kermani et al. 2015).

Fig. 8
figure 8

Number of bolls in research treatments in 2 statistical years

Water-use efficiency (WUE)

The WUE in the treatments is shown in Fig. 9. According to the results, treatment T3 has the highest WUE of 0.616 and 0.685 kg/m3 in the first and second years, respectively.

Fig. 9
figure 9

Water-use efficiency (WUE) in research treatments

Unlu et al. (2010) similarly found that the greatest WUE as 75% and 50% of water requirement for cotton in Turkey.

The good yield of treatment T3 (50% WI combination and 50% UTW) can be evaluated in terms of the positive effects of mild stress during the growing season on cotton yield components as well as the effectiveness of other plant organs related to yield components (Fig. 10). It has been shown to perform well under mild stress treatments, which are consistent with the results of researchers such as White and Raine (2004), and Zonemat Kermani et al. (2015).

Fig. 10
figure 10

Total cotton yield in the first and second years

Modeling results

In this section, the cotton yield was estimated using the TGO-ANFIS hybrid method. Initially, all available data were standardized, and after the introduction of input structures, ANFIS parameters were optimized. The population size is 25, the number of generations is 40, and the number of iterations of the algorithm is 1000. Evaluation criteria for different input scenario to estimate cotton yield are presented in Table 7.

Table 7 Evaluation of input scenarios

The results show the accuracy of the proposed method in estimating cotton yield with a correlation coefficient above 95% between measured and predicted values (R2 = 0.991 in the training stage and R2 = 0.981 in the test stage) (Fig. 11). E1 model with input parameters of two irrigation levels including well water (WI) and urban treated wastewater (UTW) was introduced as the superior model in predicting cotton yield.

Fig. 11
figure 11

a, b Predicted cotton yield using the TGO-ANFIS hybrid model in the training and test stages (Model E1)

The mean and minimum values of the objective function, the normalized standard deviation (σ), and the number of executable performances per 1000 times of program executions for the TGO algorithm, cotton yield, and the type and number of membership functions are presented in Table 8. Using the proposed model, an appropriate answer to the problem with a minimum objective function of 5.48*10–5 was obtained.

Table 8 Mean and minimum values of the objective function for 1000 times of program execution

As can be seen, the results of the TGO-ANFIS hybrid method in estimating cotton yield with a R2 of 0.981 are very optimal, which indicates the high efficiency and accuracy of the TGO-ANFIS model.

Conclusions

The results showed that the physiological and morphological characteristics of cotton increased due to the use of urban treated wastewater (UTW). Treatment T3 (50% well water combination and 50% urban treated wastewater) showed the highest values for cottonseed weight, cotton yield, number of bolls, and WUE for 2 years compared to treatment T1. The results of soil chemical analysis showed that the use of urban treated wastewater as irrigation water increased salinity due to the high concentration of cations such as Na+ and K+ in the wastewater. The results of sensitivity analysis showed that WI and UTW input parameters (model E1) are the most effective factors in determining WUE and cotton yield. The results also showed that the TGO-ANFIS hybrid model in estimating cotton yield with values ​​of R2 = 0.981, RMSE = 0.022, and MAE = 0.013, respectively, has a good performance and minimizes the values of the target function to perform better. In general, the results of observations and modeling indicate better cotton yield under the conditions of using a combination of 50% well water and 50% urban treated wastewater, which should continue for other areas with climatic, geographical, growth conditions, as well as different plants, to obtain a complete encyclopedia of the plant growth status under irrigation with wastewater.