A Partnership of Virtual Power Plant in Day-Ahead Energy and Reserve Markets Based on Linearized AC Network-Constrained Unit Commitment Model

+is paper presents coordinated energy management as a virtual power plant (VPP) framework with a wind farm, a storage system, and a demand response program in the transmission network according to the cooperation of VPPs in day-ahead energy and reserve markets. +is strategy is based on a bilevel method, where it maximizes the expected VPP revenue in the proposed markets subject to constraints of renewable and flexible sources and the VPP reserve model in the upper-level problem. Also, a market-clearingmodel based on network-constrained unit commitment (NCUC) is explained in the lower-level problem so that it minimizes the expected operating cost of generation units constrained to a linearized AC-NCUC model. +e scenario-based stochastic programming (SBSP) models the uncertainties of loads and WF power generation. +en, the master/slave decomposition method solves the bilevel problem to achieve an optimal solution at a low computational time. Also, since the lower-level problem is mixed-integer linear programming, the Benders decomposition algorithm is adopted to solve this problem. Finally, the suggested approach is implemented on IEEE test networks in GAMS software, and numerical results confirm the efficiency of the coordinated VPP management in DA energy and reserve markets and its capabilities in improving network operation.


Motivation and Approach.
Nowadays, the utilization of renewable energy sources (RESs) such as wind farms (WFs) has prospered to reduce environmental concerns, where these sources generally include uncertainty in their power generation [1,2]. erefore, to achieve a flexible power system in the presence of RESs, flexible sources such as energy storage systems (ESS) and demand response programs (DRP) should be used at different points of the network [3,4]. However, it should be noted that management and control of many of these sources distributed throughout the network, especially in a large-scale power system, are complicated [5]. Hence, they should be operated centrally in the context of a virtual power plant (VPP) in the power network so that WF, ESS, and other sources and active loads in a zone are aggregated in the VPP to be coordinated with a VPP operator (VPPO). Moreover, the VPPO is also coordinated with the network/market operator to achieve a flexible, reliable, and secure power system while increasing the VPP profit.

Literature Review.
In recent years, many pieces of research have been carried out in the area of energy management of RESs and active loads, such as ESS and DRP, that are distributed in the power system. For instance, the authors in [6] present the optimal operation of the ESS in the transmission network in the presence of a WF. Also, the storage operation in the power system, including high penetration of RESs, is expressed in [7] for the medium-and long-term operation. In [8], stochastic optimization is used to determine the hourly scheduling of optimal reserves in the network by considering the uncertainties of wind and load power, where DRP is used as a flexible source in this condition. In [9], the authors propose a new structure for ESS in the transmission expansion planning problem to obtain a flexible transmission network with high penetration of wind systems. Also, the DRP is considered in [10] as a means of mitigating transmission violations when uncertainties of wind farms are considered. In addition, the aggregation of renewable and flexible sources is investigated in other works so that the stochastic coordinated model of WF, ESS, and DRP as a VPP framework, which operates based on the day-ahead (DA) and intraday energy markets, is presented [11]. Also, the proposed model in [11] is used [12] according to DA and real-time energy markets to obtain optimal profit for the VPP. e VPP capabilities for implementing optimal management and control of different sources and active loads are introduced [13] in which a hybrid automata model is used for the VPP. e capability of the VPP to control frequency is expressed [14]. Moreover, the optimal bidding strategy of the VPP in the auxiliary service market as a deterministic model to consider carbonelectricity integration trading is modeled [15]. Finally, the taxonomy of recent works is expressed in Table 1.

