Optimal Cost Management of Distributed Generation Units and Microgrids for Virtual Power Plant Scheduling

Virtual power plant (VPP) interconnects distributed generation (DG) units, microgrids, and energy storage systems (ESSs) of an electrical power system. This article presents a linear programming cost minimization model of VPP for the design and commitments of DG, ESS, and microgrid. Using a set of renewable energy resources, the proposed model creates a reliable, cost-effective, and environmentally friendly distribution system. Accurately, it illustrates the schedule of the VPP to operate autonomously. The proposed model is applied to a set of United States commercial load profiles to determine the investment benefit of implementing DGs in the power system. Analysis of results concerning variation in energy price illustrates feasible solutions. VPP decision-makers can select the best reasonable solution based on their specific project budget for feature electricity generation. Moreover, results show the need for the proposed method in VPP decision making.


A ESS
The annuity factor refers to the corresponding capital investment of the i th installed Independent ESS in the kth microgrid OutDG i,j,k The output of i th DG in the kth microgrid at the jth period (kW) McDG i,j,k The maintenance cost of i th DG in the kth microgrid at the j th period ($/kWh) W j Weighting for period j (the reflection of the number of days of this 'type' per year) OutIDG i,j The output of i th independent DG in the power network at the j th period (kW) The maintenance cost of i th independent DG in the power network at the j th period ($/kWh) OutESS i,j,k The output of i th ESS in the kth microgrid at the j th period (kW) VESS i,j,k Electricity stored in the i th unit of the kth microgrid in period j (kWh) McESS i,j,k The maintenance cost of i th ESS in the kth microgrid at the j th period ($/kWh) OutIESS i,j The output of i th independent ESS in the power network at the j th period (kW) VIESS i,j Electricity stored in the i th unit in period j (kWh) McIESS i,j The maintenance cost of i th independent ESS in the power network at the j th period ($/kWh) I j,k Electricity imported from the k th microgrid in period j P j,k Price for electricity imported from the kth microgrid in period j E j,k Electricity exported to the kth microgrid in period j r j,k Buyback price for exported electricity to the kth microgrid in period j Pmicrogrid k (γ ) Fixed cost for microgrid components, as a function of the number of sites (k) and the distance between sites (γ ) IIDG i,j Electricity imported from the i th independent DG in period j PIDG i,j Price for electricity imported from the i th independent DG in period j EIDG i,j Electricity exported to the i th independent DG in period j rIDG i,j Buyback price for exported electricity to the i th independent DG in period j PIDG i (γ ) Fixed cost for independent DG components, as a function of the number of sites (k) and the distance between sites (γ ) IIESS i,j Electricity imported from the i th independent ESS in period j PIESS i,j Price for electricity imported from the i th independent ESS in period j EIESS i,j Electricity exported to the i th independent ESS in period j rIESS i,j Buyback price for exported electricity to the i th independent ESS in period j PIESS i (γ ) Fixed cost for independent ESS components, as a function of the number of sites (k) and the distance between sites (γ ) V b Voltage magnitude at bus b RIDG l,i Ramp down the limit for i th independent DG RIDG u,i Ramp up the limit for i th independent DG hESS u,i,k Maximum charge rate for i th ESS of kth microgrid hESS l,i,k Maximum discharge rate for i th ESS of kth microgrid RDG l,i,k Ramp down the limit for i th DG of kth microgrid RDG u,i,k Ramp up the limit for i th independent DG hIESS u,i Maximum charge rate for i th ESS hIESS l,i Maximum discharge rate for i th ESS

