# Evaluation of Contemporary Computational Techniques to Optimize Adsorption Process for Simultaneous Removal of COD and TOC in Wastewater

Authors: Areej Alhothali; Hifsa Khurshid; Muhammad Raza Ul Mustafa; Kawthar Mostafa Moria; Umer Rashid; Omaimah Omar Bamasag
Journal: Adsorption Science & Technology
 (2022)

---

## Abstract

This study was aimed at evaluating the artificial neural network (ANN), genetic algorithm (GA), adaptive neurofuzzy interference (ANFIS), and the response surface methodology (RSM) approaches for modeling and optimizing the simultaneous adsorptive removal of chemical oxygen demand (COD) and total organic carbon (TOC) in produced water (PW) using tea waste biochar (TWBC). Comparative analysis of RSM, ANN, and ANFIS models showed mean square error (MSE) as 5.29809, 1.49937, and 0.24164 for adsorption of COD and MSE of 0.11726, 0.10241, and 0.08747 for prediction of TOC adsorption, respectively. The study showed that ANFIS outperformed the ANN and RSM in terms of fast convergence, minimum MSE, and sum of square error for prediction of adsorption data. The adsorption parameters were optimized using ANFIS-surface plots, ANN-GA hybrid, RSM-GA hybrid, and RSM optimization tool in design expert (DE) software. Maximum COD (88.9%) and TOC (98.8%) removal were predicted at pH of 7, a dosage of 300 mg/L, and contact time of 60 mins using ANFIS-surface plots. The optimization approaches showed the performance in the following order: ANFIS-surface plots>ANN-GA>RSM-GA>RSM.


---

## Body

## 1. Introduction

With an increase in the world population, industrialization, and urbanization, the evaluation of water resources and monitoring of their quality have become a significant concern in hydroenvironmental science. Various contaminants are being released continuously into water resources and causing the degradation of aquatic animals’ habitat and freshwater quality up to a greater extent [1, 2]. Attempts have been made to establish strategies for the safe removal of contaminants in wastewaters, e.g., coagulation-flocculation, photocatalytic treatment, electrocoagulation, adsorption, and oxidation [3, 4]. However, in comparison to other methods, adsorption has gained prominence due to its high operating speed, design stability, cost-effectiveness, and robustness [5, 6].The adsorption process is influenced by various operating variables, including contact time between adsorbent and adsorbate, adsorbent particle size, pollutant concentration, and pH of the solution. It has been noted that building an automated and optimized adsorption treatment process is complex in wastewater treatment plants (WWTP) due to the following reasons: (i) complex nature of adsorption process, (ii) nonlinear interactions between the operating variables, and (iii) drastic changes in pollutant’s concentrations [7]. Therefore, mathematical models are needed to understand, optimize, and quantify the interactions between the operating variables. Modeling and simulation can save time, reagents, and delayed analysis by avoiding multiple time-consuming experimental runs of the process. Classical and linear mathematical models can not completely model and simulate the adsorption results. Recently, response surface methodology (RSM) has been used to model a wide variety of adsorption processes, but it has been found to have limited application when the data is minimum. Therefore, to interrelate the adsorption operating variables with output removal efficiencies of the pollutants and automate the WWTP, advanced computer-simulated models are necessary. Automation and optimization of the adsorption process can help in saving workforce, cost, and resources [8].Artificial Intelligence (AI) is an advanced computer-based simulation technology. It was first implemented in the mid-1950s in the world of computer science. After that, many more robust and realistic AI-based techniques were developed in engineering to solve challenging problems and provide real-world implementations, whereas traditional or conventional methods were inadequate or unsuccessful [7, 9]. The application of AI techniques in the water treatment sector and optimization process has recently gained attention [10]. AI-based methods, such as knowledge-based structures and fuzzy logics (FIS), including adaptive neurofuzzy interface systems (ANFIS) [11], particle swarm optimization (PSO) [12, 13], genetic algorithm (GA) [14, 15], and artificial neural network (ANN) [16, 17], have been applied recently in water treatment and adsorption optimization systems. Such as optimization of the adsorption process of various dyes [18–24], metals [8, 14, 25, 26], and organic matter [27] has been reported in the literature using ANN, ANFIS, and RSM methods. However, limited studies have been found for the application of ANN, GA, and ANFIS for modeling and optimization of chemical oxygen demand (COD) and total organic carbon (TOC) adsorptive removal in produced water (PW).The PW is one of the largest wastewater streams obtained during oil and gas exploration. Contaminants in PW change significantly depending on the source of their disposal. However, recently organic contaminants in PW have become the highest priority pollutants and need to be treated on a priority basis [28]. The COD and TOC are significant parameters for analyzing organic contaminants in PW and have been commonly used to represent the effluent water quality (WQ) [29, 30]. Hence, for the safe disposal of PW, these parameters need to be reduced significantly.Most of the studies in the literature are performed on synthetic waters, which cannot be used efficiently for automation of oil and gas reservoirs’ effluent treatment plants. Hence, there is a gap in the literature regarding the application of ANN, GA, and ANFIS in the adsorption field utilising PW. This research work was aimed at designing, implementing, comparing, and evaluating the ANN, GA, and ANFIS approach to remove COD and TOC in PW. Tea waste biochar (TWBC) had been used as an adsorbent in batch studies under the control of three factors, i.e., pH, adsorbent dosage, and contact time. The ANN and ANFIS results were compared with RSM results. It is expected that this study would help to scale up the industrial application of the adsorption process for COD and TOC removal in PW.


## 2. Materials and Methods

### 2.1. Materials

Tea leaves waste was used for the preparation of biochar (BC). The waste was collected from local Malaysian restaurants. High range (HR) COD vials were obtained from Avanti’s laboratory items supplier in Malaysia. The water sample was taken from a South-East Asian oil and gas company.


### 2.2. Characterization of PW

The PW was filtered to remove suspended solids using a suction filtration unit. The filtered water was characterized for initial COD and TOC concentration. COD was measured using the USEPA reactor digestion method. Briefly, 2 mL of filtered PW sample was added to the high range COD vial. The vial was capped, mixed, and kept in a preheated digester at 150°C for 2 hrs. An empty vial prepared using 2 mL pure water was also observed in the digester. After 2 hrs, the concentration of COD (mg/L) was measured using USEPA method 800 under program 430, using HACH DR 2800 spectrophotometer. TOC in PW was measured using the Shimadzu TOC-L/SSM-5000A analyzer. The pH value of PW was found out using the OHAUS pH meter, and it was about8±0.2.


### 2.3. Preparation and Characterization of Biochar

The TWBC was prepared using our previously reported method [31]. Briefly, the tea leaves were washed and all impurities were removed. Before pyrolysis, the leaves were soaked overnight in phosphoric acid. The soaked leaves were dried and pyrolyzed at 700°C for 2 hrs in the presence of N2 gas. The obtained TWBC was washed, dried in an oven for 24 hrs, and stored in a desiccator. The surface characteristics of the TWBC were determined using a ZEISS scanning electron microscope with energy-dispersive X-ray spectroscopy (SEM-EDX) mapping and a 15 kV accelerating voltage.


### 2.4. Design of Experiments Using RSM

The RSM-based polynomial Box–Behnken Design (BBD) in design expert (DE) software (Stat-Ease, version 12) was used for the design of adsorption batch experiments. Three independent variables were taken as inputs, including initial pH of PW, contact time, and dosage of TWBC. Adsorptive removal efficiencies of COD and TOC were taken as outputs. The design was chosen at three stages of low (-1), center (0), and high (1) points (Table1), giving a total of 13 experimental runs.Table 1
Ranges of variables for the design of experiments.
FactorVariablesLevel-101ApH3610BAdsorbent dosage (mg/L)25162.5300CContact time (min)103560


### 2.5. Adsorption Batch Experiments

