{'fraction_non_alphanumeric': 0.032464664310954065, 'fraction_numerical': 0.01980270906949352, 'mean_word_length': 5.024390243902439, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Response Surface Optimization of Electrocoagulation to Treat Real Indigo Dye Wastewater

This research aimed to optimization of the electrocoagulation process was investigated in terms of chemical and physical mechanisms using Box-Behnken response surface design (BBD). The experimental conditions were optimized by examining the interaction effects of initial pH, electrolysis time, and current density on COD and color removal efficiencies. The results showed that the calculated response functions agreed well with the experimental data, where R2 = 94.87% for COD and 97.86% for color. An ANOVA analysis revealed p-values lower than 0.05 at the 95% confidence interval (CI) (p = 0.05), confirming that the quadratic models were statistically significant and supportive of the phenomenon study on COD and color removal. According to BBD results, for the maximum removal of COD and color, the optimal independent variables were a pH of 4.0, electrolysis time of 60 min, and current density of 300 A/m2. Predicted removal efficiencies of COD and color under optimal operating conditions were 71.96% and 96.38%, respectively. Three experiments conducted to confirm optimal operating conditions revealed mean values of COD and color removal efficiency to be 73.13% and 94.68%, respectively. These findings confirmed that predictions of optimal operating conditions generated by the response surface design model were reliable.

organic and inorganic compounds, some of which are non-biodegradable and harmful to human health and the environment [2][3]. Therefore, natural dyes made from biodegradable and non-toxic substances are becoming trendy among people who like natural products. Of these, indigo dye is one of the most popular and is used to color products such as sarong, t-shirts, scarves, and bags.
Indigo dyeing is often carried out in small-scale industrial settings or community enterprise groups. The dyeing process generates irregular volumes of dark bluegreen wastewater containing high organic substances [4][5]. While the wastewater from the indigo dyeing process is biodegradable, it is characterized by insufficient nutrients for biological wastewater treatment, leading to the possibility of untreated wastewater being discharged directly into the environment. Moreover, the amount of wastewater created varies based on an irregular market demand and the producer's inconsistent free time, as indigo dyeing often contributes toward supplemental income among agriculturists.
Due to the aforementioned characteristics of indigo dye wastewater, including its color, organic composition, and irregularity of production, Electrocoagulation (EC) is potentially a suitable treatment method, as this technique removes organic compounds and colloidal particles without requiring additional chemicals or microorganisms [6]. In comparison with other techniques, the EC process is compatible with a high variability of the water quality. In the EC process, electric current is applied to electrodes, triggering coagulant productions dissolved from the anode, while the cathode releases hydrogen gas and hydroxyl ions [7][8].
Factors that influence EC efficiency include electrolysis time, current density, electrode type, interelectrode spacing, and the pH of the electrolyte [9]. Response surface optimization is a widely used method to investigate optimal process variables of EC when aiming to obtain maximum treatment efficiency [10]. To predict the maximum response, a mathematical model is generated from response surface methodology using a statistically-based experimental design [11]. In this study, electrocoagulation was conducted to investigate optimal conditions for treating real indigo dye wastewater collected from a community enterprise group in Sakon Nakhon Province, Thailand. Box-Behnken response surface design (BBD) was used to optimize initial pH, electrolysis time, and current density as process variables for COD and color removal.

Wastewater Samples and Chemicals
Real indigo dye wastewater samples were collected from an indigo fabric community enterprise group in Sakon Nakhon Province, Thailand. The wastewater was generated from the washing process, which produced approximately 100-200 L of indigo dye wastewater discharge per day. The wastewater samples were well-preserved according to standard methods at 4ºC in a 20-liter plastic container. Table 1 presents the characteristics of the wastewater samples, and the wastewater's dark blue-green color is shown in Fig. 1. The pH was adjusted to a desired value using an H 2 SO 4 or NaOH solution (Merck, Germany). All reagents used in the experiments were analytical grade and used without additional purification.

Electrocoagulation Process
The experiment setup for electrocoagulation (EC) is shown in Fig. 2. The EC experiments were conducted at lab scale using a total volume of 500 ml for each batch experiment. The EC cells were equipped with monopolar electrodes: one anode and one cathode, each with dimensions of 50 mm×150 mm×0.5 mm and made from aluminum 1100 sheets. The total effective electrode area was 50 cm 2 and interelectrode spacing was 15 mm. The electrodes were connected to a DC power supply (KPS3010D; 30V, 10A). The EC process was performed using 15 experimental runs with a 3-factor, 3-level Box-Behnken experimental design as described in Table 2. After finishing each experimental run, the wastewater was left to precipitate for 30 minutes. Then the supernatant water was filtered using sand filtration with 60-cm depth. Finally, the clear water was analyzed for COD and color.

Analytical Measurements
Chemical oxygen demand (COD) measurements were determined according to standard methods for the examination of water and wastewater. The COD samples were analyzed using a COD reactor (HACH DRB200) and the color samples using an ADMI Spectrophotometer (HACH DR6000). The pH of the solutions was measured using a pH meter (METROHM 713). COD and color removal efficiency (R) calculations subsequent to electrocoagulation treatment were expressed as a percentage, given by ...where C 0 and C 1 are initial and final coloration and COD, respectively [12][13].

Experimental Design and Optimization
As shown in Table 2, Box-Behnken response surface experimental design (BBD) with three factors and at three levels was used in optimizing and investigating the influence of process variables, namely initial pH (4-10), electrolysis time (10-60 min), and current density (100-300 A/m 2 ), on COD and color removal [14].
The effects of the selected independent variables and their interactions on responses according to BBD were described using the second order polynomial equation ...where β 0 , β i , β ii , and β ij are constant, linear, quadratic, and cross-factor interaction coefficients, respectively; X i and X j represent the independent variables; Y i is the predicted response; and k and C are the number of factors and the residual terms, respectively [15].

Results and Discussion
Response Analysis and Interpretation Using Box-Behnken Design (BBD) Three factors in a three-level Box-Behnken response surface design (BBD) were used to optimize and examine the influence of process variables, namely pH (X 1 ), electrolysis time (X 2 ), and current density (X 3 ), on COD removal (Y 1 ) and color removal (Y 2 ) responses. Table 3 shows the independent variables' BBD matrix with uncoded and coded units as well as experimental and predicted response values. Values for the predicted responses in terms of COD and color removal efficiency were obtained from a quadratic regression model using the software mimitab16 (trial version). The response functions with the determined coefficients for COD and color removal are given by Equations (3) and (4), respectively. The calculated response functions agreed well with the experimental data, which were R 2 = 94.87% for Y 1 and R 2 = 97.86% for Y 2 .
Analysis of variance (ANOVA) was used to examine the adequacy of the quadratic model and determine the quality of the correlation between parameters and responses. The evaluation was based on the p-values generated from the Minitab program, as shown in Table 4. The significance of the equations, individual parameters, and factor interaction were evaluated by analysis of variance (ANOVA) at the 95% confidence interval (CI) (p = 0.05). P-values lower than 0.05 confirmed statistical significance of   the quadratic models and showed that they properly explained the phenomenon study on COD and color removal. Furthermore, the models' acceptability was examined using data plots of predicted versus actual values, presented in Fig. 3. The relationship between the predicted values calculated by the model and the experimental values determined by the obtained data is represented by a nearly diagonal line, indicating that both data generation methods were accurate and reliable. Therefore, the relationship was deemed suitable and an adequate model was achieved [16].

Effects of Operating Parameters
Figs 4-6 show two-dimensional (2D) contour plots representing the interaction effects of pH, electrolysis time, and current density on removal efficiencies. The contour plots were generated from the mathematical models, presented in Equations (3) and (4), describing the process variable effects on COD and color removal efficiencies.

Effects of Initial pH and Electrolysis Time
The interaction effects of initial pH and electrolysis time on COD and color removal efficiencies, with current density being fixed at central level (200 A/m 2 ), are shown in Fig 4. The contour plot between initial pH and electrolysis time indicates a high efficiency for COD and color removal when the initial pH was lower than 7, while initial pH values higher than 7 resulted in lower removal efficiencies. The main immediate reaction occurred from the aluminum used as electrodes in the EC process. The reactions can be described by Equations (5)-(7):
The major amorphous metallic Al was Al(OH) 3 when pH was in the range of 5-7. The freshly formed amorphous Al(OH) 3 , having a large surface area, removed the colloidal particles in the wastewater by forming with the flocs of Al(OH) 3(s) , causing the formed flocs to precipitate easily. Conversely, an initial pH higher than 7 resulted in low COD and color removal efficiency as a consequence of less formation of Al(OH) 3 [17].

Effects of Initial pH and Current Density
The contour map in Fig. 5 shows the interaction between pH and current density as it affected COD and color removal efficiencies, with electrolysis time fixed at central level (35 min). The results revealed that increasing current density tended to increase COD and color removal efficiencies; however, COD and color removal had high efficiency only when the initial pH was lower than 7. This confirmed that when using EC, initial pH is an important parameter of COD and color removal efficiencies [18]. Fig. 6 shows the contour map based on the interaction between electrolysis time and current density and its effects on COD and color removal efficiencies, with pH fixed at central level (pH 7). This study found that long electrolysis time and high current density resulted in increased COD and color removal efficiencies on condition that the initial pH was lower than 7 [19].

Optimization Using Box-Behnken Design
Multi-response numerical optimization technique was carried out to determine the optimal operating conditions for maximum COD and color removal efficiencies when using electrocoagulation to treat real indigo dye effluent. According to BBD results, depicted in Fig. 7, maximum removal of COD and color occurred under the following operating conditions: a pH of 4.0, an electrolysis time of 60 min, and a current density of 300 A/m 2 . Under these optimal conditions, the COD removal efficiency and color removal efficiency were reported to be 71.96% and 96.38%, respectively. Three tests were conducted to validate the optimal conditions. Mean values of the test results were 73.13% for COD removal and 94.68% for color removal. The observed responses were found to be in close agreement with the predicted values obtained from the numerical optimization technique.

Conclusions
The experimental conditions were optimized by observing the effects of interactions among variables (initial pH, electrolysis time, and current density) on COD and color removal efficiencies using a response surface methodology (RSM) with Box-Behnken design. The calculated response functions agreed well with the experimental data, where R 2 = 94.87% for COD and R 2 = 97.86% for color. ANOVA results at the 95% confidence interval (CI) (p = 0.05) revealed p-values lower than 0.05, confirming that the quadratic models were statistically significant and properly explained the phenomenon study on COD and color removal. The contour plot of initial pH, electrolysis time, and current density indicated that COD and color removal occurred at high efficiencies when the initial pH was lower than 7, while an initial pH higher than 7 resulted in lower removal efficiencies. It was also shown that long electrolysis time and high current density resulted in increasing COD and color removal efficiencies as long as the initial pH was lower than 7. According to the BBD results, optimal operating conditions to obtain the maximum removal of COD and color are: a pH of 4.0, electrolysis time of 60 min, and current density of 300 A/m 2 . Under these optimal conditions, the COD and color removal efficiencies were found to be 71.96% and 96.38%, respectively.