1. Introduction
The presence of distributed generation (DG) resources in a distribution network needs 24-h scheduling. The scheduling of the DGs in the microgrid has several benefits such as loss reduction, improve power quality and reliability and also reduce operation cost [
1]. On the one hand, the transportation sector is the main consumer sector of petroleum products and, therefore, will be one of the most important environmental contamination factors. So that according to the energy and environmental crisis in the future, especially in industrialized countries, the issue of replacing existing vehicles with electric vehicles has been considered seriously [
2,
3].
An EV can be operated as a controllable load. When a vehicle is not used for moving, it can be connected to the grid at peak time in order to feed the grid and increase the reliability of the smart grid [
4,
5]. In this way, the vehicle owners can earn profit by selling extra electricity to the network by using the Vehicle 2 Grid (V2G) technology. In addition, the ability to inject electric power into the grid can provide some valuable services, such as spinning reserve, power supply at peak load and frequency setting [
6]. On the other hand, the huge number of vehicles in the grid due to demand for power can challenge grid control and exploitation [
7,
8]. Following this challenge, a promising horizon in the name of the smart grid is presented to address these concerns in the energy distribution network [
9]. In [
10], a new demand response-based model is proposed for a microgrid energy management. The microgrid consist of renewable energy sources and EV parking lots. In the proposed model, EV owners can participate in the demand response program by changing their driving schedule. The simulation results prove the good performance of the proposed method in reducing the operating costs in the microgrid. In [
11], a control method has been introduced based on minimizing energy generation and energy losses. Planning of units in the distribution network in the presence of EVs can be connected to the grid in a variety of ways. In [
12], the authors have introduced a collaborative model of units in the presence of networkable electric vehicles by using a particle swarm optimization (PSO) algorithm to reduce the operation cost and the environmental emission in a MG. Also, in [
13], scheduling DGs and scheduling charging and discharging EVs in a smart grid using the GAMS software was designed to reduce the cost of operating and emission rates. In [
14] an energy management system (EMS) is proposed for residential microgrid (MG) with home parking lot based on the mixed integer linear program (MILP) method and for balancing power transactions in MG. The radial basis neural network (NN) method has been used to predict electrical demand. In this article, it is claimed that using car batteries parked in residential houses with proper management is an economical way to reduce operating costs. In [
15], a model for maximizing the revenue from charging and discharging electric vehicles in the microgrid is proposed. The proposed model has de-peaked with the help of demand response program (DRP). The proposed method is implemented on the 14-bus IEEE system and the MILP optimization model is analyzed with CPLEX software. In [
16], an online EMS is proposed for the optimal use of EVs in the parking lot in real time, and a balance between the demand and the state of charge (SOC) of the EV battery is obtained. The results of this paper show the efficiency of this method in supplying the loads with low operating costs.
Ignoring part of the operation cost of parking lots in the objective function to reduce optimization time by the algorithms and on the other hand being trapped in local optimal and low optimization convergence is the main drawbacks of the reviewed articles [
17]. To increase the accuracy of the simulation results, a comprehensive objective function as well as the precise meta-heuristic algorithm should be used. The proposed algorithm should not be trapped in local optimum.
This paper specifically addresses the planning of the participation of distributed generation units and the scheduling of charging and discharging EV batteries during the 24 h for a day considering the vehicles daily schedule, which is received from the customer, to minimize the cost of the operation in consideration of the owners’ opinion. This issue is presented as an optimization problem with some constraints. In a smart grid environment, it is expected that the management of energy resources will be solved at a logical time, in spite of the operating constraints. Also, a modified version of the imperial competition algorithm is proposed to solve the optimization problem. High accuracy and not trapping in local optimal points are the prominent features of the proposed algorithm.
4. Modified Imperialist Competitive Algorithm
Imperial competition algorithm (ICA) was proposed by Caro Lucas and Esmael Atashpaz in 2008. This algorithm, similar to other algorithms, begins with a primitive population composed of a number of countries. To create empires, a number of the best countries are selected based on their deserving colonial qualities, and the rest of the countries are considered as their colony [
22]. In an optimization problem with
N variable, each country is constructed with an array 1 ×
N that is displayed as follows.
where
and
are the variables of the problem. The value of the objective function is
ith for the country is as follows.
To start the optimization process, the
N country is created as a primary population. Then
from these countries are selected as colonizers based on their worth.
remaining countries are considered as a colony. Then, to create empires, the colonial colonies are divided by the power of each colonist. To divide them among colonists, first of all, the degree of plurality of colonizers must be normalized, which is done in the following way.
That
is the value of the objective function for the colonizer and
is its normalized value. Therefore, any colonialist whose value has a more objective function would have a lower normalized value. With the normalized value of the objective function for each colonizer, the power of each colonizer is calculated by the following equation [
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61].
And finally, the colonial colony’s initial number is obtained from the following equation.
Which
is the n number colony of first colonists. For the division of colonies between empires,
are randomly selected from colonies and belong to the respective empire. Each empire that has more power will have a greater chance of absorbing the colony. The colonial countries are trying to advance their colonies. This fact is modeled by moving all the colonies towards their colonialist. This movement is modeled by two formulas,
and
two random variables are distributed uniformly.
In these formulas,
is the vector of the size and
is the degree of deviation from the direction of movement towards the colonialist. Also,
is a number greater than 1,
is the distance between the colony and colonialist,
is a parameter that determines the degree of diversion. As each colony moves toward the colonizer, that colony may acquire a lower cost function than its colonialist. Therefore, the role of the two will change together and the algorithm continues with the new colonizer. All other empires, on the strength of their power, are given the chance to seize the colony. So that, the power of each empire must be defined. First, the value of the cost function of each empire is calculated with the formula below [
22].
In which,
, the total function of
n empire cost, is a positive number less than 1. can determine the extent to which the colonies of each empire have the same value per
capita cost per empire than colonialism. Obviously, the values close to one, the effect of the colonies on the value of the function of the cost of the empire and the values close to zero will increase the colonial influence. After calculating the value of the cost function for each empire, these values are normalized to find the power of each empire as follows.
Which
and
are the value of the cost function and its normalized value for the
nth of empire, respectively. With the normalization of the cost function of each empire, the probability of taking over, which represents the power of each empire, is obtained by Equation (28).
Thus, the following vector is defined that there is the possibility of seizing the colony for all the empire.
We then construct the vector-sized vector with the
vector called
whose arrays are random numbers with a uniform distribution between zero and one.
Then the vector of subtraction of these two vectors is calculated as follows.
Therefore, for each empire there is a vector in which each empire that has a larger value in this vector belongs to that colony. In the process of losing the colonies of weak empires, after all, all the empires will collapse except the empire that is strongest and all countries, as colonies, are under colonial control of this empire, and the absorption process is pursued with an existing empire so that the algorithm approaches the ideal conditions. In the proposed modified version of the ICA algorithm, it is supposed that in the weaker colonies, groups are formed and they try to improve the situation by making internal reforms. Internal reforms in colonies are variable in the form of random changes in the range of 10% of the upper and lower bands, which is expressed as Equation (32).
where
UB and
LB are upper and lower bounds respectively. The algorithm flowchart is shown in
Figure 4.
Step 1: Define input data. These data include: cost of EVs and DGs operation, and also energy price, fuel cell parameters, diesel parameters and load level.
Step 2: Generate initial random population and calculate the objective functions (cost) for each country.
Step 3: Select the best particle from best solutions as the Imperial.
Step 4: Move the colonies to the imperialist country
Step 5: If there is a colony in the empire that costs less than the imperialist, replace the colonial and the imperialist together.
Step 6: Update the best position for each particle. To update the best position, the new particle position is compared with its previous position.
Step 7: Calculate the total cost of an empire (cost).
Step 8: Choose a colony from the weakest empire and give it to the empire most likely to be conquered.
Step 9: Internal reforms is performed for weak colonies.
Step 10: If the maximum number of iterations is reached, the optimization process stops, else returns to step 4.
Step 11: Remove the weak empires.
Step 12: If there is only one empire left, stop and go step 4.
Step 13: Provide final results of the Algorithm.