Contributions.
According to the literature review and Table 1, the following items are among the main research gaps in energy management of networked VPPs: (i) e optimal power flow approach for power systems with RESs and flexible sources distributed in different locations of the system is mainly reviewed such as [6][7][8][9][10]. Management and control of these sources in this condition are complicated due to the high data density in the network operator unit [5]. (ii) Also, the aggregation of these sources as a VPP framework is investigated in different studies [11][12][13][14][15] where the network model is dismissed. Considering network formulation in the VPP can lead to an accurate and real solution, and also the VPP benefit in the power system can be investigated. (iii) Reserve services can improve flexibility, reliability, and security indices in a power system. Hence, VPPs can be participated in the energy and reserve markets simultaneously to achieve high benefits, while the reserve market-clearing method is presented in few studies. (iv) Many studies [6][7][8][9][10][11][12][13][14][15] present the market-clearing model based on optimal power flow formulation. Nonetheless, generation units operate according to the unit commitment (UC) model. Hence, the network-constrained unit commitment (NCUC) equations are needed in the market-clearing model, and this scheme has rarely been studied.
To bridge the above-mentioned research gaps, this paper presents stochastic scheduling of a grid-connected VPP that operates according to a coordinated energy management strategy in the DA energy and reserve market, as shown in Figure 1. is strategy includes a bilevel optimization model, where the VPP model is expressed in the upper-level problem and the market-clearing approach based on linearized AC network-constrained unit commitment (LAC-NCUC) model is presented in the lower-level problem. e upperlevel problem maximizes the expected VPP revenue in DA energy, up and down reserve markets, and it limits the coordinated model of WF, ESS, and DRP as VPP framework, as well as VPP reserve model. Also, the lower-level problem minimizes the expected operating cost of generation units subject to the LAC-NCUC formulation including linearized AC power flow equations and network limits as well as unit commitment model of generation units and up and down reserve requirements in the transmission network. In addition, scenario-based stochastic programming (SBSP) models the uncertainties of load and WF power. In this method, the Monte Carlo Simulation (MCS) generates many scenario samples and, thus, the Kantorovich method applies some of these scenarios with a high probability of occurrence to the proposed problem according to its scenario reduction technique. Note that the lower-level problem of the model includes a mixed-integer linear programming (MILP) model. Hence, conventional methods such as Karush-Kuhn-Tucker (KKT) and duality approaches cannot achieve a single-level formulation for the proposed bilevel formulation. erefore, this paper uses the master/slave decomposition algorithm to solve the proposed bilevel problem to obtain an optimal solution at a low computational time. As shown in Figure 1, the VPP model is formulated in the master problem and the LAC-NCUC-based market-clearing approach is defined in the slave problem. e slave problem is MILP; hence, the Benders decomposition (BD) algorithm solves this formulation as illustrated in Figure 1. Finally, the main contributions of this paper can be summarized as follows: (i) presenting a coordinated energy management method as a networked VPP framework to obtain an optimal benefit for WF, ESS, and DRP in DA energy, up and down reserve markets, (ii) obtaining the LAC-NCUC formulation-based market-clearing model to calculate local marginal energy and reserve prices, (iii) modeling the proposed bilevel problem based on the master/slave decomposition method and obtaining the BD model for the lower-level problem.

Paper
Organization. e rest of the paper is organized as follows: Section 2 presents the stochastic method of VPP participation in the electric market according to the DA energy and reserve market-clearing approach. Section 3 expresses the solution method of the proposed problem, and Sections 4 and 5 demonstrate the numerical simulation results and conclusions of the proposed approach, respectively.

Optimal Participation of VPP in the Electricity Market
In this section, the optimal stochastic scheduling of VPPs based on the framework of DA energy and reserve markets is presented in the power system according to the 2 International Transactions on Electrical Energy Systems NCUC-based market-clearing model. is problem maximizes the expected profit (revenue) of VPPs in the proposed markets subject to constraints of renewable and flexible sources and the reserve model of the VPP in the upper-level problem. Also, the lower-level problem obtains an NCUCbased market-clearing model, which minimizes the expected operating cost of power generation limited to AC-NCUC constraints. e proposed strategy is described in the following sections and subsections. A bilevel problem is a specific type of a multilevel problem, which includes an upper level and a lower level. e upper level is separate from the lower level and they are implemented in order. Objective functions of decision-makers perform independently and attempt to optimize their functions. However, decisions impact the objective of others. Some variables of the upperlevel problem are subject to the solution of the lower-level problem [16].
In the mentioned problem, the goal is to encourage VPP owners in the energy and reserve market. erefore, their goal is to maximize their profits in the mentioned markets. erefore, an optimization problem for VPP is stated, whose objective function is to maximize the VPP profit, and its constraints are the operation equations of resources and storage devices in the form of VPP and the VPP reserve model. Profit also depends on the market price. e market price is also different in different network buses. Also, the market price, like the energy price, is equal to the dual variable of active power balance in network buses. erefore, this price is extracted from the market-clearing price problem. erefore, there is a need to present the lower-level problem in which the NCUC-based marketclearing model is expressed until the market price is determined.

