Biodiesel Production from Castor oil by Two-Step Catalytic Transesteriﬁcation: Optimization of the Process and Economic Assessment

: The use of biodiesel and the requirement of improving its production in a more e ﬃ cient and sustainable way are becoming more and more important. In this research work, castor oil was demonstrated to be an alternative feedstock for obtaining biodiesel. The production of biodiesel was optimized by the use of a two-step process. In this process, methanol and KOH (as a catalyst) were added in each step, and the glycerol produced during the ﬁrst stage was removed before the second reaction. The reaction conditions were optimized, considering catalyst concentration and methanol / oil molar ratio for both steps. A mathematical model was obtained to predict the ﬁnal ester content of the biodiesel. Optimal conditions (0.08 mol · L − 1 and 0.01 mol · L − 1 as catalyst concentration, 5.25:1 and 3:1 as methanol / oil molar ratio for ﬁrst and second step, respectively) were established, taking into account the biodiesel quality and an economic analysis. This type of process allowed cost saving, since the amounts of methanol and catalyst were signiﬁcantly reduced. An estimation of the ﬁnal manufacturing cost of biodiesel production was carried out.


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, CH 3 ONa, or CH 3 OK as catalysts [1][2][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 [(9Z, 12R)-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].

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 CH 3 OK, 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 CH 3 OK 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][26][27][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 −1 KOH and 3:1-6:1 molar ratio of CH 3 OH/oil were used. Regarding second stage, the ranges of operation variables were 0.01-0.05 mol·L −1 KOH and 1:1-5:1 molar ratio of CH 3 OH/oil.

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), CH 3 OH/oil molar ratio in the first step (B), catalyst concentration in the second step (C) and CH 3 OH/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).
Ester content (wt%) = 92.961 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 > CH 3 OH/oil molar ratio first step > CH 3 OH/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. 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.

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 CH 3 OH/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 −1 and 3:1 as KOH concentration and CH 3 OH/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 CH 3 OH/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 −1 of KOH and 4:1 CH 3 OH/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 CH 3 OH/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 −1 KOH and 6:1 CH 3 OH/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.

Process Optimization
The most interesting aspect of the response surface graphs was their wide area of high ester yield. This implies stability, being a desirable effect because high ester contents can be obtained under various experimental conditions. In particular, it is possible to find lots of reaction conditions which lead to an ester content greater than 96.5%, the minimum value specified by the European Standard UNE-EN 14214. According to Equation (1), the maximum ester content would exceed 100%; using 0.10 mol·L −1 KOH and 3:1 CH 3 OH/oil molar ratio in the first step and 0.05 mol·L −1 KOH and 5:1 CH 3 OH/oil ratio in the second step, the predicted ester content would be 101.2% (Table 3). However, experimental ester content higher than 98% was not obtained in any reaction. It was expected that the empirical ester content would be close to 98% when the predicted ester content was higher than 98%. This hypothesis was supported by the first reaction in Table 3, whose conditions led to predicted ester contents higher than 100%, and the measured one was close to 98%. On the other hand, the second reaction of this table was carried out under conditions which led to ester content over 96.5%, and the measured one was also higher than 96.5%, so this biodiesel would be within the European standard. 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 −1 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.

