Introduction

The widespread detection of antibiotics in aquatic systems has generated great concern from environmentalists due to their potential to cause adverse effects on the ecosystem. Trimethoprim (TMP) is a derivative of the trimethoxybenzylpyrimidine group used for the broad-spectrum treatment of bacterial infections [1]. Approximately 80% of TMP is released to wastewater treatment bodies in its pharmacologically active form, thus posing a threat to aquatic ecosystems [1, 2]. Conventional wastewater treatment plants are ineffective in eliminating these antibiotics. This antibiotic can only be partially metabolized in the human body, is chemically stable in water matrices, and has antibacterial properties that hinder its elimination by biological/chemical systems [3, 4]. There is an urgent need for the development of effective treatment techniques.

Heterogenous photocatalysis is a promising advanced oxidation process capable of mineralizing emerging pollutants using visible light at mild temperature, pressure, and pH [5]. The reaction involves a solid semiconductor material that is excited by light photons, which generates electron/hole pairs that diffuse to the surface. Photogenerated electrons are scavenged by O2− to generate superoxide radicals. Furthermore, the holes generated can directly oxidize water to produce •OH radicals, which directly attack and mineralize organic molecules [6]. Common semiconductors used include; metal oxides (TiO2, CeO2, ZnO, Cu2O, In2O3, BiVO4, WO3), metal sulfides (ZnS, CuS, MoS2), metal ferrites (Fe3O4, ZnFe2O4, CoFe2O4, CuFe2O4) and carbonaceous materials [7]. Among the metal semiconductors, TiO2 is the most popular in photocatalytic applications due to its outstanding photocatalytic properties [8]. However, since most photocatalysts are metal oxides, there is an attempt to reduce the metal content in photocatalysts to reduce the potential risk of heavy metal pollution. Hence, non-metal semiconductors are increasingly explored.

Graphite carbon nitride (g-C3N4) is one of the potential photocatalysts due to its favorable properties such as a moderate band gap energy, sensitivity to visible light up to 460 nm, and a suitable conduction and valence band for oxidation. Besides, it is a metal-free n-type semiconductor [9]. The band gap energy of graphite carbon nitride is 2.7 eV, and the energy location of its conduction and valence band is − 1.1 and + 1.6 eV [10]. Furthermore, it has the dual advantage of eliminating pollutants through a synergistic mechanism of adsorption and photocatalysis. Due to these desirable properties, g-C3N4 is a promising green photocatalyst. Nevertheless, previous studies using g-C3N4 for pollutant degradation have obtained unsatisfactory results due to limited optical response to visible light and poor photogenerated charge separation due to rapid recombination [11]. One potential method of improving the photocatalytic activity of g-C3N4 is by constructing a heterojunction with a photocatalyst such as zinc ferrite.

ZnFe2O4 is a p-type semiconductor that belongs to the spinel ferrite family and has widely been investigated in visible light degradation of emerging pollutants [12, 13]. Its narrow bandgap of ~ 1.9 eV ensures that it can utilize a broad spectrum of solar irradiation. Furthermore, the Fe3+ in its structure reacts with peroxide in a Fenton-like process to yield hydroxyl radicals that decompose organic molecules [11, 12]. However, bare ZnFe2O4 still suffers from fast recombination of photogenerated charge and photo-corrosion effects in the presence of light, which decreases its photocatalytic performance [14]. Therefore, coupling an n-type semiconductor such as g-C3N4 with a p-type ZnFe2O4 effectively addresses the weaknesses faced by each photocatalyst. The combined photocatalysts form a composite type-II heterojunction semiconductor with decreased charge recombination, extended visible light absorption, and enhanced photocatalytic activity [15, 16]. Solar energy is widely available in nature with a feasible potential of 60TW [17]. Solar radiation is available in approximately 5% UV-A (300–400 nm), 43% visible light (400–700 nm), and 52% infrared (700–2500 nm) [18]. The UV-A wavelength is the most effective since it can excite wide bandgap semiconductors (TiO2, ZnO, ZnS). However, emerging semiconductors can utilize wavelengths up to 600 nm [19]. Therefore, there is a need to test the synthesized photocatalyst under real solar light since zinc ferrite is active within this range.