VPP Model (Upper Level).
In this paper, a VPP with WF and flexible sources such as ESS and DRP is connected to the transmission network to inject/absorb electrical energy and to provide the network reserve requirement based on its optimal participation in DA energy and reserve markets. Hence, the VPP operation is modeled as (1)- (14). In equation (1), VPPO maximizes the expected VPP revenue obtained from DA energy, up reserve, and down reserve markets according to local marginal energy and up and down reserve prices (LMEP, LMUP, and LMDP). It should be noted that the VPP will achieve revenue in the DA energy market if its active power is positive; otherwise, it leads to cost instead. However, the VPP revenue is always positive  International Transactions on Electrical Energy Systems due to the positive value of up and down reserve powers [17]. VPP constraints are explained in (2)- (14). e output active power of VPP is calculated based on (2) and includes passive load, WF, DRP, and ESS powers. Also, the equation of WF generation power is presented in (3), where its maximum capacity, W max , changes in an hour and scenario due to its dependency on wind speed [18]. Note that WF can generate power around W max due to zero operating cost; therefore, WF is modeled as (3). Equations (4) and (5) formulate the incentive model of the DRP [10]; the DRP power limit is expressed in (4) and the daily energy of DRP should be zero (see (5)). In other words, the proposed DRP model can shift high loads in peak to off-peak periods based on the energy price of the DA market according to constraints (4) and (5) and objective function (1). e ESS constraints (6)-(10) denote charge and discharge rate limits, respectively, (6) and (7), stored energy in ESS, (8), the initial energy of ESS, (9), and energy limit, (10) [18]. In addition, the VPP capacity limit is formulated in (11), where it is the same as the capacity limit of the transmission line between VPP and the network. Finally, up and down reserves provided by VPP are calculated based on constraints (12) and (13) [19], where these variables are always positive based on (15).
subject to

NCUC-Based Market-Clearing Model (Lower Level).
In the problem model (1)- (14), the local marginal market prices, that is λ E , λ U , and λ D , must be obtained from the market-clearing approach. Hence, this paper uses the NCUC-based market-clearing model that is implemented by an independent system operator (ISO). is method can provide a unit commitment (UC) framework to generation units and other sources considering the network model [19]. is framework is modeled in (15)- (33). e objective function minimizes the expected operating cost of generation units (15), where it refers to the summation of no-load, startup, shutdown, and fuel costs of generation units. Note that up and down reserve costs are considered in the fuel cost part based on the second row of (15) because these reserve powers are provided by input mechanical power of generation units, which depends on fuel cost. Moreover, equations (16)-(21) express the network constraints according to the AC optimal power flow (AC-OPF) model, where these equations refer, respectively, to active and reactive power balance, (16) and (17), active and reactive power flow of transmission lines, (18) and (19), line capacity limit, (20), and limitation of voltage magnitude, (21) [10,18]. Also, the UC model of generation units equipped with reserve technology is presented in (22)-(31) [18]. e limits on active and reactive generation power are stated in (22) and (23), respectively, and refer to the capability curve model of generation units [20]. Turned on/off states of generation units are calculated by a logical equation (24). Equations (25) and (26) refer to minimum up/down times of each generator so that if a generator is turned on at time t, it must remain switched on at least for the next (MinUp) periods and similarly for the shutdown constraint. Constraints (27) and (28) refer to, respectively, up and down ramp rate limits considering active and reserve powers. e values of up and down reserve power of generation units are obtained according to (29) and (30), where these variables are always positive based on (31) [19]. e up and down reserve requirements in the transmission network at hour t are satisfied by constraints (32) and (33), respectively [21]. Accordingly, these reserve powers in this paper will be provided by generation units and VPP. Finally, λ E , λ U , and λ D are dual variables of equations (16), (32), and (33), where λ E is a free variable and λ U and λ D are positive variables.
subject to International Transactions on Electrical Energy Systems