Process Optimization
The most interesting aspect of the response surface graphs was their wide area of high ester yield. This implies stability, being a desirable effect because high ester contents can be obtained under various experimental conditions. In particular, it is possible to find lots of reaction conditions which lead to an ester content greater than 96.5%, the minimum value specified by the European Standard Since the experimental conditions to obtain biodiesel from castor oil were optimized, an economic evaluation was carried out. For this economic evaluation, the conditions assuming that the predicted ester content was higher than 96.5% were considered. These conditions are collected in Table S1 of Supplementary Material. The main variable costs of the process, such as the consumed methanol, catalyst, and neutralizer, were determined for each condition. To simplify, only the levels of the factors integrated in the model were considered to this calculation, although similar conditions would be expected to achieve similar results and there would be infinite options. Since four factors and five levels were considered, 54 alternatives were evaluated. Among them, the ester content was predicted to be greater than 96.5% under 74 conditions. Firstly, a biodiesel plant which uses 50,000 tons of castor oil per year was considered. Since biodiesel yield is usually close to 100%, this yield was assumed to the following calculations of this section [19,26]. The process is composed by two heated series reactors. The biodiesel and glycerol phase of the product of the first reactor would be separated, and biodiesel phase would be transferred to the second reactor. Fresh alcohol catalyst solution would also be added. From the products of the reaction, methanol would be recovered in about 90% of unreacted alcohol [2]. The neutralizer was H 3 PO 4 , so an input from the sale of K 3 PO 4 to the industry of fertilizers was added. The prices to purchase one kilogram of CH 3 OH, KOH, and H 3 PO 4 were $0.47, $1.87, and $0.40, respectively. The price of selling one kilogram of K 3 PO 4 was $0.64. These data were obtained from local companies and the Methanex Methanol Price Sheet [36]. According to these values, the annual cost of methanol, catalyst, and neutralizer in the aforementioned biodiesel plant were evaluated. These expenses were calculated for each condition (Table S1 of Supplementary Material) and they were plotted in Figure 2 as variable cost per liter of biodiesel. The cost of castor oil was not considered because it would be the same for all conditions. The numbers in the x-axis represent the experimental conditions considered to calculate the cost. According to the model, all of these conditions will lead to an ester content greater than 96.5%. Among them, the reaction conditions which showed the cheapest processes in terms of feedstock cost would be the numbers 57, 58, 39, and 65. These numbers represent the conditions collected in Table 4. As an example, the number 57 represents 0.06 mol·L −1 as catalyst concentration and 6:1 as MeOH/oil molar ratio for the first step and 0.01 mol·L −1 as catalyst concentration and 3:1 as MeOH/oil molar ratio for the second step. When these conditions were used in a biodiesel plant of 50,000 tons of castor oil, a cost saving close to $400,000 could be obtained in comparison to the most unfavorable conditions collected in Figure 2. On the other hand, the optimal conditions as shown in a previous work, where one-step process was used, were 0.064 mol·L −1 CH 3 OK and 18.8:1 as catalyst concentration and MeOH/oil molar ratio, respectively [8]. Considering these conditions and the same biodiesel plant, close to $800,000 per year could be saved if the process with two steps were used. Therefore, the use of two-step transesterification for this process will suppose important saving costs for reagents.
Catalysts 2019, 9, 864 7 of 16 and 18.8:1 as catalyst concentration and MeOH/oil molar ratio, respectively [8]. Considering these conditions and the same biodiesel plant, close to $800,000 per year could be saved if the process with two steps were used. Therefore, the use of two-step transesterification for this process will suppose important saving costs for reagents.

Process Simulation
Experimental conditions related to run 39 were considered to simulate the process. Due to the high solubility between methanol and castor biodiesel, phase separation was extremely slow when the conditions of run 57 and 58 were used. Therefore, the third condition with lower cost was taken into account. The simulation of a plant of 50,000 tons·year −1 of castor oil was carried out. A continuous process was considered because it is common in industry, especially in plants with high capacities [2]. The process flowsheet is shown in Figure 3. The simulation was carried out with the software

