Optimal energy management of microgrid based on multi-parameter dynamic programming

With the wide application of microgrid system, fluctuation and randomness are the characteristics of distributed generation output. The traditional energy management system can’t meet the requirements to ensure the security and stability of the grid. The microgrid energy management is of great significance to the stable operation of power grid. In order to obtain higher economic benefits and pay less environmental costs, reasonable scheduling of various distributed power sources is able to achieve this goal. In this article, microgrid energy management including distributed generation is studied. The objective function includes the economic objective and the environmental objective. The model of energy management is considered as a multi-objectives and multi-parametric optimization problem. The multi-parameter dynamic programming is used to optimize the energy management of microgrid. Finally, the efficiency of the proposed method is examined by the simulation studies.


Introduction
Microgrid is an effective form of distributed energy grid-connected, which becomes an important part of smart grid. 1 The use of clean energy is encouraged by countries that further promote the development of microgrids. The microgrid mainly includes distributed generators (DGs), diesel generators, energy storage systems (ESSs), as well as AC and DC loads. The operation of the microgrid has two modes of operation: islanded and grid-connected mode. In the islanded mode, the output power of distributed power in the microgrid must meet the requirements of local loads. The microgrid is connected to the main network via a point of common coupling (PCC). In the gridconnected operation model, the microgrid is able to provide energy to the main network or absorb power from power network. 2 The application of multiple distributed power sources, bidirectional power and information flow, energy storage and other equipment makes the microgrid more flexible and intelligent. 3 The two-way flow of energy and information is the core 1 feature of the microgrid, which makes the complex power control and management of the microgrid possible. 4 Under the condition of satisfying the power balance, it is necessary to study the energy optimization management strategy of the microgrid for the economical operation and the coordinated control of the distributed power source, improving the efficiency of energy utilization and the optimal distribution of power.
The operation goal of the microgrid is to obtain minimum operating costs, as well as, high quality of power supply. However, A lot of distributed power will change the balance of supply and demand in the microgrid, especially in the islanded mode. Distributed generations also increase the voltage of the system and reduce the quality of voltage. In general, the energy management system (EMS) can satisfy the objective function as well as other operational constraints. In the previous research, many algorithms are applied to the energy management of microgrids. The impact of the service life of lead-acid batteries, and the independent operation cost of the microgrid and the maximum utilization of the battery are considered as the objective functions. 5 An optimization calculation program is designed for the energy management strategy. In Wang et al., 6 an online EMS that takes into account distributed hybrid fuel cells was introduced. The system structure consists of three layers: the first layer captures the possible modes of operation. The second layer is based on the energy distribution between the fuzzy controller of battery and the fuel cell. The third layer adjusts each subsystem. Mathematical model of EMS based on the reliability of battery capacity and the increase in load demand were presented to get maximize profits. 7,8 A novel networked EMS to distributed power generation scheduling schemes was introduced in Doostizadeh et al. 9 The energy exchange problem of microgrid is optimized to participate in the traditional electricity market to gain minimal global energy production costs. In Huang et al., 10 a method for coordinated control of ESSs and distributed power sources has been employed. Users can adjust electricity consumption according to market prices to meet economic requirements. At the same time, many algorithms are applied to the energy management of microgrids. The model and cost function of different distributed power sources are given in Chen at al., 11 and the optimal solution is obtained by genetic algorithm and game theory. In Sortomme and EI-Sharkawi, 12 a new effective algorithm is addressed to complete the optimal energy system of microgrids. In summary, the heuristic algorithm can only obtain the near-local optimal solution, and not the global optimal solution. Some of these algorithms depend on the initial value setting with low efficiency.
The purpose of this article is to propose a global optimal solution to solve the optimal energy management problem under different operation modes of microgrid. Considering the characteristics of different distributed generation and the randomness of load, an optimized scheduling scheme is proposed. The optimal energy management of microgrids is a multi-stage decision process problem. The multi-stage decision process is expressed as the dynamic process of successive stages in a discrete-time system to find the optimal way of each process to maximize the benefits or minimize the cost of each stage. Therefore, this article proposes a multi-parameter dynamic programming method to solve the optimal energy management in the grid, taking into the dynamic performance of the battery consideration. This algorithm can solve the problem of falling into local optimal solution. The simulation results show the feasibility of the optimization method proposed in this article.
In summary, this article consists of the following sections. Section 'The optimization model of microgrid energy management' describes objective function and limitation factors of microgrid energy management. This section defines the model of the microgrid energy system under different operating modes. Section 'Multiparameter dynamic programming' presents characteristics of optimization algorithms and their applications in EMSs. Section 'Simulation results' evaluates the multiparameter dynamic programming in the simulation experiments. Section 'Conclusion' concludes this article and summarizes the effectiveness and economics of the optimization algorithm.