I. INTRODUCTION
Improving distributed generation (DG) in all aspects such as renewable technologies, financial-economic, and power quality causes the end-users to be keen on generating power electricity, individually. DG units independently operate with different owners that can be implemented on-grid or offshore [1]. Hence, on the one hand, applying DG in microgrids may damage the system's regular operation. On the other hand, it may improve power generation cost, greenhouse gasses emission, and power quality factors such as power loss, voltage deviation, and distribution system reliability. A virtual power plant (VPP) is a technical, economical, and practical structure that interconnects DG units and energy storage systems (ESSs) within microgrids [2].
Recently, several works [3]- [6] have presented challenges and opportunities for VPP in bidding strategies of markets or optimal scheduling issues that the main idea of this article (i.e., presenting an optimal practical VPP model) is inspired by them, for instance, authors of [6] have designed a market mechanism for virtual inertia. Sadeghian et al. [7] have presented the sizing model of ESS in a VPP contains constant photovoltaic units, wind turbines, and loads to minimize the cost of VPP. With this idea, the current study uses the modified model not only for the sizing of ESS but also for the sizing of DGs and other power generators of the power system. Moreover, the authors of [8] have shown an energy management system (EMS) of VPP considering DGs, ESSs, and controllable loads in an integrated model. The current study expands this model for considering commercial loads. The focus of [9] is on recognizing risk management in the optimal operation of VPP, the optimal operation is a part of the current study. Dulau et al. [10] have gathered the main features of DG and VPP that contain power quality issues. This article considerers these features, too. The authors of [11] have reviewed all definitions, principal components, and the primary concept of VPP and have presented two principal VPP types: technical VPP and commercial VPP. Based on the presented definitions in [11], this article presents commercial VPP with considering technical aspects. Zamani et al. [12] have shown a two-stage mathematical model for the implementation of DGs and ESSs for scheduling of a VPP with considering uncertainties of electricity prices. This article improves the used optimization model in [12] to avoid achieving unwanted local optimum solutions and to increase the calculation velocity of the optimization algorithm.
Besides that, microgrids as one of the subsystems in the VPP have some dispatched units such as DG units, ESSs, and demand-side systems. Recently, scholars have introduced various methods and models for EMS of microgrids [13]- [15]. The authors of [15] have presented an optimal model for a local microgrid that uses a day-ahead optimization algorithm considering a daily variation of demand and supply. Furthermore, the authors of [16] have reviewed the state of the art in the field of reconfiguration in microgrids. They have highlighted the research gaps in this field of study contain modeling of VPP and future challenges in microgrid reconfiguration. Hence, this article presents a practical model of VPP with connected microgrids. On the other hand, some scholars have presented the research gaps related to optimization algorithms used in the microgrids models [17]- [19]. The authors of [17] have presented a swine-influenza optimization algorithm for minimization of cost in microgrid under probabilistic and deterministic environment. Moreover, Dawoud et al. [18] have reviewed some other optimization techniques and algorithms for minimizing the cost function of the microgrid. Li et al. [19] have presented a Zero-Order Distributed Policy Optimization algorithm combination of leveraging consensus algorithm and Zero-Order Policy Optimization algorithm to learns the local controllers in a distributed fashion. The mentioned algorithms and other types of optimization algorithms have some specific characteristics that cause the selection of one in detriment of the others. Although the classical mathematical algorithms in comparison to heuristic algorithms (including evolutionary algorithms) are more accurate, their calculation velocity is very slow for some optimization problems such as VPP modeling. Moreover, the differences in the heuristic algorithms such as mentioned optimization algorithms are in the calculation speed and the accuracy of solving the optimization problem.
Analysis of the reviewed literature shows one of the main objective functions in microgrids is the reduction of operational costs that still needs more research to achieve this goal [8]- [12], [20]. Additionally, the study of reviewed kinds of the literature shows the VPP model is one of the best concepts for increasing DG and ESS integration in the power system but the scholars try on finding the reliable and accurate VPP model [13]- [18], [21], [22]. Moreover, the common intelligent control center of VPP needs a linear programming cost minimization model of DG and storage within microgrids that some articles have stated the need for more research about it [5], [8], [23]- [26]. Therefore, presenting an optimum model of DG and storage within the microgrid for the control center of VPP is the main target of this article that a few studies have been conducted to present it.
This article presents a simultaneous DG, microgrid, and ESS scheduling method for a VPP considering uncertainty parameters, and demand response resources. Modeling of uncertainties in operational planning for EMS makes the scheduled results more realistic. The power system operational cost is the objective function. Wind turbines, photovoltaics, and batteries are considered as DG in this article, mainly because of the recent growth in their usage. Analysis of results shows some interesting points such as solution 1 illustrates the best participant of renewable energy resources about %43 of the whole generation while solution 2 indicates the minimized initial investment cost and solution 3 demonstrates the minimized operation cost for 25 years.
Most of this article's novelty and originality are related to improving a linear programming cost minimization model and a new hybrid optimization algorithm to solve it for VPP planning. The applied strategy in the proposed optimization algorithm for determining the optimal operation of power generators of the VPP, and using sensitive analysis optimization technique are the most critical innovative elements of the proposed approach. The comparison of the proposed optimization algorithm with the other optimization algorithms proves the superiority of the proposed optimization algorithm in accuracy and calculation velocity. Furthermore, the proposed optimization algorithm may be interesting for some scholars who need an accurate optimization algorithm with a superb calculation velocity in solving optimization problems related to power systems. Comparing the proposed optimization algorithm feasible solutions with each other proves the capability of the proposed algorithm in analyzing and presenting the best VPP model for each special project. The innovative contributions of this article are as follows: • This article presents a practical model for the reconfiguration of the power system.