Process Simulation
Experimental conditions related to run 39 were considered to simulate the process. Due to the high solubility between methanol and castor biodiesel, phase separation was extremely slow when the conditions of run 57 and 58 were used. Therefore, the third condition with lower cost was taken into account. The simulation of a plant of 50,000 tons·year −1 of castor oil was carried out. A continuous process was considered because it is common in industry, especially in plants with high capacities [2]. The process flowsheet is shown in Figure 3. The simulation was carried out with the software UniSim Design, and the properties of the main streams of the process were collected in Tables 5 and 6. The process could be improved by energy integration and a study in-depth of the pumping system.  Plant capacity was established as 50,000 tons·year −1 of castor oil transformed to biodiesel; therefore, 6.25 tonnes·hour −1 were considered (8,000 annual operating hours) [10]. As shown in Figure  3, castor oil and fresh methanol were fed to the process by stream 1 and 2, respectively. The stream 3  Firstly, the chemical components were defined for the simulation process. Methanol, glycerol, NaOH (instead of KOH) and water were available in the software component library. The castor oil feedstock and biodiesel were defined as the triglyceride of ricinoleic acid and methyl ricinoleate, respectively. Both compounds were added as hypothetical components [19,37]. Due to the presence of highly polar components, non-random two liquid (extended NRTL) was recommended as thermodynamic model. In addition, liquid-liquid equilibrium data for the system of methanol-glycerol-methyl ricinoleate were faithfully provided by the model [38,39].
Plant capacity was established as 50,000 tons·year −1 of castor oil transformed to biodiesel; therefore, 6.25 tonnes·hour −1 were considered (8,000 annual operating hours) [10]. As shown in Figure 3, castor oil and fresh methanol were fed to the process by stream 1 and 2, respectively. The stream 3 was a 30% catalyst solution in methanol. Conditions and compositions of these streams are shown in Tables 5  and 6. Methanol was added in excess, so the surplus was recovered and purified, and 89.2% of unreacted methanol was recycled. In the first reactor, the reaction was carried out with a 5.25:1 methanol/oil molar ratio, 0.08 mol·L −1 NaOH, 45 • C, and 10 min as residence time. In the second reactor, composition and flow of the streams were regulated to use a 3:1 methanol/oil molar ratio, 0.01 mol·L −1 NaOH, 45 • C, and 10 min as residence time. These conditions were the established in run 39, Table 4.
The reactors used in the simulation were conversion reactor models with 89% oil conversion in the first reactor (CRV-100) and 77.5% remain oil conversion in the second reactor (CRV-101). As previously checked by other authors, the presence of the theoretical reaction intermediates, diacylglycerols and monoacylglycerols, was only observed in the initial stages of the reaction, due to high methanol to oil ratios [40].
In the process flowsheet (Figure 3), the product of the first reactor was led to a liquid-liquid separator (V-100). In the process design, a high-speed disc bowl centrifuge was considered because this separation is very slow for castor oil biodiesel and glycerol [41]. Biodiesel rich phase was led to the second reactor and fresh catalyst and methanol were also added. After this reaction, the product was a monophasic mixture. Methanol was recovered by two in series vacuum distillation (V-101 and V-102) at 50 kPa. The temperatures of these operations were 150 • C in the first separator and 50 • C in the second one. The recycled stream had 99.9% methanol.
The streams of biodiesel from the separators were washed in a water washing column (T-100) with hot water (40 • C). It was a column with four theoretical stages at atmospheric pressure [2,40], and in this step, the total removal of the remaining catalyst, methanol, and glycerol was achieved.
Final biodiesel refinement was conducted through vacuum distillation, in order to obtain biodiesel which was within the EN 14214:2013 standard. According to these specifications, water and methanol contents were lower than 0.05% and 0.20%, respectively. The final amount of biodiesel obtained in the process was 6016 kg·h −1 , with a yield of 96.3% based on the initial oil.
Glycerol rich phase was neutralized with H 3 PO 4 and this operation was simulated by the tool "Component Splitter" (X-100). This tool allowed for the separation of NaOH. The real operation requires a reactor where H 3 PO 4 reacts with KOH and a following step for the separation of the synthesized salts [2]. Finally, a distillation column (T-101) was used for methanol recovery and glycerol purification. The design of this column was carried out according to previous works [40,42] and using the "Short Cut Distillation" software. The achieved glycerol purity was 86.4%, but depending on its desired use, additional purification could be necessary.