Stochastic Model.
In the proposed model in (1)-(33), the maximum power of load and WF are considered as uncertainty parameters. us, the SBSP models these uncertainties based on normal and Weibull probability distribution functions (PDFs) [18]. e SBSP generates many scenario samples by MCS and the scenario reduction strategy, that is, the Kantorovich method, decreases the number of the generated scenario samples to a certain number of scenarios with high occurrence probability; more details of this process are expressed as follows [3]. In addition, the problem variables are divided into "wait and see" and "here and now" variables that do and do not depend on uncertainty, respectively. Binary variables such as x, u, v, and s are here and now, and they lack a w index; yet, other variables are wait and see and include a w index.
Concerning the uncertainty modeling, Monte Carlo Simulation produces several scenarios. Each uncertainty parameter of a given scenario is specified according to the mean and standard deviation of that parameter. Normal and Weibull probability density functions are, respectively, used to calculate the probability of the chosen values of load and power of WF [18]. en, the probability of each generated scenario (ρ 0 ) can be obtained by multiplying the probability of uncertain parameters of that specific scenario. Eventually, high probable scenarios are selected using the Kantorovich method and are applied to the problem. Kantorovich method selects scenarios that are in the shortest distance from each other. e problem [22] is in an NP-hard form. Kantorovich method helps solve this problem and selects the mentioned proper scenarios in the shortest possible duration. In this method, the probability [22] provides more details of the Kantorovich method.

Solution Method
e proposed market-based VPP scheduling is based on a bilevel optimization problem, where its lower-level problem is convex mixed-integer nonlinear programming (MINLP) [10]. Hence, conventional methods such as Karush-Kuhn-Tucker (KKT) and duality approaches cannot convert this bilevel model to a single-level problem due to the existing nonconvex formulation and binary variable in the lower-level problem model. To cope with the issue, the master/slave decomposition (MSD) approach is used in this paper to solve the proposed bilevel VPP strategy, where it is expected to reach the optimal solution at a low computational time [23]. In this approach, the upper-level method is expressed in the master problem defined by MP1 to calculate dispatched active and reserve power of VPPs. Also, the NCUC-based marketclearing approach is used in the slave problem to determine local marginal market prices, that is, LMEP, LMUP, and LMDP. Note that, in the slave problem, primal (P G , Q G , P L , Q L , RD G , RU G , x, u, v, V, and θ) and dual (λ E , λ U , and λ D ) variables need to be calculated simultaneously. In this case, the KKT model of the problem is needed [10]. Since the slave formulation is nonconvex MINLP, this approach cannot be applied to the proposed problem. To achieve the convex model, LAC-OPF can replace AC-OPF (16)-(21) [10]. Constraints in the slave problem (18)-(20) are nonlinear. As the magnitude of voltage V in the transmission network changes between 0.95 and 1.05 p.u., the approximate values of V 2 and V n V j [20] can be found rom 2V-1 and V n + V j -1, respectively, and the maximum approximation error is 0.0025 p.u. [20]. Additionally, functions ϑ 1 and ϑ 2 in constraints (18) and (19) satisfy ϑ 1 (δ) + h∈L β 1 h Δδ h and ϑ 2 (δ) + h∈L β 2 h Δδ h [10], respectively, where Δδ is the deviation of power angle, β is the slope of the line, and δ shows the minimum value of power angle and is equal to − 2θ considering θ in the range of [− θ, θ]. Parameter θ gives the maximum value of voltage angle which is normally π. e power angle (δ) is equal to θ n − θ j and can be given by δ + h∈L Δδ h in the conventional piecewise linearization method. e values of ϑ 1 (δ) and ϑ 2 (δ) are found from G L n,j cos(− 2θ) + B L n,j sin(− 2θ) and G L n,j sin(− 2θ) − B L n,j cos(− 2θ), respectively. Moreover, ϑ 1 V n V j or ϑ 2 V n V j can be defined as V n V j ϑ 1 (δ) + h∈L β 1 h Δδ h or V n V j ϑ 2 (δ) + h∈L β 2 h Δδ h with a maximum approximate error of 0.005. Consequently, approximation of constraints (18) and (19) can be given by linear equations (34) and (35), respectively: 6 International Transactions on Electrical Energy Systems e deviation in power angle is expressed by where N h shows the total number of linearization segments. Constraint (20) represents a circular plane in P and Q coordinates;

