Abstract

In this paper, we develop a function of population, GDP, import, and export by applying a hybrid bat algorithm (BAT) and artificial neural network (ANN). We apply these methods to forecast oil consumption in Iran. For this purpose, an improved artificial neural network (ANN) structure, which is optimized by the BAT is proposed. The variables between 1980 and 2017 were used, partly for installing and testing the method. This method would be helpful in forecasting oil consumption and would provide a level playing field for checking the energy policy authority impacts on the structure of the energy sector in an economy such as Iran with high economic interventionism by the government. The result of the model shows that the findings are in close agreement with the observed data, and the performance of the method was excellent. We demonstrate that its efficiency could be a helpful and reliable tool for monitoring oil consumption.

1. Introduction

The efficient application of energy is a factor which can considerably affect the sustainable development of countries. Energy is a foundation element of the modern industrial economy. Over the past few decades, energy has become a very critical element in industries and also a fundamental product and factor in the growth of the economy in different world regions. The ever-increasing dependence of human life on energy has made this factor play a critically crucial role either potentially or actively in the functions of various economic sectors of countries [1]. Given the vital applications of energy in different economic sectors and also the rise of the population over past years, energy has turned the center of attention as one of the most significant factors of production [2]. Oil, natural gas, electric power, solar, wood, animal, and plant waste could be recognized as Iran’s basic energy resource [3]. The oil industry is a fundamental factor in the economy of Iran and the government’s annual budget. It affects foreign trade, the national capital, and developments in nonpetroleum exports [4]. Therefore, recognizing the factors that affect the needed energy in a country is required in managing the energy supplement. Based on the reality that the energy demand procedure and factors that affect it go through vague and complicated patterns, determining efficient instruments for appropriate energy use is necessary. Due to the increasing demand for energy, the assessment of it is necessary. Different optimization techniques, e.g., birds, bats, and fireflies, are appropriate to forecast these models [1]. Different models are presented to determine the possible approach ever in modeling energy issues as a function of various indicators. Given the high dependency of the Iranian economy on oil incomes, acquiring data by employing precious and qualified methods in this field will result in more efficient planning. Hence, the studies in this field have a considerable degree of importance. We examine the relationship between oil consumption in Iran and diverse independent variables, based on socioeconomic factors, using the BANN (hybrid bat algorithm and artificial neural network) technique. Results arising from the present study provide important reference information for the utility companies in pursuing patterns of oil consumption and selecting a more accurate approach to estimate future oil demand.

A few studies that propose several models for energy demand policy management with different techniques are introduced. Pourdaryaei et al. [5, 6] in two studies worked on short-run electricity price forecasting using hybrid algorithms. Using a hybrid method for electricity price forecasting via artificial neural network and artificial cooperative search algorithm and using the hybrid backtracking algorithm and the adaptive neuro-fuzzy inference system (ANFIS) approach have improved the accuracy and effectiveness. Kaboli and Alqallaf [7] conducted a study on solving the problem of sending nonconvex economic load via an artificial algorithm for cooperative research. Thus, they used a method that is to interfere and work with feasible solutions throughout the optimization. Hlal et al. [8] conducted an optimization study based on NSGA-II and MOPSO for sizing a hybrid PV/wind/battery energy storage system. Kıran et al. [9] applied artificial bee colony (ABC) and particle swarm optimization (PSO) techniques to forecast electricity energy demand in Turkey in two forms (linear and quadratic) by using selected socioeconomic and demographic variables that included gross domestic product (GDP), population, import, and export. Behrang et al. [4] presented GSA (gravitational search algorithm) oil demand estimation models to be used in the Iran context. In another study, Behrang et al. [10] predicted the total energy demand in Iran from 2006 to 2030, using the bees algorithm technique. Ceylan et al. [11] developed the harmony search (HS) technique to forecast Turkish transport energy demand in tree forms (linear, exponential, and quadratic) based on three factors including population, GDP, and vehicle kilometers. The energy consumption in Turkey is also determined by using the ant colony (ACO) by Toksari [12] with independent variables such as population, GDP, import, and export.

