Simulation of Electricity Demand Function in Agricultural Sector: an Application of Genetic Algorithm (case Study: Electricity-fed Wells of Iran)

AbStrACt Due to several problems arisen from consumption of gas oil, it is necessary to electricity substitute fossil fuels in agriculture wells in Iran. Problems such as lack of opportune and adequate supply of fuel, air and soil pollution, noise pollution and huge costs of installation, operation and maintenance imply the necessity of replacing gas oil systems by electricity-consuming ones in agriculture sector of Iran.However, it is essential to study on the demand of electricity, nowadays, substituting other energy sources.As waterwells are the main electricity consumersin agriculture sector, the estimation of energy demand function would be beneficial for policy makers to achieve their goals. The present paper investigates on energy demand function in agriculture sector of Iran. Genetic algorithm techniques are appliedto estimate electricity demand in agricultural sector in three forms: linear, quadratic and exponential equations. Based on the conventional criteria, the exponential model is selected as the best model for estimation. Furthermore, electricity demandof agricultural sector is forecasted under three scenarios for years next three years.


IntroDuCtIon
Mechanization is the essential prerequisite for transition from traditional to modern agriculture.Obviously, the traditional methods can not guarantee the food security for growing 70-million-people population.Now a days, the key role of mechanization in agriculture production motivates policy makers to accelerate the mechanization process in agriculture sector.Hence, mechanization is constantly addressed by planners of agricultural sector in their strategic plans.
In order to provide water for growing population, it is vital to optimize the exploitation of surface and underground water sources.Human beings have been preoccupied by inventing devices enabling them to bring water to the ground surface.In this regard, they took the first steps towards mechanized agriculture by making manual pump and, finally, modern pumps.One of the most important applications of the pumps is in agricultural sector for pumping water from groundwater aquifers (Nikue, 2000).
The energy consumed in Iranian agricultural sector is mainly supplied by the petroleum products such as oil, gas, and, kerosene.The share of petroleum products which are consumed in agriculture sector on the first decade after Iran's Revolution was 94.6% of the total energy consumed in agriculture sector.In the recent years, despite the increase of energy prices, the share of electrical power used in agricultural activities has been significantly raised, as it has shifted from 6.73% in 1991 to 29.04% in 2009.One of the major consumption fields of electrical power in agricultural sector, which shares a considerable part of total electricity used in this sector, is agricultural wells.A significant share of energy consumed in this sector is allocated for the electro-pumps used for pumping water in these wells.
One of the major goals pursued by electrical power industry is to optimize the consumption of the generated electricity, as generation of energy requires huge investment in long run.Applying a proper and systematic consumption management in the energy sector not only offer a great economic contribution to the country, it also provides a stable power supply for its subscribers.
Consumption of electrical energy has been increased over recent years.On the other hand, by the available technology it is not possible yet to store the generated energy in huge scales.Thus, it is important to optimize the consumption of energy.In this way, this is necessary to make aprecise prediction of the energy consumption, in order to economize electrical energy consumption (Khademi Zare & Akhavan, 2009).
Although,no explicit domestic work has been conducted in agricultural sector for predicting electrical energy consumption using the artificial intelligent techniques such as genetic algorithm (GA), Musavi et al (2010) predicted consumption of energy carriers in Iranian agriculture based ARCH and ARIMA models using the annual data of 1968 to 2005.The results of this work indicated that a slight increase would be observed in consumption of energy carriers in the agricultural sector.In the following lines, some studies conducted on prediction and estimation of demand function in different fields using the different techniques are introduced: This paper consists of 7 parts: After general overview of the study in part 1, wells electrification is discussed in energy economic in part 2. Part 3 deals with theoretical basics of GA.Then, in part 4, the model is introduced.In parts 5 and 6, the result analysis and prediction of electrical energy demand in Iranian agriculture are discussed, respectively.Finally, conclusion is offered in part 7.