According to the design of experiments obtained through BBD, 13 batch experiments were conducted to investigate the effects of initial solution pH, adsorbent dosage, and contact time on COD and TOC removal in PW. The adsorbent was applied in varying amounts (25−300 mg/L) for 100 mL of PW at varying initial pH (3 − 10) and contact times (10−60 mins). The water was stirred at 220 rpm at a temperature of20±5°C using a magnetic stirrer. The initial and final COD and TOC concentrations were measured before and after each experiment. All data were measured in three replicates, and the average value was recorded. The removal efficiencies were determined using the formula given as follows:
(1)Removalefficiency%=Initialconcentration−FinalconcentrationInitialconcentration×100,where initial and final concentrations refer to COD and TOC amounts in mg/L before and after the adsorption experiment, respectively.


### 2.6. Modelling of Artificial Neural Network (ANN)

Artificial neural networks (ANNs) are well known for their ability to research and organize large amounts of data. It is influenced by the brain, neurological system, neuronal learning, and reaction mechanism [18].MATLAB R2021a was used to create a three-layer feed-forward neural network (FFNN). A FFNN network has no loops or cycles because all data is solely delivered forward [32]. For training the network, three inputs in the input layer, 2–20 neurons in the hidden layer, and two outputs in the output layer were taken. The input layer was given pH, TWBC dosage (mg/L), and contact time (min) as independent variables. The output layer had two dependent variables showing the removal efficiency of COD (%) and TOC (%), as shown in Figure 1. The neurons in the hidden layer were connected to the inputs and outputs through weights (w) and biases (b). In Figure 1, the symbol i represents the ith input in the input layer (1≤i≤3), j represents the jth neuron in the hidden layer (1≤j≤n), and k represents the kth output in the output layer (1≤k≤2). wi,j represents the weights from the input layer to the hidden layer, and wj,k represents the hidden layer to output layer weights, where n represents the total number of neurons in the hidden layer.Figure 1
Schematic diagram of ANN model.Training a network aims to reduce the error between the network’s outputs and the target values. The training procedure reduces the error by modifying the weights and biases of the network. The ANN architecture was repeatedly trained to select the best suitable number of neurons, training algorithm, weights, and biases to predict COD and TOC removal efficiencies. A total of 13 data sets were taken through batch experiments for COD and TOC removal efficiencies, respectively. 70% data was used to train the model and 15% for validation and testing, respectively. For all data sets in ANN, the symmetric sigmoid transfer function (tansig) was used in the hidden layer. The linear transfer function (purelin) was used at the output node for the simulation and prediction of COD and TOC elimination.The suitable number of neurons in the hidden layer was selected based on the hit and trial method using 2−20 neurons. As for performance criteria, minimum mean square error (MSE) and simulation time were taken.After selecting the no. of neurons, the network was evaluated for various algorithms. The backpropagation (BP) algorithms were chosen for the network’s training. It is a first-order gradient descent technique to model the experimental data [33]. The three BP algorithms named Elman BP (EBP), Cascade Forward BP (CFBP), and Levenberg Marquardt BP (LMBP) were evaluated for their performance, and the best algorithm was taken for the training purpose.In order to train the ANN model, input values are multiplied by connection weights, followed by bias addition. The same procedure is used for the output layer, with the hidden layer’s output acting as the input. After training the ANN model, it was tested and validated. The goal was to achieve an overall correlation coefficient (R) of nearly 1. The relationship between inputs and outputs can be expressed through Equation (2) [34].
(2)y=fx=∑j=1nwj,k∑i=1mwi,j.x+bj+bk,wherey shows the output variable and x denotes the input variable, and n represents the number of neurons in the hidden layer and m is the number of input variables. w and b are the weights and biases between the layers. i, j, and k represent the input order number, hidden neuron order number, and output order number, respectively.


### 2.7. Modelling of Adaptive Neurofuzzy Interference System (ANFIS)

Fuzzy systems have some advantages over traditional approaches, particularly where ambiguous data is involved. Recently, fuzzy systems have gained popularity as alternative methods for information processing [35].As illustrated in Figure2, the fuzzy inference system (FIS) used in ANFIS was created in MATLAB R2021a using a neurofuzzy designer. The Sugeno-type ANFIS design consisted of four hidden layers: fuzzification layer, inference layer, defuzzification layer, and output layer [36]. For each output, a total of 13 data sets were used to train the model. Data were randomly divided into training (70%), testing, and checking data (30%). Three variables (pH, TWBC dosage, and contact time) were selected as inputs and removal efficiency of COD, and TOC were taken as targets. Minimum numbers of membership functions (mf) were selected based on minimum MSE. Optimization of the model was done based on backpropagation and least square estimation. FIS and optimization methods were selected based on error minimization.Figure 2
Schematic diagram of FIS.


### 2.8. Modelling of Response Surface Methodology (RSM)

The experimental data collected through batch tests were subjected to the second-order polynomial regression model. As a polynomial model based on the quadratic equation, the responseY can be connected to the independent variables. At the middle of the pattern, one center point was used to approximate the total error. The quadratic regression equation used to extract the expected response results is given as follows:
(3)Y=β0+∑p=1mβp+∑p=1mβppxp2+∑q=1∑p=1βqpxqxp+ε.The output is expressed here byY, while variables are written in the form of xq and xp. m shows the number of variables examined. Β0, βp, βpp, and βqp, are classified as a constant coefficient, linear coefficient of interaction, coefficient of quadratic interaction, and the interaction coefficient of the 2nd order terms, respectively. Furthermore, the F-test and p values were used to determine the validity of each element.To determine the adequacy of the established model and the statistical importance of the constant regression coefficients, the analysis of variance (ANOVA) was applied [37]. ANOVA analyzed the interactive, individual, and quadratic effects of input variables using TWBC on the removal efficiency of COD and TOC. Using the p value with a 95% trust rating, the model terms were evaluated. The F-value was used to analyze the sensitivity of the coefficients in regression. Also, to verify the adequacy of the formula, the coefficient of determination (R2) value was compared to the adjusted R2 value.


### 2.9. Performance Evaluation of the Models

The performance of the AI techniques (ANN and ANFIS) and RSM for prediction of adsorption data were evaluated using statistical equations, i.e., (i) the coefficient of determination (R2) Equation (4), (ii) the sum of squared error (SSE) Equation (5), and (iii) mean squared error (MSE) Equation (6) [32, 38]. The value of R2 should lie between 0 and 1. A value near 1 shows a good correlation between the experimental and model-simulated data sets. The SSE has values ranging from 0 to 1, while the best value is closer to 0 [39]. The minimum value of MSE is taken as the best value [40]. Following equations were used to measure the errors:
(4)R2=1−∑l=1rypred,l−yexp,l2∑l=1rypred,l−ym2,(5)SSE=1r∑l=1rypred,l−yexp,l2,(6)MSE=1r∑l=1rypred,l−yexp,l2,whereYpred and Yexp denote the predicted and experimental values, respectively. r denotes the total number of values in data. The mean value of the response is denoted by ym.


### 2.10. Optimization of the Adsorption Process

#### 2.10.1. Development of ANN-GA

ANN and genetic algorithm (GA) hybrid were used for the optimization purpose using MATLAB optimization tool. Multiobjective optimization using GA (gamultobj) was taken as solver, and the ANN output equation (Equation (2)) was taken as an objective function. The algorithm had the following attributes: (i) population type of double vector; (ii) population size of 50; (iii) creation and mutation functions were constraint dependent; and (iv) crossover fraction of 0.8. The algorithm was run for optimization further. The goal was to maximize the COD and TOC removal efficiency.


#### 2.10.2. Development of ANFIS Surface Plots

For the optimization of adsorption data through ANFIS, 2D surface plots were generated for pH range 3−10, dosage 25−300 mg/L, and contact time 10−60 min. Optimal values of the input variables were obtained through the surface plots.


#### 2.10.3. Development of RSM Surface Plots and RSM-GA

Using the DE software, three-dimensional surface and two-dimensional contour plots were created to visualize the relationship between the process factors and their corresponding effect on the output response. Optimal conditions were calculated after the model was completely analyzed. The numerical method was used under the optimization option in the Design Export software. For all independent variables “in range” options were chosen (e.g., pH 3−10, biochar dosage 25−300 mg/L, and contact time 10−60 min) while the “maximize” alternative was chosen for COD and TOC elimination.RSM was also hybridized with GA in MATLAB R2021a using the response equations as the objective function. Response equation was obtained through the RSM model. GA parameters were the same as stated above. The optimized input values were obtained.


