Optimization of a Microgrid Integrated with Renewable Energies using PSO

. Nowadays, microgrids (MGs) play a crucial role in modern power systems due to possibility of integrating renewable energies into the MG system. It is expected in near future collaborating microgrids as a community has a great affect in providing efficient energy for suppliers. Therefore, optimal operation of a MG, as a first step, is an important issue in this field. In this paper, by considering an integrated MG comprised of conventional generators, photovoltaic and wind a particle swarm optimization (PSO) is applied to minimize the cost function of the MG. Finally, the simulation results are discussed and analyzed to evaluate the system operation.


Introduction
Microgrids (MGs) can be consider as a small power system which are combined with distributed generations (DGs), energy storage systems (ESSs), and loads [1].Moreover, DGs can produce energy by different types of generators such as diesel generators or renewable source of energy such as solar or wind energy.Therefore, MGs can be integrated with renewable energies (REs) to take advantage of limitless sources of energy with no environmental pollution as a vital commitment to the future of the world [2].
As it can be inferred, an MG can produce and consume energy according to the instantaneous generated energy and load demands.Therefore, the power balance in MGs is more critical due to higher dynamic of the system in comparison with power system.This issue will be more acute when the MG is integrated with REs due to uncertainty, inherent randomness and volatility of renewable generators [3].As a consequence, energy storage system (EES) plays a vital role in order to provide the power balance especially in standalone operation mode.
Batteries, as one of the most common parts of ESSs, can effectively cope with the energy swing in a single MG owing to their high dynamic response to absorb or exude of energy [4].However, in grid-connected MGs, power system can play the same role of batteries in ESS with more reliability and economically [5] then the importance of ESS reduce significantly.Grid-connected MGs can exchange energy with power system, therefore, the paradigm of conventional power system will be affected by injecting energy to the power system, and it makes some changes in the adjustment related to the power system [6].Microgrid community is another effective method to reduce the impact of ESS in the single MG.In MG community, energy can exchange between each other in order to provide the power balance [7].In this case, the setting of the power system will be affected less than a single MG.Energy management system (EMS) in MG community plays a significant role in order to realize some features such as: managing the power flow between MGs and power system [8], optimal operation [9], generation prediction for all RES [10].One on the most important tasks of an EMS, is realizing the optimal operation of each individual MG in order to determine how much energy can exchange optimally by considering the practical constraints of a particular MG.
There are various optimization methods such as evolutionary programing, dynamic programing, genetic algorithm, and artificial neural network approaches, in order to optimize the operation of the system by considering the equality and inequality constraints [11], [12].In this paper, particle swarm optimization (PSO) is applied to a single MG integrated with RES in order to minimize the operational cost of the system.In PSO each individual particle makes his decision using his own experience together with other individuals' experiences [13].The individual particles are drawn stochastically toward the position of present velocity of each individual, their own previous best performance, and the best previous performance of their neighbors [14].The main advantages of the PSO algorithm can be elaborated as: simple concept, easy implementation, robustness to control parameters, and computational efficiency.
In this paper, after determining the configuration of the proposed MG, a particular case or scenario, the cost function, equality and inequality constraints of the power generations will be defined, and the system will be optimized by applying a PSO algorithm.The optimizer determines the economic power generation of all generators based on the load profile.Moreover, the probable surplus energy or required energy from power system can be calculated over this optimization.Finally, the simulation results will be presented in order to evaluate the system operation.

System Configuration
As it can be seen from Fig. 1, the considered single MG in order to study in this paper, as a particular scenario, comprises a photovoltaic (PV) power plant, a wind turbine (WT) generator, three conventional diesel generators (G1-G3), and loads which all are connected to the power system (PS).On the one hand, the power profile of the load, over a 24-hour interval, is shown in Fig. 2. On the other hand, Fig. 3 and Fig. 4 show the generated power of photovoltaic, and wind turbine, respectively, also over a 24-hour interval.In addition, the nominal power for each element included in Fig. 1 is listed in Table I.The configuration in Fig. 1 with three diesel generators and without any energy storage system which all are connected to the main grid is usual in some countries which their weak main grid system cannot guarantee to supply the load at all moments or maybe for some hours a day the main grid is cut-off.Therefore, as can be seen from Fig. 1, the circuit breaker can connect the MG to the main grid in case of either existing surplus energy or shortage energy of energy in MG.
In the following, the characteristics of each power generation and load demand is elaborated, and the cost function for each part is described.Then, the optimization problem is defined based on the cost function and operation function of each power generation.

Photovoltaic Generation
Fig. 3 shows the solar irradiation profile, and for this study it is supposed that the PV panels are implemented on 100 m 2 of area.Due to the high cost of production especially for solar and wind energies, usually a maximum power point tracking (MPPT) system is implemented for these systems to be sure that the maximum possible power is extracting from the implemented system.However, the cost function of solar generation is defined in (1) by considering the investment cost of the equipment and operation and maintenance (O&M) cost of the energy generation [15].where P PV is solar power (kW), α is annuitization coefficient, r is interest rate, N is investment lifetime, I P is investment costs, and G E is O&M costs for solar generation.
As it can be inferred from the solar radiation, it is obvious the power generation of photovoltaic panels can be between 0 and maximum value:

