Introduction

Clean and accessible freshwater is a vital resource for humanity according to 2030 Sustainable Development Goals. However, the availability of freshwater is still a major global concern because of the combined effect of climate change and various anthropogenic activities (Papa et al. 2023; Mahmoud and Fawzy 2021). The demand for more freshwater causes threats to available water resources, which leads to water scarcity in developing and developed countries (Dotaniya et al. 2022). This could be due to the increasing population and satisfying the needs of agricultural/industrial sectors (Kathi et al. 2023; Tawfik et al. 2022). The environmental contamination by pharmaceuticals has been a priority concern among academics, politicians, and the public around the world. Among personal care products (PPCPs) and pharmaceuticals, antibiotics are becoming ubiquitous in the environment and pose serious health concerns even at low concentrations because they are non-biodegradable and hazardous (Baaloudj et al. 2021; Bhagat et al. 2020). They are consumed in huge quantities every year around the world as they are vital components in medicines and veterinary practices. The global use of antibiotics is estimated to be 100,000–200,000 ton year−1 (Qin et al. 2018). It was found that the usage of antibiotics increased 65% between 2010 and 2015 and is anticipated to triple in South Africa, China, Brazil, and India between 2010 and 2030 because of the growing demand for antibiotics in many sectors, which resulted in more annual production and consumption.

Antibiotics are not completely digested by the body, and approximately 80% of antibiotics are excreted as unmetabolized compounds in their parent forms (Chi et al. 2022). Until now, municipal wastewater treatment plants have not had the potential to completely remove PPCPs and can reach the environmental compartments (Gwenzi et al. 2022; Cao et al. 2016). Therefore, residual antibiotics can be detected in raw and treated wastewater (Khan et al. 2021; Mousazadeh et al. 2021) as well as in freshwater resources that are discharged from poultry industries, pharmaceutical industries, and hospitals (Maged et al. 2023; Ziarati et al. 2022). Their concentration range usually varies from ng L−1 to mg L−1.

Among all antibiotics, fluoroquinolone groups (levofloxacin, ciprofloxacin, and norfloxacin) are the most commonly detected in wastewater treatment plants (Hamjinda et al. 2018). They are excreted in unmetabolized form, ~ 70% for levofloxacin, 30% for norfloxacin, and 40% for ciprofloxacin (Ajibola et al. 2021). Levofloxacin is a third-generation fluoroquinolone compound that is listed as an essential medicine in the World Health Organization (Sitovs et al. 2021; WHO 2019). It is usually used to treat critical infections that other antibiotics cannot treat in most veterinary practices such as poultry industries (Abukhadra et al. 2022).

Herein, levofloxacin was chosen as a representative of this group. Because of its large quantities in wastewater, it is the most widely prescribed synthetic antibiotic (Altaf et al. 2021). Levofloxacin antibiotics are frequently discharged in their parent form to water bodies and can potentially cause the death of aquatic species if there is an excessive amount of this antibiotic in the water. This is because its residue can lead to an increase in bacterial resistance and harm the aquatic ecosystem (Zhu et al. 2020). For instance, during the growth phase of fish embryo, levofloxacin can cause death within 24 h. In addition, it can be biomagnified and bioaccumulated when the exposed aquatic species become part of the food chain as well as inhibiting algal growth in the aquatic environment (Kalantzi et al. 2021).

Owing to the low biodegradability of levofloxacin, traditional treatment technologies could not remove it from water (Al-Jabari et al. 2019). In Kenya, the levels of levofloxacin in river water and wastewater were 0.04 and 1.60 μg L−1, respectively (K’Oreje et al. 2016). In Nigeria, the levels of levofloxacin ranged from 0.1 to 0.3 mg L−1 in the effluents of hospitals (Ajibola et al. 2021). In addition, levofloxacin levels in wastewater streams were found to be 6.63 mg L−1 in Pakistan and 0.54 mg L−1 in India (Zafar et al. 2021; Gothwal and Shashidhar 2017).