Electrification of Wells: A necessity for energy economization
Nowadays, human encounters two major crises, which are interrelated more than they appear.On one hand, industrial cities deal with environmental pollutions and, on the other, the raw materials and fuel resources are shrinking for the fossil fuel resources are among non-renewable energies.
One of 15 biggest consumers of petroleum products in the world is Iran, whose consumption of petroleum products tripled during less than two decades.In comparison, Western countries have strictly controlled and lowered their consumption by applying appropriate energy optimization policies.One of the policies applied by the government for proper optimization of fossil fuel consumption and, consequently, pollution reduction is to find a proper alternate for fossil fuel used in pumps of agricultural wells and moving towards installing electrical pumps and expansion of electricity networks to agriculture wells.
Problems such as lack of opportune and adequate supply of fuel, air and soil pollution, noise pollution and huge costs of installation, operation and maintenance imply the necessity of replacing gas oil systems by electricity-consuming ones in agriculture sector of Iran.
In regard to arid climate of Iran and water crisis coupled with unpermitted water withdrawal and considering the fact a big share of unauthorized water withdrawal is in these wells, it is required to define a strict program for controlling these extractions, as in electrical wells it is easier as compared to diesel or other non-electrified wells.
Another advantage forelectrification of the agricultural wells is to detecting and preventing activities of non-permitted wells.In this way, by correcting fees of agricultural electricity, increasing the energy fine and fine forenergy demand excess to the limit defined in the permit, it is possible to easily control water withdrawal from underground aquifers and also optimize water and electricity consumption in this sector.
Because of the national interests concerning the electrification of the agricultural wells, since 1999 government has allocated a considerable budget in subsidiary and non-return forms to farmers to motivate them towards electrifying their wells.To extract water from wells, generally fossil fuels (gasoil) are used which have high costs as compared to the natural fuel gas as well as harmful environmental consequences.Electrification of the agricultural wells would also result in a considerable economic save in national economy considering the price difference between oil and gasoil.
In Iran, the rule for facilitation of electrifying the agricultural wells was passed in Islamic Consultative Assembly in 2001.Based on this rule, towards facilitating the electrification of the agricultural wells and optimum usage of energy sources and national capitals, the government is obliged to provide maximum facilities and equipment for farmers; also, Ministry of Energy is obliged to provide energy needs of the demanders and subscribers of agricultural sector 24-27 round the year.By passing this rule, the farmers demand for electrification of their wells indicated a multifold increase.Furthermore, based on the agreement between Ministries of Energy and Petroleum, and the rule passed in High EconomicCounciltowards providing special facilities, a large number of diesel engines were converted to electrical engines.
At the beginning of Iranian Islamic Revolution, there were only 2000 electrified wells in the country.Ever since, 4,275 wells have been electrified each year.By end of 2011, the total number of wells in Iran is 357,218 where 189,893 of them is electrified and the rest 167,325 are diesel (Electricity Statistics book, 2011).These electrified wells, with average demand of 36 kW, consume 21,390 million Kwh per year.