����������
(P) 2 + (Q) 2 ≤ S max and its approximation are given by a polygon so that a linear equation is achieved [24]. Provided that the number of sides is high, the approximation error will be insignificant. e equation related to the sides of the polygon is P. cos(k.Δα) + Q. sin(k.Δα) � S max , which is linear in form. Δα shows the angle deviation and it is 360/ N e . N e expresses the number of sides of the polygon and k represents the number of sides of a regular polygon selected from set K � 1, 2, . . . , N e . e plane corresponding to side k is given by P. cos(k.Δα) + Q. sin(k.Δα) ≤ S max . Eventually, a polygon plane can be found by sharing the corresponding pages with all sides. As a result, the linear equation of constraint (20) is provided by so the linear model of the slave formulation will be us, KKT cannot be applied to this problem due to existing binary variables. In the next step, the Benders decomposition (BD) method is used to solve the linearized slave formulation to calculate primal and dual variables simultaneously [20]. e details of the BD approach are presented in the Appendix. Finally, the solution process of the problem ((1)-(33)) is summarized as follows: Step 0 (initial MP1): assume that the iteration counter (v) is 1, and initial values of LMEP, LMUP, and LMDP are calculated by the problem in (38) and (39) based on the BD approach neglecting VPP variables. en, solve the initial MP1 with equations (1)- (14) and obtain the optimal value of VPPs power displayed as P Step 1 (linearized slave problem): the linearized slave problem model in iteration v for the proposed marketbased VPP strategy is written as follows: subject to VPPi,t,w , ∀i, t, w, VPPi,t,w , ∀i, t, w, VPPi,t,w , ∀i, t, w.
In the above model, equations (40) and (41) are the same as those of the lower-level problem, (38) and (39). Nevertheless, constraints (42)-(44) are used in the slave problem to satisfy the operating limits of the system, (21) and (37). In other words, these limitations may not meet the lower-level model, (38) and (39), as the value of VPP active and reserve power is obtained from MP1.

International Transactions on Electrical Energy Systems
Hence, constraints (42)-(44) control VPPs power between zero and its optimal value in MP1, that is, P

VPP , and RD
(v) VPP . erefore, this model calculates VPPs powers and local marginal market prices denoted by "∼." Note that the solution to the above problem is based on the BD approach in the Appendix. Also, the local marginal market prices, λE, λU, and λD, are dual variables of constraints (16), (32), and (33), respectively, where these variables are calculated by the BD method.
Step 2 (convergence checking): the optimal solution is achieved if equation (45) is satisfied, where ε MSD is the allowable tolerance of the MSD algorithm; otherwise, v ⟶ v + 1, and go to Step 3.

Numerical Results and Discussion
e proposed method is simulated on modified 6-bus and 30-bus IEEE transmission networks in GAMS 23.5.2 software and is solved by CPLEX solver [25].