The valorization of waste residuals as adsorbents is a concept inspired from the circular economy that could drastically minimize enormous amounts of accumulated wastes. In addition, this could be integrated into sustainable water and wastewater treatment practices (Nagy et al. 2023; Mahmoud et al. 2023). Therefore, using a low cost and eco-friendly adsorbent is a promising alternative for the removal of levofloxacin from water. Composite materials have not only the same features as their single components but also could exhibit novel characteristic features. Herein, the adsorption process is applied with chitosan–walnut shells composite due to the following advantages: i) Walnut shells are available in a huge amount after fruit processing in walnut kernel production centers (Jahanban-Esfahlan and Amarowicz 2018), simple to gather and store as well as their richness in phytoconstituents as reported in Jahanban-Esfahlan et al. (2019), and ii) chitosan has been used to embedded as surface modifier for the walnut shells because of its functional groups that could enhance the adsorption process (Zhuang et al. 2022). In addition, it is biocompatibility, nontoxicity, adhesivity, and bioactivity (Benettayeb et al. 2023). Despite pristine chitosan is a cationic biopolymer with hydroxyl and amino groups, as well as it is the second most abundant biopolymer after cellulose, it possesses limited surface area, low mechanical stability, and low thermal resistance (Ahmed and Mohamed 2023). Therefore, chitosan typically requires crosslinking to increase its mechanical stability and chemical robustness (Wang and You 2023).

This work aims to synthesize an eco-friendly adsorbent; chitosan–walnut shell composite applying the circular economy concept and testing its potential in levofloxacin adsorption–desorption under various experimental conditions. Linear and nonlinear isotherm/kinetic models as well as the central composite design (CCD) were employed to optimize the experimental conditions and detect the variation resulted from each factor and their interactions.

Materials and methods

Chemicals and reagents

Chitosan and acetic acid (98%) were purchased from Sigma-Aldrich, Germany. Levofloxacin (purity 98%), hydrochloric acid 37% (HCl), Sulphuric acid (H2SO4), and sodium hydroxide (NaOH) powder were obtained from the same company. Table S1 shows the chemical structure and characteristics of levofloxacin. All chemicals were of analytical grade.

Preparation of chitosan–walnut shells composite

About 50 g L−1 of chitosan (Ch) was dissolved in acetic acid with ultrasonication for 30 min to remove the formed bubbles. About 3.5 g of the prepared walnut shells (W) was added slowly to the prepared solution and stirred for 1 h. Subsequent to stirring, the final solution was left to stand for 24 h. The supernatant was removed, and the composite was washed with DI. The composite was then slowly added to 1 M NaOH and soaked for 1 h to neutralize the acid. The product was then dried in 100°C after rinsing with DI. The final product (Ch–W) was stored in a desiccator to keep it dry and ready for characterization and environmental application.

Characterization

The surface morphology of the Ch–W composite before and after application was inspected by scanning electron microscope (SEM; JOEL-JSM-IT200, Japan) and energy-dispersive X-ray spectroscope (EDX). FT–IR Bruker (TENSOR 37, UK) was used to determine the spectra of Fourier transform infrared (FT–IR) to detect the functional groups on the prepared composite before and after application with attenuated total reflectance at a resolution of 4 cm−1. The zero-point charge (pHzpc) was investigated and recorded with various pH values using pH meter (Martini meter, Mi805, Romania).

Removal of levofloxacin from water

Adsorption experiments and models

Different levofloxacin concentrations were prepared from a stock solution of 20 mg L−1. The effects of the contact time, pH, and chitosan–walnut shells dose on the adsorption of levofloxacin were investigated. The pH of the aqueous solutions was modified by the addition of 0.1 and 0.01 mol L−1 of NaOH and HCl. Levofloxacin was analyzed using UV–Vis spectroscopy (PG Instruments T80 + , UK) at a maximum wavelength absorption of 288 nm. Figure S1 shows the standard curve with the trendline equation and the correlation coefficient; R2 = 0.9844. All experiments were repeated three times, and the average ± standard deviation was calculated. The uptake capacity of Ch–W composite and its levofloxacin removal efficiency were calculated using Eqs. (1 and 2), respectively (Mahmoud et al. 2022a, 2021; Badr et al. 2020). Isotherm and kinetic models were employed to fit the experimental data using linear and nonlinear equations as illustrated in Table S2. Moreover, the feasibility of the adsorption process is expressed by the separation factor (SF).

$$q_{t} = \frac{{C_{0} - C_{t} }}{m} x V ,$$
(1)
$$R = \frac{{C_{0} - C_{t} }}{{C_{0} }} x 100 ,$$
(2)

