Adaptive Neuro-Fuzzy Inference System (ANFIS) and Artificial Neural Network (ANN) for Predicting the Kinematic Viscosity and Density of Biodiesel-Petroleum Diesel Blends

Biodiesel is considered as an alternative source of energy obtained from renewable materials. In the present paper, the investigation of the applicability of adaptive neuro-fuzzy inference system (ANFIS) and artificial neural network (ANN) approaches for modeling the biodiesel blends property including kinematic viscosity and density at various temperatures and the volume fractions of biodiesel. An experimental database of kinematic viscosity and density of biodiesel blends (biodiesel blend with diesel fuel) were used for developing of models, where the input variables in the network were the temperature and volume fractions of biodiesel. The model results were compared with experimental ones for determining the accuracy of the models. The developed models produced idealized results and were found to be useful for predicting the kinematic viscosity and density of biodiesel blends with a limited number of available data. Moreover, the results suggest that the ANFIS approach can be used successfully for predicting the kinematic viscosity and density of biodiesel blends at various volume fractions and temperature compared to another models.


Introduction
Increasing environmental consciousness such as the concerns about greenhouse gas, global warming, and emissions and the soaring price of oil associated with the depletion of the world's oil reserves have drawn researchers' interest in alternative renewable sustainable energy sources [1][2][3].
Vegetable oils, non-edible oils and their derivatives such as biodiesel have received increasing attention due to their promising characteristics. These renewable sources are biodegradable [4] carbon neutral [5] and clean-burning fuels [6] with almost-zero sulphur content.
Biodiesel is a mixture of mono-alkyl esters of saturated and unsaturated long chain-fatty acids obtained by a transesterification of oils and fats from plant, animal sources [1]. Both vegetable oils and biodiesel can be directly used in conventional petroleum diesel engine with little modification or fuel modification [7]. Moreover, when various blends of petroleum diesel and vegetable oils [8] or petroleum diesel and biofuels [9] are used, the engines work without any damage to their parts and without any engine modifications.
One of the most advantage of biodiesel is reduced the level of pollutants [10]. In addition, biodiesel has become attractive because it is biodegradable [4]. Biodiesel has higher point, also is non-toxic, and essentially free of sulfur and aromatics than petro-diesel fuel. Furthermore, it improves remarkably the lubricity of diesel in blends. In addition, it has some disadvantages such as lower heat of combustion and higher cloud point [11].
Comparing biodiesel with petro-diesel, the density, density, viscosity, cloud point and cetane number of biodiesel is higher than petro-diesel. In general, the main important biodiesel properties are density and viscosity because they have a direct effect on the atomization process during combustion, Accurate prediction methods are of great practical value in predicting the biodiesel properties and relevant studies can be found in the recent literature. For instance, in the middle 1960s Gouw and Vlugter [12] used the Smittenberg relation 9 to estimate the density of saturated methyl esters at 20°C and 40°C. Allen et al. [13] proposed empirical correlations to estimate the viscosity of saturate and unsaturated FAMEs as a quadratic function of their molecular weight. Krisnangkura et al. [14] fitted empirical equations to predict the temperature-dependent kinematic viscosities of saturated FAMEs as a function of the carbon number in the corresponding fatty acid. In general, mathematical models [15,16], statistical models [17][18][19][20][21][22], neuro fuzzy [23][24][25] and artificial neural network [26][27][28][29][30][31] have been used in predicting the properties of biodiesel including viscosity, density or cold flow properties.
This present study evaluated the efficiency of ANFIS and ANN in accurately predicting the kinematic viscosity of biodiesel blends at different degrees of blends and temperatures using biodiesel obtained from rapeseed oil and other types of vegetable oils. The details of the calculation method, numerical validation, and comparative statistical analysis are fully described in this work. The ANFIS and ANN to be developed in this paper address a more extensive database that published in other works [32][33][34][35][36][37][38][39][40][41][42][43][44][45][46][47][48][49].

