Research on Microgrid Optimization Based on Simulated Annealing Particle Swarm Optimization

Based on the pursuit of different goals in the operation of the microgrid, it is not possible to meet the lowest cost and the least pollution at the same time. From the perspective of economy and environmental protection, a microgrid model including photovoltaic power generation, wind power generation, micro gas turbine, fuel cell and energy storage device is proposed. This paper establishes a comprehensive benefit objective function that considers both microgrid fuel cost, maintenance management cost, depreciation cost, interaction cost with public grid and pollutant treatment cost. In order to avoid the defect that the traditional particle swarm optimization algorithm is easy to fall into the local optimal solution, this paper uses the combination of simulated annealing algorithm and particle swarm optimization algorithm to compare with the traditional particle swarm optimization algorithm to obtain a more suitable method for microgrid operation. Finally, a typical microgrid in China is taken as an example to verify the feasibility of the algorithm.


Preface
The form of distributed power in the microgrid is diverse. There are photovoltaic and wind power generation devices that make full use of natural energy. There are also micro gas turbines and fuel cells that use clean energy. If necessary, there are also traditional fossil fuel power generation devices. Microgrid also has access to energy storage devices and Public grids to increase the reliability of power usage. The combination of multiple distributed power sources and the output method can solve different power demand, Under the premise of ensuring reliable power supply reliability, scientific distribution can maximize economic benefits and minimize environmental pollution. The focus of the current discussion.
In this paper, some high-altitude or island demonstration areas in China are carrying out research on the practical needs of grid-connected distributed power microgrids, using intelligent algorithms combined with simulated annealing algorithm and particle swarm optimization algorithm to optimize the environmental economic optimization of microgrid systems. Explore. For one thing, from the perspective of micro-grid economy, the fuel consumption cost, maintenance management cost, depreciation loss cost and power interaction cost of public grid are taken into account; for another thing, from the perspective of micro-grid environmental protection, The unit treatment cost of pollutant gas emissions (including , , , and ), establish a comprehensive benefit optimization model that considers both aspects. Under the premise of ensuring the safety and stability of the microgrid and meeting the needs of users, the example is used to solve and demonstrate.

Grid-connected microgrid structure model
The first step in solving the environmental economic optimization problem of the microgrid is to establish a mathematical model. The common grid-connected microgrid structure is shown in Figure 1   The grid-connected microgrid generally includes: a micro power supply device, a user load, an energy storage device, and the like. The micro power supply devices mentioned in this paper are: Photovoltaic power generation system (PV), Wind turbine (WT), Micro gas turbine (MT), Fuel cell (FC) And diesel generators (Diesel generators, DEG for short). The energy storage device in this model considers the more common leadacid batteries (BAT), and the load refers to the daily load demand in life. When solving the micro-grid optimization scheduling problem, a mathematical model is built according to the performance of each device to calculate the working condition of each unit.

Grid-connected microgrid optimization description
Although the situation discussed in this paper is the optimal operation of the grid-connected microgrid, it is best to ensure that the microgrid (such as high altitude or island demonstration area) is self-sufficient in power supply. When the microgrid cannot meet the daily load demand, the power of the large grid is considered. Because solar photovoltaic devices and wind power generation devices that rely on natural energy to generate electricity are relatively economical, recyclable, clean and pollution-free, are the most ideal power generation methods, and are the top priority of power generation equipment in this paper, that is, when photovoltaics and When the maximum power of wind power is used, the second-level micro gas turbine and fuel cell are used to generate electricity as much as possible. The fuel used by the two is a sustainable clean energy, but it is also constrained by the power constraints and climbing rate of each power generation unit. Such restrictions, so the third level of power generation equipment large energy grid and energy storage device also need to participate. Because the operation of the microgrid is a complex system that cooperates with each other, it is necessary to consider the instability and volatility of photovoltaic and wind treatment, and consider the practical problems of the treatment of the entire system's polluted gases. In the case of ensuring stable operation of the system, It can be combined with modern intelligent algorithms to calculate the best micro-grid operation mode with the most reasonable and comprehensive benefits.