Cost Evaluation
Once the production process was established, a cost evaluation was carried out. Firstly, the main units were identified and their sizes calculated. To determine the volume of the transesterification reactors, the volumetric flow of reagents and their residence time were considered; the reactor was a stirred tank with 0.5 as a fill factor. The size of the high-speed disc bowl centrifuge was estimated based on the flow of product that had to be separated. Flash distiller sizes were obtained according to the guidelines established by Silla [43]. The evaporator V-101 was a vertical vessel with cylindrical shape, 4.5 m 3 as total volume and 3 as the length/diameter ratio. The design of V-102 was carried out considering that the inlet stream was mainly composed of vapor. In this case, the length to diameter ratio was 2 and its volume was 0.70 m 3 . The most suitable shape of the distiller V-103 was a horizontal cylinder with 50% as liquid level and 10 min as residence time. Under these assumptions, the volume of the vessel was 2.7 m 3 .
The cost of the water washing column and the neutralization and salt removal units was estimated based on the inlet flow rate [16,40]. Regarding the distillation column for glycerol purification (T-101), design criteria for this type of unit were used [44]. A packed column was chosen instead of a plate column, because of its short dimensions. The packing material was INTALOX ® , 1". The diameter and length of the column were 0.30 and 5.2 m, respectively, considering 65% efficiency [43][44][45]. The cost of the reboiler and condenser were considered in the heat exchanger section.
The costs of the processing units were calculated based on its size and previous data. In addition, the exponential rule of economy of scale was applied, following Equation (2), where S 0 and C S0 are the capacity and cost of the known unit, respectively, and S and C S are the capacity and cost of the unit of which the cost is unknown. Exponent, δ, is characteristic of each technology and δ = 0.65 for the estimation of tanks, reactors, and columns, and δ = 0.80 for the pumps [46].
This rule was also applied to determine the cost of the equipment in an additional plant. A plant which used 16,000 tons·year −1 of castor oil was also evaluated. This plant was considered because the production of castor oil could be smaller in some areas. Fifty thousand tons of castor oil and about one-third of this amount were considered. The cost of the equipment has to be updated, following changes in the value of money due to inflation and deflation according to the chemical engineering plant cost index. Equation (3) was employed, where C A and C B are the current capital cost and the cost in the base period, respectively, and CEPCI A and CEPCI B are the index published in Chemical Engineering Journal. The costs of the major processing units are presented in Table 7. The total capital cost of the plant was estimated by the method of factors developed by Lang and improved by Peter and Timmerhaus [47]. This method was based on the cost of the major processing units. In Table 8, factors and capital costs of the plant were collected. As seen in this table, the cost of the plant increased because of the increase of capacity, however, one plant was more than three times bigger than the other, while its cost was only double. The price of castor oil was considered as an average price of this oil for the European region. However, this price strongly depends on Indian producers, because this country accounts for more than 60% of the global yield [48]. The prices of the rest of the raw materials were also obtained. As shown in Table 9, the costs of the utilities, and fixed costs were collected to obtain the final manufacturing cost of biodiesel in plants with capacity of 50,000 and 16,000 tonnes·year −1 . As seen in Table 9, vegetable oil represents 81% of the biodiesel costs in the plant of 50,000 tons·year −1 and 78% in the smallest plant. Castor oil can be a promising raw material for biodiesel production on account of the low production requirements. Castor bean can be grown in poor or low fertile lands with low rain indexes, making it a good option for poor regions. However, this oil shows high price on the international market, possibly due to its dependence on the Indian market and its use as lubricant and in the chemical industry. The issue of this type of biodiesel is its high viscosity, which make its direct use in injection engines difficult. However, there are some works where castor oil is used to obtain biodiesel because it has good behavior in engines when it is mixed with other biofuels or diesel [4,49].