System Data.
e structure of the proposed 100 MVA, 230 kV test system is plotted in Figure 3 [18] and includes 6 buses, 7 lines, 4 generation units, 2 load points, and 1 VPP. Tables 2 and 3 list the data of transmission lines and generation units [18]. In addition, the total peak load of the network is 25 MW, where 40%, 40%, and 20% of the load are distributed at buses 3 and 4 (bus bar) as well as bus 5 (VPP bus), respectively. e power factor of loads is assumed to be 0.9. Also, the hourly load curve of these buses is equal to the product of their peak load value and load factor (load percentage) curve. is is shown in Figure 4(a) based on real data reported in the Nord Pool market for the Finnish (FI) zone on September 30, 2019 [24]. is network includes one VPP, is located at bus 5, and contains a WF with the capacity of 10 MW, an ESS with capacity/efficiency of 25 MWh/0.88, and 10 MW charge/discharge rate as well as a minimum/ initial energy of 2.5 MWh. Also, the load at bus 5 is considered as the VPP's load that participates in the DRP with a participation rate of 0.3, that is, P max DR � 0.3 × P D [18]. Moreover, the daily data of power percentage for WF is based on data of FI zone in Nord Pool market on September 30, 2019 (Figure 4(a)) [26]. VPP is connected to the network via a transmission line with a capacity of 4 MVA. Also, the total up and down reserve requirements according to this zone data are presented in Figure 4(b), where it is shared between buses 1-3 and 5-6 (buses with generation units or VPPs) about 20%. Finally, the MCS generates 1000 scenario samples for load and WF power generation based on a standard deviation of 10%, and, thus, the Kantorovich method extracts 40 scenarios with a high probability of occurrence from these generated scenarios.

e Benefit of Coordinated Energy Management in the VPP Scheme.
In this section, the expected profit or revenue values of the VPP in DA energy and reserve markets are expressed for coordinated and uncoordinated energy management (CEM and UEM) schemes. In the case of the uncoordinated method, the energy management strategy is run separately on a test transmission network with WF, ESS, and DRP. For example, from a modeling viewpoint, all equations, variables, and parameters related to ESS and DRP are removed from constraints (1)-(14) when the 8 International Transactions on Electrical Energy Systems uncoordinated method is used to manage the WF in the network. In other words, VPP is similar to WF in this case. It should be said that this rule is the same for the uncoordinated management of all ESSs and DRPs. However, in the coordinated scheme, these sources and active loads are managed simultaneously as a VPP framework, that is, the model of (1)- (14). Finally, the results of different energy management strategies in DA energy and reserve markets are presented in Table 4 for various load levels. Considering the column related to the load level of 100% in Table 4 Increasing the load level, in this case, reduces the VPP profit due to increasing the VPP load. Note that high profit brings a higher incentive for the VPP to participate in the DA market using the proposed energy management method, (1)- (33).
To elucidate, the proposed model by (1)- (33) can increase the operational ability of WF, ESS, and DRP in DA markets without supportive or subsidizing mechanisms.

