Dynamic Economic Dispatch Model of Microgrid Containing Energy Storage Components Based on a Variant of NSGA-II Algorithm

With the development of microgrid, in order to improve the economy of the microgrid and intelligent service of electric power marketing, the proper management of the output of micro-source in microgrid and power exchange between grids is an urgent problem to be solved. Considering the interests of multiple stakeholders, such as users, power grids, renewable energy and battery, a dynamic economic dispatch model of microgrid is proposed in this paper based on time-of-use power price mechanism. Using a variant of Non-Dominated Sorting Genetic Algorithm (NSGA)-II algorithm, at the same time, an external penalty function is introduced to deal with the constraint conditions, which is convenient for solving multi-objective optimization models. Based on the data of load forecasting and renewable energy output in microgrid, the function of battery and time-of-use power price mechanism is considered to optimize the output of controllable micro-source in the system, in order to achieve the optimization of microgrid dispatch. The model established in this paper considers the overall economic optimization of multi-objective and multi-interest groups within the microgrid, and hence, can get a more comprehensive and reasonable scheduling scheme. It provides effective help for the operation of micro grid system, and realizes the electric power marketing for demand side, so as to provide help for improving the power marketing’s economy and intelligent service.


Introduction
With an increasing demand for electric energy and the expanding scale of power grid, the stability and security of power system operation are facing severe challenges, and the decreasing fossil energy, increasing environmental pollution and other issues become particularly acute.Environmental protection, efficient and flexible distributed generation technology is favored.
However, the problems of high cost, randomness and uncontrollability of distributed generation have brought adverse effects on power system operation and control.In order to solve the above problems, coordinate the power system and distributed energy, and bring higher value and benefits to the grid and users, micro-grid has been paid attention to and continuously developed in the world.According to statistics, there are 1437 microgrid projects published worldwide, with installed capacity exceeding 13 gigawatts, and more than half of them belong to remote microgrid [1].As an important part of smart grid, how to properly manage the renewable energy and energy storage capacity within the microgrid, how to optimize the operation of the microgrid considering the real-time electricity price in the market, and how to improve the economy of operation are the problems to be solved.
In order to achieve the economic operation of microgrid, scholars at home and abroad have done a lot of research.Reference [2][3][4][5][6] establishes an optimization model aiming at maximizing the profit of the system.Reference [7][8][9][10][11] synthetically considers the operation cost and emission cost of microgrid, and establishes a multi-objective optimization model to minimize the economic cost and emission of microgrid.Reference [12] analyzed the characteristics of distributed generation and the mathematical model of optimization objectives in detail, and proposed a multi-objective immune algorithm of niche evolution for the optimal management of distributed power output in microgrid.Reference [13] presents a mathematical model to minimize the comprehensive costs of system investment, operation and reliability.Reference [14] establishes the reliability model of wind farm, which refers to availability of wind farm, based on Monte Carlo simulation method, and evaluates the reliability of combined generation and transmission schemes.
As part of the micro-grid, energy storage devices play a key role in improving the reliability of power supply on the user side when the grid runs in isolation [15].However, due to the high cost of energy storage devices, limited charging and discharging time and charge cycles, it is difficult to optimize the dynamic operation of microgrid.In Reference [16], in view of the coordinated operation of microgrid with energy storage, a combination scheme of wind-solar power generation and power purchase is proposed according to the time-sharing price of power grid and the charging and discharging characteristics of storage batteries; in Reference [17], a unit combination model with minimum cost is proposed, and the effects of uncertain factors such as power price, energy demand and environmental impact on the economic benefits of microgrid system are analyzed.Reference [18] Aiming at the optimal dispatching problem of microgrid under grid-connected conditions, a new dispatching method of microgrid operation based on fixed dispatching strategy of energy storage unit and dynamic optimal dispatching of controllable micro-sources under a time-sharing tariff mechanism is proposed.Reference [19] establishes a multi-objective model for optimal operation of microgrid with multiple distributed generators and energy storage, and proposes a multi-objective optimization method based on Improved Particle Swarm optimization.
In this paper, based on the load forecasting and the output of wind power and photovoltaic power, considering the time-sharing price of power grid, a dynamic economic dispatching model for microgrid with energy storage is established.Dynamic economic dispatching of microgrid (DEDM) is a large-scale mixed integer nonlinear programming problem.Many classic optimization techniques have been applied for solving DEDM problems.However, these techniques have severe limitations like (i) need of continuous and differential objective functions, (ii) they easily converge to local minima, and (iii) their difficulty in handling discrete variables.To overcome these limitations, the robust and flexible evolutionary optimization techniques have been applied.These evolutionary algorithms have shown success in solving the DEDM problems since they do not need the objective and constraints as differentiable and continuous functions [20].
Considering multiple stakeholders, this paper establishes a multi-objective optimization function aiming at the lowest average purchase price of electricity for consumer, the lowest generation cost of micro-grid and the highest income of power grid.Conventional optimization methods can at best find one solution in one simulation run, thereby making those methods inconvenient to solve multiobjective optimization problems.On the contrary, the multiobjective evolutionary algorithms are getting immense popularity, mainly because of their ability to find a widespread of Pareto-optimal solutions in a single simulation run [20].
In this paper, Non-Dominated Sorting Genetic Algorithm (NSGA)-II algorithm has been modified by ordinal value, non-dominated sorting, and crowding distance to ensure better convergence and diversity and is termed as modified NSGA-II.Aiming at the conflict of several objective functions, this paper introduces the modified genetic algorithm NSGA-II, and uses the constraint processing method to intervene in advance.This paper compares and analyses the utilization of renewable energy and the role of energy storage elements through experimental examples, compares the system costs and comprehensive benefits, and achieves the economic optimization of multiple stakeholders.

