The application of particle swarm optimization algorithm in forecasting energy demand of residential-commercial sector with the use of economic indicators

Article history: Received June 4, 2014 Accepted 10 October 2014 Available online October 14 2014 Energy supply security is one of the strategic issues of all states. Beside the energy supply management, the section that has received less attention is energy demand management. According to importance of residential and commercial sectors in energy consumption, in the present study energy demand of these sectors is estimated using linear and exponential functions and the coefficients are obtained from PSO algorithms. 72 different scenarios with various inputs are investigated. Data from the years 1968 to 2011 are used to develop the models and select the suitable scenario. Results show that an exponential model developed based on particle swarm optimization algorithm has had the best performance. Based on the best scenario the energy demand of residential and commercial sectors is estimated 1718 Mega barrel of crude oil equivalent up to the year 2032. © 2014 Growing Science Ltd. All rights reserved. Particle swarm optimization Forecasting Energy


Introduction
Efficient use of energy is a factor that can significantly influence on the sustainable development of countries and not one should disregard this important issue on its way towards development.Due to the increase in population and significant use of energy in various economic sectors in recent years, energy has become the center of attention as the most important production factor (Assareh et al., 2010).Moreover, determining the factors influencing on required energy in a country is necessary in management of energy supplement.According to the fact that the energy demand procedure and factors influencing it follow vague and complicated patterns, identifying efficient tools for proper energy consumption is essential.Therefore, it seems necessary to find efficient tools to identify energy demands, accurately.In Iran, energy estimation in residential and commercial sectors constitutes 34 percent of the total energy consumption (Azadeh & Tarverdian, 2007) .
This paper predicts the trend of energy demand for residential-commercial sector using linear and exponential models as well as particle swarm optimization algorithm.To this end, different scenarios with various inputs are studied and the best scenario is selected.Several studies are presented to propose some models for energy demand policy management using intelligence techniques.Some of highlighted researches in this field are shown in Table 1.According to the knowledge of these studies, the action of meta-heuristics algorithms to predict the energy demand is essential, but none of the studies has been conducted to evaluate various scenarios to predict energy demand.In the present study, we use particle swarm optimization algorithm (PSO) to select the best scenario for the residential-commercial sector of Iran and try to fill out the gap of other studies.

Particle Swarm Optimization Algorithm
Particle swarm optimization is an evolutionary algorithm for optimizing functions, which is designed based on social behavior of birds by Kenedy in 1995.In this algorithm, a group of particles, as the variables of an optimization problem, are dispersed in the search environment.Obviously, some particles will occupy better positions than others do.Therefore, according to aggregative particles' behavior, other particles will attempt to raise their position to the prior particles' positions.In this method, position change is accomplished based on every particle's experience obtained in previous motions as well as the experiences of neighborhood particles.In fact, every particle is aware of its priority/non priority over neighborhood particles as well as over whole the group (Mikki & Kishk, 2008).Fig. 1 shows the flow chart of the mentioned algorithms.
Fig. 1.The proposed study • Each particle tries to modify its position using the following information:  the current positions,  the current velocities,  the distance between the current position and pbest,  The distance between the current position and the gbest.
• The modification of the particle's position can be mathematically modeled according to the following equation : where v i k : velocity of agent i at iteration k, w: weighting function, c j : weighting factor, rand : uniformly distributed random number between 0 and 1, s i k : current position of agent i at iteration k, pbest i : pbest of agent i, gbest: gbest of the group.

Materials and methods
As mentioned before, this research evaluates different scenarios with different inputs and selects the best scenario.After studying different research and acquiring experts' opinions, the model's variables including input and output variables Fig. 2B (Shakouri, 2011) are categorized in two sets) described below: The prototype of data Any of the above mentioned inputs can be considered as an input variable.For instance, the added value of all economic sectors, total added value minus petroleum sector and national income can be considered as an input variable.Different scenarios assume each of the variables as an input variable, investigate the test data, and finally select the best scenario.Regarding 12 input variables (Fig. 2A), 72 models of four were obtained by combining the variables as different scenarios.Table 2 shows the models.Then, each model was investigated in two states: a) linear state as per Eq. ( 4) and b) exponential state as per Eq. ( 5).Therefore, it can be argued that 288 scenarios will be investigated.

