Decontamination of levofloxacin from water using a novel chitosan–walnut shells composite: linear, nonlinear, and optimization modeling

Chitosan–walnut shells (Ch–W) composite was tested for the removal of levofloxacin from water. Various experimental factors were examined at different contact time intervals. The prepared composite exhibited maximum uptake capacity of 7.43 mg g−1 for levofloxacin with 0.5 g L−1 Ch–W dose at 45 min and pH = 7. Linear and nonlinear isotherm/kinetic models have been investigated, and the pertinency of the models was confirmed by correlation coefficients (R2) and error functions. Consequently, the adsorption of levofloxacin could be more accurately described by the nonlinear pseudo-second-order and Langmuir as well as Temkin models (R2 ˃ 0.98). Optimization modeling of levofloxacin was performed using a central composite design. The independent parameters; initial concentration, pH, and Ch–W dose, were selected while levofloxacin removal was the response. The maximum levofloxacin removal was 75.7% and 94.2% at concentrations of 4 mg L−1 and 2 mg L−1, respectively. Furthermore, 3D surface plots with the interaction effects of the investigated factors are presented. The developed model was reliable for further study and prediction owing to the closeness between the experimental and predicted values. The individual and interacting factors were found to be significant except for “concentration x dose” based on the ANOVA. The models confirmed the experimental results with R2, R2adjusted, and R2predicted values ˃ 0.939. The continuity adsorption cycles were tested for reuse and revealed that the removal of levofloxacin was decreased ~ 23% after six cycles. Hence, the prepared composite has the potential to remove antibiotics from water.


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  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.

Chemicals and reagents
Chitosan and acetic acid (98%) were purchased from Sigma-Aldrich, Germany.Levofloxacin (purity 98%), hydrochloric acid 37% (HCl), Sulphuric acid (H 2 SO 4 ), 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 energydispersive X-ray spectroscope (EDX).FT-IR Bruker (TEN-SOR 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 (pH zpc ) was investigated and recorded with various pH values using pH meter (Martini meter, Mi805, Romania).

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; R 2 = 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(Mahmoud et al. , 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).
where q t : the uptake capacity (mg g −1 ), C 0 and C t : 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.
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.
where N: the total experimental numbers, k: the variables numbers, and n c : the center points numbers.
As the model type is polynomial, and the response (R) could be estimated using Eq. 4.
Performance analysis of the optimized models.
where the parameter definitions of each equation are in the supplementary information.

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. (5) 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 SiO 2 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.
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.
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.

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).

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 Fe 3 O 4 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.pH zpc was investigated using doubledistilled 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 pH zpc of Ch-W was 6.7.As the pH value of the aqueous solution was 7, which is higher than pH zpc , 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 pKa 1 (pH = 6).While it is anionic form when pH values are higher than the pKa 2 value (pH = 8), no experiments were conducted because of electrostatic repulsion and the competition Within the values of pKa 1 to pKa 2 , 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  2.
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 (q e ) increased with increasing equilibrium concentration (C e ) until saturation.
It was found that the Langmuir and Temkin models could describe the adsorption behavior with R 2 ˃ 0.980 and minimum error functions compared to the Freundlich model as indicated in Table 2.The calculated maximum uptake capacity (q m ) of Ch-W was 7.43 mg g −1 , and this value was closer to the experimental values than the linear calculated q m (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 R 2 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 q t versus t 0.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 ratelimiting 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 (K 1d ) was higher than that of the second-line stage (K 2d ).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.
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 R 2 adj 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 Fig. 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 (pH zpc ) of Ch-W.g Chemical structures of levofloxacin depending on pH.◂ low P value < 0.0050.All the model terms were significant except for AC.Furthermore, the values of R 2 , R 2 adjusted, and R 2 predicted were ˃ 0.939 where they confirmed this model fitted the experimental results.
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.q m exp (mg g −1 ) 7.42 Langmuir Pseudo-first order q m cal (mg g −1 ) 7.36 7.43 q e cal (mg g −1 ) 2.17 5.67 K L (L mg −1 ) 3.89 3.51 K 1 (min   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." 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).
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.
where r i and h ii : 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.

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.

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.

Regeneration and cycled adsorption
H 2 SO 4 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.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 q m 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.
Open Access This article is licenced under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution, and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made.The images or other third-party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material.If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.To view a copy of this licence, visit http:// creat iveco mmons.org/ licen ses/ by/4.0/.
India between 2010 and 2030 because of 244 Page 2 of 19 Fig. 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

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

Fig. 3 a
Fig. 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

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

Fig. 10
Fig. 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

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