Structural Chart of Microgrid Power Generation System
Microgrid systems include source, load, energy storage devices and control devices, forming a single controllable unit, while providing users with electricity and heat.Most of the power sources in the microgrid are micro-power sources, which are in fact the aggregation of actual, smaller-size entities and include various forms of power generation, such as renewable energy generation like wind energy, solar energy, non-renewable energy generation such as micro-gas turbine, fuel cell and energy storage devices such as supercapacitors, flywheels and batteries.A number of power conversion systems are needed in microgrid systems in order to link the renewable energy, non-renewable energy generation and grid.Figure 1 is a simplified diagram of a microgrid system with wind turbine, photovoltaic, battery and conventional load.
objective functions, this paper introduces the modified genetic algorithm NSGA-II, and uses the constraint processing method to intervene in advance.This paper compares and analyses the utilization of renewable energy and the role of energy storage elements through experimental examples, compares the system costs and comprehensive benefits, and achieves the economic optimization of multiple stakeholders.

Structural Chart of Microgrid Power Generation System
Microgrid systems include source, load, energy storage devices and control devices, forming a single controllable unit, while providing users with electricity and heat.Most of the power sources in the microgrid are micro-power sources, which are in fact the aggregation of actual, smaller-size entities and include various forms of power generation, such as renewable energy generation like wind energy, solar energy, non-renewable energy generation such as micro-gas turbine, fuel cell and energy storage devices such as supercapacitors, flywheels and batteries.A number of power conversion systems are needed in microgrid systems in order to link the renewable energy, non-renewable energy generation and grid.Figure 1 is a simplified diagram of a microgrid system with wind turbine, photovoltaic, battery and conventional load.

