**1. Introduction**

Nowadays, fossil fuel depletion and the increase in atmospheric carbon dioxide concentration are two of the main reasons to promote sustainable alternatives for petroleum products. Biodiesel can be considered as a real alternative for diesel because of its renewable character and its use in any compression ignition engine [1]. The most commonly used route to obtain biodiesel is through transesterification of vegetable oils (or other sources such as animal fats) with methanol as an alcohol and NaOH, KOH, CH3ONa, or CH3OK as catalysts [1–3]. Non-edible vegetable oils such as castor oil could be considered as appropriate raw material because it is not used in human diet, its plants can grow in agronomically poor soils, and its oil yield is higher than in the case of other energy crops [4]. The main component of this oil is the triglyceride formed of the unsaturated hydroxyl-fatty acid, ricinoleic acid [(9*Z*, 12*R*)-12-hydroxy-9-octadecenoicacid]. This compound is the main cause of the high viscosity and polarity of castor oil [4]. Such properties would limit its use as a biodiesel; nevertheless, as is usually done for other biodiesel samples [5], mixtures with castor oil biodiesel show good properties when mixed with conventional diesel or other less viscous biodiesels [6], and can also be used in mixtures as oil [7]. In addition, castor oil shows high solubility in alcohols, which favors transesterification [8].

Biodiesel production from castor oil was studied in mixtures with soybean oil. Nevertheless, nonsignificant substrate preference was observed [9]. On the other hand, the use of co-solvents was

an additional method for improving castor oil biodiesel yield [10]. In this case, hexane was used as a co-solvent and biodiesel yield was not significantly a ffected by the presence of this compound. A high alcohol/oil molar ratio, 20:1, was also necessary. The transesterification of castor oil using methanol was done with ultrasound; the highest ester content was 93.3% [11]. Solid catalysis was also tested in castor oil transesterification [12]. The catalyst was composed of Ag salts and 29:1 methanol/oil molar ratio, 60 ◦C, and a reaction time of 3 h were necessary to reach 90% biodiesel yield. As seen in previous works, the e ffort to enhance the results of the conventional method did not lead to completely satisfactory conclusions. The highest ester content, 97%, was obtained with homogeneous basic catalysis and conventional heating. However, 18.8:1 methanol/oil molar ratio was necessary [8].

The transesterification is a reversible reaction. When enough catalyst is present in the reaction medium, chemical equilibrium is reached. Methanol is usually added in higher ratios than the stoichiometric ratio (3:1) in order to shift the equilibrium position of the reaction towards the product side. However, this fact strongly increases the final cost of the process due to the fact that methanol expenses are higher. Therefore, the optimization of the process is vital to reduce environmental impacts and costs [13]. In this research work, a process with two steps was proposed to obtain castor oil biodiesel with high methyl ester content and decrease costs. In this way, two reactions were carried out and, before the second one, the glycerol produced in the first reaction was removed. The removal of this product promoted a change in the equilibrium position towards the products. The aim of this work was to assess the best transesterification conditions to improve the process and reduce production costs. The operation conditions were optimized to obtain high methyl ester yields and the best conditions were economically evaluated. Some economic assessments have been carried out for industrial plants of biodiesel production [14–18]. However, there was little information when castor oil was used as a feedstock [19]. Therefore, the global process of biodiesel production from castor oil in an industrial plant was evaluated, and the final cost of biodiesel production was calculated for the analyzed plant.

#### **2. Results and Discussion**

## *2.1. Raw Material*

Oil properties and its corresponding fatty acid content are shown in Table 1. The oil content of the feedstock used was equivalent to the composition of a typical castor oil: 90% ricinoleic acid, 4.5% linoleic acid, and 3.6% oleic acid [20]. Ricinoleic acid, with a hydroxyl group, shows very di fferent properties compared to other fatty acids, that is, regarding density and viscosity, it was highly hygroscopic and had a low iodine value and high solubility in alcohols. The latter is the most interesting characteristic considering transesterification to obtain biodiesel because it promotes this chemical reaction at low temperatures [21,22]. Compared with other vegetable oils, there were clear di fferences in fatty acid profile, with oleic acid being the majority fatty acid for rapeseed and sunflower oils. This di fference in fatty acid composition could explain the di fference in observed properties.

The low acid value of this oil made the use of basic catalysis possible for transesterification [23]. This way, potassium hydroxide was selected, as basic catalysts are suitable for oils with low acid values [21,24].


**Table 1.** Castor oil fatty acid profile and properties and comparison with other biodiesel from vegetable oils.

N.D. = not detected.

#### *2.2. Reaction Conditions and Variables of the Design*

In previous works, castor biodiesel was obtained using a one-step reaction process, achieving 97% methyl esters [8]. This ester content was suitable for its use as biodiesel; however, a very high concentration of alcohol was necessary. The methanol/oil ratio was 18.8:1. In addition, the used catalyst was CH3OK, which means high costs and preventive measures to avoid contact with atmospheric moisture. In this work, two serial transesterification reactions were proposed to decrease MeOH concentration and to avoid the use of CH3OK as a catalyst because it would involve higher costs in an industrial process [14,16,19,26]. In this case, KOH was used as a catalyst because it is cheaper and easier to use.

