# Developing a Novel Method for Estimating the Speed of Sound in Biodiesel Known as Grey Wolf Optimizer Support Vector Machine Algorithm

Authors: Zhenzhen Lv; Ming Hu; Yixin Yang; Jeren Makhdoumi
Journal: BioMed Research International
 (2021)

---

## Abstract

In the current study, our goal was to obtain a robust model to predict the speed of sound in biodiesel. For this purpose, an extensive databank has been extracted from previously published papers. Then, a Support Vector Machine (SVM) has been optimized by Grey Wolf Optimization (GWO) method to analyze these data and determine the correlation between speed of sound in biodiesel and its related properties including pressure, temperature, molecular weight, and normal melting point. The results were very satisfactory because the values of statistical parametersR2 and RMSE were obtained 1 and 1.4024, respectively. Here, this is the first time that the sensitivity analysis is used to estimate this target value. This analysis shows that the pressure widely affects the output values with relevancy factor 87.92. Also, our proposed method is highly accurate than other machine learning methods used in papers employed for this objective.


---

## Body

## 1. Introduction

In the future, the use of petroleum and fossil fuels will be limited [1]. A large number of studies have recently investigated biodiesel utilization within engines [2]. The need for oil imports would be reduced by using animal or agricultural sources to produce methyl esters. This can improve energy security and the local economy and lead to a satisfactory carbon emission balance [3]. Moreover, biodiesel combustion within a diesel engine typically emits smaller quantities of carbon [3–5].Biodiesel can be extracted from several chemical compositions of feedstock. Due to the dependence of fat/oil structures in fatty acids on the source of oil/fat, biodiesel highly varies in physicochemical properties, including the cold-flow properties and cetane number [3]. Hence, the biodiesel type is considerably important in combustion and emissions [6].It is important to identify better fatty acid compositions in order to enhance engine performance and diminish emis2sions. This has been studied by numerous works [7–11]. It is rational to relate the properties of biodiesel to some important oil characteristics, e.g., fatty acid composition, chain length, number of double bonds, unsaturation degree, and molecular weight [12–16]. Earlier works related the fatty acid composition and cetane number through regression models [12]. The use of different methods of artificial intelligence has been widely used in various sciences [17–21], and the cetane number was studied using artificial neural networks (ANNs) and multiple linear regression models [13]. Furthermore, temperature and density were associated in previous studies [22]. Some researchers related the cetane number, viscosity, density, and increased heating value to the number of double bonds and molecular weight [23]. The cetane number, oxidative stability, cold filter plugging point, and iodine value were related to the long-chain saturated factor and methyl ester unsaturation degree [24]. Some studies related the number of double bonds and the number of C atoms in the fatty acid [25].Biodiesel utilization in engines was broadly investigated [26] under transient conditions [27]. Furthermore, broad examinations were performed statistically to find and study the impacts of biodiesel feedstock on emissions of engines [28] and fuel properties [29].As an important and practical property, the present study focuses on the prediction of speed of sound in biodiesel in order to develop an accurate predictive correlation formulation based on the fatty acid composition through a multiple linear regression known as SVM-GWO. This very important property of biodiesel has received less attention from researchers, so we were looking for an accurate model to be able to estimate this functional property with high accuracy. In this paper, an extensive database has been used and an attempt has been made to evaluate the accuracy of this model using various analyses.


## 2. Materials and Methods

### 2.1. Support Vector Machine (SVM)