II. SYSTEM MODELING AND PROBLEM FORMULATION
An energy management problem is defined in this article. The problem is determining the feasible and optimized solutions of a VPP contains different DGs, ESSs, loads, and microgrids for minimizing the cost. The objective function is the minimization of the annual cost of generating electricity. This article improves a linear programming cost minimization model while uses the previous studies in this area as a basis for the formulation of a new approach to solving this problem. This article formulates the problem as linear programming that is a convex optimization problem and introduces a hybrid optimization algorithm to solve this problem. The models and methods to solve this problem are gathered in this section.

A. VIRTUAL POWER PLANT MODEL
VPP is defined as a combination of DGs, ESSs, loads, and microgrids participating in the power market as an independent power plant for specific objective trading the generated the electrical energy for minimizing the cost. In the power market, the VPP can buy power for the power market and charge the ESSs when the electricity price is low. On the other hand, the VPP decreases power obtained from the controlled load and discharge energy from the ESSs when the electricity price is high in the power market. All kinds of DGs, such as photovoltaic units, wind turbines, or diesel generators, can be implemented in the VPP structure. EMS, the core of VPP, duty is to coordinate the output power of generators, the load demand, and ESS capacity [24]. Fig.1 illustrates a schematic overview of a VPP structure that is implemented in this article. The data and power flow connections between all components of VPP is shown in this figure. The passive management of distribution network which is generally found in a centralized system where power electricity flows from large power plants, through the transmission lines, and then the VPP structure has changed through the distribution system to the load. When substantial power generation occurs in the distribution system, the power electricity flow will be changed.
The structure of the microgrid using the VPP structure is shown in Fig.2. The power flows of all generators, load and ESS are shown in this figure. The microgrids 1 to n that are shown in Fig. 1 have different DGs that are connected to the microgrid in Fig. 2. The number and kinds of DGs can be changes in various case studies. The DGs can independently connect to VPP or can use in the microgrids.

B. MICROGRID MODEL
A set of DGs, electrical energy storage, the grid connection for export or import electricity, a power distribution infrastructure, and an energy management system are defined as a microgrid. The main characteristic of a microgrid is operating autonomously in an ''islanded'' mode where there is no electricity exchange with the macro-grid. Microgrid creates a reliable network with high efficiency and low emission of greenhouse gas [22]. Fig. 3 shows an example of a microgrid in the real world. This figure indicates a large hotel and a hospital in the USA, supplied by the 1.5 MW wind turbines, the 10 MW photovoltaic units, a 1MWh generic Lithium-ion battery, and a utility having diesel generator (2MW). The microgrid model is usually simulated with HOMER [27], DER-CAM [28], and MATLAB [29] software. Because of the various number of design options and uncertainty parameters, simulation, design, and analysis of microgrid can be challenging. This article used the reliable HOMER software developed by the US national renewable energy laboratory (NREL).

C. STOCHASTIC AND UNCERTAINTY MODEL
Several models have presented in different studies to model the power system uncertainties, and some methods are used to solve them such as the Monte Carlo (MC) method, approximate methods, and analytical techniques. The MC method is computationally expensive, but it can handle complex, uncertain variables accurately [21]. In this article, the authors have used the MC method to solve the model of the uncertainty of the power system. The flowchart and details of the MC method can be found in [30], [31]. Moreover, the authors of [32] have applied the MC method to uncertainty in measurement that is the same model of the MC method that is used in the current study. The authors of [12] have presented the model for the uncertainties of market prices, electrical demand, and intermittent renewable power generation that is used in this article, as well. The procedure to use the MC method in the grid search optimization algorithm is explained in [33].