Photosensitization is the approach of initiating photochemical reactions between light photons and dye molecules, which releases extra electrons that are injected to the photocatalyst [20]. Most dye sensitization studies focus on the photoelectric conversion in solar cells and water-splitting reactions to generate hydrogen [21]. However, few studies exist on dye sensitization of photocatalysts for pollutant degradation. Recently, dye sensitization has been used to improve the photocatalysts solar light harvesting property at long wavelengths, hence boosting pollutant degradation [22]. Common types of dyes used in photosensitization include erythrosine B, eosin Y, rhodamine B, indoline dyes, porphyrins and phthalocyanines, and inorganic metal dyes (Co, Fe, Au–Ag) [23]. Thus, in this study, the effect of Eosin Y-dye was explored.

Statistical modeling approach using response surface methodology (RSM) is increasingly adopted due to its multifunctional capabilities, such as design of experiments (DOE), studying the interaction between independent variables, estimating the objective function as well as predicting responses using multiple regression analyses [24, 25]. The influence of operating conditions on the responses can be determined by RSM, which also aids in optimizing processes. Moreover, RSM has been used to solve many optimization problems encountered in slurry/immobilized TiO2-based-photocatalytic systems [6]. For complicated systems, RSM methods combine mathematical and statistical techniques to design experiments involving multiple factors, using the lowest possible number of experimental runs while building robust models [26, 27]. Variants of RSM used in optimization include Box-Behnken design (BBD), central composite design (CCD), and Doehlert matrix (DM). The central composite design is a method of choice for many researchers optimizing photocatalytic systems since it can optimize multidimensional variables with an optimum number of runs [28].

This work used RSM to maximize the TMP degradation and TOC removal responses by varying three independent variables (TMP dose, pH, and catalyst dose). This is one of the few studies that have evaluated the interactions among these variables in optimizing the photodegradation process.

Material and methods

Materials

All reagents used in this study were of analytical grade and used without any further purification. Melamine powder (Sigma-Aldrich), deionized water, dilute ammonia solution, Iron (III) chloride hexahydrate (Sigma-Aldrich), Zinc (II) chloride dehydrate (RD HAEN), Eosin Y-dye (Kobian Chemicals), Ethanol, hydrogen peroxide (Kobian chemicals), trimethoprim (Universal Corporation), 0.2 M HCl (Kobian chemicals), and 0.2 M NaOH (Kobian chemicals).

Experimental design

The CCD was used to study the effect of three independent variables and the responses, trimethoprim degradation and TOC removal. The variables are pollutant dose (A), pH (B), and catalyst dose (C). Each factor had 5 levels, summarized in Table 1.

Table 1 Experimental levels and range of independent variables

TMP degradation and TOC Removal were the responses measured and used to generate separate regression equations. The mathematical relationship between the response (Y) and the selected process variables was fitted using a general second-order polynomial equation as follows [29].

$$Y = \beta_{o} + \sum\nolimits_{i = 1}^{3} {\beta_{i} X_{i} } + \sum\nolimits_{i = 1}^{3} {\beta_{i}^{2} X^{2}_{i} } + \sum\nolimits_{i = 1}^{3} {\sum\nolimits_{i = 1}^{3} {\beta_{{_{ij} }} {\rm X}_{i} } } {\rm X}_{j} + \varepsilon$$
(1)

Y = predicted response, \({\beta }_{o}\), \({\beta }_{i}\), \({\beta }_{i}^{2}\), \({\beta }_{ij}\) are the constant coefficients; Xi is the independent variables and \(\varepsilon\) the experimental error. These coefficients were determined from the regression model obtained from Design Expert software Version 11 and used to generate the predicted responses. Quadratic models are highly preferred to linear, 2FI, and cubic models since they exhibit high coefficient of determination, adjusted R2 and predicted R2, which results in robust models [30]. Statistical analysis was then carried out for the fitted models using ANOVA, residuals, p-value, F-value, and adequate precision.

Synthesis and characterization of Eosin-Y sensitized 25%ZnFe2O4-g-C3N4 photocatalyst

The Eosin-Y sensitized photocatalyst was synthesized using a three-step procedure involving step-wise calcination of melamine at 550 °C in a furnace (Carbolite Gero Furnace, ELF 11/14). This was followed by thermal and ultrasonic exfoliation of the resultant g-C3N4. The next step was hydrothermal/co-precipitation synthesis procedure of g-C3N4, Zinc chloride dehydrate, and iron (ii) hexahydrate to yield 25%ZnFe2O4/g-C3N4. The as-synthesized photocatalyst was then sensitized using Eosin Y-dye in a mixing/adsorption procedure. Detailed reaction steps and characterization of the composite can be found in our previous work [31].