⋯
(5) ⋯ Here, α, β, γ and c are the coefficients derived from the genetic algorithm.x(t) stands for the model's input variable in terms of time and y(t) stands for the model's output variable showing the energy consumption of residential-commercial sector by one mega tons of crude oil equivalent.288 models were designed using genetic and particle swarm optimization algorithms and their validity is confirmed using root mean square error (RMSE) fitness function and mean absolute percentage error (MAPE) as Eq. ( 6) and Eq. ( 7) are shown, respectively.The y actual and y estimated are actual value and estimated value, respectively.
The data in this study, collected from annual reports of central bank, Iran Ministry of Energy and Iran Ministry of Petroleum.These data were divided into the education data  and the test data (2008)(2009)(2010).First, to initialize computing process using genetic algorithm and particle swarm optimization algorithm the data were converted to normal data with a value between zero and 1.This conversion was performed using Eq. ( 8). ( where z, x, µ and δ are normal distribution function, variable's value, data mean and standard deviation, respectively.Since the prediction of energy consumption in residential-commercial sector was the main goal of this study, the competence function, influenced by time, was developed in the form of Eq. ( 9).This equation enables us for the convergence of the simulated curve to the actual one under the influence of time.
where t, n, sim(t) and re (t) are the time, number of variables, simulated value and actual value of data, respectively.The software of Matlab version R2013a was used to estimate the optimal coefficients of patterns.The particle swarm optimization algorithm parameters were selected according to Tables 3.

Selecting the most appropriate model for predicting energy demand of residential-commercial sector
After developing different scenarios and simulating them for 100 times, the following four models were selected, out of 288 models, as the best models of linear and exponential states: The linear form of Eq. ( 10) was estimated by the particle swarm optimization algorithm: ER 8.054483 vat 1.152488 bld 1.092040 po 6.260510 papl +0.0382 (10) The exponential Eq. ( 11) was estimated by the swarm particle optimization: ER 4.0584 vat .
2.09336 po .9.4801 papl . 0.0041 where ER, energy consumption in residential-commercial sector, VAT, Value added of all economic sectors (total value added), BLD, Investment for the value of made constructions, PO, Population, PAPL, Electrical and Fuel Appliance price index.Figs. 3 (A and B) show the curves of the best simulated states of the above two equations.To select the best model, the test data were assessed using Eq. ( 6) and Eq. ( 7).Tables 4 shows the results.According to the results, the best scenario for predicting the energy demand of residential-commercial sector of Iran is derived from the exponential model simulated by particle swarm optimization algorithm.The results indicate that among the above possible states, the exponential model derived from particle swarm optimization algorithm is the best model with the minimum MAEP and RMSE for predicting the future trend of energy demand of Iran.Comparison between presented models in the literature and presented models in this study are shown in Table 5.

Prediction of energy Demand of Residential-Commercial Sector up to 2034
According to Eq. ( 13), the exponential model simulated by the particle swarm optimization algorithm was selected as the best scenario.Therefore, the energy demand of residential-commercial sector was predicted up to 2032.According to the Fig. 4, the energy demand of this sector will have nondecreasing trend up to 2032 and grows up to 1718 Mega barrel of crude oil equivalent.

Conclusion
In this study, different scenarios with different inputs were developed for predicting energy demand of residential-commercial sector.The scenarios were studied in two linear and exponential states using genetic algorithm and particle swarm optimization algorithm.According to the results, the exponential model derived from the particle swarm optimization model is the best model for the mentioned purpose with the following inputs: 1-Value added of all economic sectors (total value added) 2-Investment for the value of made constructions 3-Population 4-Electrical and Fuel Appliance price index.

Fig. 3 .
Fig. 3.The curves of the best simulated states of the above two equations

Fig. 4 .
Fig. 4. The results of the proposed study

Table 1
Summary of Iranian energy demand estimation studies (Kaveh et al., 2012)energy demand Population, GDP and the number of vehicles

Table 2
Models derived from combining the variables

Table 3
Particle swarm optimization algorithm parameters

Table 4
Investigation of test data prediction compared with simulated values with particle swarm optimization algorithm (by Mtoe) a Mboe: Million barrel of oil equivalents.1 barrels of oil equivalent (boe) = 6,119 × 10 6 joule (J).

Table 5
Comparison of different models presented in the literature and present study a Average relative errors are on testing period of each model. a