Microgrid optimization objective function
In this paper, the optimal operation of microgrid is considered economic operation, followed by environmental protection, and finally consider the comprehensive benefits of the two [3]. (I) Objective function one: economic operation (1) Where: is only considering the operating cost of the microgrid economic operation; refers to the calculation of the average daily operating cost, T=24, ie 1-24 hours Operating cost; is the fuel cost per kWh converted; is the maintenance management cost per kWh converted to each power unit; is the depreciation loss of each power unit; is the government subsidy amount for clean energy; refers to the interaction cost with the large power grid. When purchasing electricity from the large power grid, k>0; when selling electricity to the large power grid, k<0. among them: (2) Where: fuel cost mainly refers to the cost of natural gas consumption (yuan); i from 1 to N represents the number of micro-power in the micro-grid; refers to the price of fuel (yuan / ), the price of natural gas in this paper 3.75 yuan / ; refers to the low calorific value of natural gas (kw • h / ), this paper takes 9.7kw • h / ; refers to the output power of the i-th power generation unit at time t ( kw); refers to the output operating efficiency (%) of the i-th power generating unit at time t. (3) Where: refers to the maintenance management cost (yuan) of the i-th power generation unit at time t; refers to the output power (kw) of the i-th power generation unit at time t ; refers to the maintenance management cost coefficient (yuan/kw•h) of the i-th power generation unit at time t. (4) Where: refers to the depreciation loss cost (yuan) of the i-th power generation unit at time t; refers to the annual average depreciation cost of the i-th power generation unit (yuan); refers to the maximum output power (kw) of the i-th power generation unit; 8760 refers to 8760 hours of the year; refers to the capacity factor (%) of the i-th power generation unit. (II) Objective function two: environmentally friendly operation Where: is only considering the operating cost (yuan) of the microgrid environmental protection operation, mainly considering the treatment cost of the polluted gas; j is the j-class pollutant gas (including the , , and derivatives generated in the microgrid and the large grid); refers to the processing cost of the jth class of polluting gases (yuan/kw); and refer to the emissions of the jth class of polluting gases in the microgrid power generation unit and The emission coefficient of unit power is converted in the large power grid; and refer to the current actual working power (kw) of the microgrid power generating unit and the large power grid at time t. (III) Objective function three: comprehensive operation Where: is a comprehensive consideration of the economical and environmentally friendly operation cost of the micro-grid (yuan), and maintaining a certain balance between economy and environmental protection is the best optimization result pursued in this paper [4]. This paper uses the linear weight assignment method. Turning multi-objective issues of economics and environmental protection into a single-target problem.
The weight coefficients and are not obtained by subjective conjecture, nor are they randomly generated by computer. In this paper, the value of the adaptive function is selected according to the variation law of the objective function. =0.43 was selected by experiment.

Optimization of operating constraints
We must ensure the safety, stability and feasibility of microgrid operation. Based on the power balance in the microgrid, all power generation units, energy storage equipment, transmission lines, etc. need to meet certain constraints. (7) Where:

1) Grid power balance constraints
represents the power generation (kw) of the i-th power generating unit currently working at time t; represents the power (kw) emitted by the energy storage device, and if it is a negative number, it is the energy storage of the microgrid Device charging; indicates the power (kw) purchased from the public grid. If it is negative, the microgrid sells electricity to the public grid; indicates the load power (kw) required by the user at the current time.
2) Output constraints of each power generation unit in the microgrid (8) 3) Controlled power generation unit climbing rate constraint in microgrid (9) Where: represents the active power (kw) of the i-th power generating unit currently working at time t; represents the increased active power of the i-th power generating unit currently in operation Power limit (kw). 4) Microgrid tie line transmission power constraint (10) Where: represents the line transmission capacity (kw) between the microgrid and the distribution network. 5) Energy storage device charging and discharging capacity constraint Where: represents the state of charge of the energy storage device at time t; and respectively represent the charge and discharge power of the energy storage device at time t, and a certain upper limit is required [5]. 6) Exchange power constraints with public grids The annual exchange capacity of the microgrid and the external grid generally does not exceed 50% of the annual electricity consumption. This paper takes into account the black start capability of the microgrid, so the annual exchange capacity of the constrained microgrid and the public grid does not exceed 40% of the annual electricity consumption. Where: indicates the exchange power of the microgrid and the large power grid 24 hours a day, mainly refers to the purchased power (kw). 3 Improved simulated annealing particle swarm optimization algorithm