Transesterification Reaction
Transesterification reactions were carried out in a 500 mL spherical glass reactor connected to a condenser, which had a sampling outlet and stirring, heating, and temperature control systems. The process was composed of two successive transesterification reactions which were carried out in the same experimental setup. For the first step, oil was preheated to 45 • C, the reaction temperature, and a solution with the desired amount of methanol and KOH was added to the reactor. For the second step, after 10 min, the mixture of reaction was separated in a decantation funnel, removing glycerol. Biodiesel phase was put into the reactor again, it was heated (45 • C) and a new solution of catalyst and alcohol was added. After the reaction time (10 min), the catalyst was neutralized with sulfuric acid, glycerol and methanol were removed, and the biodiesel was washed with distilled water. The remaining water was removed by heating at 110 • C.
To optimize the process, catalyst concentration and methanol/oil molar ratio were studied, whereas temperature and time were set at 45 • C and 10 min, respectively, for both steps and every reaction.

Experimental Design and Statistical Analysis
Central composite rotatable design (that is, CCD) was used to evaluate the influence of operational conditions on methyl ester yield. There were five levels of points and four factors for the statistical analysis, as indicated in Table 10. The selected variables were catalyst concentration and methanol/oil molar ratio in the first and the second step. Four factors in 24 full factorial CCD with five levels culminated in 31 runs of experiments (2k + 2k + 7), where k represents the number of independent variables or factors selected. Seven runs of center point experiments evaluated the pure error increased with 8 axial and 16 factorial experimental runs. The variables were normalized in the range from −2 to +2 to compare between variables according to Equation (4): where x i is the normalized value of a certain variable (X) at a certain condition i; X i is the actual value; and X min and X max are the lower and upper limits, respectively. The range of each variable and the decoded values are shown in Table 10. Catalyst concentration in each step was calculated considering the total volume of reaction for each step and the methanol/oil molar ratio for both steps was based on the initial oil amount. Experimental reactions were performed in a random order to minimize errors due to systematic trends in variables. The results were analyzed through RSM to fit a second-order polynomial model (see Equation (5)): where y is the response factor (that is, % methyl ester); x i is the ith independent factor; β 0 is the intercept; β i is the first order coefficient of the model; β ii the quadratic coefficient for i factor; β ij the lineal coefficients of the model for the interaction between i and j factors; and ε the experimental error related to y. The quality of the model fit was assessed by ANOVA test and a confidence level of α = 5% was used to check the statistical significance of the polynomial model. Table 11 shows the experimental conditions, the predicted and experimental values of the response factor and the residual values for each experiment.

Analytical Procedure
Biodiesel was analyzed by gas chromatography, using a gas chromatograph with an FID detector (VARIAN 3900, Varian, Palo Alto, CA, USA). A polyethylene glycol column (Zebron ZB-WAX PLUS, Phenomenex, CA, USA) was used with the following characteristics: length, 30 m; film thickness, 0.5 µm; and i.d., 0.32 mm. Helium (1.4 mL·min −1 ) was used as a carrier gas, and the temperature oven for each run was 220 • C for 34 min and at 245 • C for 29 min with a ramp of 20 • C·min −1 . The injector and detector temperatures were 270 and 300 • C, respectively. Methyl heptadecanoate and methyl erucate were used as standards for the internal standard method for most methyl esters and methyl ricinoleate, respectively. Ethyl acetate was used as a solvent for the standards, and calibration curves were carried out for each standard.

Conclusions
The main findings in this research work are as follows: Two-step transesterification was an effective and economic method to produce biodiesel from castor oil. An analysis of the main variables of the process-catalyst concentration and methanol/oil molar ratio-in both steps showed that this method was quite robust, since a lot of experimental conditions produced a methyl ester yield in excess of 96.5%. An economic assessment of the main variable costs of biodiesel production showed an important reduction of annual expenses when the optimum conditions were used. This decrease was caused by the use of a two-step process instead of one-step, and the optimization of the conditions allowed for the use of response surface methodology. In the complete economic analysis, raw material costs accounted for a major portion of the total manufacturing costs. For this reason, the total manufacturing costs of biodiesel in the smallest industrial plant were close to the value in the biggest plant. The decrease in castor oil price could considerably improve the profitability of the process.