## 2.1. Materials

Tea leaves waste was used for the preparation of biochar (BC). The waste was collected from local Malaysian restaurants. High range (HR) COD vials were obtained from Avanti’s laboratory items supplier in Malaysia. The water sample was taken from a South-East Asian oil and gas company.


## 2.2. Characterization of PW

The PW was filtered to remove suspended solids using a suction filtration unit. The filtered water was characterized for initial COD and TOC concentration. COD was measured using the USEPA reactor digestion method. Briefly, 2 mL of filtered PW sample was added to the high range COD vial. The vial was capped, mixed, and kept in a preheated digester at 150°C for 2 hrs. An empty vial prepared using 2 mL pure water was also observed in the digester. After 2 hrs, the concentration of COD (mg/L) was measured using USEPA method 800 under program 430, using HACH DR 2800 spectrophotometer. TOC in PW was measured using the Shimadzu TOC-L/SSM-5000A analyzer. The pH value of PW was found out using the OHAUS pH meter, and it was about8±0.2.


## 2.3. Preparation and Characterization of Biochar

The TWBC was prepared using our previously reported method [31]. Briefly, the tea leaves were washed and all impurities were removed. Before pyrolysis, the leaves were soaked overnight in phosphoric acid. The soaked leaves were dried and pyrolyzed at 700°C for 2 hrs in the presence of N2 gas. The obtained TWBC was washed, dried in an oven for 24 hrs, and stored in a desiccator. The surface characteristics of the TWBC were determined using a ZEISS scanning electron microscope with energy-dispersive X-ray spectroscopy (SEM-EDX) mapping and a 15 kV accelerating voltage.


## 2.4. Design of Experiments Using RSM

The RSM-based polynomial Box–Behnken Design (BBD) in design expert (DE) software (Stat-Ease, version 12) was used for the design of adsorption batch experiments. Three independent variables were taken as inputs, including initial pH of PW, contact time, and dosage of TWBC. Adsorptive removal efficiencies of COD and TOC were taken as outputs. The design was chosen at three stages of low (-1), center (0), and high (1) points (Table1), giving a total of 13 experimental runs.Table 1
Ranges of variables for the design of experiments.
FactorVariablesLevel-101ApH3610BAdsorbent dosage (mg/L)25162.5300CContact time (min)103560


## 2.5. Adsorption Batch Experiments

According to the design of experiments obtained through BBD, 13 batch experiments were conducted to investigate the effects of initial solution pH, adsorbent dosage, and contact time on COD and TOC removal in PW. The adsorbent was applied in varying amounts (25−300 mg/L) for 100 mL of PW at varying initial pH (3 − 10) and contact times (10−60 mins). The water was stirred at 220 rpm at a temperature of20±5°C using a magnetic stirrer. The initial and final COD and TOC concentrations were measured before and after each experiment. All data were measured in three replicates, and the average value was recorded. The removal efficiencies were determined using the formula given as follows:
(1)Removalefficiency%=Initialconcentration−FinalconcentrationInitialconcentration×100,where initial and final concentrations refer to COD and TOC amounts in mg/L before and after the adsorption experiment, respectively.


## 2.6. Modelling of Artificial Neural Network (ANN)

Artificial neural networks (ANNs) are well known for their ability to research and organize large amounts of data. It is influenced by the brain, neurological system, neuronal learning, and reaction mechanism [18].MATLAB R2021a was used to create a three-layer feed-forward neural network (FFNN). A FFNN network has no loops or cycles because all data is solely delivered forward [32]. For training the network, three inputs in the input layer, 2–20 neurons in the hidden layer, and two outputs in the output layer were taken. The input layer was given pH, TWBC dosage (mg/L), and contact time (min) as independent variables. The output layer had two dependent variables showing the removal efficiency of COD (%) and TOC (%), as shown in Figure 1. The neurons in the hidden layer were connected to the inputs and outputs through weights (w) and biases (b). In Figure 1, the symbol i represents the ith input in the input layer (1≤i≤3), j represents the jth neuron in the hidden layer (1≤j≤n), and k represents the kth output in the output layer (1≤k≤2). wi,j represents the weights from the input layer to the hidden layer, and wj,k represents the hidden layer to output layer weights, where n represents the total number of neurons in the hidden layer.Figure 1
Schematic diagram of ANN model.Training a network aims to reduce the error between the network’s outputs and the target values. The training procedure reduces the error by modifying the weights and biases of the network. The ANN architecture was repeatedly trained to select the best suitable number of neurons, training algorithm, weights, and biases to predict COD and TOC removal efficiencies. A total of 13 data sets were taken through batch experiments for COD and TOC removal efficiencies, respectively. 70% data was used to train the model and 15% for validation and testing, respectively. For all data sets in ANN, the symmetric sigmoid transfer function (tansig) was used in the hidden layer. The linear transfer function (purelin) was used at the output node for the simulation and prediction of COD and TOC elimination.The suitable number of neurons in the hidden layer was selected based on the hit and trial method using 2−20 neurons. As for performance criteria, minimum mean square error (MSE) and simulation time were taken.After selecting the no. of neurons, the network was evaluated for various algorithms. The backpropagation (BP) algorithms were chosen for the network’s training. It is a first-order gradient descent technique to model the experimental data [33]. The three BP algorithms named Elman BP (EBP), Cascade Forward BP (CFBP), and Levenberg Marquardt BP (LMBP) were evaluated for their performance, and the best algorithm was taken for the training purpose.In order to train the ANN model, input values are multiplied by connection weights, followed by bias addition. The same procedure is used for the output layer, with the hidden layer’s output acting as the input. After training the ANN model, it was tested and validated. The goal was to achieve an overall correlation coefficient (R) of nearly 1. The relationship between inputs and outputs can be expressed through Equation (2) [34].
(2)y=fx=∑j=1nwj,k∑i=1mwi,j.x+bj+bk,wherey shows the output variable and x denotes the input variable, and n represents the number of neurons in the hidden layer and m is the number of input variables. w and b are the weights and biases between the layers. i, j, and k represent the input order number, hidden neuron order number, and output order number, respectively.


## 2.7. Modelling of Adaptive Neurofuzzy Interference System (ANFIS)

Fuzzy systems have some advantages over traditional approaches, particularly where ambiguous data is involved. Recently, fuzzy systems have gained popularity as alternative methods for information processing [35].As illustrated in Figure2, the fuzzy inference system (FIS) used in ANFIS was created in MATLAB R2021a using a neurofuzzy designer. The Sugeno-type ANFIS design consisted of four hidden layers: fuzzification layer, inference layer, defuzzification layer, and output layer [36]. For each output, a total of 13 data sets were used to train the model. Data were randomly divided into training (70%), testing, and checking data (30%). Three variables (pH, TWBC dosage, and contact time) were selected as inputs and removal efficiency of COD, and TOC were taken as targets. Minimum numbers of membership functions (mf) were selected based on minimum MSE. Optimization of the model was done based on backpropagation and least square estimation. FIS and optimization methods were selected based on error minimization.Figure 2
Schematic diagram of FIS.


## 2.8. Modelling of Response Surface Methodology (RSM)

The experimental data collected through batch tests were subjected to the second-order polynomial regression model. As a polynomial model based on the quadratic equation, the responseY can be connected to the independent variables. At the middle of the pattern, one center point was used to approximate the total error. The quadratic regression equation used to extract the expected response results is given as follows:
(3)Y=β0+∑p=1mβp+∑p=1mβppxp2+∑q=1∑p=1βqpxqxp+ε.The output is expressed here byY, while variables are written in the form of xq and xp. m shows the number of variables examined. Β0, βp, βpp, and βqp, are classified as a constant coefficient, linear coefficient of interaction, coefficient of quadratic interaction, and the interaction coefficient of the 2nd order terms, respectively. Furthermore, the F-test and p values were used to determine the validity of each element.To determine the adequacy of the established model and the statistical importance of the constant regression coefficients, the analysis of variance (ANOVA) was applied [37]. ANOVA analyzed the interactive, individual, and quadratic effects of input variables using TWBC on the removal efficiency of COD and TOC. Using the p value with a 95% trust rating, the model terms were evaluated. The F-value was used to analyze the sensitivity of the coefficients in regression. Also, to verify the adequacy of the formula, the coefficient of determination (R2) value was compared to the adjusted R2 value.