The SVM is one of the machine learning (ML) methods. Rather than other techniques, this technique works based on a minimum of structural risk expressed by statistical theory [30]. This technique, for the first time, is proposed by Vapnik in 1992 for classification problems [31]. Afterward, it was developed by Cortes and Vapnik, in 1995 and 1997, for regression problem adaptation [32, 33]. SVM can be employed for both linear and nonlinear problems, but for nonlinear problems, it must be improved by kernel functions. The SVM equations are given in the following [34]. In Equation (1), a sample dataset is used for training using the SVM regression model, where yi, xi, d, and R are output, input, input space dimension, and output space, respectively.(1)xi,yix∈Rd,y∈R,i=1,2,⋯,n.In Equation (2), the input data is mapped from Rd space to a high-dimension one, Rk (k>d).(2)ψx=ϕx1,ϕx2,⋯,ϕxn.Equation (3) introduces the prediction model for SVM as follows:(3)fx=ωTϕx+b,ω∈Rk,⋯,ϕxn,whereb, ω, and fx are bias constant, weight, and a nonlinear mapping function, respectively, and ω and b are defined by Equation (4) with minimal structural risk.(4)minR=12ω2+c×Remp,where ω2 is used to handle the difficulty of the model, c is the regularization coefficient, and Remp is a function for handling errors. Also, for optimizing the objective function, Remp is defined as the linear term of the error of SVM. So, Equation (4) can be changed into Equation (5) using the relaxation factors, ξi and ξi∗, and insensitivity loss function, ε:(5)minJ=12ω2+c∑i=1nξi+ξi∗yi−ωTϕxi−b≤ε+ξi,ωTϕxi+b−yi≤ε+ξi,ξi,ξi∗≥0i=1,2,⋯,n.Also, the Lagrange function is given by Equation (6) to solve the SVM error.(6)Lω,ξi,ξi∗,α,α∗,c,β,β∗=12ω2+c∑i=1nξi+ξi∗−∑n=1nαiωTϕxi+b−yi+ε+ξi−∑n=1nα∗iyi−ωTϕxi−b+ε+ξi∗−∑n=1nβiξi+βi∗ξi∗,αi,αi∗,βi,βi∗>0,where αi, αi∗, βi, βi∗∞ are defined as Lagrange factors. According to Karush-Kuhn-Tucker optimization conditions (Equation (7)) and symmetric kernel function (Equation (8)), the optimization problem can be obtained as Equation (9).(7)∂L∂ω=0⟶ω=∑i=1nαi−αi∗ϕxi,∂L∂b=0⟶ω∑i=1nαi−αi∗=0,∂L∂ξi=0⟶c−αi−βi=0,∂L∂ξi∗=0⟶c−αi∗−βi∗=0,(8)Kxi,xj=ϕxiTϕxj,(9)maxWαi,αi∗=−12∑ij=1nαi−αi∗αj−αj∗Kxi,xj+∑i=1nαi−αi∗yi−∑i=1nαi−αi∗ε(10)s.t.∑i=1nαi−αi∗=00≤αi,αi∗≤c.So, the SVM regression function is given by(11)fx=∑i=1nαi−αi∗Kxi,xj+b.The SVM method utilizes different kernel functions. In the current work, we used the radial basis kernel function (Equation (12)), where σ is representative of the width parameter of this function.(12)Kxi,xj=exp−xi−xj22σ2.


### 2.2. Grey Wolf Optimization (GWO)

The GWO algorithm was introduced by Mirjalili et al. in 2014 as a novel metaheuristic algorithm inspired by the social hunting of grey wolves [35]. Generally, this algorithm follows four classes including (1) decision-making is performed by alpha (α) wolves about everything, (2) the alpha wolves are supported/consulted by beta (β) wolves, (3) the delta (δ) wolves must surrender to α and β wolves, and finally in (4) the other wolves are defined by omega (ω), which have to follow α and β orders. The ω wolves must help others whenever required [36, 37]. So, the hierarchy of power reduces from α to ω. In four classes, a specific optimization issue is defined by solutions of the GWO algorithm. So, α, β, and ω are the best solutions in this algorithm, and others are considered as ω. With this definition, the algorithm is updated in every iteration. The process of the algorithm follows these rules for prey: searching, surrounding, chasing, and attacking. The surrounding is given as follows:(13)Xt+1=Xpt−A×D,where A, D, Xpt, Xt+1, and t are the matrix coefficient, the distance between the prey and grey wolf, the position vector of each wolf, the next position of a grey wolf, and the current iteration whose calculations are given by(14)D=C×Xpt−Xt,A=2ar1−a,C=2ar2,where r1,r2 are the random vectors from 0 to 1.In the hypersphere form, the relocation around the prey is feasible with the help of these equations. So, theω wolves can update their positions as follows:(15)Xt+1=X1+X2+X33,where X1, X2, and X3 are defined as the following:(16)X1=X∝t−A1×D∝,X2=Xβt−A2×Dβ,X3=Xδt−A3×Dδ,D∝=C1×X∝t−Xt,Dβ=C2×Xβt−Xt,Dδ=C3×Xδt−Xt.