ANFIS Model Development
ANFIS is a kind of adaptive neuro-fuzzy inference system which connects fuzzy logic system with neural network and constructs hybrid intelligent system and benefits from the advantages of both fuzzy logic and neural networks, and its efficiency in very accurate models has been proved. In this work, the thermo-physical properties of two biodiesel and their blends was modeled using ANFIS. A fuzzy model was developed for the prediction of the kinematic viscosity, density and dynamic viscosity of five biodiesel samples. The typical ANFIS model, which has five layers (fuzzification, product, normalization or rule, defuzzification and overall summation layers), was proposed for the process [50]. A characteristic fuzzy rule in a Sugeno fuzzy model can be represented as follows: If x is M and y is N, then h = f (x, y) where M and N are the fuzzy sets, h = f (x, y) is a function resulting from M and N.
Assuming h = f (x, y) is a first-order Sugeno fuzzy inference system (FIS) model with two fuzzy rules [50]: Rule 1. If x is M 1 and y is N 1 , Then f 1 = r 1 x + s 1 y + t 1 Rule 2. If x is M 2 and y is N 2 , Then f 2 = r 2 x + s 2 y + t 2 where, f i is the system output, r i , s i , and t i are adjustable parameters.

Artificial Neural Network (ANN)
ANNs are computational models composed of processing units called neurons that are connected together to form a network. The computation that each neuron performs, along with the way they are interconnected, decides particular type of neural network. The network usually consists of an input layer, some hidden layers and an output layer. The information contained in the input layer is mapped to the output layer through the hidden layers [51]. The number of hidden layers and neurons within each layer can be designed by the complexity of the problem and data set. The estimation problem using neural network models has three successive steps: model building or neural network architecture, the learning or training procedure, and the testing procedure. An important stage when accommodating a neural network is the training step, in which an input is introduced to the network together with the desired outputs, the weights and bias values are initially chosen randomly and the weights are adjusted so that the network attempts to produce the desired output. The weights, after training, contain meaningful information, whereas, before training, they are random and have no meaning. When a satisfactory level of performance is reached, the training stops, and the network uses these weights to make decisions [52]. A back propagation (BP) algorithm was chosen to calculate the weight values of the network. BP is composed of two phases. The knowledge is processed from the input layer to the output layer by means of a feedforward phase. In the BP phase, the difference between network output values obtained in feed forwarding and desired output value is compared with previously determined difference tolerance and the error in output layer is calculated. This error value is propagated backward to update the links in the input layer [53].

Appraisal of the Developed Models
The developed ANFIS and ANN models were evaluated comprehensively for predicting the biodiesel properties of biodiesel samples. The following statistical indicators were employed: correlation coefficients (R), coefficient of determination (R 2 ), mean squared error (MSE), and root mean squared error (RMSE).
where n is the number of experimental data, a p,i is the predicted values, a e,i is the experimental values, a e,ave is the average experimental values, a p,ave is the average predicted values and i is the number of input variables.