## 2.9. Performance Evaluation of the Models

The performance of the AI techniques (ANN and ANFIS) and RSM for prediction of adsorption data were evaluated using statistical equations, i.e., (i) the coefficient of determination (R2) Equation (4), (ii) the sum of squared error (SSE) Equation (5), and (iii) mean squared error (MSE) Equation (6) [32, 38]. The value of R2 should lie between 0 and 1. A value near 1 shows a good correlation between the experimental and model-simulated data sets. The SSE has values ranging from 0 to 1, while the best value is closer to 0 [39]. The minimum value of MSE is taken as the best value [40]. Following equations were used to measure the errors:
(4)R2=1−∑l=1rypred,l−yexp,l2∑l=1rypred,l−ym2,(5)SSE=1r∑l=1rypred,l−yexp,l2,(6)MSE=1r∑l=1rypred,l−yexp,l2,whereYpred and Yexp denote the predicted and experimental values, respectively. r denotes the total number of values in data. The mean value of the response is denoted by ym.


## 2.10. Optimization of the Adsorption Process

### 2.10.1. Development of ANN-GA

ANN and genetic algorithm (GA) hybrid were used for the optimization purpose using MATLAB optimization tool. Multiobjective optimization using GA (gamultobj) was taken as solver, and the ANN output equation (Equation (2)) was taken as an objective function. The algorithm had the following attributes: (i) population type of double vector; (ii) population size of 50; (iii) creation and mutation functions were constraint dependent; and (iv) crossover fraction of 0.8. The algorithm was run for optimization further. The goal was to maximize the COD and TOC removal efficiency.


### 2.10.2. Development of ANFIS Surface Plots

For the optimization of adsorption data through ANFIS, 2D surface plots were generated for pH range 3−10, dosage 25−300 mg/L, and contact time 10−60 min. Optimal values of the input variables were obtained through the surface plots.


### 2.10.3. Development of RSM Surface Plots and RSM-GA

Using the DE software, three-dimensional surface and two-dimensional contour plots were created to visualize the relationship between the process factors and their corresponding effect on the output response. Optimal conditions were calculated after the model was completely analyzed. The numerical method was used under the optimization option in the Design Export software. For all independent variables “in range” options were chosen (e.g., pH 3−10, biochar dosage 25−300 mg/L, and contact time 10−60 min) while the “maximize” alternative was chosen for COD and TOC elimination.RSM was also hybridized with GA in MATLAB R2021a using the response equations as the objective function. Response equation was obtained through the RSM model. GA parameters were the same as stated above. The optimized input values were obtained.


## 2.10.1. Development of ANN-GA

ANN and genetic algorithm (GA) hybrid were used for the optimization purpose using MATLAB optimization tool. Multiobjective optimization using GA (gamultobj) was taken as solver, and the ANN output equation (Equation (2)) was taken as an objective function. The algorithm had the following attributes: (i) population type of double vector; (ii) population size of 50; (iii) creation and mutation functions were constraint dependent; and (iv) crossover fraction of 0.8. The algorithm was run for optimization further. The goal was to maximize the COD and TOC removal efficiency.


## 2.10.2. Development of ANFIS Surface Plots

For the optimization of adsorption data through ANFIS, 2D surface plots were generated for pH range 3−10, dosage 25−300 mg/L, and contact time 10−60 min. Optimal values of the input variables were obtained through the surface plots.


## 2.10.3. Development of RSM Surface Plots and RSM-GA

Using the DE software, three-dimensional surface and two-dimensional contour plots were created to visualize the relationship between the process factors and their corresponding effect on the output response. Optimal conditions were calculated after the model was completely analyzed. The numerical method was used under the optimization option in the Design Export software. For all independent variables “in range” options were chosen (e.g., pH 3−10, biochar dosage 25−300 mg/L, and contact time 10−60 min) while the “maximize” alternative was chosen for COD and TOC elimination.RSM was also hybridized with GA in MATLAB R2021a using the response equations as the objective function. Response equation was obtained through the RSM model. GA parameters were the same as stated above. The optimized input values were obtained.


## 3. Results and Discussion

### 3.1. Characteristics of BC

The SEM-EDX images of TWBC are presented in Figure3. Figures 3(a) and 3(b) showed that TWBC had many open pores available for adsorption of COD and TOC. The activating agent (phosphoric acid) seems to create an etched texture, as well as volatile matter decomposition [41]. The AC surfaces are uneven due to the etching, with significant porosity and roughness, indicating a desirable textural property of AC [42]. The mesopores available at the surface seem to cause capillary condensation as well as transferring adsorptive into the micropores, hence increasing the AC’s adsorption capacity. The elemental composition in Figure 3(c) showed that TWBC had 80.8% of carbon and 16.2% oxygen content. The high carbon content showed good carbonization of TWBC. Small impurities of Ca and K were also observed in the TWBC.Figure 3
SEM-EDX images.
(a)(b)(c)(d)(e)(f)(g)(h)


### 3.2. Characterization of PW

The concentration of COD in the PW was about 1400 mg/L, which was much higher than the safe discharge limit of COD in effluents reported as 150 mg/L. The initial concentration of TOC in PW was 433.9 mg/L. It was also higher than the safe discharge limit of TOC in effluents, e.g., 30 mg/L. The COD>TOC indicated that the PW sample contained a substantial amount of chemically oxidizable organic and inorganic molecules. Oil and grease content can be found to attribute to the higher COD and TOC in PW, followed by suspended solids, organic acids, aromatic compounds, carbonyl compounds, anions, phenols, and metals [43].


### 3.3. Experimental Results

The experimental results of removal efficiencies for COD and TOC are presented in Table2. A total of 13 batch experiments were conducted, and 26 data points were obtained. The results were used for the modeling of ANN, ANFIS, and RSM models.Table 2
Experimental design matrix using the RSM technique with the experimental values for COD and TOC removal efficiency.
Run orderpHDosageContact timeCOD removal efficiencyTOC removal efficiency(mg/L)(min)(%)(%)110162.56030.61±383.13±323162.56075.27±391.52±336.5256058.94±389.34±346.53006089.87±396.87±356.5162.53570.57±388.35±3610253583.04±398.39±376.5251068.83±188.75±383162.51052.12±393.13±393253560.96±388.78±31010162.51078.3±394.6±31133003555.89±390.07±312103003562.92±392.19±3136.53001057.12±288.32±3136.53001057.12±288.32±3


### 3.4. Modelling and Training of ANN