where qt: the uptake capacity (mg g−1), C0 and Ct: initial concentration and concentration after time (mg L−1), respectively, and R: the levofloxacin removal (%).

Optimization using response surface models

The experiment was designed using Design Expert 13. The three selected factors were levofloxacin concentration, pH, and Ch–W dose. The removal % of levofloxacin was set as a response to the design. Table 1 shows the investigated levels and ranges of the studied factors (independent parameters) that affect the response using the CCD.

Table 1 Levels and ranges of the investigated factors for levofloxacin removal using CCD

Central composite design is applied in optimization studies with RSM design, and Eq. 3 can compute the total number of experiments. Consequently, the number of experimental runs was 20 including two center points.

$$N = 2^{k} + 2k + n_{c} ,$$
(3)

where N: the total experimental numbers, k: the variables numbers, and nc: the center points numbers.

As the model type is polynomial, and the response (R) could be estimated using Eq. 4.

$$\begin{aligned} R & = \beta_{0} + \beta_{1} X_{1} + \beta_{2} X_{2} + \beta_{3} X_{3} + \beta_{12} X_{1} X_{2} + \beta_{13} X_{1} X_{3} \\ & \quad + \beta_{23} X_{2} X_{3} + \beta_{11} X_{1}^{2} + \beta_{22} X_{2}^{2} + \beta_{33} X_{3}^{2} , \\ \end{aligned}$$
(4)

where Xi: the investigated factors (levofloxacin concentration, pH, and Ch–W dose), \(\beta_{0}\): constant coefficient (intercept), \(\beta_{1} - \beta_{3}\): linear coefficients (the effect of separated factors), \(\beta_{12} - \beta_{23}\): interacted coefficients for the interaction effect between two variables, and \(\beta_{11} - \beta_{33}\): quadratic coefficients reveal the curve shape.

Performance analysis of the optimized models.

The developed isotherm and kinetic models were assessed based on correlation coefficients and errors functions as illustrated in Eqs. (512).

$$R^{2} = 1 - \frac{{SS_{{{\text{residual}}}} }}{{SS_{{{\text{model}}}} - SS_{{{\text{residual}}}} }},$$
(5)
$${\text{Adj}} R^{2} = 1 - \frac{{SS_{{{\text{residual}}}} /DF_{{{\text{residual}}}} }}{{\left( {SS_{{{\text{model}}}} + SS_{{{\text{residual}}}} } \right)/\left( {\frac{{DF_{\bmod el} }}{{DF_{{{\text{residual}}}} }}} \right)}},$$
(6)
$$X^{2} = \sum \frac{{\left( {q_{e,\exp } - q_{{e,{\text{cal}}}} } \right)^{2} }}{{q_{{e,{\text{cal}}}} }}$$
(7)
$${\text{SSE}} = \sum (q_{{e,{\text{cal}}}} - q_{e,\exp } )^{2}$$
(8)
$${\text{ARED}} = \frac{1}{N} \sum \left| {\frac{{\left( {q_{{e,{\text{cal}}}} - q_{e,\exp } } \right)^{2} }}{{q_{e,\exp } }}} \right|x 100$$
(9)
$${\text{MPSED}} = \sqrt {\frac{{\sum \left[ {\left( {q_{e,\exp } - q_{{e,{\text{cal}}}} } \right){/}q_{e,\exp } } \right]^{2} }}{N - P}} x 100,$$
(10)
$${\text{MSE}} = \frac{1}{N} \sum (q_{{e,{\text{cal}}}} - q_{e,\exp } )^{2} ,$$
(11)
$${\text{SEP}} = \frac{{{\text{MSE}}}}{{\overline{{q_{e,\exp } }} }} x 100,$$
(12)

where the parameter definitions of each equation are in the supplementary information.

Results and discussion

Characterization

Figure 1a shows that the particles of walnut shells are irregular in shape and compacted. Furthermore, there are some pores and grooves that exist. For chitosan–walnut shell (Ch–W) composite, the shape became more orientated, its morphology became rougher than that of walnut shell, and chitosan layers are distributed on the walnut shells keeping the pores (Fig. 1b). This agrees with Chesnutt et al. (2009) who reported that the surface of chitosan/CaP was more textured than chitosan. Fernandes et al. (2011) observed that chitosan has an open pore structure with a high degree of interconnectivity. Figure 1c reveals that the composite surface became smoother, and the pores and grooves are closed to confirm the adsorption process.