### 2.3. Designing the GWO-SVM Model

Concerning the previous discussion,C, ε, and γ are used to handle the SVM performance. So, the GWO can be optimized by these factors. Table 1 depicts the characteristics of the GWO-SVM algorithm.Table 1
Details of the implemented GWO-SVM algorithm.
ParameterValue/commentKernel functionRBFNo. of train data786No. of test data262Optimization techniqueGWOC52263.664ε0.5033Γ0.07825


### 2.4. Gathering Data and Selecting Features

In this study, the database containing 1048 data with various variables related to the test system of the speed of sound in biodiesel— i.e., temperature, melting point, pressure, and molecular weight, has been collected from previously published papers. The source and range of inputs and output data are given elsewhere [38]. Three-quarters of the data are selected as training phase data and one-quarter of them are randomly separated as testing phase data.


## 2.1. Support Vector Machine (SVM)

The SVM is one of the machine learning (ML) methods. Rather than other techniques, this technique works based on a minimum of structural risk expressed by statistical theory [30]. This technique, for the first time, is proposed by Vapnik in 1992 for classification problems [31]. Afterward, it was developed by Cortes and Vapnik, in 1995 and 1997, for regression problem adaptation [32, 33]. SVM can be employed for both linear and nonlinear problems, but for nonlinear problems, it must be improved by kernel functions. The SVM equations are given in the following [34]. In Equation (1), a sample dataset is used for training using the SVM regression model, where yi, xi, d, and R are output, input, input space dimension, and output space, respectively.(1)xi,yix∈Rd,y∈R,i=1,2,⋯,n.In Equation (2), the input data is mapped from Rd space to a high-dimension one, Rk (k>d).(2)ψx=ϕx1,ϕx2,⋯,ϕxn.Equation (3) introduces the prediction model for SVM as follows:(3)fx=ωTϕx+b,ω∈Rk,⋯,ϕxn,whereb, ω, and fx are bias constant, weight, and a nonlinear mapping function, respectively, and ω and b are defined by Equation (4) with minimal structural risk.(4)minR=12ω2+c×Remp,where ω2 is used to handle the difficulty of the model, c is the regularization coefficient, and Remp is a function for handling errors. Also, for optimizing the objective function, Remp is defined as the linear term of the error of SVM. So, Equation (4) can be changed into Equation (5) using the relaxation factors, ξi and ξi∗, and insensitivity loss function, ε:(5)minJ=12ω2+c∑i=1nξi+ξi∗yi−ωTϕxi−b≤ε+ξi,ωTϕxi+b−yi≤ε+ξi,ξi,ξi∗≥0i=1,2,⋯,n.Also, the Lagrange function is given by Equation (6) to solve the SVM error.(6)Lω,ξi,ξi∗,α,α∗,c,β,β∗=12ω2+c∑i=1nξi+ξi∗−∑n=1nαiωTϕxi+b−yi+ε+ξi−∑n=1nα∗iyi−ωTϕxi−b+ε+ξi∗−∑n=1nβiξi+βi∗ξi∗,αi,αi∗,βi,βi∗>0,where αi, αi∗, βi, βi∗∞ are defined as Lagrange factors. According to Karush-Kuhn-Tucker optimization conditions (Equation (7)) and symmetric kernel function (Equation (8)), the optimization problem can be obtained as Equation (9).(7)∂L∂ω=0⟶ω=∑i=1nαi−αi∗ϕxi,∂L∂b=0⟶ω∑i=1nαi−αi∗=0,∂L∂ξi=0⟶c−αi−βi=0,∂L∂ξi∗=0⟶c−αi∗−βi∗=0,(8)Kxi,xj=ϕxiTϕxj,(9)maxWαi,αi∗=−12∑ij=1nαi−αi∗αj−αj∗Kxi,xj+∑i=1nαi−αi∗yi−∑i=1nαi−αi∗ε(10)s.t.∑i=1nαi−αi∗=00≤αi,αi∗≤c.So, the SVM regression function is given by(11)fx=∑i=1nαi−αi∗Kxi,xj+b.The SVM method utilizes different kernel functions. In the current work, we used the radial basis kernel function (Equation (12)), where σ is representative of the width parameter of this function.(12)Kxi,xj=exp−xi−xj22σ2.