The neural network tool (nntool) was used in MATLAB R2021a for training of the ANN model. Among 26 data points collected from batch experiments, 18 points were selected for the training purpose and the remaining points were used for the testing and validation of the model.12 no. of neurons, LMBP algorithm with trainlm training function, and tan sigmoid (tansig) transfer function were found most suitable to fit the experimental data. The no. of neurons and algorithm were selected based on the best performance measured as minimum MSE and highest regression analysis coefficient (R2) as shown in Table 3.Table 3
Performance evaluation of ANN based on number of neurons and algorithms.
ParametersMSER2No. of neurons10.010.78920.0040.87230.0060.84240.0080.81250.00020.99860.00090.89170.00050.99780.00060.99490.00080.991100.00010.999AlgorithmCascade-forward backpropagation (CFBP)0.40.7Levenberg-Marquardt backpropagation (LMBP)0.00010.99Bayesian regularization (BR)0.040.85Scaled conjugate gradient (SCG)0.0010.91After the selection of ANN architecture parameters, the model was applied for experimental data prediction. The trained model had a correlation coefficient of 0.985 with the experimental data as shown in Figure4. The MSE value was 0.0001 which showed that the model had a minimum error and was significant. For the validation of the model, the remaining 15% points were tested and removal efficiency was found out, which had an R-value of 0.999. It showed that the model was well trained and could be used effectively for the prediction of COD and TOC adsorption on biochar. The model was further applied for the 15% data set for the prediction of COD and TOC adsorption, and an R-value of 1 was obtained for the predicted data. The overall efficiency of ANN model was 0.989 (Figure 4).Figure 4
Training of ANN model.The weights and biases of the trained ANN model at 12 neurons and LMBP algorithm are given in Table4. wi,j represents the weights from the input layer to hidden layer, wj,k represents the weights from hidden layer to the output layer, bj represents the biases added at hidden layer, and bk represents the biases added at the output layer of ANN model.Table 4
Weights and biases for ANN model.
Weights from input 1 to hidden layerwi,jWeights from input 2 to hidden layerwi,jWeights from input 3 to hidden layerwi,jWeights from hidden layer to output 1wj,kWeights from hidden layer to output 2wj,kBiases for hidden layerbjBiases for output layerbkw1,1=−1.157w1,2=−1.8344w1,3=0.72447w1,4=0.74183w1,5=−2.8229w1,6=2.3265w1,7=1.5054w1,8=0.65708w1,9=−2.4848w1,10=3.1325w1,11=3.5646w1,12=2.0214w2,1=2.0135w2,1=1.4641w2,1=1.0304w2,1=−3.2745w2,1=−0.6843w2,1=−1.6772w2,1=−2.3961w2,1=2.5639w2,1=−1.169w2,1=−0.5409w2,1=−1.3943w2,1=−0.1438w3,1=0.9782w3,1=−2.2931w3,1=2.8132w31=−0.0515w3,1=1.5581w31=−1.1571w3,1=−0.7552w3,1=−2.1007w3,1=−1.1492w3,1=0.4161w31=−0.0107w3,1=2.2269w1,1=1.5125w2,1=0.24355w3,1=0.98934w4,1=1.2401w5,1=−0.01233w6,1=−0.57107w7,1=−0.58306w8,1=0.46212w9,1=−0.9444w10,1=1.0595w11,1=−0.2883w12,1=0.5544w1,2=−0.6018w2,2=0.5023w3,2=0.6861w4,2=0.6152w5,2=0.7447w6,2=0.2616w7,2=−0.8805w8,2=0.1041w9,2=−0.6083w10,2=0.8042w11,2=0.2258w12,2=0.15603.75382.5117-2.9508-1.34290.67837-0.06931.260.51291-2.16022.24431.91932.8432-1.43410.042027


### 3.5. Modelling and Training of ANFIS

Sugeno-type subclustering FIS was generated for three inputs (26 data points) and two outputs (COD and TOC removal efficiency). 70% data was used for the training of the model. Membership functions were taken as 13 in numbers for each input variable and guassmf type. The range of influence was tested from 0 to 1 value. A minimum error was obtained at the value of 0.00001. Whereas, squash factor, accept ratio, and rejection ratio were 1.25, 0.5, and 0.15, respectively. The backpropagation method was taken as the optimization method due to the minimum RMSE of training data as compared to the backpropagation method. The optimized schematic diagram of ANFIS generated is shown in Figure5.Figure 5
Schematic diagram of optimized ANFIS.A total of 1000 no. of epochs were taken, and the model was trained several times for each output. The ANFIS training parameters were as follows: (i)numberofnodes=110; (ii) numberoflinearparameters=52; (iii) numberofnonlinearparameters=78; (iv) totalnumberofparameters=130; (v) number of training data pairs: 13; (vi) number of checking data pairs: 6; and (vii) numberoffuzzyrules=13. The model was well trained after 10000 epochs for COD and 5000 epochs for TOC output. The minimum MSEs obtained for COD and TOC are given in Table 5. The model was tested and checked for the remaining 30% of experimental data.Table 5
Modeling performance of ANFIS.
OutputTraining MSETesting MSEChecking MSECOD0.36260.494140.00000001TOC0.332810.691480.00001Minimum MSE was obtained for both COD and TOC removal efficiencies after repeated training (Figure6). It showed that model was well trained and could be used for prediction or optimization of adsorption data. The performance of the model was better in understanding the behavior of TOC removal as compared to COD removal. The reason can be low variance in TOC data as compared to COD.Figure 6
Modeling results using ANFIS for (a) CD removal efficiency and (b) TOC removal efficiency.


### 3.6. Modelling of RSM Using BBD and Statistical Analysis

In the BBD design, three variables (pH, dosage, and contact time) were given as inputs. COD and TOC removal efficiencies were given as a response for analyzing the experimental data in design expert software. The generated runs and their experimental outputs are given in Table2. The results of analysis of variance (ANOVA) are given in Table 6. It predicts the reliability of the applied design and correlation between various variables and their significance. A p value shows the significance of the results if it is less than 0.05. A higher p value shows that the data is insignificant to predict the behavior of variables. It can be seen in Table 6 that the overall model was significant for the removal of COD and TOC using biochar. The model F-values of 10.87 and 44.12 for COD and TOC removal efficiencies, respectively, implied that the model was significant, and there were only 3.74% and 0.50% chances that an F-value this large could occur due to noise. Adequate precision measures the signal to noise ratio. A ratio greater than 4 is desirable. Here, the ratio of 11.51 and 25.046 indicated an adequate signal and indicated that the model could be used to navigate the design space. The terms A, B, C, AB, AC, BC, and A2 were significant model terms. The results of COD and TOC were fitted by a quadratic equation given in Equations (7) and (8), respectively:
(7)COD=+62.92+8.28A+5.43B+8.86C−0.00450AB−3.41AC−4.60BC−11.01A2+7.17B2+2.09C2.(8)TOC=+92.19+1.24A+0.84B+1.79C−1.15AB−1.98AC+1.35BC−5.74A2+0.9488B2+1.27C2.Table 6
ANOVA for removal efficiencies using RSM.
(a)
COD removal efficiency
SourceSum of squaresdfMean squareF-valuep valueModel2248.6859249.853910.870230.037405SignificantA-pH548.63281548.632823.869020.016399B-dosage235.98781235.987810.266970.049173C-contact time627.64251627.642527.306440.013633AB0.008110.00810.0003520.020142AC46.58063146.580632.0265540.024975BC84.73203184.732033.6863830.015064A2276.94871276.948712.049030.040312B2117.5881117.5885.1158270.108743C29.98422919.9842290.4343780.556921Residual68.95543322.98514Cor Total2317.6412(b)
TOC removal efficiency
SourceSum of squaresdfMean squareF-valuep valueModel202.2155922.4683944.118380.004961SignificantA-pH12.37531112.3753124.299860.016003B-dosage5.644815.644811.083990.044744C-contact time25.52551125.5255150.121280.005796AB5.2915.2910.387320.048476AC15.72123115.7212330.869810.0115BC7.2917.2914.314470.032367A275.276175.276147.81010.001198B22.05743212.0574324.0399240.137989C23.69388913.6938897.2532310.074214Residual1.52782530.509275Cor Total203.743312In terms of coded factors, Equations (7) and (8) can be used to predict responses for various ranges of each factor.The three-dimensional surface plots of variables and their interaction are shown in Figure7. Figure 7(a) shows that higher removal of COD can be achieved at higher values of dosages and pH within the selected range of parameters. Whereas for TOC adsorption, the removal efficiency decreased after pH 7 (Figure 7(d)). A similar trend has been observed in Figures 7(b) and 7(e) that higher contact times and higher pH was suitable to achieve the maximum removal of COD whereas TOC removal was maximum at middle points of the data range. The interaction plots of dosage and contact time (Figures 7(c) and 7(f)) suggested that higher dosage and contact time were suitable for the maximum removal of COD and TOC onto TWBC.Figure 7
Surface plots for COD and TOC removal efficiencies using RSM (a) pH~dosage~COD removal efficiency (b) pH~contact time~COD removal efficiency (c) dosage~contact time~COD removal efficiency (d) pH~dosage~TOC removal efficiency (b) pH~contact time~TOC removal efficiency (c) dosage~contact time~TOC removal efficiency.
(a)(b)(c)(d)(e)(f)The correlation between COD and TOC removal efficiencies predicted and real values using RSM was quite strong. TheR2 values of the COD and TOC correlation plots were 0.999 and 0.999, respectively. Figures 8(a) and 8(b) represent the correlation plots of predicted and actual data whereas normal plots of residuals are represented in Figures 8(c) and 8(d). It showed that the model could be used satisfactorily for the prediction and optimization of the actual data set.Figure 8
RSM model predicted vs actual data plots and normal residual plots. (a) Predicted and experimental values for COD removal efficiency. (b) Predicted and experimental values for TOC removal efficiency. (c) Normal percentage probability with respect to standardized residuals for COD removal efficiency. (d) Normal percentage probability with respect to standardized residuals for COD removal efficiency.
(a)(b)(c)(d)