D. MATHEMATICAL FORMULATION
The operational schedule of DGs is optimized, usually with the objective function of maximizing the profit or minimizing the cost of generating electricity by different optimization algorithms [23], [34], [35]. The objective function which is considered in this article is the annual cost of generating electricity. The other objective functions, such as loss and voltage deviation [36] and the concept of multiobjective [37], can be considered for future improvement of this study. The objective function is defined as follows: The imposed constraints on the optimization process can be listed as follows: • Voltage restriction The permissible limits of the power network voltage should always be kept as follows: • The unit restriction for generating power more than its capacity OutIDG i,j − CapIDG i ≤ 0 for i = 1 to a and j = 1 to t (3) (OutIESS i,j −VIESS i,j )−CapIESS i ≤ 0 for i = 1 to b and j = 1 to t (4) OutDG i,j,k − CapDG i,k for i = 1 to c, j = 1 to t and k = 1 to n (5) (OutESS i,j,k −VESS i,j,k )−CapESS i,k ≤ 0 for i = 1 to d, j = 1 to t and k = 1 to n (6) • Charge/discharge rate restrictions for each storage unit and ramp limits for each generator RIDG l,i ≤ OutIDG i,j+1 − OutIDG i,j ≤ RIDG u,i for i = 1 to c, j = 1 to t and k = 1 to n (7) OutESS i,j,k ≤ hESS u,i.k (8) VESS i,j,k ≤ hESS l,i,k (9) RDG l,i,k ≤ OutDG i,j+1,k − OutDG i,j,k ≤ RDG u,i,k for i = 1 to c, j = 1 to t and k = 1 to n (10) OutIESS i,j ≤ hIESS u,i (11) VIESS i,j ≤ hIESS l,i

E. OPTIMIZATION MODEL
Many optimization algorithms such as symbiotic organisms search algorithm (SOSA) [38], backtracking search algorithm (BSA) [39], stud krill herd algorithm (SKHA) [40], and honey-bee-mating-optimization algorithm (HBMOA) [41] are proved to optimize different objective functions in the power system. The main difference between them is their calculation speed and accuracy to obtain the optimum point. In this article, two optimization algorithms are combined. The grid search algorithm is used to obtain all of the feasible system configurations by the search space. Additionally, a proprietary derivative-free algorithm is used to search for the least-costly system. The Pseudo-codes of these two algorithms can be seen in [42] and [43]. The proven superiority of the grid search algorithm in comparing the other optimization algorithm is the capability of selecting the best parameters for the optimization problem from the provided list of parameter options [44]. Because of this proved superiority, this article has used this part of the grid search algorithm to obtain all of the feasible system configurations contains DGs, ESSs, loads, and microgrids. After finding the feasible solutions based on the imposed constraints, a derivative-free algorithm is used to find the best feasible solution based on the objective function. This article selects a derivative-free algorithm because of the perfectibility of this algorithm to solve convex optimization problems in comparison to the other optimization algorithms [45]. This algorithm uses the Monte Carlo method to calculate the impact of risk and uncertainty in the prediction and forecasting model that calculates the 25 years cost of using the best solution. Someone may ask that why after finding feasible solutions by grid search algorithm the minimization process of the objective function is not continued with the second part of the grid search algorithm and a derivative-free algorithm is replaced! The answer is related to the type of optimization problem. It is proven that the derivative-free algorithm is more accurate than the other optimization algorithms in solving convex optimization problems [45], [46].
For applying the proposed algorithm, the following steps have to be taken: Step 1: input data definition: The input data are including the standard load profile sample, the restriction of VPP components, and the number, and the power level of all generators.
Step 2: efficiency calculation: The efficiency of all generators at the operating points are calculated as follows: Efficiency = gen fuel (13) gen and fuel are the amounts of generators' electricity generation at the operating point in J (joule).
Step 3: grid search algorithm: Generate feasible solutions by using the grid search algorithm based on inputs and efficiency of the generators.
Step 4: variable and constraints definition: all problem variables and constraints described in section 2 in parts 2.4 are defined in this step.
Step 5: objective function definition: The objective function, which is essential for the decision-maker, is defined in this step based on equation 1.
Step 6: calculation of objective function: the defined objective function with considering of the defined variables and constraints is calculated by using the derivative-free algorithm for all feasible solutions. In HOMER, the applied minimization method is the derivative-free algorithm, too.
Step 7: make schedule operating time of generators: the minimum of the objective function should be calculated for all period times based on the efficiency of generators and load demand, which is calculated by the derivative-free optimization algorithm. MC method determines the uncertainty of the power system in this step, too.
Step 8: Check the termination criteria: the termination criteria (i.e., the last interval of the mission) is checked to stop the program. If the termination criteria are not satisfied, then the algorithm repeat from step 2. Fig. 4 shows the flowchart of the proposed optimization algorithm. All steps of the proposed algorithm are shown in this figure as well as the designed loops. The presented data helps the readers to implement the proposed optimization algorithm in different software.