Wind Generation
Fig. 4 shows the wind profile for this study.The wind turbine trips from the system when the wind speed exceeds the maximum wind value, until the wind gets back to its nominal value.The same as solar energy, wind energy also takes the advantage of MPPT in order to harvest the maximum possible power for each time.Moreover, the cost function of wind generation only by considering the investment cost of the equipment and O&M cost of the energy generation is defined below [15]: where α is defined in (2), I P is investment costs and G E is O&M costs for wind generation.
The wind turbine generation has the following restriction:

Diesel Generators
The conventional generators are more reliable and predictable in an MG rather than solar and wind generation.The cost function of DGs usually is considered as a second order polynomial function as in (6).

Power System
The proposed MG in this paper is connected to the main grid.Therefore, if the power generation units in the MG are not able to supply the load, main grid compensate the energy.Moreover, if the produced power in the MG is more than load power, the surplus energy can transfer to the main grid.In order to calculate the cost of energy transaction, CF (P PS ) the following equation can be used: () where Δt is the period that the power P PS is injected to the grid (with negative sign) or is absorbed from the grid (with positive sign).In addition, there is no any power limit for the main grid.

Optimization Problem
The optimization problem in this paper is a real time operation optimization of the MG in order to minimize the defined cost function by considering the constraints of the power generation units.The objective function (OF) for this problem is the sum of all cost functions subject to the aforementioned constraints of the units.P DG1 +P DG2 +P DG3 =P Load -P PV -P WT (+/-P PS ), (10) where +/-P PS represents the surplus energy transferred (positive) to the main grid or consumed (negative) from it.Fig. 5 shows the optimization procedure for this study.As it can be observed, the MG is simulated by MATLAB-Simulink ® , and, in order to optimize the MG operation, the data of MG transfers to the optimizer.In this paper, in order to optimize the problem a PSO algorithm is applied to the problem.PSO determines the economic power generation for each diesel generator at the end of the each calculation.For this purpose, PSO minimize the objective function by considering the constraints which are defined in system model.The first priority is supply the load by the power generation units of the MG.However, if the load requires more energy, power system can supply it.On the other hand, if the power generation of the MG is more than the load consume, the surplus energy is transferred to the main grid.

Simulation Results
A simulation carried out on an MG with the configuration of Fig. 1 and power rate that is shown in Table 1.The PSO take the real time power of the PV, wind and load of the MG and based on these information optimize the power generation of the DGs in order to operate at lowest cost.The shortage and surplus energies of the MG can be traded off with the main grid through the power system.Moreover, the power losses of transmission lines are considered in this simulation to have more accurate results.In (11) the power loss equation is presented.In order to calculate the transmission line losses based on the following equation, the B loss coefficient are listed in ( 12)-( 14).
where, 0.0017 0.0012 0.0007 B 0.0012 0.0014 0.0009 0.0007 0.0009 0.0031 Moreover, in order to calculate the cost of each generation units the parameters in Tables 2 and 3 are used in this simulation according to the corresponding equation that defined in section 2 for the PV, wind and DGs units.

Power generation unit PV Generator
Wind Turbine IPV = 5000 ($/kW) IWT = 1400 ($/kW) GPV = 1.6 ($/kW) GWT = 1.6 ($/kW) rPV = 0.09 rWT = 0.09 NPV = 20 NWT = 20 Finally, Table 5 shows the optimization results of the MG.In order to avoid generating enormous data, the step time of optimization is adjusted for every 90 minutes for a whole day.As it can be seen from Table 5 at the times 180, 270, 630 and 1080 min., the generated power by MG is more than load profile at these times.Therefore, the surplus energies are transferred to the main grid by means of the power system.The power losses in this simulation just considered the loss power between diesel generators and as it can be observed by increasing the generated power by each DG the power loss increase as well.Total costs include the cost of each DG, PV and wind turbine based on the cost functions in ( 6), ( 1) and (4), respectively.The costs of the PV and wind turbine are calculated based on the maximum power which they can produce at the time.The costs of the diesel generators are calculated based on the optimum power which is calculated by the PSO optimizer.In order to evaluate the cost function of the power generation units in the MG, the parameter's values are defined in Tables 2 and 3.

Conclusions
In this paper, an optimization procedure for an integrated grid-connected MG comprised of renewable energies has studied.The PSO optimization applied to the proposed MG to optimize the power generation of diesel generators by minimizing their cost functions and considering the constraints related to DGs, PV and wind energies.In order to satisfy the power balance in the MG, the main grid can absorb or inject energy to the MG.The optimizer applies to the MG for the defined time interval to keep the MG operation optimum and economic.
Finally, the simulation results show the optimum power values for diesel generators; however, the generated power of PV and WT are the maximum power which they can produce at the time based on solar irradiation and speed of the wind.The generated power by PV and WT affect the power balance equation and consequently to the optimum values of DGs generation.

Fig. 1 .
Fig. 1.Block diagram of the considered single MG.It comprises a photovoltaic (PV) power plant, a wind turbine (WT) generator, three conventional diesel generators (G1-G3), and loads which all are connected to the power system (PS).

Table 1 .
Nominal power of the units

Table 3 .
DGs coefficients.As it can be seen in Fig5, the model of each power generation unit are defined in SIMULINK, and the cost function, objective function and constraints of power generation units are defined in MATLAB environment, therefore, MATLAB and SIMULINK effectively interchange their data.Moreover, the PSO parameters are listed in Table4.