### 3.7. Optimization of Adsorption Process Using Trained ANN, ANFIS, and RSM

For optimizing process parameters, the GA approach was combined with the ANN model to maximize COD and TOC removal efficiency. The optimum conditions for the COD and TOC removal process were as follows: 6.5 pH, 298.5 mg/L dosage of biochar, and 60 min contact time. The relationship between removal efficiency and iteration showed that the removal efficiency achieved the maximal value after 121 iterations and remained constant. The COD and TOC removal performance obtained under optimum conditions was 89.80% and 98.9%. The values were confirmed in the lab and obtained as89.3±3% and 97.95±3%.For the prediction of adsorption data through ANFIS, surface plots were generated. Optimized value was obtained at pH value of 7, the dosage of 300 mg/L, and contact time 60 mins. The removal achieved at the optimized parameters was 88.9% and 98.8% for COD and TOC, respectively. The experimental value for the found variables was89.3±3% and 97.95±1.5%. It shows that the model well predicted the optimized value.Optimal conditions using RSM were found after the model was completely analyzed. Optimized values were obtained at pH 6.5, dosage 300 mg/L, and contact time 60 min, with COD and TOC elimination of maximum as 89.859% and 98.390%, respectively. The viability of the model and the existence of ideal conditions were confirmed by a strong agreement between the experimental COD (89.87±2%) and the predicted COD (89.859%) performance. The model predicted value was also confirmed for TOC removal efficiency as 96.87±3% (experimental) and 98.390% (predicted) values.The RSM-GA optimization was performed using Equations (7) and (8) as an objective function in GA using MATLAB. GA quickly trained and found the optimum values as pH of 6.6, TWBC dosage as 300 mg/L, and contact time of 60 min with removal efficiencies of COD and TOC as 89.86% and 97.2%, respectively.


### 3.8. Comparison of ANN, ANFIS, and RSM for Prediction of COD and TOC Adsorption Data

All three models applied for the adsorption data were well trained for COD and TOC removal efficiencies using pH, the dosage of TWBC, and contact time as input variables and COD and TOC as output variables. All models well fitted the adsorption data and were further applied for the prediction of experimental data. It was observed that the model’s predicted values were near to the experimental data (Table7). Further performance of the models was analyzed using Equations (4)–(6) for error analysis of predicted data. The analysis is given in Table 7. Analysis showed that RSM, ANN, and ANFIS had error values of 2.301, 1.2249, and 0.49157 for SSE and 5.29809, 1.49937, and 0.24164 for MSE, respectively, for the adsorption of COD onto biochar. For prediction of TOC adsorption using three models, the error values were as follows: 0.34243, 0.32001, and 0.29576 for SSE and 0.11726, 0.10241, and 0.08747 for MSE. The run time of ANFIS was only 100 seconds for 100 epochs whereas ANN took 120 seconds for 100 epochs. ANFIS proved to be a highly efficient tool in MATLAB for the modeling and prediction and optimization of adsorption data. The error analysis and coefficient of determination of three models determined that ANFIS>ANN>RSM in performance for the prediction of COD and TOC adsorption on the biochar. Whereas for the optimization of adsorption data, ANN and ANFIS performed better as there were no specific limits for the input and output variables like RSM. Also, for both AI methods, no specific design of experiments was needed. It helped the models to analyze the correlation between inputs and outputs in a broader range. Enhanced efficiency of RSM may be obtained using larger data points. However, AI methods are innovative and include a variety of parameters to understand the nonlinear adsorption data.Table 7
Experimental and predicted results of COD and TOC adsorption using RSM, ANN, and ANFIS and statistical analysis of predicted results.
Sr. no.COD removal efficiencyTOC removal efficiency(%)(%)pHDosage (mg/L)Contact time (min)ActualPredicted RSMPredicted ANNPredicted ANFISActualPredicted RSMPredicted ANNPredicted ANFIS110162.56030.633.4530.69430.683.182.7183.19283.123162.56075.273.3676.93775.391.592.1188.58991.536.5256058.956.8461.51158.989.389.1687.38689.346.53006089.989.8689.26090.296.998.3996.06196.856.5162.53570.567.7370.54670.688.388.7788.34088.3610253583.081.8783.0028398.398.3998.33198.476.5251068.872.8468.77068.888.788.3388.72888.883162.51052.153.2952.20652.193.193.1393.14693.193253560.961.8960.9366188.788.9588.78388.81010162.51078.380.2178.46978.394.694.0195.313941133003555.857.9955.83255.990.090.2590.04389.412103003562.962.9262.89362.992.192.1992.18393.2136.53001057.156.1957.15757.1288.388.1588.34288.3R20.9690.99200.99860.99240.99320.9943SSE2.30171.22440.49150.34240.32000.2957MSE5.29801.49930.24160.11720.10240.0874


## 3.1. Characteristics of BC

The SEM-EDX images of TWBC are presented in Figure3. Figures 3(a) and 3(b) showed that TWBC had many open pores available for adsorption of COD and TOC. The activating agent (phosphoric acid) seems to create an etched texture, as well as volatile matter decomposition [41]. The AC surfaces are uneven due to the etching, with significant porosity and roughness, indicating a desirable textural property of AC [42]. The mesopores available at the surface seem to cause capillary condensation as well as transferring adsorptive into the micropores, hence increasing the AC’s adsorption capacity. The elemental composition in Figure 3(c) showed that TWBC had 80.8% of carbon and 16.2% oxygen content. The high carbon content showed good carbonization of TWBC. Small impurities of Ca and K were also observed in the TWBC.Figure 3
SEM-EDX images.
(a)(b)(c)(d)(e)(f)(g)(h)


## 3.2. Characterization of PW

The concentration of COD in the PW was about 1400 mg/L, which was much higher than the safe discharge limit of COD in effluents reported as 150 mg/L. The initial concentration of TOC in PW was 433.9 mg/L. It was also higher than the safe discharge limit of TOC in effluents, e.g., 30 mg/L. The COD>TOC indicated that the PW sample contained a substantial amount of chemically oxidizable organic and inorganic molecules. Oil and grease content can be found to attribute to the higher COD and TOC in PW, followed by suspended solids, organic acids, aromatic compounds, carbonyl compounds, anions, phenols, and metals [43].


## 3.3. Experimental Results

The experimental results of removal efficiencies for COD and TOC are presented in Table2. A total of 13 batch experiments were conducted, and 26 data points were obtained. The results were used for the modeling of ANN, ANFIS, and RSM models.Table 2
Experimental design matrix using the RSM technique with the experimental values for COD and TOC removal efficiency.
Run orderpHDosageContact timeCOD removal efficiencyTOC removal efficiency(mg/L)(min)(%)(%)110162.56030.61±383.13±323162.56075.27±391.52±336.5256058.94±389.34±346.53006089.87±396.87±356.5162.53570.57±388.35±3610253583.04±398.39±376.5251068.83±188.75±383162.51052.12±393.13±393253560.96±388.78±31010162.51078.3±394.6±31133003555.89±390.07±312103003562.92±392.19±3136.53001057.12±288.32±3136.53001057.12±288.32±3


## 3.4. Modelling and Training of ANN