basics of genetic algorithm (GA)
G A 's a r e a m o n g t h e m e m b e r s o f computation models expired from evolution theory.These algorithms codify potential solutions of a problem in the form of simple chromosomes and then apply combinational operators on these structures.GA's are typically recognized as optimization functions.However, their application domain is wider than being merely applied for optimization problem.
GA's have essential differences with traditional searching and optimization methods.Goldberg (1989)  Implantation of GA's is initiated by creating an initial (typically random) population of chromosomes.Then, these initial structures are evaluated and are allowed to breed based on their merits.GA, for the first time, wasintroduced by Holland (1975).In these algorithms each solution is represented by a set of gens called as chromosomes.A selected population of chromosomes is called as "community", while each community is called as a "generation" for a specific long period.After defining the target function, initial community is generated.This population is evaluated and each chromosome is assigned a ranking based on its fitness.If the defined criterion of problem is not satisfied, regeneration cycle is iterated for improving the solutions.This cycle includes selection, crossover, and mutation steps.Chromosomes are selected based on their assigned ranking and introduced to crossover step where the selected chromosomes (parents) produce child chromosomes.These solutions are entered to mutation step for completing regeneration step and create new community.Thus, based on the mentioned points, each GA should necessarily cover the following points (Goldberg, 1989 Other required operators such as population, mutation probability, crossover probability, etc. In general, a genetic algorithm has a cycle similar to the one presented in Figure 1.The first step is to produce initial random population of chromosomes.Next, fitness level of each member (chromosome) in the population is evaluated and defined and then selection step is preformed based on the fitness of members.In this way, a number of chromosomes with highest fitness are selected for regeneration.Ultimately, genetic (cross over and mutation) algorithms evaluate the selected members by modifying or combining their genetic codes.Each run of this cycle is called as one generation.This process is iterated until satisfying stop criterion of the cycle.
In the present research, the parameters of the chromosomes are modeled in binary form.Here, each parameter of the bits is determined based on modeling precision in the decimal system using Eq.(1): ... (1) Where, ∆ is the desired accuracy; k is number of bits; and l is high and low boundary of each parameter.To decode the chromosomes of this algorithm, first value of each parameter in binary chromosome was converted to the one in decimal system and then normalized between 0 and 1 using Eq. ( 2): ... (2) Where, k and d represent number of bits and corresponding decimal value of each parameter.Next, the normalized value was mapped to value between high and low boundary and the average of obtained values was recorded for the given generation.To develop next generation, first the selected chromosomes are placed in breeding pool.Then, by determining crossover probability, which is p c = 0.9 in this work, the chromosomes were randomly selected and crossover process is performed.A chromosome might be transferred to the next generation with probability of 1 -p c, which indicates lack of crossover.In some cases, value of a given bit is probable to change due to the crossover effect, while in its previous state it was more valuable.Then, to avoid this phenomenon, it is required to apply another operator called as mutation with p m considered as -0.06 in this work.Similar to crossover operators, also this operator runs in a random basis.As a result, the mutation of a given bit varies in the range of 0 to 1.By determining the number of iterations and stop criterion.After defining number of iteration for a generation and stop criterion, the average and optimum solutions are recorded until the given generation.
Target function, and, more accurately, the model proposed for estimation of electricity demand in agricultural sector in the future years is calculated using Eq. ( 3): ... (3) Where, the value of fitness function equals to sum of square error (SSE); E obs , and E est are observed and estimated electricity demands, respectively; m is number of observations; and s i is weighting factor.Table 1 presents the parameters using GA for estimation of mentioned equations.Considering the gathered information, electricity demand function in agricultural sector is computed using Eq. ( 4): ..( 4) Where, E is electricity consumption in electrified wells of agricultural sector; CH is number of electrified wells; P is average price of electricity in agricultural sector; and M is the budget allocated for construction and reinforcement of electricity networks in agricultural sector.
Based on the characteristics mentioned for GA, in this research three equations were utilized for estimation of electricity demand in agriculture: Linear equation in the form of Eq. ( 5): ... (5) Second order equation in the form of Eq. ( 6): ... (6) And exponential equation in the form of Eq. ( 7).
... (7) In Eq. ( 5), (6), and (7), x 1, x2, and x3 are the number of electrified wells, average price of electricity in, and M is the budget allocated for construction and reinforcement of electricity networks in agricultural sector, respectively.Besides, w i and α I are weight coefficient and exponent of each variable.

Estimation of the demand models
After performing the procedure mentioned in part 3 (basics of genetic algorithm), the linear, second order, and exponential equations were obtained using MATLAB 2009 as follows: Linear demand function simulated for electricity obtained using the GA method (Eq.8): ... (8) Second order function simulated for electricity obtained using the GA method (Eq.9): ..( 9) Exponential function simulated for electricity obtained using the GA method (Eq.10): ... (10) Figure 2 represents electricity estimation demand in agricultural sector using the linear, second order, and exponential equations from second half of 2008 until end of 2011.

Evaluation criterion of the simulation process
For a more accurate evaluation of the performance of simulated functions, three other criteria beside fitness function were applied to assess other simulation (prediction) performances.These criteria are as follows: Mean Square Error (MSE) indicated the difference between the observed and simulated values of electricity consumption in Iranian agricultural sector.MSE is computed using the equation ( 11): ... (11) root mean Square Error (rmSE) is the root of mSE.
Mean Absolute Percentage Error (MAPE),as the difference between the observed and simulated values of electricity demand in agricultural sector of Iran, is an important criterion for calculating percentage of predicted error.Calculating prediction error in terms of MAPE yields better results (Equation 12): ... (12) Where, n represents number of observations.These criteria are computed for the simulated functions of electricity demand and the results are listed in Table .2.
As shown in table 2, all criteria emphasize superiority of exponential model over linear and second order models.Based on the obtained results, it can be stated that exponential model indicates better and more accurate prediction results for estimation of electricity demand in agricultural sector as compared to linear and second order models.For all scenarios, the average growth rate of electricity demand in agricultural sector indicates an ascending trend in exponential model.However, as electricity price is assumed as constant, growth rate of allocated funds in scenarios 1 and 2 and growth rate of electricity demand indicate a sharper increasing trend as compared to scenario 3.

ConCluSIon
Iran is among the 15 countries of the world with highest usage of petroleum products as the registered statistics show that the consumption of petroleum products in this country has had a three time increase in less than two decades.In comparison, Western countries have strictly controlled and lowered their consumption by applying appropriate energy optimization policies.One of the policies applied by the government for proper optimization of fossil fuel consumption and, consequently, pollution reduction is to find a proper alternate for fossil fuel used in pumps of agricultural wells and moving towards installing electrical pumps and expansion of electricity networks near to these wells.
The problems induced by lack of proper and on time fuel supply, contaminations generated by pouring the petroleum products, air pollutions caused by burning the oil products, noise pollution, as well as costs concerning the installation and commissioning, exploitation and maintenance, and fuel supply have made finding alternative systems for diesel and gas pumps as a top rank priority for the authorities of the agricultural sector.
Hence, studying the effective factors on electricity demand for accurate and proper recognition of behavior structure of the consumption pattern is a critical need for careful planning towards meeting the desired goals.In this research, first electricity demand function was introduced and then factors effective on electricity demand of agricultural wells were discussed.The variables used for estimation of electricity demand in agricultural sector include annual number of electrified wells, average electricity price in agricultural sector, and allocations for constructing and reinforcement of electricity networks in agricultural wells.
The results of this work indicated that exponential model produces better results for estimation of electricity demand function as compared to linear and second order models.Moreover, in this research, electricity demand of agricultural wells was predicted by exponential function using 3 different scenarios for time period of 2012 to 2014.

→
): Chromosome representation of possible solutions; → Initialization of the initial population; → Evaluation function for ranking the solutions on basis of their fitness; → Genetic operators for crossing over and changing the structure of chromosomes; and → model representation In this research, to simulate demand function of electricity in the agricultural sector, the 6-month data from 2003 to 2010 were used.Statistic and information related to the average electricity price (P) in agricultural sector (in IRRs per hour) were extracted from energy balance sheet of Ministry of Energy.Statistics of the electricity consumption rate of the electrified wells in agricultural sector (E) in kwh, number of electrified wells (CH), and allocated budget for electrification of these wells (M) in million IRRs are extracted from Rural Electricity Statistics of Ministry of Energy.

Fig. 2 :
Fig. 2: Estimated consumption values in agricultural sector lists this difference as follows: