## 1 Introduction
presented a differential equation model for conducted in two continuous stirred-tank reactors in series and using two decanters considering only the transesterification of palm oil [4]. [PERSON] et al. developed a model, via mass and energy balances, for conducting transesterification in a continuous tubular reactor operating with only soybean oil supply [16]. [PERSON] et al. developed a mass balance for the chemical equilibrium, reaction kinetics, and mass transfer required for transesterification in a continuous tubular reactor, a model which considers the kinetics of glyceries containing different combinations of gadoleic, linoleic, linolenic, oleic, palmitic, and stearic acids [17]. Thus, a methodology for the modeling of oil changes in the feed streamduring the continuous operation of a CSTR of biodiesel is presented in this work. Following the proposed methodology, a first principles model for a industrial continuous stirred-tank reactor of transesterification [3] was developed, and then an evaluation of the disturbances effects caused by feed oil changes during the continuous reactor operation was developed based on model simulations. Mass and energy balances techniques are used to model the reactor in this work. Palm, mustard, and sunflower oils were used as feedstock for the reaction operation. These oils were selected from an exhaustive literature revision because the kinetic parameters of their transesterification were determined with similar experimental conditions. The results show that temperature is practically not affected after oil changes; however, the ester concentration varies considerably. The ester mass fraction varying by up to 22.07% after a change from palm to mustard oil. Mathematical models for continuous stirred-tank reactor of biodiesel developed with the methodology presented in this study have important practical applications. These models can help to improve the economic viability for biodiesel production process. [PERSON] and [PERSON] enhance the economic performance of a batch transesterification reactor producing biodiesel by implementing advanced control strategies based on a first principle model [18]. In addition, these models can help in decision-making. For example, it can be used to estimate the cost of feedstock changing during the continuous operation of a biodiesel production line and evaluate the cheaper form to make the changes: stopping the production line or during the continuous operation. Furthermore, these models can be used in the design of control strategies that will be able to ensure the production specifications when disturbances occur caused by oil changes. Various studies in the literature present the design of advances control strategies based on first principle models, such as adaptive or predictive control systems, to ensure the production specifications and to face common disturbances and changes of the production requirements [3; 4; 12; 13; 14; 15; 19]. Moreover, the model of biodiesel reactors can be used to develop observers for the online estimation of concentration variables which are not available for online measurements [4; 20]. These practical implications for the present work are important because modern plants need technology capable of adapting to the challenging and changing operating conditions of biodiesel industry. This paper is divided in five sections: Introduction, General aspects of biodiesel, Methodology, Results and Discussion, and Conclusions. The Introduction posits the current work within the previous relevant literature; furthermore, it establishes the research problem, the main aim, and the solution proposed. Section 2 presents important aspects of biodiesel such as the processes for biodiesel production, type of raw materials, important variables in the production process, and others. Section 3 presents the methodology utilized in this work to develop the mathematical model that is used to develop the analysis of the disturbance effects caused by the oil changes.