VPP Profit.
is section investigates the VPP profit in a load level of 100% based on the coordinated energy management in VPP. Figure 5 shows the daily power and profit curve of VPP in DA energy and reserve markets. According to Subsection 4.1.1, the peak load of VPP is 5 MW and WF peak generation power is 10 MW. Hence, based on Figure 5(a), WF generation power is more/less than VPP load during 1:00-12:00 and 20:00-00:00/13:00-19:00. Moreover, VPPO/ISO is tried to increase/decrease the VPP profit/network operating cost based on equation (1)/ (15). Hence, VPP is tried to generate active power at all simulation hours based on Figure 5(b). Accordingly, ESS and DRP are discharged at the period of 13:00-19:00 to increase VPP generation power with respect to WF power at this period based on Figure 5(b). To provide discharge energy from ESS and DRP, they are charged at the period of 1:00-8:00, where WF generation power is greater than VPP load at these hours. In addition, the format of daily up and down reserve power curves for VPP in Figure 5(b) is the same as daily up and down reserve requirements curves in Figure 4(b) to satisfy equations (32) and (33). Hence, VPP can supply a notable percentage of reserve requirements to reach profitability in the DA reserve market. Finally, the total selling energy (TSE), that is, the daily summation of power, is 34.7, 20.75, and 3.2 MWh in DA energy and up and down reserve markets, respectively, based on Figure 5(b).
It is noted that total hourly reserve (up and down) demand in the modified 6-bus IEEE network changes between 4 and 5 MW according to Figure 4(b). Also, the total hourly network load neglecting the VPP load (20 MW at peak load time, 19:00) changes between 16 and 20 MW in this network based on the daily load percentage curve shown in Figure 4(a). Hence, the total reserve and active power demand of the network without VPP will be changed between 19.5 and 24 MW according to the blue curve in Figure 5(c).
us, the gap between the total reserve and active power demand in this network and VPP active power is less than 20 MW at periods 1:00-5:00 and 22:00-00:00, and it is between 20 and 24 MW at period 6:00-21:00 based  on the red curve in Figure 5(c). erefore, G1, G2, and VPP are supplying total reserve and load demand at periods 1: 00-5:00 and 23:00-00:00; hence, LMEP, LMUP, and LMDP are equal to G1 and G2 operation price that is 25 $/MWh based on Table 2. However, G3 and G4 are added to the network at hours 6:00-22:00; thus, LMEP, LMUP, and LMDP are between 25 and 37 $/MWh at different buses in the network. Accordingly, DRP and charging/discharging modes of ESS are based on low/high energy prices regarding these results. As seen in equation (1), the expected VPP profit in different DA markets depends on energy or reserve price, that is, LMEP, LMUP, and LMDP, and VPP active or reserve power. Hence, the hourly changing format of the VPP profit in Figure 5(d) is close to that of VPP power in Figure 5(b). Besides, VPP obtains low revenue at all simulation times in the DA down reserve market compared with DA energy and up reserve markets corresponding to Figure 5(d) because the reserve requirement in this market is low compared to up reserve requirement and VPP energy demand. By comparing DA energy and up reserve markets, it can be seen that VPP obtains high profit from the DA up reserve market at hours 15:00-19:00 compared with the DA energy market. is statement is due to reserve demand that is greater than energy demand at VPP according to Figure 5(b). It should be mentioned that the VPP can obtain a high profit in the DA energy market in comparison with the DA up reserve market at other hours as is presented in Figure 5(d) because the VPP generates more active power in this condition.
Regarding DA market profit, Table 5 presents the expected profit of VPP in DA energy and reserve markets for deterministic (discarding the uncertainties of WF power and load) and stochastic models. Accordingly, the expected VPP profit for different DA markets in stochastic programming is less than the deterministic programming arising from considering the uncertainties of WF and load. Moreover, this table expresses the expected operating cost of generation units in the two proposed models; all generation units include a lower operating cost in the deterministic method compared with the stochastic one due to discarding the uncertainties of WF and load. Furthermore, the network and VPP demand/VPP generation power will be increased/reduced if the load level is increased based on the model described in (1)- (33).
is statement results in reduced expected VPP profit in DA energy and reserve markets and increased operating cost of generation units, according to Table 5. Accordingly, VPP profit is reduced by $61.4 (1008.4 + 714. 2 -1048.4 -735.6) in the SBSP method with respect to the deterministic programming in the load level of 100% due to considering the uncertainties of WF and load power. is value is $64.9 and $67.2 for load levels of 110 and Table 3: Characteristics of generation units [18].    the optimal solution at 7 convergence iterations or calculation time of 25 s by the MSD approach as is reported in Table 5. ese values will be increased if the load level increases because the feasibility region is reduced in this case.  [27]. Upper and lower voltage limit are 0.95 and 1.05 per unit, respectively [28][29][30][31][32][33][34][35]. Moreover, this network contains three VPPs located at buses 4, 15, and 24, and the data of WF, ESS, and DRP in the VPP is the same as that in the modified 6-bus IEEE network. e daily curves of load and WF power percentage are shown in Figure 4(a) based on Nord Pool market data for the FI zone on September 30, 2019 [26]. e daily up and down reserve requirements curve is depicted in Figure 4(b) with a scale of 7.5. e results of this section are presented in Table 7. Based on this table, the 30-bus network with three VPPs can reduce the expected operating cost of generation units by approximately 24.17%, 19.61%, and 16.31% for load levels of 100, 110, and 120%, respectively, with respect to the case without VPP. e network with VPP can reduce the amounts of different markets prices concerning the proposed 30-bus network without VPPs, even in the worst-case scenario where load level is 120%. Finally, in addition to the benefits of VPPs to the 30-bus transmission network, all VPPs can obtain optimal profit in DA energy and reserve markets based on Table 7. However, these profits will be reduced if the load level increases because load demand increases. e proposed master/slave decomposition method can achieve an optimal solution after 91, 102, and 115 s for load levels of 100, 110, and 120%, respectively.

