Optimization Applying Response Surface Methodology in the Co-treatment of Urban and Acid Wastewater from the Quiulacocha Lagoon, Pasco (

The co-treatment of acidic water (AW) and urban wastewater (UWW) is a technique that allows mitigating the negative impact of AW on natural aquatic environments


Introduction
In Peru, the acidic water (AW) generated by mining tailings brings with them high concentrations of heavy metals that modify the balance of ecosystems and generate a potential health risk for humans (Zhuang et al., 2009). In areas surrounding the Quiulacocha lagoon (Pasco-Junin-Peru), mining tailings have been deposited without any treatment, containing 50% pyrite by weight, impacting local ecosystems (Baylón Coritoma et al., 2018), as well as local populations (Astete et al., 2009). These mining tailings have an extension of 114 ha, which have infiltrated the Quiulacocha lagoon generating AW with high concentrations of Fe +3 y Fe +2 (Dold et al., 2009). Acidic water is known by having high concentrations of dissolved metals and it is considered one of the main sources of environmental pollution for water resources (Naidu et al., 2019). Iron is one of the main pollutants in AW, known by its instability and oxidation (Schippers, 2007), with dangerous and toxicology effects on aquatic and terrestrial organisms and ecosystems (Talukdar et al., 2016). On the other hand, urban wastewater (UWW) has microbial contaminants, oxyanions and nutrients (Yang et al., 2020), of which ammonia and phosphate are the elements of main ecological concern due to their ecological impact such as eutrophication (Mavhungu et al., 2020). A limited number of researches have focused on the co-treatment of AW and UWW (Carneiro Brandão et al., 2020;Edzai et al., 2020;Silva et al., 2021).
The co-treatment of AW with UWW is a promising alternative that allows two types of wastewater to be treated through a single system, avoiding the use of chemical agents for the neutralization of AW and iron removal, reflecting in a reduction of sludge, operation and maintenance costs (Johnson and Younger, 2006), as well as the reduction of the area of land required for the treatment of both types of water through separate lines; considering this alternative a type of sustainable treatment (Muga and Mihelcic, 2008). Nevertheless, Masindi et al. (2022) recommends its application as a pretreatment technique due to its feasibility of co-treating AW with UWW on an industrial scale. However, the optimization of the co-treatment of these two types of wastewater would increase the efficiency as a pretreatment (Masindi et al., 2022), being necessary to improve the operating conditions of the different parameters that have a significant effect on the co-treatment (Ruihua et al., 2011), such as the initial concentrations of iron and phosphorus present in the wastewater, volume ratios, contact time, stirring speed, sedimentation and pH (Masindi et al., 2022). Researchers have reported that optimization models have experimental advantages to improve operating conditions and the analysis of different processes. (Calabi-Floody et al., 2019;Huzir et al., 2019).
Response surface methodology (RSM) is used for cross-factor interaction analysis to achieve optimal responses using the minimum number of experiments (Montgomery, 2017;Panić et al., 2015). One of the widely applied response surface methods is the composite central design (CCD). In this context, this research applied CCD to model the relationship between three independent study variables (Fe/P molar ratio, stirring time, stirring speed) and dependent or response variables (pH, conductivity, turbidity, removal of chemical oxygen demand (COD), Fe T , P T y SO 4 -2 . In this sense, the objective of this study was to optimize the co-treatment of UWW and AW from the Quiulacocha lagoon through the CCD methodology.

Research area
The research area corresponds to the AW coming from the Quiulacocha lagoon (Pasco-Junin-Peru), the place where mining tailings have been deposited without any treatment, with a high content of pyrite, that infiltrates the Quiulacocha lagoon generating AW with a high concentration of Fe +3 y Fe +2 (Dold et al., 2009). In Fig. 1, the Quiulacocha lagoon location (359778.00 E; 8816825.00 S) and the UWW treatment plant (277345.05 E, 8675960.0 S) are shown.

Sample collection
The AW samples were collected from the Quiulacocha lagoon, located in the Simón Bolivar district, Pasco province, Pasco district as shown in Fig. 1 at a depth of 30 cm, according to the National Protocol for Monitoring the Quality of Surface Water Resources in Peru (ANA, 2016). The samples collected from the AW were composite samples. UWW samples were collected from the equalizer tank of the wastewater treatment plant of the municipality of Independencia in Lima, Peru. The samples were collected twice a day to have a greater representativeness.
The UWW and AW samples were stored in 60 L high-density polyethylene containers at 4 °C and transferred to the laboratory of the Faculty of Environmental Engineering and Natural Resources at the National University of Callao for co-treatment tests and analysis. All the analysis were done by triplicate (n = 3).

Selection of variables
Three parameters were conditioned as variables: the molar ratio (Fe T :P T) (effect of the molar ratio), the stirring time (effect of the contact time) and the stirring speed (effect of rapid mixing). The quality parameters of the water treated were pH, turbidity, chemical oxygen demand (COD), sulfates (SO 4 -2 ), total iron (Fe T ) and total phosphorus (P T ). The Fe/P molar ratio was calculated based on the following Equation (1): Where: MR -Molar ratio (L); [ ] -concentration; Vvolume of the solution (L).

Jar test
The co-treatment tests were carried out mixing the AW with the UWW at different dosages of Fe T /P T molar ratios in a one-liter beaker, varying the mixing times and the stirring speed. After the mixing process, the samples were allowed to settle, taking the clarified part for the determination of the corresponding parameters. The equipment used for the experimental development was a jar tester (WiseStir Jar Tester Wisd model) equipped with six variable speed stirrers with an illuminator, as shown in Fig. 2. Each beaker was filled with 1 L according to the different dosages between AW and UWW.
Dosages were added according to the molar ratio (mmol Fe T /mmol P T ) in a range from 25 to 40, to each 1 L beaker and stirred for a time range of 5 to 15 min and a stirring speed of 150-300 revolutions per minute (rpm). All the dispersions obtained were allowed to settle and the clarified samples were recovered from the top of the beaker for analysis. Following this, the clarified ones were removed for the analysis of the parameters: pH, conductivity (μS/cm), turbidity in nephelometric turbidity units (NTU), Fe T (mg/L), P T (mg/L), COD (mg/L), and SO 4 -2 (mg/L).

Optimization design
The parameters chosen for the co-treatment of AW and UWW were optimized by adopting the RSM. This methodology is a second-order regression analysis used to predict the value of the dependent variables through the manipulation of the independent variables (Asaithambi et al., 2016) and the central composite design (CCD). The CCD is a two-level factorial design with (2 n ) factorial points, (2n) axial points corresponding to the highest and lowest levels of the factors, and center points (n C ) corresponding to the intermediate level of the factors, where n is the number of factors. In this sense, the number of treatments (N) is calculated based on Equation 2 (Arami-Niya et al., 2012;Khuri and Mukhopadhyay, 2010).

Response surface method (RSM)
For the experimental design, the CCD was selected with 3 factors and 2 levels (−1 and +1), 2 replicates, 6 axial points, 6 central points where the manipulated factors were the Fe/P molar ratio (X 1 ): (effect of the molar ratio), the stirring time (X 2 ): (effect of contact time) and the stirring speed (X 3 ): (effect of rapid mixing), as shown in Table 1.
The response variables chosen were pH, conductivity, turbidity, removal of COD, Fe T , SO 4 -2 and P T . The values taken into account were chosen based on previous works related to co-treatment (Masindi et al., 2022;Ruihua et al., 2011;Spellman Jr et al., 2020).

Desirability function
The desirability function is a technique that determines the optimal conditions in a process based on the derringer desirability function (Asfaram et al., 2015). The derringer desirability function was applied for the simultaneous optimization of three operating parameters that influence the co-treatment of AW and UWW wastewater: Fe/P ratio, stirring time and stirring rate. The technique is applied because there are several factors with uncertainty and how they affect the quality of the treated water. The objective was to maximize the molar ratio, minimize the stirring time and stirring speed in the co-treatment of wastewater. The quality parameters of the treated water: pH, turbidity, chemical oxygen demand (COD), sulfates (SO 4 -2 ), total Iron (Fe T ) and total phosphorus (P T ).

Applied statistical model
For the analysis and processing of the data, the analysis of variance (ANOVA) was used (Gutiérrez and De la Vara, 2004). Subsequently, the efficiency of CCD was statistically compared using the coefficient of determination (R 2 ), the predictive correlation coefficient (predictive R 2 ), and the adjusted correlation coefficient (adjusted R 2 ). Equation 3 shows the second-order CCD model used (Hussin et al., 2019;Khuri and Mukhopadhyay, 2010).
Where: y -the response variable; β 0 -a constant coefficient; β j , β ij , β jj -the coefficient of linear regression, quadratic regression and interaction regression, respectively; x i , x j -the manipulated factors; ε -the error.
For the validation of the model, the analysis of the residues was carried out. All the assumptions were globally contrasted. The lack of normality of the residues indicates that the model is inappropriate or the existence of heteroscedasticity. To give the model acceptability of each answer, the F value and the P value were analyzed. The statistical tests were completed with the Design Expert 11 software with a degree of reliability of 95%.

Characterization of the samples
The characterization of the samples included the evaluation of the following parameters: pH; electrical conductivity; turbidity; COD; total iron, sulfates and total phosphorus, as shown in Table 2. All the samples were analyzed in triplicate (n = 3) Factors that affect the co-treatment of wastewater Table 3 and Table 4 show the results of the central composite design (CCD), from which the removal response values can be observed: COD (mg/L) from 68.3% (223 mg/L) to 73.04% (189.67 mg/L); total iron (mg Fe T /L) from 98.53% (18.79 mg/L) to 99.88% (1.82 mg/L); total phosphorus (mg P T /L) from 62.15% (1.84 mg/L) to 89.13% (1.07 mg/L) and sulfate (mg SO 4 -2 /L) from 97.26% (715.03 mg/L) to 99.34% (124.38 mg/L), while the pH variability, turbidity (NTU) and conductivity (mS/cm) range from 4.28 to 6.53, from 4 to 204.5 and from 3.18 to 4.47, respectively.    Table 3 shows that the Fe T /P T molar ratio influences the pH of the sample; it is shown when Fe T /P T molar ratio increases, the pH value decreases, resulting in high concentrations of iron, sulfate and a high conductivity in the sample. This indicates that the pH is one of the variables that determine the precipitation, flocculation and/or adsorption process, with a higher concentration of Fe T and other metallic ions present in AW at lower pH (Masindi et al., 2022;Ruihua et al., 2011). The results show that the co-treatment process achieved a maximum Fe T removal of 99.88% (1.82 mg/L) at a molar ratio of 17.5 (mmol Fe T /mmol P T ), stirring time of 10 min and stirring speed of 225 rpm. This is similar to the results obtained in the research of Masindi et al. (2022), and is greater than the one obtained by Younger and Henderson (2014) with an 89% removal. Fig. 3a and Fig. 3b show that the treatment achieves a maximum pH of 6.53 and Fe T removal (> 98%), at a molar ratio of 17.5 (mmol Fe T /mmol P T ), stirring time of 10 min and stirring speed of 225 rpm. It can be seen that the lowest Fe/P molar ratio and the final pH increases depend on the initial concentrations of Fe and pH of the AW. Similarly, at pH > 5, precipitation is more effective, since the phosphate species are found as orthophosphates and react with the iron, forming small colloidal particles that coagulate and start to precipitate, and then co-precipitate other complex compounds such as ferric-hydroxy phosphates, reflecting on a lower conductivity (3.18 mS/ cm), with respect to the values of 256 mS/cm obtained by Masindi et al. (2022).

Fig. 3c
illustrates that the turbidity increases slightly when the volumetric ratio decreases, which means that having lower availability of iron, the probability of interaction is lower between the species present in the wastewater, reflected in a greater turbidity. However, at stirring speed (> 220 rpm), the turbidity decreases due to a better contact between the particles that allows the interaction between them. Likewise, it is observed that the turbidity reached the highest efficiency of 22.2 NTU (57%) at a molar ratio of 40 (mmol Fe T / mmol P T ), stirring time of 10 min and stirring speed of 225 rpm (Rao et al., 1992). Fig. 4a shows that COD removal tends to increase when the molar ratio decreases, increasing the volume of UWW, which promotes the increase in pH and the subsequent precipitation of metals, reducing the COD to values of 189.67 mg/L at a molar ratio of 25 (mmol Fe T /mmol P T ), stirring time of 15 min and stirring speed of 150 rpm, which are similar to those obtained by Masindi et al. (2022). Fig. 4b shows a high removal of Fe T (> 98%) that increases as the molar ratio is reduced (which translates into greater volumes of UWW with respect to AW), being indifferent to time and stirring speed. These removal mechanisms depend on several factors such as initial concentration, metal load and average pH (Hughes and Gray, 2013 (2022) indicates. Fig. 4c shows that the highest percentages of P T removal happens at a higher Fe T /P T molar ratio, short stirring time and high stirring speeds, given that with the greater availability of Fe +3 , due to its high charge, it has a higher affinity with PO 4 -3 to form precipitates as FePO 4 (Dobbie et al., 2009;Masindi et al., 2022;Parsons and Smith, 2008;Ruihua et al., 2011). Besides, Johnson and Younger (2006) make reference that phosphate can be removed by precipitates of iron oxyhydroxide, as well as other phosphate salts (Alley, 2010;Ruihua et al., 2011). For this research, it was obtained a P T removal of 89.13% for a molar ratio of 40 (Fe/P), at a stirring time of 15 min and stirring speed of 300 rpm. Fig. 4d shows how the removal of SO 4 -2 decreases slightly as the molar ratio increases at stirring times greater than 10 min. This is explained by the fact that the pH of the solution is more acidic, increasing the solubility of sulfates and phosphates (Li and Kang, 2021). In this way, the concentration of SO 4 -2 increases as the dose of AW increases. However, high percentages of SO 4 -2 removal (> 97%) were obtained, due to the high concentration of Fe +3 and the presence of other metallic ions such as Al +3 , Ca +2 y Pb +2 , which would form precipitated as sulfates such as Fe and Al oxyhydrosulfates (Masindi et al., 2022;Ruihua et al., 2011).
(d) Table 5 shows a comparison of the values of pH and removal of Fe T , P T , COD and SO 4 -2 with other research based on the co-treatment of AW and UWW, complementing with different treatment methods. The reported research of Deng and Lin (2013) and Masindi et al. (2022) show similar results to those in this research with removal values of iron and phosphorus of 99%.
Analysis of variance (ANOVA) of the model Table 6 shows the summary results of the predictive model for each response variable. Regarding the significance of each factor, it was obtained that: X 1 , X 1 2 and X 2 2 were significant in terms of pH; X 1 , X 2 and X 3 2 were significant for conductivity; regarding turbidity, the significant factors were X 1 , X 2 , X 1 X 3 , X 2 X 3 , X 2 2 and X 3 2 ; for the removal in % of COD, X 1 , X 3 , X 2 X 3 , X 1 2 were significant; for the removal in % of total iron (Fe T ), X 1 , X 2 , X 3 , X 1 X 2 , X 1 X 3 and X 2 2 were significant; for the removal in % of phosphorus (P T ), X 2 , X 3 , X 1 X 2 , X 1 X 3 , X 2 2 and X 3 2 were significant; and for the removal in % of sulfates (SO4 -2 ), X 1 , X 3 , X 1 X 2 , X 1 X 3 , X 2 X 3 , X 1 2 y X 3 2 were significant.
The acceptance of the models for the response variables was analyzed using the F value and P value ( Table 7) using the regression coefficient R 2 , adjusted R 2 , predictive R 2 and adequate precision.   (2017), where they obtained a value R 2 = 0.88 but still indicated a high degree of correlation between the response and the independent variables in its central composite design.
Likewise, the adjusted R 2 values were 0.9780 (pH), 0.9486 (conductivity) and 0.8828 (Fe T removal). As for the R 2 predictive, these resulted in 0.9651 (pH), 0.8842 (conductivity) and 0.776 (Fe T removal). The difference of these indicators is within a margin of 0.20, which indicates a reasonable agreement for the proposed model.
Regarding the other response variables, such as turbidity, COD removal, P T and SO 4 -2 , the R 2 values were 0.8556, 0.8015, 0.8530 and 0.8396, respectively. This last value of R 2 for sulfate is similar to that obtained in the study by Pratinthong et al. (2021) who obtained an R 2 = 0.8379 in the research of removal of sulfates by precipitation of ettringite in which chemical reagents were applied. The R 2 was a desirable value and it fitted well to the evaluated quadratic model, as well as the R 2 obtained in this research was adjusted to the proposed quadratic model.    Meanwhile, the adjusted R 2 and predictive R 2 values were 0.7834 and 0.4881 for turbidity, 0.7023 and 0.4429 for COD removal, 0.7795 and 0.54 for P T removal, and finally 0.7579 and 0.6231 for SO4 -2 removal. Adequate precision is an indicator that measures the range between the predicted data and the design points with the average prediction error (Davarnejad and Nasiri, 2017). A value greater than 4 indicates that the model obtained can be applied to the proposed spatial design (Hussin et al., 2019). The adequate precision for the 7 response variables was greater than 4, which indicates that the quadratic model is adequate for the application of the CCD.
The following equations represent the CCD model obtained for the response variables. Using these Equations, the model predicts the value of the response variables based on the coded factors.
In the case of COD, the residuals indicate how the model satisfies the assumptions of the ANOVA analysis, where the standardized residuals measure the differences between the observed values and the predicted values (Asaithambi et al., 2016). Fig. 5 and Fig. 6 show the normality of the residuals for the response variables. These graphs show that the data obtained follow a straight-line pattern; therefore, we can observe that the residuals have a normal distribution.

Optimization model
The objective of the optimization of the co-treatment for the AW of the Quiulacocha lagoon implies a good control of the operative conditions to achieve a balance between a better removal efficiency of water quality parameters and the low costs of the process. In general, operating costs are proportional to factors such as UWW supply, as well as the operating time required. In the particular case of this investigation, these factors are represented by the molar ratio (Fe T / P T ), the stirring time and the stirring speed. For this, numerical optimization was used through the RSM to determine the optimal values of the factors to reach the maximum pH, the minimum conductivity, turbidity and the maximum removal of COD, Fe T , P T and SO 4 -.
To optimize the co-treatment conditions, the minimum possible value of the stirring time and the maximum of the molar ratio (Fe T /P T ) were established, for a lower need for UWW. The stirring speed value was kept in the range (150-300 rpm). Regarding the response variables, the pH and the removal of COD, Fe T, P T and SO4 -2 were maximized. Meanwhile, the conductivity and turbidity were established at their minimum values. Fig. 7 shows the optimization graph for the co-treatment of AW and UWW at a stirring speed of 255 rpm. The yellow part of the graph represents the values of the response variables that can be accepted. This range was at a molar ratio (Fe T /P T ) between 20 and 40, with a stirring time between 5 and 20 min. In this sense, the optimal treatment was chosen based on the experimental runs with the highest desirability. This value is within a range from 0 to 1, with 1 being the value for the most desirable response and 0 for an undesirable response. The optimal treatment is shown in Fig. 7 with a desirability of 0.71. This condition was given at a molar ratio (Fe T /P T ) of 32.9, a stirring time of 5 min and a stirring speed of 255 rpm. In this way, a pH of 5.7, a conductivity of 3.8 mS/cm 2 , a turbidity of 56 NTU, a removal of COD, Fe T , P T and SO 4 -2 of 71.78%, 99.49%, 84.29% and 98.94% were obtained, respectively.

Conclusions
In this research, RSM was used for the optimization of the operating conditions of the co-treatment of AW and UWW such as the molar ratio (Fe T /P T ), the stirring time and the stirring speed. The proposed CCD Fig. 7. Optimization chart for co-treatment model provides a satisfactory level of prediction for the increase in pH, reduction in conductivity and reduction in total iron (mg Fe T /L) with significant values of P = 0.000, with the factor X 1 = molar ratio (mmol Fe T / mmol P T ) being the most significant. The proposed quadratic model resulted in an R 2 > 0.92 for the responses: pH, conductivity (mS/cm) and Fe T removal (%). Likewise, an R 2 > 0.80 was obtained for turbidity (NTU) and removal of COD, total phosphorus (%) and sulfate (%).
The optimal conditions determined by the model were as follows: molar ratio 32.9:1 (mmol Fe T / mmol P T ), stirring time of 5 min and a speed of 255 rpm. The pH reached a value of 5.7, the conductivity was 3.8 mS/cm 2 , the turbidity was obtained at 56 NTU, the removal efficiencies of COD, Fe T , P T , SO 4 -2 and their This research demonstrated the effectiveness of co-treatment of AW from the Quiulacocha lagoon and UWW from Independencia municipality by developing a second-order model, and the importance of experimental design for optimizing operating conditions since it provides the conditions in which the greatest removal of contaminants would be obtained, taking into account that the molar ratio is a significant factor and that optimizing this factor would allow the co-treatment to be replicated in other polluted areas.
Regarding pH, this parameter does not exceed the water quality standards established by Peruvian regulations. Besides, all measurements were made after 30 min of rest after the jar test. Therefore, the use of a post-treatment is recommended for the regulation of the pH and the decrease in conductivity, as well as an increase in the rest time.
The co-treatment between AW and UWW is a promising alternative for the treatment of both types of water, which allows the reduction of costs since the additional use of chemical agents for the neutralization of AW is avoided. However, this alternative is not yet applied on a larger scale due to the high dose of residual water that is required; nevertheless, this represents a very promising pre-treatment alternative that, when coupled with other subsequent technologies, would achieve better efficiency. In addition, this co-treatment can be used using those wastewaters with high concentrations of PO 4 -3 that are close to mining areas to reduce the costs of supplying wastewater.
On the other hand, regarding the limitation of the research, analytical techniques such as SEM/FIB/EDX, FTIR and XRD were not applied, despite the fact that these would have allowed a better understanding of the reaction mechanisms of the synergism between the AW and UWW. However, the aim of the research was to optimize the iron-phosphorus ratio, which are the main components of the treated water.
Finally, it is recommended to use other residues that contain a high phosphorus content allowing the removal of iron from AW, favoring the principle of circular economy.