Fig. 1
figure 1

a–c SEM micrographs of a raw walnut shells, b chitosan–walnut shells composite (Ch–W), and c Ch–W after levofloxacin adsorption at two different magnifications

The quantitative elemental constituents of raw and prepared samples are depicted in Fig. 2a and b. The peaks show the decrement of C% and increment of O% with increasing peak intensity of Na and Ca due to the incorporation of chitosan into walnut shells. Chitosan could intensify the existence of oxygen-containing functional groups on the walnut shell surface. Similar findings were reported recently when biochar was loaded with chitosan (Chen et al. 2022). Rafigh et al. (2017) detected that the C and O percentages of chitosan were 48% and 37% and the successful incorporation of chitosan to the surface of SiO2 nanospheres. Moreover, it is noting worthy that the C element percentage increased and the Ca peak disappeared after applying the adsorption process (Fig. 2c). The C percentage increased due to the π–π interactions between the ring-shaped structure of chitosan and the benzene ring of levofloxacin.

Fig. 2
figure 2

EDX of a walnut shell, b chitosan–walnut shell composite, and c chitosn-walnut shell after levofloxacin adsorption

The FT–IR spectra display the bands of different functional groups of the raw and prepared samples (Fig. 3a). In the walnut shell, 2922 cm−1 is stretching vibration of the aliphatic –CH group. The appearance of the band at 3450 cm−1 in Ch–W is attributed to − OH stretch which is significantly reduced after levofloxacin removal from water.

Fig. 3
figure 3

a FT–IR spectra of walnut shells (W) and chitosan–walnut shells (Ch–W) before and after levofloxacin adsorption. b XRD of Ch–W. c UV–Vis spectra of 4-mg L−1 levofloxacin before and after adsorption process using Ch–W

The intensity of the carboxylic group (–COO–) in the walnut shell at 1658 cm−1 was increased in intensity and shifted to 1635 cm−1 in Ch–W composite. This effect is due to the addition of acetic acid in the composite preparation, which led to its attachment to the amine group in chitosan. Paluszkiewicz et al. (2011) found the FT–IR peak intensities (the range 1600–1300 cm−1) of the chitosan and montmorillonite composite film. Subsequent to levofloxacin removal, this band became wider and less intense. Furthermore, the C–OH group of the alcohol in chitosan appeared in a low intense band at ~ 1446 cm−1 (Drabczyk et al. 2020; Taspika et al. 2020). The epoxy group (–C–O–C–) was detected at 1027 cm−1 in walnut shells and shifted to 1044 cm−1 after incorporation of chitosan, then reduced in intensity to the minimum with shifting to 1060 cm−1 after levofloxacin adsorption.

Figure 3b demonstrates an amorphous diffraction peak (2θ = 21°), which reveals the combined chitosan with walnut shells. A similar diffraction peak was detected for the blended PVA and chitosan (Abdeen et al. 2015). Both chitosan and walnut shells possess a peak at 2θ = 21°. This is due to their composition with lignin, cellulose, and hemicellulose (Yang et al. 2016; Ayala and Fernandez 2019). The peak at 2θ = 15° reflects the crystal I in chitosan associated with (101) plane (Dey et al. 2016). While the peak at 2θ = 34° belongs to the walnut shell structure.

Figure 3c illustrates the major absorbance peak of levofloxacin at 288 nm with a shoulder at 328 nm. The same two peaks of levofloxacin were detected by Mondal Roy and Roy (2017). Subsequent to the adsorption process, the peak intensity was reduced, which confirms the results obtained from the calibration curve.

Removal of levofloxacin from water

Adsorption experiments and models

The contact time effect

Figure 4a–d illustrates the removal efficiency and the uptake capacity of levofloxacin on Ch–W composite with increasing contact time intervals. During 15 min, the removal efficiency and amount uptake of levofloxacin raised linearly until the equilibrium reached at 45 min. As the levofloxacin concentration was high in the aqueous solution and the adsorption sites were available, the adsorption and mass transfer was high in a short time. Then, the adsorption sites were occupied, and the saturation was obtained. The removal of levofloxacin from water was attained at pH = 7 with Mg/Ca oxide nanocomposite after 720 min (AbuKhadra et al. 2020).

Fig. 4
figure 4