Experimental Data
Kinematic viscosity and density data of different biodiesel blends samples at different temperatures and volume fraction of biodiesel were gathered from the literature. A total of 900 and 520 experimental points for kinematic viscosity and density, respectively, were obtained from various scientific publications [32][33][34][35][36][37][38][39][40][41][42][43][44][45][46][47][48][49]. The development of the proposed approaches was performed as follows. In the first step, the experimental measurement data were separated into input data (independent variables, including temperature and volume fraction of biodiesel and output data (dependent variable in term of kinematic viscosity and density). Subsequently, different approaches (ANFIS and ANN) were proposed to describe the behavior of the kinematic viscosity and density as a function of temperature and volume fraction of biodiesel. In this case, the database was randomly divided into three groups with 60% to training, 20% to testing and 20% to checking or validation. The temperature and volume fraction biodiesel were considered as input variables on ANFIS and ANN. Since the input variables and output variables on the ANFIS and ANN have different magnitude, a normalization of them is required [54,55].

Adaptive Neuro-Fuzzy Inference System (ANFIS) Model of Density
The model was trained with part of the database derived from the experimental results of previous studies. The database was first split into training data and testing data. The training data set was also split into two parts, a training set and a checking set. The use of checking sets in ANFIS learning beside the training set is a recommended technique to guarantee model generalization and to avoid over-fitting the model to the training data set.
In this study, by trial and error, the best number of membership functions for each input was determined as 6, the membership grades takes the Gaussian-shaped membership functions and the output part of each rule uses a constant defuzzifier formula.
In this research, two methods, hybrid and back propagation tested for generation ANFIS that the results is presented in Table 1. The results show the training error in the hybrid method is lower of back-propagation method. Therefore, the hybrid method has used for simulations. The structure (rules) of the tuned FIS is shown in Figure 1, which contains 36 rules with AND logical connector for all rules. In order to develop ANFIS models for designing the density of biodiesel, the available data set from the previous study, which was consisted of two input (temperature and volume fraction of biodiesel with diesel) vectors and their corresponding output vector (density), was used. This data set was randomly assigned as the training set. After training, fuzzy inference calculations of the developed model were performed. The three-dimensional surface plots of kinematic viscosity of biodiesel blend with benzene against temperature and volume fraction of biodiesel is depicted in Figure 2. The plot suggest strong interaction between the variables with significant influence on the density of biodiesel blends. From the Figure, increasing in volume fraction of biodiesel leads to increase the density of biodiesel blends, while the lowest temperature leads to decrease the density of biodiesel blends as shown in Figure 2.   Figure 3. It can be observed from the figure that the density increased as the percentage of biodiesel blend with diesel increased for each temperature considered. Additionally, it can be noticed that increasing temperature leads to decrease the density of biodiesel blends. Furthermore, Figure 4 shows the comparisons of ANFIS with experimental results for density of biodiesel blends, which also show good agreement between ANFIS predicted data and experimental data. The R-squared values are also close to unity highlighting proper fitting of the predicted values of density with experimental data.

Artificial Neural Network (ANN) Model of Density
The development and the training of the network model in this study were carried out using the MATLAB Neural Network Toolbox. In this study, the experimental data of 454 biodiesel samples were randomly split into three data set, 60% in the training set, 20% in the validation set and 20% in the test set.
The inputs and targets are normalized into the range [-1, 1] to make the training procedure more efficient. Training of the network was performed by using the Levenberg-Marquardt, back-propagation algorithms. There is no general rule for the determination of the optimum number of hidden layers and usually it is determined through trial and error method. Therefore, the number of neurons in the hidden layer was determined by trial and error test, where a mean squared error greater than 1 ×10 -3 and a correlation coefficient higher than 0.9 was obtained. In addition, with the trial and error method, training results showed that the ANN with three hidden layers has the best performance. Consequently, the developed ANN model for predicting density biodiesel blends is shown in Figure 5 and the training parameters can be found in Table 2. The developed network architecture has a 2-3-1 configuration with two neurons in the input layer indicating temperature and volume fraction of biodiesel. Three hidden layers with varying neurons and ten neurons in the output layer representing density are used.   Figure 6 illustrates a linear relation for the training, validation, testing and performance of the network with high correlation coefficients (R) of density. The straight lines in Figure 6 are the linear relationships obtained between the output (predicted) and the target (experimental) data of density used in this study. The mean squared error (MSE) for density network is 1.16×10 -3 . The high coefficients of correlation (R) obtained during the training, validation and testing of the density network display very good relationship between the output and the experimental values of density.  To evaluate the performances of the ANN modeling further, Figure 8 shows the results of fitting the predicted and experimental values for density of biodiesel, using linear regression equations. These clearly show the fit values, and variance of the results predicted by the ANN models has been expressed in terms of R-squared (R 2 ) values, which are quite encouraging. R-squared value is a measure of goodness-of-fit, which means how close the data points are to the fitted regression line. These values are close to unity, as shown in Figure 8, highlighting proper fitting of the predicted values by the adopted methodology.

Adaptive Neuro-Fuzzy Inference System (ANFIS) Model of Kinematic Viscosity
The proposed ANFIS methodology to predict the kinematic viscosity of biodiesel blends using various biodiesel obtained from vegetable oils or waste vegetable oils. The developed ANFIS model for predicting the kinematic viscosity at different temperature and volume fraction of petro-diesel is shown in Figure 9. The model was trained with part of the database derived from the experimental results of literature studies. A total of 934 experimental points were obtained from various scientific publications to estimate the kinematic viscosity of biodiesel blends. The database was first split into training data (80%) and testing data (20%). The training data set was also split into two parts, a training set (60%) and a checking set (20%). In this work, the best number of membership functions for each input was determined as 3, the membership grades takes the Gaussian-shaped membership functions and the output part of each rule uses a constant defuzzifier formula, which found by trial and error methods. Moreover, two methods (hybrid and back-propagation) are tested for generation ANFIS that the results is obtained in Table 3. The results show the training error in the hybrid method is lower of back-propagation method. Therefore, the hybrid method has used for this study. The 3D surface plots of kinematic viscosity of biodiesel blend with benzene against temperature and volume fraction of biodiesel is depicted in Figure 10 The plot suggest strong interaction between the variables with significant influence on the kinematic viscosity of biodiesel blends. From the Figure, increasing in volume fraction of biodiesel leads to increase the kinematic viscosity of biodiesel blends, while the highest temperature leads to decrease the kinematic viscosity of biodiesel blends as shown in Figure 10.  Figure 11 illustrates the results of fitting the predicted and experimental values for kinematic viscosity of biodiesel blends, using linear regression. It can be seen that these values are close to unity highlighting proper fitting of the predicted values by the adopted methodology.

Artificial Neural Network (ANN) Model of Kinematic Viscosity
The kinematic viscosity of biodiesel blends was estimated considering an input layer with two independent variables (temperature and volume fraction of biodiesel) eight neurons in the four hidden layer, as well as one response variable in the output layer (kinematic viscosity), which made an architecture of 2: 4: 1 as shown in Figure  12. Approximately 60% of the experimental data was used for training and 20% for validation, while the remaining 20% was reserved for testing. The observed experimental data were normalized for improving the performance of the network. The back propagation algorithm was used for training the ANN model. The performance of ANN model is noticeably affected by the number of hidden layers and number of neurons in each hidden layer. The optimum number of neurons in the hidden layer was selected as 4. The maximum number of epochs and goal were fixed as 1000 and 0.000001, respectively, during the training. For the chosen network the training performance is achieved with minimum error of 8.6581 × 10 −6 error rate, which is shown in Figure 13. A linear relation for the training, validation, testing and performance of the network with high correlation coefficients (R) of kinematic viscosity of biodiesel blends is shown in Figure 14. The high coefficients of correlation (R) obtained during the training, validation and testing of the kinematic viscosity network display very good relationship between the output and the experimental values of kinematic viscosity. The results of fitting the predicted and experimental values for kinematic viscosity of biodiesel blends, using linear regression is shown in Figure 15. It can be seen that these values are close to unity highlighting proper fitting of the predicted values by the adopted methodology.  Figures 16 and 17 show a comparison for the calculated density and kinematic viscosity data using ANFIS and ANN approaches expressed by their percent absolute error, the results are in the range of 0.2% to 3% and 0.2% to 5% for predicted density data using ANFIS and ANN, respectively as shown in Figure 16. Moreover, the results of kinematic viscosity using ANFIS and ANN are in the range of 0% to 10% and 0.7% to 25%, respectively as shown in Figure 17. Figures 16 and 17 indicate that ANFIS approach gives an excellent agreement between the experimental and predicting values of density and kinematic viscosity of biodiesel.

Conclusions
Viscosity and density are the most significant properties of biodiesel because of its major effect on the engine performance. For this reason reliable mathematical models that accurately describe the kinematic viscosity and density of biodiesel as a function of temperature and biodiesel fraction are of great interest for the development of combustion models as well as for the design of process equipment.
This work proves two empirical approaches, which are ANFIS and ANN to predict the density and kinematic viscosity of biodiesel blends at various temperatures and volume fraction of biodiesel, which is characterized by only two adjustable parameters.
The following conclusions can be drawn from the study: a. The densities and kinematic viscosity of diesel fuels are lower than biodiesels. Therefore, the density and kinematic viscosity of the blend increases with the increase of biodiesel concentration. b. The ANFIS and ANN methods used the temperatures and biodiesel fraction as inputs and the density and kinematic viscosity of biodiesel blends were output. Results indicate that the proposed ANFIS method is able to predict the most accurate biodiesel densities and kinematic viscosities with the overall R 2 of 0.95 compared with the other approaches. c. There is an excellent agreement between the experimental data and estimated values for the densities and kinematic viscosities. d. Overall, the ANFIS method presented the best accuracy with the highest R-squared. e. The statistical indices used in performance assessment of the developed models showed that the predictions of ANFIS model were more accurate than ANN model. Because of R-squared of the model is higher than ANN approach.