1. Introduction
The current industrial revolution and population growth have led to high energy demands, heavily relying on fossil fuels [
1,
2,
3] due to a depletion of these fuels, environmental pollution, and global warming [
4,
5,
6]. This has increased worldwide awareness of environmental conservation and the need for alternative fuels. From the year 2022 to 2023, worldwide energy-related CO
2 emissions increased by 1.1% to 37.4 GtCO
2. To minimise fossil fuel emissions, the Kyoto Protocol (1997) and the Paris Agreement (2015) have encouraged renewable energy [
7]. Therefore, biodiesel has emerged as a viable alternative to petroleum-based gasoline [
8]. It is preferred as an alternative fuel because its combustion in diesel engines decreases emissions of hydrocarbons, carbon monoxide, particulate matter, and sulphur dioxide [
6]. Additionally, biodiesel exhibits fundamental similarities with traditional petroleum diesel, such as a higher combustion efficiency, a high flash point, and a higher cetane number [
2]. Biodiesel is an eco-friendly, biodegradable, and non-toxic fuel [
4] synthesised from organic materials such as animal fats, vegetable oil, and waste oils [
9]. The range of applications of biodiesel extends well beyond its use in automobiles; it finds usage in power generators, maritime ships, agricultural and mining equipment, boilers, and more [
10].
Several methods, such as alcoholysis, micro-emulsion, and pyrolysis, have produced biodiesel. Because of its capacity to produce high-quality biodiesel, alcoholysis, also called esterification or the transesterification reaction, has become the most popular of these processes [
2]. Transesterification or esterification, in the presence of a catalyst, produces fatty acid alkyl esters (FAAE), methyl esters when methanol is used, and ethyl esters when ethanol is used [
7]. One of the most common approaches to the production of biodiesel is the employment of an acid or basic homogeneous catalyst [
11], such as HCl and H
2SO
4 (acid catalyst) and NaOH and KOH (base catalyst) [
12].
The production of economical biodiesel has challenges, such as the high cost of feedstock [
11]. Feedstock is a critical component in biofuel manufacturing, comprising 75% of the total production cost [
13]. There are four generations of biodiesel feedstock. First-generation feedstocks include edible oils such as palm, sunflower, rapeseed, canola, and soybean. Second-generation feedstocks include non-edible oils such as jatropha, neem, rubber seed, and Karanja. Third-generation feedstocks comprise algae, seaweed, waste frying oils, animal fats, waste oils, and fish oils. The fourth generation encompasses synthetic biology, which remains in a state of development [
9]. Using costly edible oils for biodiesel production leads to a conflict between food and fuel, impacting crop yields and land use. As a result, waste feedstocks are being increasingly evaluated for biodiesel production to mitigate elevated edible oil prices [
11]. Butter and margarine production factories produce considerable amounts of waste oils. Some of these oils are flushed from production facilities, increasing waste disposal challenges. These margarine oils, a third-generation feedstock, can be two to three times less costly than edible vegetable oils. This drastically lowers processing costs and establishes it as a valuable raw material for producing biodiesel [
4].
To reduce costs and maximise the yield of biodiesel production, tools such as Response Surface Methodology (RSM), are commonly employed to optimise the operational parameters of the process [
9]. Several researchers used RSM for biodiesel process optimisation. Pugazhendhi et al. [
14] investigated the use of RSM for enhanced biodiesel production from waste cooking oil. A maximum yield of 90% was reached in 63 min. By optimising the biodiesel production process, using RSM has reduced operational costs. Ozgur [
15] optimised biodiesel production parameters to identify the optimal alcohol, catalyst, and reaction time for transesterification of waste frying oil using RSM, achieving an optimal yield of 93.124%. Yang et al. [
16] investigated the optimisation of soybean oil transesterification by the ball-milling method catalyst dosage, reaction time, and rotation speed as process parameters, achieving the optimum yield of 100%. Ao et al. [
17] investigated RSM-optimised Jatropha curcas oil transesterification catalysed by active sites engineered biomass-carbon, reaction time, temperature catalyst load, and methanol-to-oil ratio. These process parameters achieved a 97.1% biodiesel yield. Senusi et al. [
9] performed an optimisation comparative study of third-generation feedstocks (macroalgae oil, waste palm oil, waste sunflower oil, and waste corn oil), with a maximum yield raging from 89.07% to 99.18%. The molar ratio of methanol-to-oil, catalyst concentration, reaction time, and reaction temperature were the process parameters.
Despite a growing body of literature on biodiesel production, a significant research gap remains in optimising biodiesel derived from waste margarine oil. Most existing studies focus on conventional feedstocks, including vegetable oils, waste vegetable oils, and animal fats, resulting in a notable gap in understanding the challenges and opportunities associated with waste oils. Furthermore, the current kinetic models may not apply to waste margarine oil’s unique characteristics. This research seeks to bridge this gap by investigating the reaction kinetics of waste margarine oil and optimising process parameters such as catalyst concentration, methanol-to-oil molar ratio, reaction time, and temperature, hence contributing to the body of knowledge in biodiesel production and waste valorisation, paving the way for more efficient and cost-effective processes in renewable energy.
2. Materials and Methods
The waste margarine oil used as feedstock was obtained from a local margarine production facility. Potassium hydroxide (85%) was used as a catalyst for transesterification, methanol (99.5%) was used as an acyl acceptor, and phenolphthalein indicators were procured from ACE (Associate Chemical Enterprises), Johannesburg, South Africa. Using the Design Expert software (version 13.0.1.0), central composite design (CCD) in response surface methodology (RSM) was employed for experimental design, as shown in
Table 1.
Before transesterification, the waste margarine oil was heated to 110 °C for 1 h to remove any moisture present. The oil was subsequently cooled to room temperature. The suitability of KOH as a catalyst for waste margarine oil was assessed by calculating the FFA content of the oil, following a method described in our previous study [
18]. The FFA content was found to be below the desired value of 2% (1.87 ± 0.059%); therefore, a one-step transesterification route was selected for the transesterification of waste margarine oil. Biodiesel was produced using approximately 100 g of waste margarine oil in every run. Methanol-to-oil molar ratio, catalyst ratio, reaction time, and temperature were varied according to the experimental design at a constant stirring speed of 450 RPM. The experimental runs and yield obtained for every run are shown in
Table S1. The reaction vessel consisted of a two-neck, round-bottom flask, equipped with a condenser and a temperature controller. The condenser was installed to ensure that any evaporated methanol remains within the system during the reaction at temperatures approaching or exceeding the boiling point of methanol. The temperature controller regulated the reaction temperature by automatically adjusting to the predetermined set point [
19]. The reaction vessel was placed on a heating plate to maintain the reaction’s thermal conditions. The experimental setup is shown in
Figure S1.
The designed amount of the catalyst was dissolved in methanol and then transferred to the reaction vessel, which initially contained oil. When the reaction time elapsed, the product mixture was emptied into a separating funnel, separating the biodiesel and the glycerol. The biodiesel was then washed 3 times with distilled water at 60 °C at a ratio of 1:1 (water/biodiesel) to ensure that any traces of methanol and KOH were washed off from the biodiesel. The washed biodiesel was then dried using a heating plate at 105 °C for 1 h until no trace of water was observed. The biodiesel yield was calculated as per Equation (1). A second-order polynomial regression model was employed to establish a relationship between the biodiesel yield and the transesterification process variables, considering first-order, second-order, and interaction effects, as shown in Equation (2):
where
Y is the predicted biodiesel yield,
Xi, and
Xj represent the parameters,
βo is the offset term,
βi and
βj are linear effects,
βij is the first-order interaction effect, and
βjj is the squared effect.
To facilitate and simplify the kinetics study of the waste margarine oil transesterification, the following consideration were taken into account: The reaction kinetics was assumed to follow the first-order reaction. The rate constants were determined by considering the total transesterification processes, while excluding any intermediary stages. Le Chatelier’s principle indicates that a significant excess of methanol shifts the transesterification equilibrium in favour of the forward reaction, rendering the reverse reactions negligible. Due to excess of methanol, the methanol concentration was treated as a constant [
20]. The kinetics models can be represented by Equations (3)–(10).
where
TG is triglyceride,
M is methanol,
G is glycerol,
ME is methyl ester,
r is reaction rate, X is biodiesel conversion,
k is the rate constant, [
TGo] is the initial triglyceride concentration, [
TG] is the actual triglyceride concentration,
t is time,
A is the preexponential factor,
Ea is activation energy,
R is the gas constant (gas constant = 8.314 kJ/kmol. K), and
T is temperature in Kelvin.
3. Results and Discussion
Analysis of variance (ANOVA) was used to evaluate the effect of process variables. As shown in
Table 2, the Model F-value of 142.98 indicated the significance of the model further supported by a
p-value of less than 0.0001 implying that there is only a 0.01% chance that an F-value this large could occur due to noise. Model terms A, B, C, D, AB, AD, BC, BD, CD, A
2, B
2, C
2, and D
2 were significant as they had a
p-value of less than 0.05 indicating the reliability and fitness of the model. This was evidenced by the not significant lack of fit with a
p-value of 0.0808 less than 0.1 which is statistically required. The methanol-to-oil ratio had more impact on the transesterification reaction, followed by the catalyst ratio, temperature, and lastly time. This is indicated by their F-values as shown in
Table 2. The high R
2 of 0.997 further indicated the fitness of the model. The predicted R
2 of 0.7929 was in reasonable agreement with the adjusted R
2 of 0.9900 as shown in the fit statistic
Table S2. A difference of 0.197 was obtained in this study which agrees with a statistically required difference of less than 0.2 than is required. Adequate precision of 37.731 indicates an adequate signal. Statistically, a ratio greater than 4 is desirable. Adequate precision is the measure of signal-to-noise ratio. This model can be used to navigate the design space [
19]. Regression equations in terms of actual factors and coded factors to predicted biodiesel yield in the specified range of process parameters were obtained as shown in
Table S3 and Equation (11), respectively. The predicted yield and the actual yield were found to be closely aligned, as evidenced by data near the point line shown in
Figure S2. The equation in terms of actual factors can be used to make predictions about the response for given levels of each factor. The levels should be specified in the original units for each factor. The equation should not be used to determine the relative impact of each factor because the coefficients are scaled to accommodate the units of each factor, and the intercept is not at the centre of the design space.
The equation in terms of coded factors can be used to make predictions about the response for given levels of each factor. The coded equation is useful for identifying the relative impact of the factors by comparing the factor coefficients.
Figure 1 and
Figure S3 depict the 3D and contour plots of the effects of process parameters on biodiesel yield; (a) shows the interaction effect of the methanol-to-oil ratio and the catalyst ratio at a constant temperature of 50 °C and 60 min; (b) shows the effect of the interaction of the methanol-to-oil ratio and time at a constant temperature of 50 °C and a catalyst ratio of 0.9 wt. %; (c) shows the effect of the interaction of the methanol-to-oil ratio and the temperature at a constant time of 60 min and a catalyst ratio of 0.9 wt. %; (d) shows the effect of the interaction of the catalyst ratio and time at a constant methanol-to-oil ratio of 9 and a temperature of 50 °C; (e) shows the effect of the interaction of the catalyst ratio and the temperature at a constant methanol-to-oil ratio of 9 and time of 60 min; and (f) shows the effect of the interaction of temperature and time at a constant methanol-to-oil ratio of 9 and a catalyst ratio of 0.9 wt.%. The methanol-to-oil ratio was varied from 3 to 15 molar ratio. The results showed an increase in yield as methanol was increased by approximately 90% where a decrease was observed above 12 molar ratios. This increasing behaviour was justified by the fact that transesterification required excess alcohol to shift to the product formation. A decrease is justified by a high methanol-to-oil ratio and can lead to glycerolysis [
5]. The catalyst was varied from 0.3 to 1.5 wt. %. An increase in yield using a catalyst ratio of up to 1.1 wt. % was observed. The catalyst reached the maximum amount as it is required to facilitate the reaction. The decrease is justified by the excess catalyst leading to saponification, affecting the separation [
4,
21]. The temperature was varied from 30 to 70 °C. As the temperature was increased, the biodiesel yield increased, attaining the highest yield at temperatures between 50 °C to 60 °C. At above 60 °C, a decrease in yield was observed. The increase in yield behaviour is explained by the temperature increasing the reaction rate as the activation energy increases [
19]. The decrease is caused by the evaporation of methanol affecting methanol interaction [
17]. Reaction time was varied from 30 to 90 min. The biodiesel yield increased with increased time, reaching a point where there was no more increase observed, and a slight decrease was observed. The increase is justified as a contact time is required for a mass transfer diffusion [
5] of methanol into the waste margarine oil to reach equilibrium, and once equilibrium was reached at approximately 70 min, a slight decrease was observed suggesting that a possible reversible reaction occurred [
5,
17].
Numerical optimisation was performed in RSM as shown in
Table S4. The optimum conditions were selected to be 11.906 methanol-to-oil molar ratio, 1.113 wt. % catalyst ratio, 59.646 min reaction time, and 52.459 °C reaction temperature obtaining the yield of 99.1%, with an error of 0.942%. This solution was selected based on its high yield and low standards of errors. This experiment validated obtaining an experimental yield of 97.67 ± 0.882% which is an acceptable range with the numerical optimum yield.
Figure 2 shows the kinetics and Arrhenius plots used to determine the kinetics.
Figure 2a was used to obtain a rate constant at different temperatures, which was later used in logarithm and temperature, the significant linearity between lnk nd 1000/T over the 303–333 K (30–60 °C). The
Ea was determined by the rate at which the k constant changes with temperature, as shown in
Figure 2b and using Equation (10). The approximate activation energy of 62.41 kJ∙mol
−1 was obtained. The activation energy obtained is close to what was reported by Mwenge et al. [
5] and in the range of 24.7 to 84.1 kJ∙mol
−1 obtained by other researchers [
17].
The biodiesel sample produced under optimum conditions was analysed to assess its compliance with ASTM D6751 standards [
18]. The results shown in
Table 3 indicate that all key fuel properties meet the required specifications. The density of 0.8687 g/cm
3 falls within the acceptable range of 0.86–0.90 g/cm
3, ensuring proper fuel atomisation and combustion. The flash point (148 °C) exceeds the minimum threshold (>130 °C), indicating safe handling and storage. The viscosity (4.6503 mm
2/s) is within the recommended range (1.9–6.0 mm
2/s), ensuring smooth fuel flow. Additionally, the water content (0.0295%), sulphur content (3.32 mg/kg), and cetane number (56) comply with ASTM standards, confirming the biodiesel’s quality and efficiency.