The optimization model of microgrid energy management
In this article, the objective function and limitation factors of the energy management are suitable for two possible modes of operation in the microgrid, islanded and grid-connected mode. In the islanded mode, the objective function of microgrid is that minimizes energy output cost (fuel costs) and operation and maintenance costs of the microgrid. When is connected to the grid, the microgrid is able to supply or absorb power from the distribution network. When absorbing power, the objective function is to minimize energy consumption, manufacturing cost and the operation maintenance cost. The electricity purchase price is the smallest; when supplying power, the objective function is to obtain maximum profits, that is, energy sales revenue minus the cost of energy and operation maintenance cost. The EMS in microgrid is to work out the scheduling plan of each unit under the condition of satisfying the objective function and constraints. The scheduling plan can guarantee the economic and efficient operation of the unit. In this article, the dynamic performance of the battery is considered. Hence, a new dynamic programming algorithm is used to solve the problem.

Objective function
Some of the necessary information about 24-h energy management needs to be obtained ahead of time. Relevant information includes the following: (1) Predictive value of hourly load; (2) Hourly wind and photovoltaic power forecasting; (3) Grid price forecasting; (4) The cost and parameters of distributed power generation; (5) Power limits; (6) Initial charging conditions of the energy storage device.

The islanded operation mode
In the islanded mode, the internal DGs supply power to the load, which minimizes costs of production, the operation and maintenance cost. Its objective function as equation (1) min where n is the number of time steps scheduled for the day, m is the number of schedulable DGs.P i (t) is the output power of the ith schedulable DG of t, F i (P i (t)) is corresponding function of fuel cost. According to different structure of consumption energy, the fuel cost function of power supply can be summed up in two basic forms. For microturbine or fuel cell, its corresponding fuel cost function F i (P i (t)) as follows For diesel engines, the corresponding fuel cost function as follows where a i , b i and c i are parameters of the fuel cost function The ith power supply is in operation 0 The ith power supply is out of operation & ð4Þ S i (t) is the start-up cost function of the schedulable DG, the expression is where sc i is the starting cost of each unit.
As a result, the operation of power grid need to satisfy power balance mentioned below where P load (t) is the predetermination of load power at time t.

The grid-connected operation mode
There are two types of operating scenarios for the microgrid in networked operation mode. Microgrid can both transmit power to the grid and absorb power. For the sake of clarity, the following are explained according to two different operating scenarios. Under the two operation modes, the state of power grid and the flow direction of energy are different. Therefore, two different objective functions will be obtained

Scenario 1: purchase electricity
In this condition, the objective function is given by where C grid (t) is real-time price of the grid. P grid (t) is the power exchanged with the grid at time t, P grid (t).0. As a result, the operation of power grid need to satisfy power balance mentioned below Scenario 2: sell electricity to the main grid In this condition, the objective function is given by where C grid (t) is real-time price of the grid. P grid (t) is the power exchanged with the grid at time t, P grid (t)\0. As a result, the operation of power grid need to satisfy power balance mentioned below

Constraints
The various constraints defined for optimal energy management are formulated below 1. Power constraints for dispatchable DGs 2. Grid power exchange constraint 3. ESS charging or discharging power constraint when the ESS is discharged, P ess (t).0; when the ESS is charged, P ess (t)\0.

Dynamic performance constraints of ESS
where SOC(t) is the charge state of the ESS at time t. h is the charging or discharging efficiency of the energy storage unit. W ess is the capacity of the ESS. The decision variables that need to be determined are the charging/discharging power P ess (t) and their state of charges SOC(t).