The transesterification reaction has five important operational conditions: catalyst percentage, methanol/oil molar ratio, temperature, time, and stirring speed. The high solubility between castor oil and methanol was to avoid mass transfer problems. A stirring speed of 700 rpm was maintained in order to ensure thermal homogeneity, and based on previous works with the same system [8,25–28]. Regarding reaction temperature, this parameter was maintained at 45 ◦C as this was the optimal temperature in previous works with castor oil, and its variation showed just slight effects in transesterification [8,29,30]. In the literature, the reaction time is usually 1–2 h; however, the equilibrium is normally reached during the first minutes of reaction [29,31,32]. In addition, previous work carried out with castor oil showed 10 min was a suitable reaction time [8]. Hence, 10 min was chosen for the first and second step in this work.

On the other hand, catalyst and methanol concentrations have been the most influencing factors in transesterification, and their effects are related each other [8,33,34]. Therefore, these variables for the first and second stages were considered in the experimental design. The ranges of these variables were established based on previous reactions. In the first stage, 0.02–0.10 mol·L−<sup>1</sup> KOH and 3:1–6:1 molar ratio of CH3OH/oil were used. Regarding second stage, the ranges of operation variables were 0.01–0.05 mol·L−<sup>1</sup> KOH and 1:1–5:1 molar ratio of CH3OH/oil.

#### *2.3. Regression Model Development*

The experimental conditions of the runs by the coded levels of the variables are shown in the Materials and Methods section. As previously mentioned, the studied variables were catalyst concentration in the first step (A), CH3OH/oil molar ratio in the first step (B), catalyst concentration in the second step (C) and CH3OH/oil molar ratio in the second step (D). These variables were analyzed by central composite rotatable design and the experimental conditions of the runs by the coded levels of the variables are shown in Table 2. The response variable was the biodiesel ester content achieved for each reaction, and these data were also collected in the table. The central conditions of the design produced biodiesel with average ester content of 93.0%. The results were analyzed through multiple regressions, testing various models such as linear, two-factor interaction, three-factor interaction, two and three factor interaction, cubic, quadratic, and cubic plus quadratic models, with the quadratic one best fitting real data as was seen for the transesterification reaction in previous works [8,33,35]. Equation (1) shows the estimated response model equation for methyl ester content of biodiesel (related to original factors).


As can be seen in Equation (1), linear terms showed positive coefficient values, quadratic terms showed negative coefficients, and some cross-product terms were positive and some of them negative. For this reason, the equation of the model will describe a response surface where the maximum ester yield can be observed. The ANOVA test of the response surface is shown in Table 2. The effect of the factors in the response variable followed this order: catalyst concentration first step > CH3OH/oil molar ratio first step > CH3OH/oil molar ratio second step > catalyst concentration second step. The determination coefficient pointed to the suitability of the model (0.966). The *P*-value of the model was lower than 0.05, implying a statistical relation between the response surface and the variables at a confidence level of 95%. In addition, the *p*-value for the parameter lack of fit was 0.0941, greater than 0.05; then, the model was appropriate to fit the actual data, there was no significant lack of fit. Most terms of the model were significant. In conclusion, the model fits the experimental data faithfully and can be used to predict experimental data.


**Table 2.** Analysis of variance table for response surface quadratic model.

In the Materials and Methods section, the predicted values from the model and the measured values under the same experimental conditions are shown. As seen, the predicted values agreed with the observed ones in these operating conditions. On the other hand, the residuals were randomly dispersed so there was no correlation between the obtained errors and the value of the response variable. This fact can be checked in Figure S1 of Supplementary Material.

#### *2.4. Response Surface Graphs*

Response surface graphs are one of the most usual ways to show the regression equation in the RSM. When the model considers more than two variables, two of them can be plotted, keeping the remaining constant. In Figure 1a, the effect of catalyst concentration and CH3OH/oil molar ratio in the first step and their interaction are shown. The conditions for second reaction were kept at the central values of the model (0.03 mol·L−<sup>1</sup> and 3:1 as KOH concentration and CH3OH/oil molar ratio, respectively). As seen, the increase of catalyst and methanol concentrations led to a significant increase of the ester content of the biodiesel. The stoichiometric molar ratio between castor oil and methanol is 3:1; however, this alcohol ratio was not enough to reach ester content greater than 95%. As seen in the figure, when CH3OH/oil molar ratio was lower, the increase in catalyst concentration in the first step would lead to higher ester contents, and vice versa. This behavior has been observed by other authors when these variables were studied in one-step processes [5,34]. On the other hand, Figure 1b shows the response surface of methyl ester yield when the catalyst proportion and methanol/oil molar ratio in the second step were varied. In this case, the higher the catalyst or methanol concentrations, the higher the obtained ester content. However, the effect of catalyst concentration on the second step was less significant than in the case of the first step and, in general, changes in conditions of the second step had less effect on the final result. According to this figure, the most suitable reaction conditions were 0.05 mol·L−<sup>1</sup> of KOH and 4:1 CH3OH/oil ratio. Then, these conditions were kept constant and the response surface of Figure 1c was plotted, where catalyst and methanol concentration in the first step were varied. In this case, the maximum ester content was achieved with high catalyst concentration and low CH3OH/oil molar ratio in the first step. The 3:1 ratio would be enough to reach high conversions, in contrast to the results plotted in Figure 1a. Finally, the condition in the first step which maximized the ester content in Figure 1a were considered (0.10 mol·L−<sup>1</sup> KOH and 6:1 CH3OH/oil molar ratio), and the response surface of Figure 1d was drawn. The optimal results differed with the previous figure once again. Therefore, there is a need to reach the condition of equilibrium between both reactions to determine the most suitable conditions.