Contact time effect for levofloxacin removal and its uptake capacity using chitosan–walnut composite with a, b different antibiotic concentrations at pH = 7 and 0.5-g L−1 dose, c, d various pH values at 4-mg L−1 and 0.5-g L−1 dose, and e different dose concentrations of chitosan–walnut composite. f Zero-point charge (pHzpc) of Ch–W. g Chemical structures of levofloxacin depending on pH.

The initial concentration effect

The uptake capacity of Ch–W composite increased from 1.89 mg g−1 to 7.42 mg g−1 as the concentration was increased from 1 to 10 mg L−1. Similar behavior was reported by Chi et al. (2022) where the uptake capacity of natural zeolite reached ~ 20 mg g−1 at 20 mg L−1. Al-Jabari et al. (2019) stated that the highest levofloxacin removal using chemical Fe3O4 nanoparticles was at pH 6.5, and the contact time was 240 min. Its maximum adsorption capacity was from 6.09 to 6.84 mg g−1.

pH effect

pH values ranging from 3 to 7 were assessed with different contact time, as illustrated in Fig. 4c. It is noticeable that levofloxacin removal was changeable according to the pH of solution. Therefore, hydrogen bonding plays a role in the adsorption mechanism. pHzpc was investigated using double-distilled water with adjustment of the pH using HCl and NaOH. The initial pH values were measured and recorded, then 0.5-g L−1 Ch–W was added and shaken at 200 rpm for 3 h. The final pH was measured and recorded. Figure 4f indicates that the pHzpc of Ch–W was 6.7. As the pH value of the aqueous solution was 7, which is higher than pHzpc, the hydroxyl functional group is responsible for the complexation reaction at the surface of the sorbent. This is consistent with the results reported by Mahmoud et al. 2016.

The chemical structure of levofloxacin is pH dependent, as illustrated in Fig. 4g. It shows various behaviors ranging from anionic, cationic, neutral, and zwitterionic, according to pKa. As shown in Table 1, levofloxacin is in the cationic form at pH values less than the reported value of pKa1 (pH = 6). While it is anionic form when pH values are higher than the pKa2 value (pH = 8), no experiments were conducted because of electrostatic repulsion and the competition of OH ions for the active site with Ch–W. Yu et al. (2017) found that the adsorption amount of levofloxacin reduced at pH = 9 by applying zirconium (IV)-loaded corn bracts due to the above-mentioned reasons.

Within the values of pKa1 to pKa2, levofloxacin is in the zwitterionic form (Abukhadra et al. 2022). Consequently, the adsorption of levofloxacin was based on various mechanisms (see “Adsorption mechanism” section).

The Ch–W dose effect

The experimental results (Fig. 4e) revealed that the further addition of Ch–W doses (0.1–0.5 g L−1) increased the target antibiotic from 42.51 to 75.70% at equilibrium. The reason could be linked to increment the quantity of binding sites available of the composite. Furthermore, the incorporation of chitosan, which possesses functional groups, into the walnut shell could result in more active sites. This could enhance the adsorption process, which is influenced by the surface area and the existence of different functional groups (see Fig. 3a). Abukhadra et al. (2022) reported that 0.5-g L−1 Zn@polyaniline/bentonite could remove 41.4% of levofloxacin whereas ZnO could only remove 9.6% at pH = 8 and 30° C.

Isotherm and kinetic models.

When the adsorption process approaches equilibrium, isotherm models were employed showing the affinity between a sorbent and a sorbate (Mahmoud 2020). The linear parameters and coefficients of each isotherm and kinetic model were calculated using intercept and slope of the plots (Figs. 5a–c and 6a–b) and compared with the nonlinear computed values as shown in Table 2.

Fig. 5
figure 5

a, b, c Linear and d nonlinear isotherm models for levofloxacin removal using Ch–W. e Separation factor

Fig. 6
figure 6

a, b, c Linear and d nonlinear kinetic models for levofloxacin removal using Ch–W

Table 2 Linear and nonlinear isotherm and kinetic parameters as well as regression coefficients for levofloxacin removal using Ch–W

It is observed that the parameter values are changeable according to linear or nonlinear equations. This could be due to the sensitivity of the linear models to experimental errors, but the nonlinear models minimize the sum of squares errors between the predicted and experimental values (Mahmoud 2020; Mahmoud et al. 2018). Figure 5d illustrates the nonlinear isotherm models where the uptake capacity (qe) increased with increasing equilibrium concentration (Ce) until saturation.