Photocatalytic studies

The photocatalytic experiments were conducted in the sunny month of February–March 2023, from 9 am to 2 pm in Eldoret, Kenya. A self-fabricated solar parabolic trough reactor (PTR) was used as the photocatalytic setup shown in Fig. S11. Detailed equipment specifications and design of the PTR are outlined in Table S8 and Figs. S9 and S10. To ensure a uniform solar irradiance (900-1050W/m2), a solar radiometer was used to monitor the focal point of the reactor. The suggested design matrix table variables (trimethoprim dose, catalyst dose, and pH) were used to guide the data collection. The mixture was first stirred in the dark for 15 min to achieve the adsorption–desorption equilibrium. The mixture was then circulated at a constant flow rate of 1LPM around the PTR. After 90 min, a 5 ml sample of the circulating solution was drawn. The sample was then filtered using 0.22 µm syringe filters. The filtered sample was then measured to determine its UV absorbance at 272 nm (maximum absorbance for TMP) using a UV vis spectrophotometer (Shimadzu, UV-1800). Calibration curves drawn using DeBeers law were used to determine the concentration. The total organic carbon of the drawn sample was then determined using a TOC/TN analyzer (Multi N/C 2100, Analytica Jena).

The tetracycline degradation efficiency was calculated according to Eq. 2:

$$Degradation Efficiency\left( \% \right) = \left( {\frac{{C_{o} - C_{t} }}{{C_{o} }}} \right) \times 100$$
(2)

The mineralization efficiency was determined by the Eq. 3:

$$TOC removal \left( \% \right) = \left( {1 - \frac{{TOC_{t} }}{{TOC_{o} }}} \right) \times 100$$
(3)

Here TOCO= Initial TOC concentration, TOCt = Final TOC concentration, mg/l.

Results and discussion

Model fitting and statistical analyses for trimethoprim

Table S1 shows the three-factor CCD matrix table generated by Design Expert software. The experimental values and the corresponding predicted values for degradation and TOC removal are shown as the responses.

It was observed that the actual and predicted responses have negligible variation, which implies that both quadratic models are strong and can accurately predict the responses. The experimental data was fitted into statistical models developed by regression analyses. The models were used to generate the predicted responses shown in Table S1. The statistical models are quadratic and are expressed in terms of the coded factors (where A = TMP dose, B = pH, C = catalyst dose) for each response as shown by Eqs. 4 and 5:

$$\% \, Trimethoprim \, \deg radation \, \left( {Y_{1} } \right) \, = + 81.58 \, - \, 8.87 \times A \, + \, 0.2072 \times B \, + \, 3.83 \times C \, {-} \, 0.6025 \times AB \, {-} \, 1.25 \times AC \, {-} \, 16.22 \times BC \, {-} \, 0.3823 \times A^{2} {-} \, 9.38 \times B^{2} {-} \, 15.17 \times C^{2}$$
(4)
$$\% TOC \, {\text{Re}} moval\left( {Y_{2} } \right) = \, + 41.60 \, {-} \, 13.86 \times A \, + \, 5.66 \times B \, {-} \, 1.48 \times C \, {-} \, 4.58 \times AB \, + \, 9.60 \times AC \, {-} \, 8.40 \times BC \, {-} \, 6.22 \times A^{2} {-} \, 5.21 \times B^{2} {-} \, 1.93 \times C^{2}$$
(5)

For both models, all the negative coefficients (A, AB, BC, B2) indicate unfavorable effects of the parameter on degradation or TOC removal. However, the positive coefficients (B, C) indicate a positive interaction of the parameter on degradation or TOC removal. Similarly, parameters closer to zero indicate less influence on responses than the larger coefficients [32].

Analysis of variance

ANOVA was conducted to determine the significance of variables for degradation and TOC removal responses, shown in Tables S2 and S3. Each factor coefficient in both models was tested for significance using the Fisher value (F-value) and the probability value (p-value). In statistical terms, if a model has a large F-value > 1 and p-value < 0.05 indicates that the model is significant. However, when a model has a small F-value and p-value > 0.05, it indicates non-significance. Therefore, both models had large F-values at 77.14 and 13.30 for Y1 and Y2, respectively. Similarly, the p-values for the models were significantly less than 0.05, which implied the strong significance of the models. On the other hand, the lack of fit for both models was insignificant since p > 0.05, which suggested that the proposed models were significant and could fit the observed data [32, 33].