Renewable Energy Output Model
In Figure 1, the microgrid system consists of two renewable energy sources, photovoltaic power generation and wind power generation.The output power of photovoltaic power generation system can be calculated according to the standard test condition (STC) output power, actual illumination intensity and ambient temperature [13].Photovoltaic (PV) power generation ) (t P s and tilt angle β can eventually establish the following functional relationship: According to the research, it is found that the output power of the wind turbine is related to the wind speed and its own parameters, as shown in Equation ( 2

Renewable Energy Output Model
In Figure 1, the microgrid system consists of two renewable energy sources, photovoltaic power generation and wind power generation.The output power of photovoltaic power generation system can be calculated according to the standard test condition (STC) output power, actual illumination intensity and ambient temperature [13].Photovoltaic (PV) power generation P s (t) and tilt angle β can eventually establish the following functional relationship: According to the research, it is found that the output power of the wind turbine is related to the wind speed and its own parameters, as shown in Equation (2): In the model, v in , v out , v rate are cut-in, cut-out and rated wind speed, and P rate is rated power of wind turbine.a and b are constants, where a = P rate /(v rate − v in ) and b = av in .

Battery Model
Batteries, as energy storage components, can play an important role in improving the quality of microgrid power supply, improving the economic benefits of microgrid, reducing the load peak-valley difference of power system, restraining power system oscillation and improving system stability.They are the key to the safe and reliable operation of microgrid, which refers to availability of microgrid.Assuming that the charging and discharging power of the battery is constant within a unit time interval, without considering the effects of battery loss and ambient temperature, the State-of-Charge (SOC) of the battery is determined by the following formula: In this formula, the initial SOC state of the battery, P cha,t and P dis,t are the charging and discharging power of batteries in t periods, X t and Y t are the charging and discharging power of batteries respectively, where X t , Y t ∈ {0, 1}, ∆t is the unit time interval, T is the total time interval and E b is the capacity of the battery.

Microgrid Economic Optimizing Strategy
From Figure 1, it can be seen that the load in the system is mainly supplied by wind power, photovoltaic power generation, energy storage devices and power grid.There are many power supply schemes for the load.When calculating the cost of renewable energy generation and the supply and sale price of microgrid to grid side, the unit price of load power supply is as follows: In the model, C w and C v represent the equivalent price of wind power and photovoltaic power, respectively, after the wind turbine and photovoltaic power are sold and then purchased.C wn and C vn represent the generating cost of wind power and photovoltaic power, respectively, and C s and C b represent the selling price and purchasing price of microgrid, respectively.
According to the market situation, the outsourcing electricity price of microgrid is always higher than the sale price, that is, the C b -C s is positive, so the equivalent price is always greater than the generation cost of renewable energy itself.Therefore, when introducing new energy sources and energy storage devices, the micro-grid prefers the power supply strategy of "in-situ absorption".
When the microgrid is selectively connected to renewable energy sources and energy storage devices, the economic dispatch between the main network and the microgrid can be carried out according to load demand and time-of-use power price mechanism.Specific dispatching strategies are as follows: Comparing the generation cost of microgrid with the purchase price, when the generation cost is higher than the purchase price, choose to abandon the wind power and the photovoltaic power, and purchase electricity from the main network to meet the load demand; conversely, if the cost of microgrid generation is lower than the purchase price, priority should be given to the micro-source output.At the same time, it should also be considered the condition that the micro-source has not reached the maximum output when it has met the load demand (supply exceeds demand).If the cost of generating electricity is lower than the price of selling electricity, the generating unit generates electricity with maximum power, and the surplus electricity will be sold to the main network; otherwise, the generating unit only needs to meet the load demand, and no more power will be generated.
According to the above dispatching strategy, it can be seen that flexible management of micro-source output by utilizing the law of power market is conducive to the optimization of micro-grid economic benefits.

Microgrid Economic Optimization Model
This paper establishes a multi-objective optimization model considering users, power grids, renewable energy and batteries, and uses improved genetic algorithm to solve the model, so that the interests of each subject can be guaranteed and the comprehensive interests can be optimized.

Objective Function
In order to satisfy the interests of multiple agents in microgrid, a multi-objective optimization model is established.Its objective function is as described below.

Maximize the Benefits of the Grid
The power grid maximizes its own benefits by increasing electricity sales to the microgrid, while reducing electricity purchases from microgrid.In order to ensure the benefits of the power grid, the objective function is established to maximize the benefits of the power grid as follows: where C t bu represents the cost of purchasing electricity in t-period and P t G represents the transmission quantity between the power grid and micro-grid.A P t G greater than 0 represents the power transmitting from grid to micro-grid; otherwise, it represents the power transmitting from micro-grid to grid.

Minimize the Cost of Generating Electricity from Renewable Sources
In order to avoid the loss caused by the abandoned wind power and photovoltaic power, and to make the best use of renewable energy for power generation and reduce the cost of wind and solar power generation, the objective function was to minimize the cost of renewable energy for power generation.The formula is as follows: where C t r represents the generation cost of renewable energy in t-period and P t w and P t v represent the output of wind turbine and photovoltaic in t-period, respectively.

Minimize the Average unit Price of Electricity Purchased by Users
In order to ensure the interests of users and make use of the battery charging and discharging function at the same time to provide load power resonably, reduce user costs.The objective function is to minimize the average unit price of electricity purchased by users.The calculation formulas are as follows: where Energies 2019, 12, 871 6 of 14 In the formula, P t L is the load power in the t-Time period, C t is the power supply cost in the t-Time period, C t se is the profit from electricity sale, which is negative, C t ec is the cost of battery charging to discharging, P t dis is the discharging power of the battery in the t-Time period, Yt is the discharging state of the battery, with a value of 0 or 1, and C e is the unit discharging cost of the battery.

Power Balance
According to the power balance, it can be obtained that: where P E is the output power of the battery.The positive value represents the discharge power of the battery and the negative value represents the charging power of the battery.

Renewable Energy Power Constraints
Considering the abandonment of wind power and photovoltaic power, the wind turbine and photovoltaic power generation should meet the following constraints:

Battery Charge and Discharge Constraints
Considering the charging and discharging cost of batteries and the transition of charging and discharging states, the constraints are as follows: The State-of-Charge (SOC) of the battery should satisfy the upper and lower limit constraints.
In the formula, S t min and S t max are the upper and lower limits of the SOC in the t-period of storage battery, respectively.
Within a unit time interval of ∆t, the charging and discharging power of the battery is balanced and cannot be simultaneously charged and discharged.Therefore, the charging and discharging state of the battery needs to meet the following constraints: The constraints must be satisfied that the energy state of the battery should be equal at the beginning and end of the scheduling cycle: Considering that the battery charge and discharge power is related to the battery life, the maximum power of charge and discharge per unit time is 20% of the rated battery power, i.e., the constraints are: In the same dispatching cycle, the number of charges and discharges and the depth of discharge will affect the battery life.The constraints of the number of charges and discharges are as follows:

Model Solving
For solving the dynamic economic optimization model of multi-stakeholders involved in the microgrid, the modified NSGA-II algorithm is used to calculate the power supply of the microgrid.At the same time, an external penalty function is introduced to deal with the constraints of energy storage elements, which is convenient for solving the multi-objective optimization model.

Processing Method of Constraint Conditions
For more constraints in the above models, the hard constraints method and the flexible constraints method were used to facilitate the calculation.
Firstly, the inequality constraints were treated with hard constraints.For example, Equations ( 14), ( 17) and (18), when their values exceeded the upper or lower bounds of corresponding constraints, were set as upper or lower bounds of constraints.The equation constraints of Equation ( 16) were treated flexibly.When the constraints were not satisfied, it was difficult to determine how to adjust the relevant power.Therefore, an external penalty function can be added to the objective function F (X) to induce the feasible solution of the constraints: where X is the decision variable, ε(S) is the periodic constraint external penalty function of battery SOC and ω is the corresponding penalty function coefficient.

Solution Flow of Microgrid Economic Optimization Model based on Modified NSGA-II Algorithm
In this paper, an improved multi-objective optimization algorithm based on NSGA-II [21][22][23] was used to solve the problem.Based on the selection, crossover and mutation of traditional genetic algorithm, this algorithm introduces the concepts of ordinal value, non-dominated sorting and crowding distance, carries out population evolution, and obtains the optimal solution.According to the microgrid economic optimization model which aims at maximizing grid revenue, minimizing renewable energy cost and minimizing average power supply cost of users, a modified NSGA-II algorithm was used to solve the problem.The flow chart is shown in Figure 2.
In this paper, an improved multi-objective optimization algorithm based on NSGA-II [21][22][23] was used to solve the problem.Based on the selection, crossover and mutation of traditional genetic algorithm, this algorithm introduces the concepts of ordinal value, non-dominated sorting and crowding distance, carries out population evolution, and obtains the optimal solution.According to the microgrid economic optimization model which aims at maximizing grid revenue, minimizing renewable energy cost and minimizing average power supply cost of users, a modified NSGA-II algorithm was used to solve the problem.The flow chart is shown in Figure 2.Where k is the iteration numer, K max the maximum iteration number, S1 the initial population, Sk the k-generation population, Qk the k-offspring-generation population and Sk+1 the k+1-generation population.

Example Analysis
In order to analyze and verify the rationality of the proposed multi-objective dynamic optimal dispatching model for grid-connected microgrid and the effectiveness of the improved algorithm, this paper used the wind/solar/storage grid-connected microgrid system shown in Figure 1 to solve the optimal economic operation mode of the microgrid based on the modified NSGA-II algorithm.Where k is the iteration numer, K max the maximum iteration number, S1 the initial population, S k the k-generation population, Q k the k-offspring-generation population and Sk+1 the k+1-generation population.

Example Analysis
In order to analyze and verify the rationality of the proposed multi-objective dynamic optimal dispatching model for grid-connected microgrid and the effectiveness of the improved algorithm, this paper used the wind/solar/storage grid-connected microgrid system shown in Figure 1 to solve the optimal economic operation mode of the microgrid based on the modified NSGA-II algorithm.[16,18,19] The technical parameters of each micro-source in Figure 1 are shown in Table 1, and the time-of-use power price mechanism of power grid is shown in Table 2. Assuming that the microgrid system is close to the client, without considering transmission line loss and internal system loss, and prefer to use wind and photovoltaic output to reduce load, without considering battery loss.At the same time, the number of battery charges and discharges per day should not exceed 8 times.Figure 3 shows the load, wind turbine and photovoltaic output forecast curve in the next 24 h.

Result Analysis
According to the multi-objective optimization model established in this paper, which considers the benefits of users, power grid, new energy and storage battery, the load power supply structure of each period is simulated by MATLAB (R2017a, MathWorks, Natick, MA, USA) as shown in Figure 4.

Result Analysis
According to the multi-objective optimization model established in this paper, which considers the benefits of users, power grid, new energy and storage battery, the load power supply structure of each period is simulated by MATLAB (R2017a, MathWorks, Natick, MA, USA) as shown in Figure 4.
From Figure 4, it can be seen that the period from 0:00 to 7:00 was the period of low power consumption, the load was all supplied by the power grid, and the battery was charged at this time.During the period from 7:00 to 10:00, the cost of the power grid rose, and the wind turbine power generation was almost enough to provide the load power, thus, the power supply of the power grid was almost 0.During the period from 10:00 to 15:00, the electricity price of the power grid was highest, and the new energy can meet the load demand at the beginning, thus, it was all generated by the micro-grid, with excess electricity sold to the grid, after a period of time, micro-grid self-generation was insufficient to meet the load.At this time, the battery discharged and got a small amount of electricity from the grid.During 15:00 to 18:00, the output of the new energy generation declined continuously while the user load increased and the price fell.In this time frame, the electricity was provided by the grid and microgrid in a hybrid way, and the batteries were charged; 18:00-21:00 peak period, grid power.At this time, both wind power and photovoltaic power were full.In order to save the cost of electricity purchase, the storage battery was in discharge state, and the rest of the load was supplied by the power grid.After 21:00, the electricity price of the power grid decreased, which made the wind power full.At the same time, the power grid needed to supply power to the micro-grid.However, due to the limitation of transmission power, the power balance was maintained by storage batteries.From the above analysis, it can be seen that the battery can charge when the micro-grid power is excessive or the grid price is low, and discharge when the grid price is high and the peak period of power consumption.This can not only reduce the cost of load supply, but also improve the utilization rate of the battery.At the same time, the battery can also maintain the power balance of the system.Figure 5 shows the charging and discharging conversion process of batteries in the whole dispatching process.It can be seen that the charging and discharging times of batteries in the From Figure 4, it can be seen that the period from 0:00 to 7:00 was the period of low power consumption, the load was all supplied by the power grid, and the battery was charged at this time.During the period from 7:00 to 10:00, the cost of the power grid rose, and the wind turbine power generation was almost enough to provide the load power, thus, the power supply of the power grid was almost 0.During the period from 10:00 to 15:00, the electricity price of the power grid was highest, and the new energy can meet the load demand at the beginning, thus, it was all generated by the micro-grid, with excess electricity sold to the grid, after a period of time, micro-grid self-generation was insufficient to meet the load.At this time, the battery discharged and got a small amount of electricity from the grid.During 15:00 to 18:00, the output of the new energy generation declined continuously while the user load increased and the price fell.In this time frame, the electricity was provided by the grid and microgrid in a hybrid way, and the batteries were charged; 18:00-21:00 peak period, grid power.At this time, both wind power and photovoltaic power were full.In order to save the cost of electricity purchase, the storage battery was in discharge state, and the rest of the load was supplied by the power grid.After 21:00, the electricity price of the power grid decreased, which made the wind power full.At the same time, the power needed to supply power to the micro-grid.However, due to the limitation of transmission power, the power balance was maintained by storage batteries.
From the above analysis, it can be seen that the battery can charge when the micro-grid power is excessive or the grid price is low, and discharge when the grid price is high and the peak period of power consumption.This can not only reduce the cost of load supply, but also improve the utilization rate of the battery.At the same time, the battery can also maintain the power balance of the system.Figure 5 shows the charging and discharging conversion process of batteries in the whole dispatching process.It can be seen that the charging and discharging times of batteries in the whole process are not more than eight times, which meets the economic requirements.In order to verify the effectiveness of the proposed model, the results of this model are compared with those of the single objective optimization model which only considers the minimum cost of load supply.The benefits of each stakeholder are shown in Table 3.In order to verify the effectiveness of the proposed model, the results of this model are compared with those of the single objective optimization model which only considers the minimum cost of load supply.The benefits of each stakeholder are shown in Table 3. From Table 3, it can be seen that the multi-objective optimization model, which is composed of the minimum average load cost, the lowest generation cost of micro-grid and the highest income of grid, is superior to the single-objective optimization model in total power supply cost without considering AC power constraints.Therefore, while considering the benefits of various stakeholders, the method proposed in this paper is more practical and effective.

Analysis of Microgrid Day-ahead Scheduling Results under Different Optimized Conditions
The day-ahead optimal dispatch of microgrid is not only related to the combination of generators and economic costs within microgrid, but also to the power exchange between microgrid and main network.Generally, the economic dispatch of microgrid is to adjust the energy storage capacity and renewable energy according to the demand of load and the price of electricity purchased and sold, and complete the electricity transaction between microgrid and main network.In this paper, according to the time-of-use power price mechanism and the demand of micro-power supply and energy storage in the micro-grid itself, and considering the economic cost, the day-ahead optimal dispatch of the micro-grid is realized.to output of renewable energy, energy storage and power limitation with power grid, this paper gives six different optimization conditions.Table 4 gives the comparison results of total cost and average cost under six different optimization conditions.As can be seen from Table 4, the cost of selective acceptance of renewable energy is significantly lower than that of full utilization.This is due to the high cost of wind turbines and photovoltaic power generation.When the load requirements are met and the selling price is lower than the cost, selective generation can greatly reduce the total power supply cost.However, the cost of energy storage and discharge is lower, thus, the cost will also be reduced when energy storage is added.Taking into account the interests of various interest groups, we can achieve better economic benefits.
Figure 6 shows the comparison curves of power exchange power and time-sharing purchase cost of each generation unit, micro-grid and grid under different conditions.
From Figure 6, it can be seen that the peak power supply cost is significantly reduced with energy storage when abandoning the wind power and the photovoltaic power.At this time, the load is mainly supplied by battery discharge and wind and solar output, which reduces the cost of purchasing from the main network at a high price.In the low load period, reducing the output of renewable energy reduces the cost of power generation, and the battery can be charged by purchasing electricity from the main network at a low price to ensure the subsequent discharge.
Through the analysis of the example, the general strategy of microgrid economic dispatch can be obtained as follows: when the cost of generating electricity is higher than the price of purchasing electricity, the microgrid does not generate electricity, and the load demand is satisfied by purchasing electricity from the main network.However, when the cost of generating electricity is lower than the price of purchasing electricity, the microgrid supplies the load demand through its own micro-source.At the same time, when the generating unit has not reached the maximum output, it can meet the load demand, that is, when the supply exceeds the demand, it is necessary to compare the cost of generating electricity with the price of selling electricity.When the cost of generating electricity is lower than the price of selling electricity, the micro-grid will sell more power to the main network; otherwise, the generating unit will not generate more power.Using real-time electricity price and other electricity market rules to flexibly dispatch the operation status of micro-grid can realize the optimization of micro-grid day-ahead dispatching and improve economic benefits.
As can be seen from Table 4, the cost of selective acceptance of renewable energy is significantly lower than that of full utilization.This is due to the high cost of wind turbines and photovoltaic power generation.When the load requirements are met and the selling price is lower than the cost, selective generation can greatly reduce the total power supply cost.However, the cost of energy storage and discharge is lower, thus, the cost will also be reduced when energy storage is added.Taking into account the interests of various interest groups, we can achieve better economic benefits.
Figure 6 shows the comparison curves of power exchange power and time-sharing purchase cost of each generation unit, micro-grid and grid under different conditions.From Figure 6, it can be seen that the peak power supply cost is significantly reduced with energy storage when abandoning the wind power and the photovoltaic power.At this time, the load is mainly supplied by battery discharge and wind and solar output, which reduces the cost of purchasing from the main network at a high price.In the low load period, reducing the output of renewable energy reduces the cost of power generation, and the battery can be charged by purchasing electricity from the main network at a low price to ensure the subsequent discharge.Energies 2019, 12, 871 13 of 14 At the same time, the charging and discharging capacity of storage battery should be considered.When the price of purchasing electricity from the main network is low, the storage battery can be charged, so that the total power generation of all units is less than the total load demand when the peak load and the price of purchasing electricity are high.The storage device of storage battery can reduce the purchasing power from the main network by discharging, so as to reduce the economic cost.If the load cannot be balanced after the battery discharge, the power loss in the microgrid can be satisfied by purchasing power from the large power grid; when the energy storage device has excess power, it can be considered to sell power to the main network for profit.
According to the above analysis, the day-ahead optimal scheduling of microgrid is a multi-objective, multi-interest group's overall economic optimization, but also limited by the number of battery charges and discharges, capacity, life and power exchange between the main network and other factors.Therefore, the reasonable optimal scheduling model and constraints established in this paper play an important role in realizing economic scheduling, can get more comprehensive and reasonable scheduling schemes, and provide efficient help for the operation of the actual microgrid system.

Conclusions
The day-ahead optimal scheduling of microgrid is not only related to the combination of generators and economic costs within microgrid, but also to the power exchange between microgrid and main network.Generally, the economic dispatch of microgrid is to adjust the energy storage capacity and renewable energy according to the demand of load and the price of electricity purchased and sold, and completes the electricity transaction between microgrid and main network.According to the time-of-use power price mechanism and the micro-power supply and energy storage requirements of the micro-grid itself, this paper fully considers the economic costs of the users, the grid and micro-sources within the micro-grid, and achieves the day-ahead optimal scheduling of microgrid.By comparing the economic dispatching results under different circumstances, the economy of the proposed scheme is verified.
Through the research results of this paper, we can see that the day-ahead optimal scheduling of microgrid is a multi-objective, multi-interest group of the overall economic optimization.However, it is also limited by the number of battery charges and discharges, capacity, life and exchange power between the main network and other factors.The multi-objective optimization model established in this paper considers the interests of users and power grid, and establishes a reasonable optimal scheduling model and constraints.At the same time, the NSGA-II algorithm has been modified by ordinal value, non-dominated sorting and crowding distance to ensure better convergence and diversity and an external penalty function has been introduced to deal with the constraints, so the solution accuracy of the multi-objective optimization model is improved, which provides great help and application prospects for realizing the economic dispatch of microgrid and improving the economy and intelligence of power marketing.

Figure 2 .
Figure 2. Flow chart for solving microeconomic optimization model based on a variant of NSGA-II algorithm.

Figure 2 .
Figure 2. Flow chart for solving microeconomic optimization model based on a variant of NSGA-II algorithm.

Figure 3 .Figure 3 .
Figure 3. Forecast curve of load, wind power and PV output.

Figure 4 .
Figure 4.The power supply structure of the load.

Figure 4 .
Figure 4.The power supply structure of the load.

Figure 5 .
Figure 5. Charge and discharge state of a battery for one day.

Figure 5 .
Figure 5. Charge and discharge state of a battery for one day.
Energies 2019, 12, x FOR PEER REVIEW 13 of 16 (c)battery output (d)exchange power (e)load time-shared electricity purchase cost

Table 1 .
The parameters of microgrid.

Table 2 .
The price of electricity sale and purchase.

Table 1 .
The parameters of microgrid.

Table 2 .
The price of electricity sale and purchase.

Table 3 .
Comparison between scheduling model in this paper and single objective optimization model.

Table 3 .
Comparison between scheduling model in this paper and single objective optimization model.

Table 4 .
Total cost and average cost of microgrids under different optimization conditions.