Conclusion
In this paper, the stochastic scheduling model is applied to the coordinated VPP energy management in DA energy and reserve markets. e scenario-based stochastic programming is used to model the uncertainties in output  generation power of the load and WF according to the MCSbased scenario generation approach and the the Kantorovich method as a scenario reduction technique. e grid-connected VPP supplies the demand and reserve energy in the transmission network according to the local marginal energy and reserve prices signal received from different DA markets. erefore, the expected profit of VPPs in DA energy and up and down reserve markets is maximized in the upper-level problem subject to VPP constraints including WF, DRP, and ESS model. Also, the lower-level problem minimizes the expected operating cost of generation units considering the network-constrained unit commitment constraints. According to the numerical results, the master/ slave decomposition approach as a suitable method finds the optimal solution at a shorter calculation time. Also, coordinated energy management as a VPP framework for WF, ESS, and DRP achieves high profit for these sources and active loads. Moreover, with the aid of a coordinated energy management strategy for VPPs, NCUC indices such as operating cost of generation units and local marginal market prices can be improved significantly in corresponding networks. Finally, the proposed method can improve flexibility, security, reliability, stability, and operational status of VPPs and networks by extracting the optimal scheduling power or energy for VPPs' devices.
Nomenclature g, i, n, j, t, w, h, k, m, r: Indices of generation unit, VPP, bus, bus, operation hour, scenario sample, linearization parts in conventional piecewise linearization method, side of the polygon, feasibility cut, and infeasibility cut G, N, S, ST, VPP, L, K: Sets of generation unit, bus, scenario sample, operation hour, and VPP.

Variables E:
Energy of ESS in per unit (p.u.) J sub : Objective function of the subproblem P ch , P dch : Charging and discharging power of ESS (p.u.) P G , Q G , RU G , RD G : Active, reactive, up reserve, and down reserve power of generation unit (p.u.) P L , Q L : Active and reactive power flow of transmission line (p.u.) P VPP , RU VPP , RD VPP : Active, up reserve, and down reserve power of VPP (p.u.) P W , P DR : Active power of WF and DRP (p.u.) s: Binary variable of charging and discharging states of ESS x, u, v: Binary variables of commitment, start-up, and shut-down states of the generation unit V, θ: Voltage magnitude (p.u.) and angle (rad) λ E , λ U , λ D : DA energy, up reserve, and down reserve price ($/MWh) ϑ 1 , ϑ 2 : Auxiliary functions (p.u.).

Constants
A G , A L , A VPP : Incidence matrixes of bus-generation unit, bus-transmission line, and bus-VPP B L , G L : Susceptance and conductance of transmission line (p.u.) C NL , C SU , C SD , C OP : No-load ($), start-up ($), shut-down ($), and operation ($/MWh) cost of generation unit CR max , DR max : Charge and discharge rate of ESS (p.u.) P D , Q D : Active and reactive load (p.u.) DU, DD: Up and down reserve requirement in the transmission network (p.u.) E ini , E min , E max : Initial, minimum, and maximum energy of ESS (p.u.) n f , n i : Number of feasibility cuts and infeasibility cuts P max VPP : Maximum capacity of a transmission line between VPP and network (p.u.) S max : Maximum capacity of transmission line (p.u.) MinUp, MinDw: Minimum up-time and down-time of a generation unit (hour) P min , P max : Minimum and maximum active power of a generation unit (p.u.) Q min , Q max : Minimum and maximum reactive power of a generation unit (p.u.) UR, DR: Up and down ramp rate of a generation unit (p.u.) W max , P max DR : Maximum active power of WF and DRP (p.u.) η ch , η dch : Charging and discharging efficiency of ESS ρ: Probability of scenario occurrence.

Data Availability
Data sharing is not applicable. No new data were created or analyzed in this study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.