According to what has been presented, using nonclassic methods for the identification and prediction of complex systems-related problems has been expanded [13]. Hence, in this study, a novel approach for oil consumption forecasting is presented. Heuristic methods are used for the better optimal solutions and to overcome the complexity of the nonlinearities [14]. The authors’ main goal, therefore, is to employ artificial methods, because of their accuracy, and present new methods, such as the proposed hybrid, in the field of oil and gas, to acquire more precise information and data.

This paper is organized as follows. First, a brief introduction is presented. In the next section, we explain the specification of the BANN (hybrid bat algorithm and artificial neural network). Section 3 presents optimization and method validation. In Section 4, the model estimations are done, and finally, in the last section, the conclusion is given.

2. Methods and Material

2.1. Bat Algorithm (BA)

The BAT algorithm was introduced by Yang [15]. This algorithm is an evolutionary algorithm inspired by the behavior of natural bats in locating their foods. It is used to solve various problems. BA starts with an initial population of bats. It employs a homologous manner by performing an echolocation method for updating its position [16]. Bats send a signal with the loudness of frequency 20 kHz to 500 kHz. This signal is deflected back after striking the object to bat as an echo signal. The echo signal is used to calculate the bat’s distance to any object which is the destination of the bat [17, 18]. Bats fly towards the object or prey, and they reduce their pulse rate when they reach the closer object. Bats continue to do so till the distance becomes zero [18, 19]. Also, they can distinguish between insects and obstacles to hunt prey based on the echo [20]. The BA is summarized in the following three main principal rules [1521]:(1)Each bat utilizes echolocation characteristics to estimate the distance and to distinguish between prey and obstacles.(2)Each bat flies randomly with position , velocity with constant frequency , updated wavelength , and loudness to seek for prey. It automatically changes the frequency of its pulse emission and regulates the rate of pulse release r in a range [0, 1] based on the proximity of its target.(3)Frequency, loudness, and pulse released rate of each bat is varied. The loudness is adjusted from a large value (positive) to a minimum constant value.

In the simulations, each bat is associated with a velocity and a location with iteration t, in a d-dimensional search or solution space. Therefore, the above three rules can be translated into the updating equations for and velocities :where is a random vector outcome from a uniform distribution. is the best current universal position, achieved after comparing the locations of all then bats. The frequency during a range corresponds to a range of wavelengths . Indeed, the frequency just varies while the wavelength is constant, and it is assumed that in implementation [22].

For the local search, a solution is selected among the best current solutions, and a new solution for each bat is produced using a random walk.where is a random number while is the average loudness of all bats. The loudness normally reduces when a bat finds its prey while the rate of the pulse emission increases. The loudness may be chosen as any value of convenience. It can be chosen as any value of convenience between and assuming which means that a bat has just found the prey and provisionally stops emitting sound. It is shown in the following:where t is the iteration number during the optimization process. As time moves towards infinity, the loudness tends to be zero; then,.

2.2. Artificial Neural Network (ANN)

Artificial neural network is a famous artificial intelligent method that simulates the work of the human mind mechanism. It is a method that handles information coming from different nodes in this model known as neurons. These nodes are embedded in different layers which will work together to solve a complicated problem [23].

Artificial neural network is a mathematical approximation to the human nervous system that have been widely used to solve various nonlinear problems. The structure of ANN contains the elements of the input layer, hidden layer, and output layer. A network can contain multiple different hidden layers enabling the network to have computational and processing abilities. The number of layers is dependent on the problem complexity. In general, a neural network is a set of connected input and output units that each connection has an associated weight [13].

An artificial neural network (ANN) contains the elements of the input layer, hidden layer, and output layer. The ANN can contain multiple different hidden layers enabling the network to have computational and processing abilities.

Figure 1 shows an artificial neural network (ANN) with a hidden layer, which contains some weights connecting between layers. The output values are going to be calculated through the subsequent steps.

First, the sum of weights is calculated as follows:where is the input variable, is the weight between the input variable and neuron j, and is the input variable’s bias term.

Second, neurons’ output values in the hidden layers are produced from the received values of weighted summation (equation (4)) by using an activation function. A popular choice of such a function is a sigmoid function as follows:where is the sigmoid function for neuron j and is the sum of weights.