III. DETAILED PROPOSED TECHNIQUE
The analysis and inputs that are used for the proposed optimization approach are explained in this section.

A. ANALYSIS METHOD
The application aim of the above-developed model is to investigate and design microgrid, DGs, and ESS dispatch to VOLUME 8, 2020  apply VPP. Microgrids may consist of a variety of generators, storages, and configuration, the flexible model, is considered to change based on specific projects. Therefore, this analysis does not represent the loss, environmental issues, and voltage deviation of the power system. The objective function is the cost, which should be optimized.
Physically, in this article, the VPP consists of the following components:  • Distribution system Other potential generators that could be used in VPP are not considered in this study, even though they may result in better power quality and environmental issues. But the proposed model can be used for them in other projects.
Central estimates of current US generators' capital costs, maintenance costs, and energy prices are input to the model and optimal size of DGs and ESSs schedule as section 3.
It is considered that the microgrid is operating in the island mode; the wind turbines cannot contribute to meeting electricity demand. Thus, the capacity credit of wind turbines reduces to near-zero within the microgrid.
Performing sensitivity analysis to the ''central estimate'' result by altering energy prices is the last step. Increasing the gas price and electricity price, which are widened the spark spread, are considered in two separate cases, and then the stochastic proposed approach is applied to each scenario.
For furnishing tractability of the optimization problem for the optimizer, the limitation for the number of units should be considered for a VPP. As a case in point, in this article, as Fig. 5 shows, a photovoltaic unit, an ESS, a wind turbine, two diesel generators, and a microgrid, which contains a wind turbine and a diesel generator, are considered as a VPP to implement the proposed method. Fig. 5 shows the case study of this article to implement the proposed optimization algorithm. The power profile of the two found loads is shown in Fig. 6, and Table 1. Fig. 6 displays the power profile of a small hotel in Los Angeles California for 12 months. The capital costs and characteristics of all units are displayed in Table 2.