Traditional particle swarm optimization
The idea of Particle Swarm Optimization (PSO) is derived from the predation behavior of birds/fish groups, simulating the foraging behavior of birds flying in the air. PSO uses the way of cooperation between bird and birds to find out the optimal purpose that where is the food and it is based on an optimization algorithm of Swarm Intelligence. The algorithm flow chart is as follows: The Simulate Anneal (SA) algorithm is also a Greedy algorithm, but it introduces random factors in the search process compared to the ordinary Greedy algorithm. That is to say, it has a certain probability to accept a solution that is worse than the current solution, so you can jump out of this extreme value, that is, get rid of the local optimal solution, and find the global optimal solution. This algorithm can solve the defect that the particle swarm algorithm is easy to fall into the local optimal solution [6]. The algorithm flow chart is as Fig. 3.

Particle Swarm Optimization Algorithm Based on Simulated Annealing Algorithm
The particle swarm optimization algorithm (SAPSO) based on simulated annealing algorithm proposed in this paper introduces the idea of probability jump in simulated annealing algorithm, so that SAPSO algorithm not only accepts better solution, but also has a certain probability to try to accept the difference. Solution, consider more possibilities, make the particle population's motion behavior more reasonable, and get a better microgrid operation mode. The SAPSO algorithm operation process is as follows: a) Initialization parameters: inertia weight , learning factor , , and annealing speed . b) Randomly generate a population containing m particles, randomly initializing the velocity and position of the particle.

Begin
Particle swarm initialization: inertia weight , learning factor , and annealing speed Randomly initialize the position and velocity of the particle Calculate the initial temperature of the annealing algorithm according to the global optimal fitness Calculate the fitness of each particle i, record the position of each particle and the global optimal position Calculate the fitness of each annealing algorithm at the current temperature c) Calculate the , of each particle i as the fitness function, that is, the objective function, abbreviated as , and record the position of each (i-th) particle. , global optimal position , fitness and global optimal fitness . d) The initial temperature T of the annealing algorithm is calculated according to the global optimal fitness . e) The function is a function to calculate the fitness of the annealing algorithm. The annealing algorithm fitness of each at the current temperature T: (14) f) Apply roulette [7] to select the idea of genetic algorithm, choose one from the individual optimal position instead of the global most position , denoted as , the algorithm is as follows: A.
( is a random number from 0 to 1). B. Calculate the cumulative probability according to the annealing algorithm fitness . C. According to the cumulative probability, the individual optimal position of the r-th particle satisfying the condition is selected instead of the global optimal position . The condition is: . g) Replace with , bring in the particle swarm formula, and update the speed of each particle as follows: (15) h) Calculate the fitness of each particle, and update the optimal position of each particle and the optimal position of the population. i) Annealing operation: j) It is judged whether the termination condition is satisfied, if it is satisfied, the search is stopped, the calculation result is output, and if it is not satisfied, the process proceeds to step e).

Setting of inertia weight
The value of inertia weight is one of the factors influencing the result of the optimization algorithm in the process of microgrid optimization algorithm [8][9]. Its function is that the current particle inherits the size of the previous particle velocity, which will directly affect the speed of particle optimization and the position of global search. In order to improve the efficiency of the algorithm, this paper uses the method of decreasing weight. At the initial stage of the operation, that is, far away from the optimal solution position, the convergence speed is faster. In the later stage of the algorithm operation, when the optimal solution is approached, the search speed cannot be Too fast, so that the particle swarm can more accurately search for the optimal solution locally. The formula is as follows: (17) In the formula: and are almost the initial value and the final value of the inertia weight respectively. After experiments, when the values of the parameters and are set to 0.9 and 0.4 respectively, the search ability of the particles is better. is the current number of iterations, and is the maximum number of iterations.