Finally, the output of neuron j is calculated as follows:where is the output of neuron j, is the weight between the output variable and neuron j, is the activation function for neuron j, and is the output variable’s bias term [24].

2.3. Proposed Method

The goal of employing a bat algorithm and artificial neural network simultaneously is to present a higher performance estimation and forecast. When the bat algorithm is embedded into an ANN to optimize its initial weights and biases, it will play a well-suited role in addressing a number of the deficiencies caused by the randomness of the initial weights and biases of ANN. The main goal of using the BAT algorithm to optimize the ANN is to combine them, using the initial connection weights between ANN layers and the initial biases between neural nodes, to optimize the distribution, execute global searches within the solution space, and find the optimal initial weights and biases of the ANN at a rapid convergence rate. Subsequently, the initial weights and biases obtained by the ANN are often used for training and testing the sample set. The ANN with the optimal weights and biases is formed and trained to predict the output. The flowchart of the BANN algorithm is shown in Figure 2.

3. Optimization and Method Validation

Optimal tuning of PI controllers for load frequency controller design was proposed by Abd-Elazim and Ali [25]. Their results of numerical simulation demonstrated the superiority of BA in comparison with simulated annealing in PI controller optimization. Bat algorithm which is a heuristic method is used for selecting features. It is a metaheuristic algorithm. The process of optimization uses it. Function minimization or maximization is a major problem in optimization. Randomization is used for computing the best solution in the best optimum way [26]. Different measures are applied to examine the estimation accuracy and forecasting ability of different estimators. The most popular ones are mean squared error (MSE) or root mean squared error (RMSE) [13] and correlation coefficient (R).

4. Empirical Results

To obtain oil consumption data, it is necessary to normalize in the first step. Equation (7) was used in this regard.: normalized value, XR: the value to be normalized, : the minimum value in all the values for the related variable, and : the maximum value in all the values for the related variable. and values for each variable are selected between 1980 and 2012 and are shown in Table 1.

The input parameters of the BANN included population, gross domestic product, import, and export, and the oil consumption was considered as the BANN output parameter [1]. The data on these parameters were divided into training, testing, and data validation. 70% of these data were used for training, 15% of data were used for validation, and the rest were used for testing.

Figures 35 show the best validation performance graph and regression plot between actual and predicted data in the BANN method. Tables 2 and 3 and Figure 6 show the performance evaluation of BANN outputs.

Figure 7 and Table 4 for the modeling and the testing data show the performance of the BANN method.

Table 5 shows the comparison of different models introduced in the introduction and present study.

5. Conclusion

Demonstration of the significance of employing hybrid estimation strategies in the energy sector is the point of the present study. The relationship between economic development and energy consumption in developing countries is something essential, and it needs proper calculation for a wide variety of economic, social, and technological features. Therefore, in this study, the BANN (hybrid bat algorithm and artificial neural network) has been successfully used to estimate Iran’s oil consumption based on the structure of Iran’s socioeconomic conditions. Oil consumption is estimated based on population, GDP, import, and export. The proposed method anticipated oil consumption in terms of relative errors and RMSE.

Given the high dependency of the Iranian economy on oil incomes, acquiring data by employing precious and qualified methods in this field will result in more efficient planning. According to Table 5, the empirical results of Iran’s data exhibit that the accuracy of the BANN method was more precise than that of the other methods. Regarding the results, oil consumption is influenced by population, GDP, import, and export. Hence, the findings proved that the recommended model was an appropriate tool for effective oil consumption prediction in Iran. It will provide a level playing field for checking the energy policy authority impacts on the structure of Iran’s energy with high economic interventionism by the government.

The BANN success in such a study suggests that it could be applied as a practical instrument for energy-economic analysis in various areas, such as designing energy systems with more theoretical specifications complexity. Forecasting oil consumption can also be studied by other metaheuristics including harmony search and simulated annealing. The results of different methods could be put into analogy with the BANN method.

Data Availability

All data are available in the British Petroleum Company plc and BP Amoco plc [27].

Conflicts of Interest

The authors declare that they have no conflicts of interest.