The neural network tool (nntool) was used in MATLAB R2021a for training of the ANN model. Among 26 data points collected from batch experiments, 18 points were selected for the training purpose and the remaining points were used for the testing and validation of the model.12 no. of neurons, LMBP algorithm with trainlm training function, and tan sigmoid (tansig) transfer function were found most suitable to fit the experimental data. The no. of neurons and algorithm were selected based on the best performance measured as minimum MSE and highest regression analysis coefficient (R2) as shown in Table 3.Table 3
Performance evaluation of ANN based on number of neurons and algorithms.
ParametersMSER2No. of neurons10.010.78920.0040.87230.0060.84240.0080.81250.00020.99860.00090.89170.00050.99780.00060.99490.00080.991100.00010.999AlgorithmCascade-forward backpropagation (CFBP)0.40.7Levenberg-Marquardt backpropagation (LMBP)0.00010.99Bayesian regularization (BR)0.040.85Scaled conjugate gradient (SCG)0.0010.91After the selection of ANN architecture parameters, the model was applied for experimental data prediction. The trained model had a correlation coefficient of 0.985 with the experimental data as shown in Figure4. The MSE value was 0.0001 which showed that the model had a minimum error and was significant. For the validation of the model, the remaining 15% points were tested and removal efficiency was found out, which had an R-value of 0.999. It showed that the model was well trained and could be used effectively for the prediction of COD and TOC adsorption on biochar. The model was further applied for the 15% data set for the prediction of COD and TOC adsorption, and an R-value of 1 was obtained for the predicted data. The overall efficiency of ANN model was 0.989 (Figure 4).Figure 4
Training of ANN model.The weights and biases of the trained ANN model at 12 neurons and LMBP algorithm are given in Table4. wi,j represents the weights from the input layer to hidden layer, wj,k represents the weights from hidden layer to the output layer, bj represents the biases added at hidden layer, and bk represents the biases added at the output layer of ANN model.Table 4
Weights and biases for ANN model.
Weights from input 1 to hidden layerwi,jWeights from input 2 to hidden layerwi,jWeights from input 3 to hidden layerwi,jWeights from hidden layer to output 1wj,kWeights from hidden layer to output 2wj,kBiases for hidden layerbjBiases for output layerbkw1,1=−1.157w1,2=−1.8344w1,3=0.72447w1,4=0.74183w1,5=−2.8229w1,6=2.3265w1,7=1.5054w1,8=0.65708w1,9=−2.4848w1,10=3.1325w1,11=3.5646w1,12=2.0214w2,1=2.0135w2,1=1.4641w2,1=1.0304w2,1=−3.2745w2,1=−0.6843w2,1=−1.6772w2,1=−2.3961w2,1=2.5639w2,1=−1.169w2,1=−0.5409w2,1=−1.3943w2,1=−0.1438w3,1=0.9782w3,1=−2.2931w3,1=2.8132w31=−0.0515w3,1=1.5581w31=−1.1571w3,1=−0.7552w3,1=−2.1007w3,1=−1.1492w3,1=0.4161w31=−0.0107w3,1=2.2269w1,1=1.5125w2,1=0.24355w3,1=0.98934w4,1=1.2401w5,1=−0.01233w6,1=−0.57107w7,1=−0.58306w8,1=0.46212w9,1=−0.9444w10,1=1.0595w11,1=−0.2883w12,1=0.5544w1,2=−0.6018w2,2=0.5023w3,2=0.6861w4,2=0.6152w5,2=0.7447w6,2=0.2616w7,2=−0.8805w8,2=0.1041w9,2=−0.6083w10,2=0.8042w11,2=0.2258w12,2=0.15603.75382.5117-2.9508-1.34290.67837-0.06931.260.51291-2.16022.24431.91932.8432-1.43410.042027


## 3.5. Modelling and Training of ANFIS

Sugeno-type subclustering FIS was generated for three inputs (26 data points) and two outputs (COD and TOC removal efficiency). 70% data was used for the training of the model. Membership functions were taken as 13 in numbers for each input variable and guassmf type. The range of influence was tested from 0 to 1 value. A minimum error was obtained at the value of 0.00001. Whereas, squash factor, accept ratio, and rejection ratio were 1.25, 0.5, and 0.15, respectively. The backpropagation method was taken as the optimization method due to the minimum RMSE of training data as compared to the backpropagation method. The optimized schematic diagram of ANFIS generated is shown in Figure5.Figure 5
Schematic diagram of optimized ANFIS.A total of 1000 no. of epochs were taken, and the model was trained several times for each output. The ANFIS training parameters were as follows: (i)numberofnodes=110; (ii) numberoflinearparameters=52; (iii) numberofnonlinearparameters=78; (iv) totalnumberofparameters=130; (v) number of training data pairs: 13; (vi) number of checking data pairs: 6; and (vii) numberoffuzzyrules=13. The model was well trained after 10000 epochs for COD and 5000 epochs for TOC output. The minimum MSEs obtained for COD and TOC are given in Table 5. The model was tested and checked for the remaining 30% of experimental data.Table 5
Modeling performance of ANFIS.
OutputTraining MSETesting MSEChecking MSECOD0.36260.494140.00000001TOC0.332810.691480.00001Minimum MSE was obtained for both COD and TOC removal efficiencies after repeated training (Figure6). It showed that model was well trained and could be used for prediction or optimization of adsorption data. The performance of the model was better in understanding the behavior of TOC removal as compared to COD removal. The reason can be low variance in TOC data as compared to COD.Figure 6
Modeling results using ANFIS for (a) CD removal efficiency and (b) TOC removal efficiency.


## 3.6. Modelling of RSM Using BBD and Statistical Analysis

In the BBD design, three variables (pH, dosage, and contact time) were given as inputs. COD and TOC removal efficiencies were given as a response for analyzing the experimental data in design expert software. The generated runs and their experimental outputs are given in Table2. The results of analysis of variance (ANOVA) are given in Table 6. It predicts the reliability of the applied design and correlation between various variables and their significance. A p value shows the significance of the results if it is less than 0.05. A higher p value shows that the data is insignificant to predict the behavior of variables. It can be seen in Table 6 that the overall model was significant for the removal of COD and TOC using biochar. The model F-values of 10.87 and 44.12 for COD and TOC removal efficiencies, respectively, implied that the model was significant, and there were only 3.74% and 0.50% chances that an F-value this large could occur due to noise. Adequate precision measures the signal to noise ratio. A ratio greater than 4 is desirable. Here, the ratio of 11.51 and 25.046 indicated an adequate signal and indicated that the model could be used to navigate the design space. The terms A, B, C, AB, AC, BC, and A2 were significant model terms. The results of COD and TOC were fitted by a quadratic equation given in Equations (7) and (8), respectively:
(7)COD=+62.92+8.28A+5.43B+8.86C−0.00450AB−3.41AC−4.60BC−11.01A2+7.17B2+2.09C2.(8)TOC=+92.19+1.24A+0.84B+1.79C−1.15AB−1.98AC+1.35BC−5.74A2+0.9488B2+1.27C2.Table 6
ANOVA for removal efficiencies using RSM.
(a)
COD removal efficiency
SourceSum of squaresdfMean squareF-valuep valueModel2248.6859249.853910.870230.037405SignificantA-pH548.63281548.632823.869020.016399B-dosage235.98781235.987810.266970.049173C-contact time627.64251627.642527.306440.013633AB0.008110.00810.0003520.020142AC46.58063146.580632.0265540.024975BC84.73203184.732033.6863830.015064A2276.94871276.948712.049030.040312B2117.5881117.5885.1158270.108743C29.98422919.9842290.4343780.556921Residual68.95543322.98514Cor Total2317.6412(b)
TOC removal efficiency
SourceSum of squaresdfMean squareF-valuep valueModel202.2155922.4683944.118380.004961SignificantA-pH12.37531112.3753124.299860.016003B-dosage5.644815.644811.083990.044744C-contact time25.52551125.5255150.121280.005796AB5.2915.2910.387320.048476AC15.72123115.7212330.869810.0115BC7.2917.2914.314470.032367A275.276175.276147.81010.001198B22.05743212.0574324.0399240.137989C23.69388913.6938897.2532310.074214Residual1.52782530.509275Cor Total203.743312In terms of coded factors, Equations (7) and (8) can be used to predict responses for various ranges of each factor.The three-dimensional surface plots of variables and their interaction are shown in Figure7. Figure 7(a) shows that higher removal of COD can be achieved at higher values of dosages and pH within the selected range of parameters. Whereas for TOC adsorption, the removal efficiency decreased after pH 7 (Figure 7(d)). A similar trend has been observed in Figures 7(b) and 7(e) that higher contact times and higher pH was suitable to achieve the maximum removal of COD whereas TOC removal was maximum at middle points of the data range. The interaction plots of dosage and contact time (Figures 7(c) and 7(f)) suggested that higher dosage and contact time were suitable for the maximum removal of COD and TOC onto TWBC.Figure 7
Surface plots for COD and TOC removal efficiencies using RSM (a) pH~dosage~COD removal efficiency (b) pH~contact time~COD removal efficiency (c) dosage~contact time~COD removal efficiency (d) pH~dosage~TOC removal efficiency (b) pH~contact time~TOC removal efficiency (c) dosage~contact time~TOC removal efficiency.
(a)(b)(c)(d)(e)(f)The correlation between COD and TOC removal efficiencies predicted and real values using RSM was quite strong. TheR2 values of the COD and TOC correlation plots were 0.999 and 0.999, respectively. Figures 8(a) and 8(b) represent the correlation plots of predicted and actual data whereas normal plots of residuals are represented in Figures 8(c) and 8(d). It showed that the model could be used satisfactorily for the prediction and optimization of the actual data set.Figure 8
RSM model predicted vs actual data plots and normal residual plots. (a) Predicted and experimental values for COD removal efficiency. (b) Predicted and experimental values for TOC removal efficiency. (c) Normal percentage probability with respect to standardized residuals for COD removal efficiency. (d) Normal percentage probability with respect to standardized residuals for COD removal efficiency.
(a)(b)(c)(d)