The coefficient of determination (R2) for models Y1 and Y2 is 0.99 and 0.96, respectively; this reveals that the models can explain 99.28% and 95.99% of the variability in response surface. Model Y1 shows a high degree of correlation between predicted and observed values since the predicted R2 = 0.91, which differs slightly from the Adj. R2 = 0.98 since the difference is below 0.2. Similarly, for model Y2, the predicted R2= 0.85 and Adj. R2 = 0.89 are in reasonable agreement. Hence, both models give a good prediction of trimethoprim degradation and TOC removal.

During variance analysis, evaluation of the normality of a dataset is crucial since it validates the assumptions made. The residuals should remain independent and have a normal distribution along the line of best fit with a constant variance, proving the adequacy of the chosen model [28]. The normal probability plot is shown in Fig. S1. It is evident that most data points are scattered along the line of best fit with some minor deviations. The linear scatter of residuals implies a homogenous error distribution, and the effect of random error due to experimental sequence is decreased [26].

Fig. S2 shows the plot of predicted vs actual values. It can be observed that a linear relationship exists between experimental and predicted values, with the majority of the data points lying along a straight line. This confirms the accuracy of the two models and signifies a minimal experimental error.

Effects of factor interaction and response surface plots

The relationship between TMP dose (A) and pH (B) in influencing the degradation is shown in Fig. 1.

Fig. 1
figure 1

a Response surface plot b contour plot for Trimethoprim dose and pH

The contour lines’ disc appearance indicates the low significance of parameter AB in affecting degradation. Similarly, it can also be observed that a narrow pH range (pH 5.5–7.2) at low pollutant dose yields the highest degradation (> 90%). However, a further increase or decrease in pH beyond the optimum range is accompanied by a rapid reduction in degradation. The high degradation observed within the narrow pH range could be due to the effect of pH on the catalyst’s surface charge and the ionization of the pollutant. TMP has a pKa value of approximately 7.1 [34]; hence, when pH < pKa, it exists as a cationic molecule. However, when pH > pKa, its dominant molecules have neutral charges [34]. On the other hand, ZnFe2O4/g-C3N4 composites have the points of zero charge (pzc) at pH 5.25–5.91, hence when pH > pHpzc, the photocatalyst surface is negatively charged [35, 36]. The highest degradation was observed at pH 6.5. At such conditions, both the photocatalyst and trimethoprim molecules possess opposite charges. This results in the increased attraction and adsorption of TMP molecules on the catalyst surface, hence the increased degradation [34]. However, when pH > pKa, both the catalyst surface and the molecules become negatively charged. This leads to strong repulsion between the catalyst and pollutant, hence a decrease in degradation observed at high pH values.

Fig. S3 shows the interaction between pH (B) and catalyst dose (C). The elliptical-shaped contour lines are evidence of significant interaction between factors BC in affecting degradation, which is confirmed by p-value (BC) < 0.05. From the RSM plot S3 (a), it is evident that an increase in the catalyst dosage increases degradation until the optimum range is exceeded, which declines steadily. Similarly, according to the contour graph S3(b), both pH and catalyst dose seem to influence degradation, with the highest degradation > 90% realized at pH 5.5–7.5 and a catalyst dosage of between 0.8 and 1.0 g/l. The decreased degradation at high catalyst loading could be attributed to increased solution turbidity, which hinders light penetration to the catalyst’s active surfaces [37].

The relationship between pollutant dose (A) and catalyst dose (C) is presented in Fig. S4. The results show that a decrease in the degradation efficiency accompanied a decrease in catalyst dosage. However, an inverse linear relationship existed between TMP dose and the degradation efficiency. Besides, from the contour graph S4 (b), it was observed that the highest degradation > 90% was obtained for a catalyst dosage of approximately 0.8–1.0 g/l and a pollutant concentration of 10 mg/l. The decrease in degradation at a low catalyst dose is due to a reduction in the number of surface-active sites available for degradation. On the other hand, high pollutant doses could have saturated the catalyst’s active sites, leading to decreased generation of radicals [26].

Response surface plots for TOC interpretation