It was found that the Langmuir and Temkin models could describe the adsorption behavior with R2 ˃ 0.980 and minimum error functions compared to the Freundlich model as indicated in Table 2. The calculated maximum uptake capacity (qm) of Ch–W was 7.43 mg g−1, and this value was closer to the experimental values than the linear calculated qm (7.36 mg g−1).

The adsorption intensity (n) was 0.23, which was higher than the calculated value in the linear model, indicating the strength of adsorption between Ch–W and levofloxacin. Furthermore, the separation factor (SF; Fig. 5e) can be used to anticipate and assess the applicability of the adsorption process. The adsorption isotherm is deemed favorable when SF is between 0 and 1. Yu et al. (2020) reported that n was 0.36, and the separation factor was in the range of 0–1. The calculated B value was ˃ 1 with high R2 and low error functions from the nonlinear Temkin model (Tables 2 and S3), which indicates that there were pores in Ch–W and electrostatic interactions between Ch–W and levofloxacin due to the adsorption process occurred exothermically. This is in line with Jang et al. 2018; Wang and Jang 2022.

Nonlinear kinetics illustrates the maximum adsorption capacity reached within 20 min and equilibrium at 45 min (Fig. 6d). Such a prominent rate suggests that the Ch–W composite could be applicable to levofloxacin removal. To characterize the second-order kinetics, the Elovich model (Fig. 6c) was employed. α value was significantly greater than β values. This finding confirmed the suitability of adsorbent for levofloxacin removal.

Figure 7a illustrates plotting qt versus t0.5, which shows multilinear plots. Herein, two stages occurred in the adsorption process. As the adsorbate transfers from the solution bulk toward the studied adsorbent, the adsorption is a rate-limiting step (Mahmoud 2020). The transportation of the targeted antibiotic from the aqueous solution to the adsorbent’s external surface is the first stage, which is called film diffusion. The second stage was due to intra-particle diffusion where the sorbate diffuses from the surface into the sorbents pores and attains the equilibrium (Roy and Mondal 2022). Table S4 shows that the slope of the first-line stage (K1d) was higher than that of the second-line stage (K2d). Consequently, the rate-controlling step was film diffusion. As the second-line stage was almost horizontal, it designates that the intra-particle diffusion was fast, and the equilibrium was obtained in short time.

Fig. 7
figure 7

Models of a intra-particle diffusion and b Boyd for the levofloxacin adsorption (Ch–W dose: 0.5 g L−1, pH: 7, room temperature)

Due to the complexity of the adsorption process, the Boyd model can be used to reveal external mass transfer, as shown in Fig. 7b. The calculated points are distributed around the linear lines, and the linear plots do not pass through the origin, showing that the adsorption process is mediated by external mass transport (Ashrul Asbollah et al. 2022).

Optimization using response surface models

The design type of RSM is selected to be central composite, and its model is quadratic because R2adj was found 0.987. Table S5 displays the randomized matrix of 20 CCD experimental runs with two blocks to determine the levofloxacin removal performance.

Based on Table S5, Fig. S2a depicts the removal efficiency of levofloxacin using Ch–W. The 50th percentile of the factors data is represented by the center, which is calculated from the lowest and upper quartile values. Within the box, the median value is presented. Vertical lines (“whiskers”) connect the points to the central box, displaying the maximum and minimum values. The table displayed inside Fig. S2a confirms that the maximum removal of 4-mg L−1 levofloxacin was about 75.7%.

Figure S2b displays the ratio of the design space volume having a certain prediction variance value to the volume of the design space with 0.90. It is recommended that the fraction of design space (FDS) should have at least 0.8 for optimization and 100% for robustness testing. The goal of this design is to display the cumulative fraction of the design space from 0 to 1 against the prediction variance.

Table 3 reports that the model F-value was 153.40, which implies that model is significant due to high F-value and low P value < 0.0050. All the model terms were significant except for AC. Furthermore, the values of R2, R2adjusted, and R2predicted were ˃ 0.939 where they confirmed this model fitted the experimental results.

Table 3 ANOVA analysis of optimized levofloxacin adsorption using Ch–W