Settings for ,
and are learning factors, which respectively represent the learning ability of the particles in their best state and the best state of the population. In the experiment, and take 2.05.

Settings for
The variables and indicate that the entire search space is to be covered, so it is a random number between 0 and 1.

Initial temperature setting
The initial temperature T setting can directly affect the global search ability of the simulated annealing particle swarm algorithm. To improve the possibility of searching for the global optimal solution, a higher initial temperature can be set. The formula is as follows:

Annealing speed setting
In the simulated annealing particle swarm algorithm, in order to improve the probability of finding the global optimal solution, the simulated annealing process can be made as slow as possible, so the simulated annealing speed is 0.95.

Numerical simulation analysis
In order to verify the feasibility of the above model and algorithm, this paper uses matlab simulation to analyze the actual microgrid system in the higher altitude region of remote areas, and the average is one day for the calculation cycle. Predicting the PV and wind power generation and the user load of the community on the day, PV and WT are the maximum power operation. The maximum charge and discharge power of the energy storage device is 10kw, and the power purchased from the large power grid does not exceed 40% of the daily power load. The premise is that the large grid is fully charged, and power outage losses are not considered for the time being. The relevant parameters of SAPSO are set as: the search space dimension (that is, the unknown number) is 48; the number of particles is 600; the maximum number of iterations is 300.

Simulation parameter setting
The photovoltaic power generation and wind power generation are predicted by reference to the local area light intensity and wind speed as follows:  It can be seen from the figure that the renewable energy full-state power generation still cannot meet the demand load of the residents, so the power-controlled micro-power supply needs to be powered together. The micro-power sources used in the above micro-grid model are: fuel cell (FC), micro gas turbine (MT), diesel generator (DEG) and lead acid battery (BAT). The relevant parameters are shown in Table 1. The corresponding emission factors and treatment costs of pollutant discharge types are shown in Table 2, and the local price lists for different time zones are shown in Table 3.

Running results in two algorithms in the grid-connected mode
It can be seen from Table 2 in Table 1 above that the fuel cost and operating cost are lower than the pollutant treatment cost, so the economy and environmental protection cannot be optimized at the same time. This paper only considers the microgrid operation mode when the comprehensive benefit is optimal. Photovoltaic power generation and wind power generation equipment are fully utilized, and the remaining micro power supply working conditions and the power exchange between the microgrid and the large power grid are as shown in the following figures:  Under the premise of ensuring the safety and stability of the microgrid and meeting the needs of users, the 24hour results of the microgrid operation are shown in Table 4 under the model of the objective function considering comprehensive benefits: As can be seen from the above chart, the particle swarm optimization algorithm based on the simulated annealing algorithm yields less cost and saves about 3,000 yuan. The cost of purchasing electricity from the public grid is lower, but it will increase the burden on the public grid. As can be seen from Figure 6 and Figure 7, the improved algorithm not only achieves lower cost, but also does not rely on the power supply of the large grid. Increased the independence of the microgrid.

conclusion
In this paper, the optimal scheduling problem of micro power supply operation modes in microgrid gridconnected operation mode is studied. Taking the higher altitude region in a remote area of China as an example, Using the particle swarm optimization algorithm based on simulated annealing algorithm to find the optimal scheduling scheme for the cooperation of each output unit of microgrid. Under the premise of satisfying system constraints and user needs, not only the lowest economic cost but also the best environmental benefits are considered, and a comprehensive benefit cost model with comprehensive consideration of economic environmental protection is established. The operating modes of FC and MT are tortuous, fully explaining the contradiction between micro-power sources and revealing the rationality of considering the comprehensive benefit operation mode. Finally, the simulation results show that the improved particle swarm optimization algorithm is more suitable for this model and has certain reference value.