IV. SIMULATION RESULTS
In this article, an optimal practical model of VPP for increasing integration of DGs, ESSs, and microgrid, which contains modeling of uncertainties in operational planning, is presented. The objective function is cost, minimized by a hybrid optimization algorithm.
The mentioned VPP with all components is simulated in HOMER, which contained 57,173 solutions. The 51,908 solutions were feasible, and 5,265 solutions were infeasible due to the capacity shortage constraint. Three optimized solutions are more critical for some decision-makers: • Solution 1: the solution that considered all the mentioned components participating in the generation of electricity.
• Solution 2: The solution that obtained minimized initial cost (minimum number of the mentioned components).
• Solution 3: The solution that obtained minimized operational cost. The optimized results for solution one are shown in Table 3. Analysis of this table indicates that Generator 1 has the maximum operating cost and total cost. Still, to compare components, the amount of generator production is needed, as shown in Table 4.
The resource cost for renewable generators is 0 because the wind and sunlight as resources are free. The replacement cost for generator three and PV is considered zero because the replacement period for them was more than 25 years (i.e., the period of this simulation).
A summary of used renewable generators is displayed in Table 5 to overview the electricity generation participation of renewable energy resources in this case study. In this table, results are divided into three parts contain results related to the capacity of electricity generation, type of energy generation, and peak values of the power system. Analysis of this table shows that about 43 percent of generation in the peak time of power system is produced by renewable generators, considering using solution 1 to generate electricity.
Results using solution 2 for generating electricity are shown in Table 6 and Table 7. In this case study, just two diesel generators produced electricity for the loads, and the grid purchases of power are about 35 percent of total generation. In this case study, the initial cost is minimized to 600,000 $ for the first year.
Results using the third solution are shown in Table 8  and Table 9. This feasible solution is obtained to minimize operating costs concerning using the maximum number of components. The tolerance of accuracy in the calculation of electricity generation in this study is 0.1 percentage.
The comparison of these three solutions in 25 years is shown in Fig. 7. In this figure, the nominal cash flow is an actual income minus cost that is anticipated in a particular year. The costs of capital, operating, replacement salvage, and resource in three solutions that are shown in tables 3, 6, and 8 are used to calculate the cash flow. Analysis of this figure shows for 25 years, the lowest initial cost belongs to solution 2, and the quietest operation time belongs to solution 3. These results can help the VPP decision-maker to select the best feasible solution for the next 25 years.
To prove the capability of the proposed optimization algorithm to achieve the best global optimization solution, the results of the proposed optimization algorithm are compared with two optimization algorithms (i.e., particle swarm optimization (PSO) and genetic (GA) algorithms) reported as the best algorithms to solve this specific optimization problem [47]. Scenario 3 has been solved with the mentioned optimization algorithms and the proposed optimization algorithm with two single-objective functions that are the total annual cost and the emission of greenhouse gases. The definitions of the mentioned objective functions are presented in [48]. The comparison of the results is shown in Fig. 8. Analysis of this figure shows the best obtained optimized solutions in the less iteration number are obtained by the proposed optimization algorithm that proves the superiority of the proposed optimization algorithm in accuracy and calculation velocity in achieving a global optimization solution.   The total net present cost (NPC) of a system is the present value of all the costs the system incurs over its lifetime, minus the present value of all the revenue it earns over its lifetime. Costs include capital costs, replacement costs, O&M costs, fuel costs, emissions penalties, and the costs of buying power from the grid. Revenues include salvage value and grid sales revenue. we calculated the total NPC by summing the total discounted cash flows in each year of the project lifetime. The total NPC for solutions 1, 2 and 3 are $40,934,530.00, 43,833,920.00, and 40,721,800.00, respectively.
The presented results were three important ones for most of the decision-makers (i.e., power system companies). These results compared in 25 years. It is noted that some other feasible solutions have existed that may be interested in a few other decision-makers. From generalizing these findings, everyone could expect that all these feasible solutions may be used to reconfigure the future power system. In this regard, the interesting point for the presented solutions is that solution 1 shows the biggest participates of renewable energy resources about %43 of the whole generation. Furthermore, solution 3 is the best economic solution but the first investment cost is more than the others and solution 2 shows the minimized initial cost.
The next step of this study can improve and complete the obtained results. This article's results show that the proposed optimization algorithm has an excellent performance in determining the optimal operation of all generators of the VPP. However, the No Free Lunch Theorem shows that no one algorithm is suitable for all models. Inherently, the proposed method is a single-objective unconstrained optimization algorithm that restricts the problem formulation, which is its main limitation. In this regard, the next step will be adding a constraint-handling technique and a multi-objective technique to the proposed optimization method.

V. CONCLUSION
The operation schedule of the microgrid, DGs, and ESS for a VPP has been presented in this article. The results obtained considered uncertainty parameters and demand response resources. All feasible solutions were calculated, and among them, the most important ones for VPP decision-makers were analyzed. Moreover, the cost flow of these solutions was compared in 25 years. Decision-maker selects the best feasible optimized solution among results based on requirements of the distribution system. The interesting point for the presented solutions is that solution 1 shows the renewable output divided by the whole generation equal to %43. Moreover, solution 3 is the best economic solution but the first investment cost is more than the others. The next steps of this research will include other objective functions, such as power quality issues.