## 2.2. Grey Wolf Optimization (GWO)

The GWO algorithm was introduced by Mirjalili et al. in 2014 as a novel metaheuristic algorithm inspired by the social hunting of grey wolves [35]. Generally, this algorithm follows four classes including (1) decision-making is performed by alpha (α) wolves about everything, (2) the alpha wolves are supported/consulted by beta (β) wolves, (3) the delta (δ) wolves must surrender to α and β wolves, and finally in (4) the other wolves are defined by omega (ω), which have to follow α and β orders. The ω wolves must help others whenever required [36, 37]. So, the hierarchy of power reduces from α to ω. In four classes, a specific optimization issue is defined by solutions of the GWO algorithm. So, α, β, and ω are the best solutions in this algorithm, and others are considered as ω. With this definition, the algorithm is updated in every iteration. The process of the algorithm follows these rules for prey: searching, surrounding, chasing, and attacking. The surrounding is given as follows:(13)Xt+1=Xpt−A×D,where A, D, Xpt, Xt+1, and t are the matrix coefficient, the distance between the prey and grey wolf, the position vector of each wolf, the next position of a grey wolf, and the current iteration whose calculations are given by(14)D=C×Xpt−Xt,A=2ar1−a,C=2ar2,where r1,r2 are the random vectors from 0 to 1.In the hypersphere form, the relocation around the prey is feasible with the help of these equations. So, theω wolves can update their positions as follows:(15)Xt+1=X1+X2+X33,where X1, X2, and X3 are defined as the following:(16)X1=X∝t−A1×D∝,X2=Xβt−A2×Dβ,X3=Xδt−A3×Dδ,D∝=C1×X∝t−Xt,Dβ=C2×Xβt−Xt,Dδ=C3×Xδt−Xt.


## 2.3. Designing the GWO-SVM Model

Concerning the previous discussion,C, ε, and γ are used to handle the SVM performance. So, the GWO can be optimized by these factors. Table 1 depicts the characteristics of the GWO-SVM algorithm.Table 1
Details of the implemented GWO-SVM algorithm.
ParameterValue/commentKernel functionRBFNo. of train data786No. of test data262Optimization techniqueGWOC52263.664ε0.5033Γ0.07825


## 2.4. Gathering Data and Selecting Features

In this study, the database containing 1048 data with various variables related to the test system of the speed of sound in biodiesel— i.e., temperature, melting point, pressure, and molecular weight, has been collected from previously published papers. The source and range of inputs and output data are given elsewhere [38]. Three-quarters of the data are selected as training phase data and one-quarter of them are randomly separated as testing phase data.


## 3. Results and Discussion

In this section, we evaluate the ability of the proposed model to predict the target parameter, which is followed by various analyses.


### 3.1. Sensitivity Analysis (SA)

In terms of exploring the impact of input data on the output, SA is defined as a mathematical method and used to determine useful priorities after the recognition of methodological errors and vital regions [39]. There are two forms for SA including local and global. The assessment of an input effect on results, while others are constant, is performed by local SA whereas the global SA evaluates the effect which stemmed from inputs on the outcome whenever changed [40].The impact of input parameters on the speed of sound has been shown in Figure1 that the most effective one is related to pressure with the relevancy factor of 87.92%.Figure 1
Sensitivity analysis on the input parameters.Also, the relative factors of temperature, melting point, and molecular weight, with scores of −29.56%, −25.63%, and 15.18%, are not so big.