## 3.7. Optimization of Adsorption Process Using Trained ANN, ANFIS, and RSM

For optimizing process parameters, the GA approach was combined with the ANN model to maximize COD and TOC removal efficiency. The optimum conditions for the COD and TOC removal process were as follows: 6.5 pH, 298.5 mg/L dosage of biochar, and 60 min contact time. The relationship between removal efficiency and iteration showed that the removal efficiency achieved the maximal value after 121 iterations and remained constant. The COD and TOC removal performance obtained under optimum conditions was 89.80% and 98.9%. The values were confirmed in the lab and obtained as89.3±3% and 97.95±3%.For the prediction of adsorption data through ANFIS, surface plots were generated. Optimized value was obtained at pH value of 7, the dosage of 300 mg/L, and contact time 60 mins. The removal achieved at the optimized parameters was 88.9% and 98.8% for COD and TOC, respectively. The experimental value for the found variables was89.3±3% and 97.95±1.5%. It shows that the model well predicted the optimized value.Optimal conditions using RSM were found after the model was completely analyzed. Optimized values were obtained at pH 6.5, dosage 300 mg/L, and contact time 60 min, with COD and TOC elimination of maximum as 89.859% and 98.390%, respectively. The viability of the model and the existence of ideal conditions were confirmed by a strong agreement between the experimental COD (89.87±2%) and the predicted COD (89.859%) performance. The model predicted value was also confirmed for TOC removal efficiency as 96.87±3% (experimental) and 98.390% (predicted) values.The RSM-GA optimization was performed using Equations (7) and (8) as an objective function in GA using MATLAB. GA quickly trained and found the optimum values as pH of 6.6, TWBC dosage as 300 mg/L, and contact time of 60 min with removal efficiencies of COD and TOC as 89.86% and 97.2%, respectively.


## 3.8. Comparison of ANN, ANFIS, and RSM for Prediction of COD and TOC Adsorption Data

All three models applied for the adsorption data were well trained for COD and TOC removal efficiencies using pH, the dosage of TWBC, and contact time as input variables and COD and TOC as output variables. All models well fitted the adsorption data and were further applied for the prediction of experimental data. It was observed that the model’s predicted values were near to the experimental data (Table7). Further performance of the models was analyzed using Equations (4)–(6) for error analysis of predicted data. The analysis is given in Table 7. Analysis showed that RSM, ANN, and ANFIS had error values of 2.301, 1.2249, and 0.49157 for SSE and 5.29809, 1.49937, and 0.24164 for MSE, respectively, for the adsorption of COD onto biochar. For prediction of TOC adsorption using three models, the error values were as follows: 0.34243, 0.32001, and 0.29576 for SSE and 0.11726, 0.10241, and 0.08747 for MSE. The run time of ANFIS was only 100 seconds for 100 epochs whereas ANN took 120 seconds for 100 epochs. ANFIS proved to be a highly efficient tool in MATLAB for the modeling and prediction and optimization of adsorption data. The error analysis and coefficient of determination of three models determined that ANFIS>ANN>RSM in performance for the prediction of COD and TOC adsorption on the biochar. Whereas for the optimization of adsorption data, ANN and ANFIS performed better as there were no specific limits for the input and output variables like RSM. Also, for both AI methods, no specific design of experiments was needed. It helped the models to analyze the correlation between inputs and outputs in a broader range. Enhanced efficiency of RSM may be obtained using larger data points. However, AI methods are innovative and include a variety of parameters to understand the nonlinear adsorption data.Table 7
Experimental and predicted results of COD and TOC adsorption using RSM, ANN, and ANFIS and statistical analysis of predicted results.
Sr. no.COD removal efficiencyTOC removal efficiency(%)(%)pHDosage (mg/L)Contact time (min)ActualPredicted RSMPredicted ANNPredicted ANFISActualPredicted RSMPredicted ANNPredicted ANFIS110162.56030.633.4530.69430.683.182.7183.19283.123162.56075.273.3676.93775.391.592.1188.58991.536.5256058.956.8461.51158.989.389.1687.38689.346.53006089.989.8689.26090.296.998.3996.06196.856.5162.53570.567.7370.54670.688.388.7788.34088.3610253583.081.8783.0028398.398.3998.33198.476.5251068.872.8468.77068.888.788.3388.72888.883162.51052.153.2952.20652.193.193.1393.14693.193253560.961.8960.9366188.788.9588.78388.81010162.51078.380.2178.46978.394.694.0195.313941133003555.857.9955.83255.990.090.2590.04389.412103003562.962.9262.89362.992.192.1992.18393.2136.53001057.156.1957.15757.1288.388.1588.34288.3R20.9690.99200.99860.99240.99320.9943SSE2.30171.22440.49150.34240.32000.2957MSE5.29801.49930.24160.11720.10240.0874


## 4. Conclusions

To obtain the optimized results for COD and TOC adsorption using ANFIS, surface plots were generated. The BC was used in this study to model and optimize the adsorption process using computational techniques. COD and TOC removal efficiencies were taken as the representation of reduction in organic pollutants in the wastewater. Batch tests were performed using pH, dosage, and contact time as input variables. The experimental results were modeled and optimized using RSM, ANN, and ANFIS models. BBD was used for the RSM model, and ANOVA was used to predict the model significance. ANN model was modeled using 3 layered, feed-forward Levenberg-Marquardt backpropagation (LMBP) algorithm and 12 no. of neurons. ANFIS was generated of Sugeno type using subclustering FIS type. The experimental data was successfully optimized using the three models. For optimization of adsorption data, ANN and RSM models were hybridized with GA. Optimized values were well matched with the experimental results. ANFIS showed minimum run time and highest performance as compared to other models. Error analysis and coefficient of determination of three models determine the ANFIS>ANN>RSM in performance for the prediction of COD and TOC adsorption onto the biochar. However, AI methods predicted the optimized values at a broader range of input data which was not possible with RSM. No specific design of experiments was needed for AI methods and once trained can be used for prediction at any range of data. Hence, it can be stated that the AI methods can be used more effectively for the automation of the COD and TOC adsorption process for wastewater treatment.



---

*Source: 7874826-2022-04-27.xml*