The model adequacy is a measure of the ratio in the predicted response relative to its associated error (Arzani et al. 2016). Its value was recorded 43.87, indicating that the model is desirable due to its ratio is ˃ 4 as reported in Mahmoud et al. 2022b. Therefore, the uncoded and coded equations of the regression model are expressed in Eqs. 13 and 14, respectively, forlevofloxacin removal. The purpose of Eq. 14 (coded) is to recognize the relative factors impact by comparing their coefficients with high and low levels of the factors coded as + 1 and −1.

$$\begin{aligned} R\% \, & = - 28.81 - 2.86\;{\text{Levo Conc}}{.} + 16.64{\text{ pH}} + 179.23{\text{ Ch}} - {\text{W Dose }} \\ & \quad - \, 1.11\;{\text{Levo Conc}}{.}*{\text{pH}} - 0.17\;{\text{Levo Conc}}{.}*{\text{Ch}} - {\text{W Dose }} \\ & \quad + \, 8.29{\text{ pH}}*{\text{Ch}} - {\text{W Dose }} + 0.32\;{\text{Levo Conc}}.^{2} - 0.58{\text{ pH}}^{{2}} - 253.58{\text{ Ch}} - {\text{W Dose}}^{{2}} \\ \end{aligned}$$
(13)
$$\begin{aligned} R\% & \, = 40.08 - 11.56 \, A + 11.06 \, B + 13.46 \, C - 6.66 \, AB \, \\ & \quad - 0.1056 \, AC + 3.32 \, BC \, + 2.97 \, A^{2} - 2.33 \, B^{2} - 10.14 \, C^{2} \\ \end{aligned}$$
(14)

Pearson correlation matrix (Fig. 8) confirmed the relationship between the columns of the model matrix as well as the relationship between the levofloxacin removal and the column factors where the removal was negatively correlated with factors of “A,” “AB,” and “AC” while it was positively correlated with “B,” “C,” and “BC.”

Fig. 8
figure 8

Pearson correlation matrix between each investigated variable and levofloxacin removal efficiency

Figure 9a shows that the residuals were distributed in random spots around zero in a range of − 4.33 and + 4.33, and there were no outliers. Moreover, Fig. 9b demonstrates the experimental runs within the determined range with no specific trend. This signifies that the model was adequate and could be used for further calculations and assumptions (Mirzaei et al. 2017).

Fig. 9
figure 9

Externally studentized residuals plotted against a predicted levofloxacin removal, b number of experimental runs, c Box–Cox plot, d predicted versus observed values for levofloxacin removal, e plot of leverage points, f difference in coefficients (DFBETAS), and g Cook’s distance for each experimental run

No response transformation is required if the residual errors are a function of the magnitude of the anticipated values (Fig. 9c). Figure 9d shows that the predicted output values were distributed along the regression line and were smooth and continuous, resulting in a high correlation value. This demonstrates that the proposed model maps observations under the given conditions very well, and that the model is ready for further study and predictions.

Furthermore, the fitting of the model coefficients was influenced by the leverage points based on their positions in the design space. In the proposed model, the leverage points were found to be less than 1, as shown in Fig. 9e. When leverage approaches or equals 1, the points influence the model. Therefore, the leverage points in this work indicated that no further replicates or more design points should be added.

Figure 9f illustrates the difference in coefficients where the influence of each experimental run on a coefficient estimate is examined by deleting each run and recalculating the coefficients. A run is considered influential on a coefficient when its difference in coefficients (DFBETAS) value is outside the limits. The limits are computed as ± 3/√n (n: number of runs in the design). In regression analysis, Cook’s distance (D) is employed to determine which data points are influential and may have a detrimental impact on the model according to Eq. (15). Figure 9g illustrates that most experimental runs were < 1 and almost zero for the Cook’s distance except for runs 2 and 17. These results demonstrate the accuracy of the model in prediction.

$$D = \left( {\frac{{r_{i}^{2} }}{{p*{\text{MSE}}}}} \right)*\left( {\frac{{h_{ii} }}{{\left( {1 - h_{ii} } \right)^{2} }}} \right),$$
(15)

where ri and hii: the ith residual and the ith leverage value, respectively, p: the coefficient number in the regression model, and MSE: the mean squared error.

The individual and interactive effects of parameters for the efficiency of Ch–W for the levofloxacin removal are displayed in Fig. S3. The individual and interacted effects of the studied parameters were found to be significant, and adsorbent dosage and adsorbate concentration were found to have a significant effect individually. The interaction factors of levo concentration and Ch–W doses were found to slightly decrease at pH = 3. This change is not significant as obtained in ANOVA.