Multi-parameter dynamic programming
Battery is the most widely used energy storage decoration in microgrid. In the actual EMS, the charging level of the battery depends on the charging level of the adjacent time. Therefore, the battery charging level is related in the adjacent time. The optimal model of microgrid is considered as a dynamic programming problem. In the previous research, heuristic algorithm is used to solve the optimal solution problem. 13 However, the heuristic algorithm cannot guarantee the optimal solution. Therefore, multi-parameter dynamic programming is adopted in this article. Considering different optimization goals is another important design in process. Not only multiple goals can be considered in technology selection and unit size determine part of the design process, but also in practice microgrid goals such as minimizing costs and emissions. 14 Dynamic programming algorithm can deal with optimization problem by numerical analysis method. Set x i as state variables which contain output powers of dispatchable DGs at time t. u i is the decision vector for each plan generation adjustment. The function g i shows the relationship between neighbouring states. The function G i represents the cost function at time t. In order to get minimum absorption cost, the following formula needs to be met Subject to the following constraints where i = 1, 2, ..., N 2 1.
In discrete time coordinates, the optimal control variables u i (i = 1, 2, . . . , N À 1) as well as the initial state variable x 1 are sought. g i , G i , c iE and c iI are second-order derivable functions. The objective function of optimal energy management in the islanded mode can be converted into   where h N is h the ESS charging or discharging efficiency, W ess denotes the capacity of ESS. Both parameters can be obtained from the factory parameters of ESS.
In the network operation mode, it is essential to increase the number of state quantity and decision amount of power exchanged between the microgrid and the distribution network The multi-stage decision process describes the dynamic process of successive phases in a discrete-time model, thereby getting the optimal path of each phase to maximize the benefits or the cost of the entire phase. In a multi-stage decision-making process, for a particular phase, it contains multiple system states to determine the current phase cost. A set of decision variables acts on the current state and produces a new state variable for the next phase. This process is repeated until the last stage. The final overall goal is to get the optimal path to the smallest sum of costs in all phase.
A classical multi-decision process including a model of discrete time and a convex phase additive cost function is expressed as x k + 1 = f k (x k , u K ), x k 2 X, u k 2 U k , k 2 0, 1, . . . , N À 1 f g where x k is the state variable of k, X 2 R n ; u k is the optimal decision variable of k, U ¼ D fu 0 , u 1 , . . . , u NÀ1 g, U k R m ; f k describes the dynamic characteristics; g k is the value function of k. Using the dynamic programming algorithm, the optimization system is decomposed into a series of lowdimensional systems based on the optimization principle. 15 Hence, the complexity of the system can be greatly reduced. The objective function for an ordinary function multi-stage optimization problem can be formulated as where u i = m i (x i ) 2 U i . Applying the optimization principle, the new recursive expressions can be given below It can be seen from the above formula that the existing cost function is total future cost functions, and the completed cost function and the set of cost functions homologous to the current decision. This method can solve the global optimal variable of the initial state. The obvious advantage is that based on the premise that all future phases are optimized to the existing phase, the decision of each phase is only the corresponding phase. Although dynamic programming is a mature method, there are some restrictions. This method can't be used in many cases. The dynamic programming algorithm is applied to some problems with specific constraints, 13 u 0 = K 0 x 0 , u 1 = K 1 x 1 , ...,u NÀ1 = K NÀ1 x NÀ1 (( À b 6 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi b 2 À 4ac p )=2a), u k 2 U k , K i is a real matrix. Under the constraints of inequality, non-linear decision rules are generated. In order to ensure that the solution obtained is the global optimal solution, non-convexity is introduced. The objective function in every decision process can be defined as fx k , u k g. In order to get a concrete solution, it is necessary to obtain global optimization parameters.
This article proposes a new algorithm to solve constrained dynamic problems. This method can effectively avoid solving no global optimal solution. This method compromises the basic definitions of dynamic programming algorithms with multi-parameter programming, which can handle uncertain data in the model. The calculation process is shown in Figure 1.
In Figure 2, k is the index of the time, x k is the state of the system at time k. Based on a sequence of stagewise optimal decisions, the system transforms from its original state into a final state.
The last decision-making stage is shown in Figure 1, the optimization problem of the nth stage as given below x min x where x N , x NÀ1 2 R n , u NÀ1 2 R m . According to Kuhn-Tucker (KKT) conditions v j (u NÀ1 , x NÀ1 ) = 0, 8j = 1, . . . , q ð38Þ where l and m are the Lagrange multiplier phasors of the inequality and the equality. Due to x NÀ1 is a variable, the quantity of the above formula u Ã NÀ1 is not a point, but an optimization function u Ã NÀ1 = m Ã NÀ1 (x NÀ1 ). This optimal function is based on Theorem 1 below, with x = x NÀ1 and u = u NÀ1 . On the frontier of x 0 , the existence of the unique continuous differential function Z(x) = ½u(x), l(x), m(x), satisfying the above formula and Z(x 0 ) = ½u(x 0 ), where M 0 and N 0 are Jacobian matrices of the system of equations Corollary 1: In the field of x 0 , the first-order function estimates of Z(x) = ½u(x), l(x), m(x) are as follows where Every exact linear optimal solution is limited by feasible solution and optimal condition. ĉ represents a stable constraint, andl represents an unstable constraint Therefore, an accurate linear conditional function can be obtained . . .
where K i NÀ1 and C i NÀ1 are real matrices,CR i NÀ1 & R n . Considering the N 2 1 phase, the corresponding optimization problem turns into min u NÀ2 J NÀ1 (u NÀ2 , x NÀ2 ) = g N (x N ) + g NÀ1 (x NÀ1 , u NÀ1 ) where In the traditional dynamic programming process, it is able to get complete model information x k + 1 = Ax k + Bu k . fx NÀ2 , u NÀ2 g represents an existing cost function. A and B are system constant matrices. Due to x NÀ1 is a non-linear function, u NÀ1 = m Ã NÀ1 (f NÀ2 (x NÀ2 , u NÀ2 )), so x NÀ2 and u NÀ2 are also non-linear functions. The global optimization problem based on the above formula cannot be solved. u NÀ1 , u NÀ2 and x NÀ2 are convex functions. Lemma 1: If a dynamic system is represented by a complex function and taking cost function as objective function that minimizes the stages, the recursive formula for the dynamic programming of the k-stage value function is given as The variables (x k , u Ã k (x k ), u Ã k + 1 (x k + 1 ), . . . , u Ã NÀ1 (x NÀ1 )) meet constraints in formulas (50) and (51) where u Ã i is the optimal solution at this stage, i 2 fk, k + 1, . . . , N À 1g. Since V k and V k + 1 are convex functions, their optimal solutions is the only one. Therefore, the optimal value of the k-phase in the function can be acquired by contrasting the optimal value of the kth phase and the (k+1)th phase . . .
where K j NÀ2 H j NÀ2 and C 2 NÀ2 are real matrices. According to the specific optimization strategy, at this stage, this method cannot solve the global optimization problem. This article examines all possible combinations using the optimization strategy. In summary, the algorithm flow is as follows: Step 1. Initialization j = 1, in the Nth stage of solving the problem, this process is regarded as the multi-parameter optimization problem of the existing state space.
Step 2. Set j j + 1, solve the (N -j) + 1 stage of the problem, which is considered as a multiparameter optimization problem, the parameter x NÀj is the existing state space, and the future optimization control variables are u NÀj + 1 , . . . , u NÀ1 .
Step 4. If j = N, the calculation stops. Otherwise, return to Step 1.