### 3.2. Outlier Analysis

Another statistical method used in this study is outlier diagnosis. This method is considered a fundamental method applied to determine datasets with different behavior from all data [41, 42]. It uses leverage statistical technique to find the outliers having parameters such as standardized residuals (R), critical leverage limit (H∗), and Hat indices (H) [43, 44]. H and H∗ are defined as follows:(17)H=XX′X−1Xt,H∗=3np+1,where X together with t are the two-dimensional (n×k) matrix and transpose matrix, respectively. Also, p and n are the numbers of input parameters and training points, respectively. Here, the likely Hat solutions include the main diagonal space of H. Also, Williams’ plot, defined by R versus H, is used to determine the outlying candidates. Then, the feasible data region is introduced as a squared area to limit the warning leverage value on the horizontal and vertical axes and cut-off value, which is usually ±3, respectively. R and H are placed out of the valid area—i.e., −3,3 and 0,H∗—and classified as the outliers. Figure 2 depicts Williams’ plot of GWO-SVM outputs. It is observed that most of the data values are placed in the valid area and the rest of them, including 16 points, have a higher value than H∗. So it is demonstrated that the useful GWO-SVM algorithm can detect the inherent relationships between the speed of sound value and input parameters in addition to having a much more acceptable approach.Figure 2
Outlier analysis to determine suspicious data points.


### 3.3. Model Assessment

The model assessment is performed by the speed of sound values that resulted in training and testing of the proposed model. Figure3 shows these values versus the data index. It is proved that this model has the considerable capability to predict the speed of sound in biodiesel.Figure 3
Observational comparison of real values and their corresponding modeled values for test and train data.Also, to assess the accuracy of results with real values, the determination coefficient,R2, is used and varies from 0 to 1. The R2 values for testing and training the GWO-SVM dataset are 1 and 1, respectively. Thus, the accuracy of the predicted model is verified. The diagram of real values versus predicted values is shown in Figure 4.Figure 4
Regression plot to determine the accuracy of the proposed model in predicting actual values.The main part of the speed of sound in biodiesel values situates along the bisector line which shows how the GWO-SVM model is able to do prediction with high accuracy. Also, Figure5 depicts the percentage of deviation for the GWO-SVM model which is not more than 0.6% that demonstrates the precision of the model.Figure 5
Relative deviation analysis to determine the accuracy of the SVM-GWO model.Also, Table2 shows statistical analyses of the SVM-GWO model and verifies the accuracy of this model for predicting the speed of sound in biodiesel.Table 2
Statistical analyses based on the proposed SVM-GWO model.
SetR2MRE (%)MSERMSESTDTrain1.0000.0611.9254454981.38761.0321Test1.0000.0611.9666022711.40241.0542Total1.0000.0611.9357346911.40241.0371


### 3.4. Comparison with Literature

Table3 shows the comparison done between previously developed models (SGB and GP) by Abooali et al. [38] and our model for predicting the speed of sound in biodiesel. As it turns out, the model proposed in this study has a higher ability to predict output values because it has more R2 and less RMSE compared to other models.Table 3
Comparison between the accuracy of different models in predicting target outcomes.
Statistical parameterSGB modelGP modelSVM-GWO modelR20.999960.998031.000RMSE1.558.819071.4024


## 3.1. Sensitivity Analysis (SA)

In terms of exploring the impact of input data on the output, SA is defined as a mathematical method and used to determine useful priorities after the recognition of methodological errors and vital regions [39]. There are two forms for SA including local and global. The assessment of an input effect on results, while others are constant, is performed by local SA whereas the global SA evaluates the effect which stemmed from inputs on the outcome whenever changed [40].The impact of input parameters on the speed of sound has been shown in Figure1 that the most effective one is related to pressure with the relevancy factor of 87.92%.Figure 1
Sensitivity analysis on the input parameters.Also, the relative factors of temperature, melting point, and molecular weight, with scores of −29.56%, −25.63%, and 15.18%, are not so big.


