## 2 Materials and Methods
### Mathematical Model Development  
The experimental design was created using Design-Expert software, which was used for mathematical modelling to determine the optimal conditions for carrying out the EC process. The pH, \(T\), and \(c\) of TY were monitored during all EC processes. Their final values and the initial conditions of each experiment are presented in Table 5.  
Figure 7: FTIR of **(a)** Tartrazine Yellow dye and **(b)** sludge after the electrocoagulation process for RUN 12 (\(i\) = 0.024 A cm\({}^{-2}\); pH = 3.0). Using the Design-Expert software [84; 85; 86; 87; 88], the relationship between the input parameters and the output values was represented by three different empirical models, enabling the evaluation of the correlation between responses and experimental parameters. The first response analysed was the change in electrolyte \(T\), where the minimum value was 23.4 \({}^{\circ}\)C, the maximum value was 50.9 \({}^{\circ}\)C, the mean value was 34.1 \({}^{\circ}\)C, and the standard deviation was 9.41 \({}^{\circ}\)C. The second response was the change in electrolyte pH, where the minimum value was 5.415, the maximum was 8.746, the mean was 8.01, and the standard deviation was 0.9995. The third response analysed was the change in final TY \(c\), with a maximum value of 0.0367 mmol L\({}^{-1}\), a minimum of 0.0003 mmol L\({}^{-1}\), a mean of 0.0133 mmol L\({}^{-1}\), and a standard deviation of 0.0111 mmol L\({}^{-1}\). Based on the results obtained and the recommendations of Design-Expert software, the final values of the model were presented as coded factors as follows:  
\[ \begin{split}\text{T}=+34.58-0.9280\times\text{A}+5.77\times\text {B}-7.67\times\text{C}[1]-0.9070\times\text{C}[2]+0.9045\times\text{AB}+0.5897 \times\text{AC}[1]\\ +1.26\times\text{AC}[2]-3.47\times\text{BC}[1]+0.9552\times\text{BC}[2 ]\end{split}  \tag{8}\]  
\[ \begin{split}\text{pH}=+7.98+0.7864\times\text{A}+0.3638\times \text{B}-0.2084\times\text{C}[1]-0.1012\times\text{C}[2]-0.5337\times\text{AB}+0. 3629\times\text{AC}[1]\\ +0.0696\times\text{AC}[2]+0.0740\times\text{BC}[1]+0.2685\times \text{BC}[2]\end{split}  \tag{9}\] \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Experiment**} & \multicolumn{3}{c}{**Input Parameters**} & \multicolumn{3}{c}{**Output Parameters**} \\ \cline{2-9}  & **A** & **B** & **C** & **t (min)** & **\(i\) (A cm\({}^{-2}\))** & **pH** & **\(T\) (\({}^{\circ}\)C)** & **\(c\) (mmol L\({}^{-1}\))** & **R (\%)** \\ \hline RUN 1 & 7.0 & 32 & 0.008 & 8.48 & 27.5 & 0.0126 & 74.8 \\ \hline RUN 2 & 5.0 & 41 & 0.016 & 8.64 & 38.9 & 0.0030 & 94.0 \\ \hline RUN 3 & 7.0 & 10 & 0.016 & 8.58 & 27.1 & 0.0257 & 48.6 \\ \hline RUN 4 & 7.0 & 50 & 0.016 & 8.49 & 41.6 & 0.0014 & 97.2 \\ \hline RUN 5 & 7.0 & 50 & 0.024 & 8.17 & 50.0 & 0.0012 & 97.6 \\ \hline RUN 6 & 5.0 & 19 & 0.016 & 8.36 & 24.8 & 0.0097 & 80.6 \\ \hline RUN 7 & 5.7 & 50 & 0.008 & 8.56 & 28.5 & 0.0071 & 85.8 \\ \hline RUN 8 & 4.8 & 50 & 0.024 & 8.25 & 50.9 & 0.0009 & 98.2 \\ \hline RUN 9 & 5.7 & 10 & 0.024 & 8.51 & 32.1 & 0.0188 & 62.4 \\ \hline RUN 10 & 5.7 & 10 & 0.024 & 8.61 & 35.0 & 0.0192 & 61.6 \\ \hline RUN 11 & 3.0 & 23 & 0.008 & 5.805 & 27.3 & 0.0213 & 57.4 \\ \hline RUN 12 & 3.0 & 37 & 0.024 & 8.563 & 48.5 & 0.0004 & 99.2 \\ \hline RUN 13 & 3.0 & 23 & 0.008 & 6.14 & 26.8 & 0.0204 & 59.2 \\ \hline RUN 14 & 5.7 & 50 & 0.008 & 8.72 & 29.8 & 0.0114 & 77.2 \\ \hline RUN 15 & 3.0 & 10 & 0.016 & 5.41 & 29.3 & 0.0245 & 51.0 \\ \hline RUN 16 & 7.0 & 10 & 0.008 & 8.75 & 23.4 & 0.0367 & 26.6 \\ \hline RUN 17 & 7.0 & 10 & 0.016 & 8.40 & 27.6 & 0.0265 & 47.0 \\ \hline RUN 18 & 4.7 & 10 & 0.008 & 8.00 & 24.1 & 0.0230 & 54.0 \\ \hline RUN 19 & 3.0 & 50 & 0.016 & 8.00 & 39.3 & 0.0013 & 97.4 \\ \hline RUN 20 & 3.0 & 37 & 0.024 & 7.74 & 49.0 & 0.0003 & 99.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Initial and final values of the selected variables during the EC process to remove the TY dye (initial concentration 0.05 mmol L\({}^{-1}\)).