The interaction between trimethoprim dose (A) and pH (B) in influencing TOC removal is presented in Fig. S5. The disc-shaped contour lines are an indicator of low interaction between the factors, which is confirmed by the p-value of AB (0.1403) > 0.05, as shown in Table S3 [38]. According to the RSM graph in Fig. S5a, an increase in trimethoprim dose is accompanied by a gradual decrease in TOC removal. On the other hand, as pH increased from 4 to 10, the TOC removal increased. Besides, the contour graph in Fig. S5b shows that the highest TOC removal efficiency (> 50%) occurred when the pollutant dose was 10–14 mg/l and a pH of 6.5–10. The influence of pH in TOC removal is prominent since it affects the protonation/deprotonation of the organic states as well as the ionization state of the photocatalyst. Therefore, the high TOC removal observed with increasing pH can be explained by two scenarios. In an alkaline environment, the hydroxyl ion concentration is elevated, promoting the hydroxylation process. Hydroxylation is a major mineralization pathway for trimethoprim; hence, more intermediate molecules are mineralized in these conditions [37]. The second explanation could be the enhanced oxidization of hydroxyl ions to hydroxyl radicals on the catalyst’s surface, consequently improving TOC removal [38].

Fig. S6 shows the interaction of pH (B) and catalyst dose (C) in influencing TOC removal. The elliptical-like contour lines show significant interaction between the factors, as confirmed by the p-value of BC (0.0236) < 0.05 shown in Table S3. The RSM graphs, show an almost linear relationship exists between the change of pH and TOC removal. Since an increase in pH from 4 to 10 is accompanied by an increase in TOC removal. On the other hand, it is observed from the contour lines that both pH and catalyst dose synergistically influence on TOC removal since the highest TOC removal (> 60%) occurs at pH range 7.5–10 and catalyst dose 0.4–0.6 g/l. Low catalyst doses tend to have the highest TOC removal due to the antagonistic influence of the organic dye-sensitizer.

The interaction between trimethoprim dose (A) and catalyst dose (C) on the influence on TOC removal is shown in Fig. S7. The elliptical-like contour lines suggest a significant level of interaction between the factors, which is confirmed by the p-value of AC (0.0144) < 0.05, as shown in Table S3. According to the RSM graph in Fig. S7a, an increase in trimethoprim dose decreases TOC removal. Similarly, an increase in the catalyst dose is accompanied by a decrease in TOC removal. Nonetheless, it can be observed from the contour graph in Fig. S7b that the highest TOC removal (> 50%) occurs at a catalyst dose in the range of 0.4–0.7 g/l and pollutant dose range of 10–13.2 mg/l.

Optimization of trimethoprim degradation and TOC removal

The desirability function was used to obtain the global optimum for the combined responses and the localized optimum for single responses, as shown in Fig. S8. The overall optimum degradation parameters for the two responses were: 10 mg/L trimethoprim dose, pH of 7.2, and 0.716 g/L catalyst dose = 0.716 g/L, which predicted a yield of 89.52% degradation and 49.11% TOC removal at desirability of 95.70%.

Effect of individual factors

Single factors studies were performed at various pH ranges (pH 5.5–10), catalyst loading (0.5–2.5 g/l), and pollutant dose (10–40 mg/l) to help validate the results obtained from RSM. The factor under study was varied, while the other factors were kept constant at their localized optimum.

Effect of operating pH

The solution pH affects the surface charge property of the catalyst as well as the ionization state of the pollutant [39]. The effect of pH was evaluated at pH 5.5–10. From Fig. 2a, the removal efficiency by adsorption for the first 15 min was 8%, 9.61%, 25.09%, and 35.77% for pH 5.5, pH 10, pH 7, and pH 6.43.

Fig. 2
figure 2

Plot of TMP concentration with time at pH values (5.5, 6.43, 7, 10); a TMP degradation, b TOC Removal. Reaction conditions: TMP dose = 10 mg/l, catalyst dose = 0.7 g/l, and 90 min irradiation time

The highest degradation was 91.83%, observed at pH 6.43, similar to the predicted optimum pH by the RSM optimization. At pH 6.43, the photocatalyst is negatively charged since pHsolution > pHpzc. However, the TMP molecules are positively charged since the pKa value is 7.1, and when pHsolution < pKa TMP exists as cations [34]. Therefore, the TMP molecules are strongly adsorbed on the catalyst surface, resulting in higher degradation. The lowest degradation efficiency of 76.34% was achieved at pH 5.5. In such conditions, both the catalyst and pollutant molecules are negatively charged, hence repelling each other strongly. Therefore, fewer pollutant molecules are adsorbed on the catalyst surface, leading to poor degradation [4].