## 3.2. Outlier Analysis

Another statistical method used in this study is outlier diagnosis. This method is considered a fundamental method applied to determine datasets with different behavior from all data [41, 42]. It uses leverage statistical technique to find the outliers having parameters such as standardized residuals (R), critical leverage limit (H∗), and Hat indices (H) [43, 44]. H and H∗ are defined as follows:(17)H=XX′X−1Xt,H∗=3np+1,where X together with t are the two-dimensional (n×k) matrix and transpose matrix, respectively. Also, p and n are the numbers of input parameters and training points, respectively. Here, the likely Hat solutions include the main diagonal space of H. Also, Williams’ plot, defined by R versus H, is used to determine the outlying candidates. Then, the feasible data region is introduced as a squared area to limit the warning leverage value on the horizontal and vertical axes and cut-off value, which is usually ±3, respectively. R and H are placed out of the valid area—i.e., −3,3 and 0,H∗—and classified as the outliers. Figure 2 depicts Williams’ plot of GWO-SVM outputs. It is observed that most of the data values are placed in the valid area and the rest of them, including 16 points, have a higher value than H∗. So it is demonstrated that the useful GWO-SVM algorithm can detect the inherent relationships between the speed of sound value and input parameters in addition to having a much more acceptable approach.Figure 2
Outlier analysis to determine suspicious data points.


## 3.3. Model Assessment

The model assessment is performed by the speed of sound values that resulted in training and testing of the proposed model. Figure3 shows these values versus the data index. It is proved that this model has the considerable capability to predict the speed of sound in biodiesel.Figure 3
Observational comparison of real values and their corresponding modeled values for test and train data.Also, to assess the accuracy of results with real values, the determination coefficient,R2, is used and varies from 0 to 1. The R2 values for testing and training the GWO-SVM dataset are 1 and 1, respectively. Thus, the accuracy of the predicted model is verified. The diagram of real values versus predicted values is shown in Figure 4.Figure 4
Regression plot to determine the accuracy of the proposed model in predicting actual values.The main part of the speed of sound in biodiesel values situates along the bisector line which shows how the GWO-SVM model is able to do prediction with high accuracy. Also, Figure5 depicts the percentage of deviation for the GWO-SVM model which is not more than 0.6% that demonstrates the precision of the model.Figure 5
Relative deviation analysis to determine the accuracy of the SVM-GWO model.Also, Table2 shows statistical analyses of the SVM-GWO model and verifies the accuracy of this model for predicting the speed of sound in biodiesel.Table 2
Statistical analyses based on the proposed SVM-GWO model.
SetR2MRE (%)MSERMSESTDTrain1.0000.0611.9254454981.38761.0321Test1.0000.0611.9666022711.40241.0542Total1.0000.0611.9357346911.40241.0371


## 3.4. Comparison with Literature

Table3 shows the comparison done between previously developed models (SGB and GP) by Abooali et al. [38] and our model for predicting the speed of sound in biodiesel. As it turns out, the model proposed in this study has a higher ability to predict output values because it has more R2 and less RMSE compared to other models.Table 3
Comparison between the accuracy of different models in predicting target outcomes.
Statistical parameterSGB modelGP modelSVM-GWO modelR20.999960.998031.000RMSE1.558.819071.4024


## 4. Conclusions

In this study, the SVM-GWO model has been proposed to investigate the effect of structural features on the performance of the speed of sound in biodiesel. The database containing large experimental data has been collected from previously published papers. Comparing all of the ML models, our model showed the best accuracy. So it has great capability to assist in the objective design of the speed of sound in biodiesel. Furthermore, it was shown that the pressure has the highest impact on the output values. In conclusion, according to the obtained maximum value of the coefficient of determination and minimum RMSE, our model is considered the most precise model to predict the speed of sound in biodiesel; therefore, it can be used to estimate this important property in related processes.



---

*Source: 5368987-2021-07-02.xml*