Simulation results
To illustrate the effectiveness of the proposed algorithm in energy management of microgrid, the following microgrid system is used for simulation calculation. As shown in the structure of microgrid below (Figure 3), 16 the rated voltage of microgrid is 400 V. Microgrid is connected to the 20-kV grid via a public connection point (PCC). The power supply in the microgrid is composed of micro gas turbines, fuel cells, wind turbines, photovoltaic power generation and loads.
The parameters of each micro power supply are given in Table 1. The parameters of cost function are given in Table 2.
Gas emission cost parameters of distributed power (see Table 3): This article determines the time-of-use electricity price with reference to Wu et al. 14 (see Table 4):

The islanded mode
In the islanded mode, the predicted solar and wind power generation capacity are shown in Figures 4 and  In isolated grid operation mode, the load forecast is shown in the following Figure 6. The sum of the maximum output capacities of all power sources can meet the maximum load demand.
In the results in Figure 7, it can be seen that the charge and discharge of the energy storage units have a consistent trend with load change. When the load is small, the load is powered by distributed power and the battery pack is charged. When the load is large, the energy storage unit discharges, which will reduce fuel costs to meet economic operation requirements.

Purchasing electricity from the main network
In this operating mode, when the microgrid is connected to the network, the output of all power sources in the microgrid cannot meet requirements of the load. The load curve is shown in the following Figure 8.
The result in Figure 9 calculated by the algorithm shows that at a time when electricity prices are low, the energy storage unit is charged. During the time when the electricity price is high, the energy storage unit inside the microgrid will be discharged, so the unit can reduce overall system operating costs.

Selling electricity to the main network
In this mode of operation, the power in the microgrid sends electrical energy to the main grid (see Figure 10). In Figure 11, it can be seen that the energy storage unit is charged when the electricity price is low. When the electricity price is high, the energy storage unit is discharged and delivering energy to the main network. The coordination of energy storage units and distributed power sources can improve energy efficiency to reduce operating costs.      In Table 5, genetic algorithm is applied to the optimal energy management model proposed in this article. Under the operation mode of island and network, the calculation time of the optimization algorithm proposed in this article is compared with that of genetic algorithm. In comparison, the efficiency of the multiparameter dynamic programming can be verified.

Conclusion
The purpose of this article is to study the optimal energy management of the microgrid in order to obtain the power generation plan of each unit in every hour of the next day. Under different operation modes of microgrid, battery performance and coordination with other distributed energy resource (DER) are considered in this article. Therefore, the multi-parameter dynamic programming algorithm proposed considers the distributed power and the fluctuations of load in the microgrid. The simulation results show that the method can guarantee the solution of the optimization problem. According to the energy management strategy, the fuel cost is minimized, and the gas emissions are reduced with high energy efficiency. The proposed method converges quickly and obtains the global optimal solution.

Declaration of conflicting interests
The author(s) declared the following potential conflicts of interest with respect to the research, authorship, and/or publication of this article: All authors have seen the manuscript and approved it to submit to the journal. The authors confirm that the content of the manuscript has not been published or submitted for publication elsewhere.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.