The highest TOC removal efficiency was realized at extreme pH conditions, as shown in Fig. 2b. The order of TOC removal for TMP was pH 10 > pH 7 > pH 6.43 > pH 5.5, with removal efficiencies of 52.83%, 46.33%, 41.64%, and 28.39%. The highest removal observed at pH 10 could be due to a slightly alkaline environment caused by excess hydroxyl ions, rapidly converted to hydroxyl radicals [40]. This is necessary for the fast mineralization of the pollutants and their intermediate groups. This is supported by previous studies that have reported pollutant molecule decomposition in strong alkaline environments [41].

Effect of catalyst dose

The effect of catalyst concentration in tetracycline degradation was studied in the range of 0.5–2.5 g/l at fixed conditions. From Fig. 3a, the removal efficiencies by adsorption for the first 15 min carried out in the dark were 22.92%, 24.33%, 27.565% and 29.52% for 0.5 g/l, 0.7 g/l, 1.2 g/l and 2.5 g/l.

Fig.3
figure 3

Plot of TMP concentration with time at catalyst dosages (0.5, 0.7, 1.2, 2.5 g/l): a TMP degradation b TOC Removal. Reaction conditions: TMP dose = 10 mg/l, pH 7, and 90-min irradiation time.

The initial increase in TMP removal at high catalyst loading is due to improved pollutant adsorption on a large surface area of catalyst active sites [42]. After 90 min irradiation, the removal efficiencies were 68.87%, 76.34%, 84% and 87.02% for 2.5 g/l, 1.2 g/l, 0.5 g/l and 0.7 g/l. The decreased TMP degradation at high catalyst loading is due to increased solution turbidity, which scatters light photons, inhibiting radical generation [43]. Furthermore, some studies have reported increased particle agglomeration at high catalyst loading, decreasing the available active sites [37].

From Fig. 3b, the TOC removal rates decreased with increasing catalyst dose from 48.64% to 21.88% for 0.5 g/l and 2.5 g/l catalyst. The high TOC removal at high catalyst dosage could be due to the antagonistic effect of the organic dye sensitizer, which slightly increases the level of organic carbon in the solution.

Effect of initial pollutant concentration

The effect of the TMP dose (10–40 mg/l) was studied at the fixed conditions. From Fig. 4a, the degradation efficiency decreased with increasing pollutant concentration from 87.02 to 57.88% for 10 and 40 mg/l.

Fig. 4
figure 4

Plot of pollutant concentration with time at various pollutant dosages (10, 20, 40 mg/l): a TMP degradation, b TOC removal. Reaction conditions: Catalyst dose = 0.7 g/l, pH 7, and 90-min irradiation time

This could be due to at low pollutant concentrations; most catalyst active sites are unoccupied and thus available for removal of pollutants. However, at high pollutant concentrations, all the active sites become saturated with contaminant molecules, which inhibits reactive radical species generation. Furthermore, intermediate products produced during photocatalysis will also increase competition with the pollutant for active sites at high pollutant doses, hence a remarkable decrease in degradation efficiency [43].

The percentage of TOC removal for 10 mg/l, 20 mg/l, and 40 mg/l TMP doses was 46.33%, 27.99%, and 13.90%, as shown in Fig. 4b. The decrease in % TOC removal with increasing pollutant dose could be attributed to the saturation of active sites with the pollutants.

Conclusions

In this study, two polynomial quadratic models, Y1 and Y2, were generated by regression analyses to predict the behavior of TMP degradation and TOC removal. Both models had large F-values (Y1 = 77.14, Y2 = 13.30) and all p-values < 0.05, which implied adequate significance of the models in predicting the responses. Similarly, a strong correlation exists between the predicted and observed data (R2 = 0.99, 0.96 and Rpred2 = 0.91, 0.85), which are in reasonable agreement. Hence, these models give a good prediction of TMP degradation and TOC removal using the photocatalyst. It was also confirmed that initial pH strongly influences TOC removal, with high pH values improving mineralization due to hydroxylation reactions that break the unstable aromatic rings into smaller organic groups. Single-factor experiments conducted at the suggested optimum helped validate the RSM values. TMP’s actual degradation and TOC removal were 87.02% and 46.33%, respectively, while the predicted values were 89.52% and 49.12%. The deviations of the predicted from actual values could be due to changes in environmental conditions. Therefore, these findings indicate that RSM can be used to effectively model the degradation and TOC removal for TMP from contaminated wastewater.