The effect of variables for optimum removal of levofloxacin

The 3D response surface plots (Fig. 10a–c) were used to assess the interaction between the studied variables. Figure 10a and c depicts the variance in levofloxacin removal in terms of response. The plots were produced from two interactive variables while keeping the 3rd variable at + 1 and − 1. The high value of pH as long as the Ch–W dose influenced more the response at low levofloxacin concentration. The results confirmed that the optimum conditions were at 4 mg L−1 of levofloxacin, pH = 7, and 0.5-g L−1 Ch–W dose. While the predicted maximum removal of 94.2% could be obtained at the same conditions with 2 mg L−1 of levofloxacin.

Fig. 10
figure 10

Three-dimensional surface plots at two different actual factors with interaction of a levofloxacin concentration and pH, b levofloxacin concentration and dose, and c pH and dose for levofloxacin removal using Ch–W

Comparison with the literature

The performance of levofloxacin adsorption with the studied composite was compared with various adsorbents reported in the literature (Table 4). Altaf et al. 2021 could reach ˃ 80% removal of 4-mg L−1 levofloxacin using magnetic nanoparticle. However, they conducted the experiments for a long time, which affected the performance of the whole treatment process and the scalability of the process. We could reveal that high efficiency could be obtained with small doses over short contact time.

Table 4 Antibiotics adsorption from water using various adsorbents in comparison with Ch–W

Adsorption mechanisms

The possible adsorption mechanisms are affected by the adsorbate structure, the functional groups, and the structure of the studied sorbent. Figure 11 shows that the electrostatic attractive forces are involved between protonated piperazinyl group and the negative sites of Ch–W and π–π interactions between the ring-shaped structure of Ch–W and the benzene ring of levofloxacin. The disappearance of Ca peak as indicated in EDX (Fig. 2b and c) was due to the electrostatic attractive forces and the possible formation of a complex with the deprotonated carboxyl group (–COO) of levofloxacin. Maged et al. (2023) observed a significant decrease in the kaolinite mineral of clay-based nanohydrated zirconium oxide after levofloxacin removal. The pore filling could also be a mechanism supporting the fast removal efficiency of levofloxacin. This is confirmed by SEM (Figs. 1b and c and 4a). Maged et al. (2021) reported the same observation for levofloxacin adsorption using activated biochar.

Fig. 11
figure 11

The possible adsorption mechanisms of levofloxacin using Ch–W

Regeneration and cycled adsorption

H2SO4 was selected as an eluent for the regeneration of used Ch–W, and six cycles of adsorption–desorption were conducted. Figure 12 demonstrates the successive adsorption cycles of Ch–W for levofloxacin. After three cycles, the performance of Ch–W was slightly decreased with 9.7%. The decrement in the levofloxacin removal percentage could be due to the filled pores and decreased strength of Ch–W functional groups.

Fig. 12
figure 12

Successive adsorption cycles of Ch–W for levofloxacin using 0.1 M H2SO4 as eluent

Mpelane et al. (2022) reported that the adsorption efficiency of mesoporous iron oxide nanoparticles decreased by 70% in the first three cycles, and the fifth cycle showed 50% decrease. Altaf et al. (2021) conducted four cycles for levofloxacin removal, and its efficiency varied from 85.35% to 80.47%.

Conclusion and recommendations

The prepared novel composite (Ch–W) was successfully prepared from readily available waste materials. Its characterization revealed porous structure and functionality with chitosan. Results of levofloxacin adsorption revealed the ability of Ch–W composite to adsorb this antibiotic via pore-filling, H-bonding, electrostatic attractive forces, complexation, and π–π interactions with optimum removal of 94.2% at 2 mg L−1 and 75.7% at 4 mg L−1. Isotherm and kinetic models indicated the applicability of Langmuir and Temkin as well as the pseudo-second-order models in the adsorption process. The nonlinear qm of Ch–W (7.43 mg g−1) was more accurate to reflect the experimental results that proved by correlation coefficients and error functions. Ch–W composite exhibited recyclability even after six cycles, and its performance was still considerable. The major advantages of the composite are high adsorption performance in a short time intervals, recyclability, and easy separation from the treatment medium. It is recommended to conduct further experiments on other pharmaceutical residuals.