#### Abstract

Capacity allocation and optimal scheduling of virtual power plants (VPP) are important aspects to ensure the effectiveness of system investment and operational economy. In this study, a two-stage optimization model for capacity planning and regulation operation of VPPs considering source-load-storage resources is constructed. In the first stage, a capacity optimization model is constructed for the VPP with the lowest annual economic cost under the refinement constraints of source-storage resources. In the second stage, based on the capacity allocation results and load characteristics, a source-load interactive operation optimization model with the lowest typical daily operating cost and incentive-based demand response is constructed under the resource capacity constraint, so as to realize the capacity allocation and energy control of the VPPs in all stages of source-load-storage resources. Finally, a planning solver is applied to solve the algorithm. The proposed model is validated. The results show that the presence or absence of demand response, the form of demand response, and the charge state of energy storage all have an impact on the allocation and operation results. Adequate consideration of the source-side, load-side, and storage-side interactions can provide a reference for more accurate planning and optimization. The research results are intended to be able to provide VPPs investors and operators with a full process of construction and operation solutions.

#### 1. Introduction

Studies on planning problems are mainly focused on capacity planning of energy storage systems. The commonly used planning methods include simulated annealing algorithm [1], mixed integer linear programming model [2, 3], mixed integer nonlinear programming model [4], time-series simulation method [5], ant colony algorithm [6], and particle swarm optimization algorithm [7]. Application scenarios mainly include electric vehicle charging station energy storage systems [8, 9], pumped storage power station energy storage systems [10, 11], wind farm energy storage systems [12], and microgrid energy storage systems [13]. Lu and Wang [1] use a simulated annealing algorithm to solve the capacity planning problem of a hybrid energy storage system under the minimum average operating cost. Qian et al. [7] use particle swarm optimization to solve the planning problem of wind farm energy storage systems. In addition, in order to improve the applicability of the traditional algorithm for the new scene, the traditional algorithm is often improved, such as in [9] for electric vehicle charging station energy storage system capacity planning when using an improved simulated annealing algorithm, Wang et al. [6] used the improved ant colony algorithm to solve multiobjective planning and energy storage systems under configuration problems.

In the process of virtual power plant operation, there are not only capacity allocation problems but also operation optimization problems. In the study of virtual power plant operation optimization, the optimization objectives are mostly profit maximization [14, 15], system operation cost minimization [16], optimal profit distribution [17], etc. According to the number of optimization objectives, the existing optimization model can be divided into a single-layer optimization model [18], a two-layer optimization model [19], and a multilayer optimization model [17]. For example, Fang et al. [17] established a three-stage two-layer optimization model to solve the operation optimization problem of the virtual power plant. Optimization methods are mostly random optimization, robust optimization, and interval optimization, but such methods have high computational complexity and are too conservative. Therefore, some scholars combine multiple methods and adopt joint methods to solve the scheduling problems of virtual power plants [20]. In addition to the above optimization methods, some scholars also adopted distributed optimization method [21], elephant grazing optimization method [22], and Shapley’s value method [23] to solve the optimization operation problem of the virtual plants. From the perspective of coverage subject, the current optimization model can be mainly divided into single a virtual power plant optimization model and virtual power plant alliance optimization model [23]. A framework for autonomous VGT (virtual generation tribe) decentralized cooperative control for smart grids was proposed in [24]. VGT-CCA (VGT-based collaborative consensus algorithm) was developed for the first time to solve the dynamic GCD (generation command and dispatch) optimization problem of AGC (automatic generation control) under an ideal communication network.

Although some scholars have carried out some research on the capacity configuration of virtual power plants, the following problems and shortcomings exist:(1)Existing research has mainly focused on the configuration of storage capacity or distributed power capacity for virtual power plants, with little literature on the simultaneous planning of source-storage capacity for virtual power plants, which should take into account the interaction between resources in a comprehensive manner during the planning stage. For example, in [14], only distributed power supply, energy storage system, and power users were considered in modeling, but the load-side demand response resources such as electric vehicles were not taken into account. In addition, the coordination of source-side, charge-side, and storage-side resources in virtual power plants is not considered in most literature.(2)Existing studies mainly predetermine the parameters of each unit’s rated power and thus configure its number of units to achieve individual optimization, rather than total optimization of the overall capacity. There is no restriction on the technical parameters of the units, and virtual power plants have more flexibility in aggregating units.(3)The constraints of the existing capacity allocation models are relatively simple, which is not the case in practice.

In contrast to previous studies, this study simultaneously considers the source-side, load-side, and storage-side interactions and constructs a two-tier planning model. In addition, this study optimizes the capacity of the overall system input devices, rather than just the number of fixed capacity devices. Compared to the simplified system operation model, this study refines the model by portraying the power output of different devices, making the model more refined.

According to the access capacity requirements of distributed power generation in the “Technical Regulations for Distributed Power Access to Power Grid” issued by the State Grid Corporation of China, this study intends to build a two-stage capacity planning and operation optimization model for virtual power plants. In the first stage, aiming at the lowest annual economic cost of the system, considering the refined operation constraints and capacity constraints of equipment, a mixed-integer nonlinear capacity planning model is constructed, and the constraint nesting method is used for nonlinear decoupling, and the capacity configuration of each resource is obtained by solving the solution. Results: in the second stage, aiming at the lowest daily operating cost of the system and taking the planned capacity as a constraint, an operation optimization model that takes into account the incentive demand response (IDR) is constructed.

The possible innovations of this study are as follows:(1)A two-layer model considering power source-grid-load-storage multiparticipant is constructed(2)A nested model that comprehensively considers upper-level capacity planning and lower-level operation optimization is constructed(3)A lower-level optimization model considering load-side incentive demand response is constructed

#### 2. The Structure and Equipment Model of the VPP

##### 2.1. The Structure of VPP

In this paper, distributed photovoltaic (PV), distributed wind power (WP), gas turbine, energy storage, and incentive demand response resources are integrated into a virtual power plant, and the energy control platform of the virtual power plant makes the best coordinated operation strategy according to the actual load demand of the terminal user and the capacity of each unit. At the same time, in order to give full play to the adjustment of the demand side resource potential, the paper sets up the IDR to participate in the optimal operation of virtual power plant, the virtual power plant and the related user anchoring prior agreement, regulation control platform of virtual power plant energy through the ascending and descending form directly to adjust its power consumption behavior, and according to the number of load adjustment type and give the corresponding subsidy. IDR can improve the self-regulation performance and energy management level of the virtual power plant. The structure of the virtual power plant is shown in Figure 1.

##### 2.2. Model of Each Device

###### 2.2.1. Distributed Photovoltaic Output Model

The power of photovoltaic power generation is related to local lighting intensity, radiation density, and environmental temperature. Generally, the photovoltaic output model can be expressed as follows:where is the output of distributed PV at a given time, is the maximum power of distributed photovoltaic under rated conditions, is the actual light intensity at time *t*, is the density of illumination radiation at standard rating, is the rated ambient temperature, and is the actual ambient temperature at time *t*.

###### 2.2.2. Distributed Wind Power Output Model

The power of wind power generation is related to wind speed conditions, and it shows phased characteristics with the fluctuation of wind speed. Generally, the wind power output model can be expressed as follows:where is the maximum power of distributed fan under rated condition, , , and , respectively, represent rated wind speed, cut wind speed, and load cut wind speed, is the actual wind speed at time *t*, and is the rated power of the fan.

###### 2.2.3. Gas Turbine Output Model

The output of a gas turbine is mainly related to the calorific value of natural gas and the power generation efficiency of a gas turbine, and its expression iswhere represents the input power of the gas turbine at time *t*, is the output power of the gas turbine, is the calorific value of natural gas, and is the power generation efficiency of the gas turbine.

###### 2.2.4. Energy Storage Device Model

The charging and discharging characteristics of a battery are usually described by the battery capacity, state of charge, and other parameters. The state of charge refers to the ratio of the remaining power in the battery to the rated capacity of the battery at a certain moment, which can be expressed as follows:

When a battery is charged and discharged, it will generate electric energy loss. Assuming that the loss coefficient of charging is and that of discharging is , then the charging state and discharge state of the battery in period *t* can be expressed as follows:where and indicate the charging and discharging status of the battery. The value 0 indicates that no charging or discharging occurs, and the value 1 indicates that the charging or discharging occurs.

#### 3. Two-Stage Optimization Model

This study adopts the two-stage optimization method to carry out capacity planning and operation optimization of the virtual power plant, and the optimization process is shown in Figure 2. The first stage is to make capacity planning for each distributed resource of the virtual power plant and determine the optimal installation capacity of the unit. In the second stage, based on the known capacity results, the optimal operation scheme of the virtual power plant is determined, and the unit output plan is reasonably arranged.

##### 3.1. Capacity Planning Stage

In the planning stage, the optimal capacity allocation scheme is determined under the capacity constraints and operational constraints of each unit under the optimization objective of the lowest annual economic cost of the virtual power plant.

###### 3.1.1. Objective Function

The annual economic cost of a virtual power plant consists of equalized investment cost , operating cost , environmental cost , and salvage value recovery income , which can be expressed as follows:(1)Equipment investment and construction costs: where is the equipment input and construction cost of the virtual power plant, represents the number of types of polymerization equipment in the virtual power plant, is the annualized conversion coefficient of the investment cost of category I equipment, represents the unit capacity investment cost of the equipment in the virtual power plant, including distributed photovoltaic unit investment cost , distributed wind power unit investment cost , energy storage unit investment cost , and gas turbine unit investment cost , represents the configured capacity of the equipment, namely, , , , and are, respectively, the rated capacity of wind turbine, photovoltaic unit, gas turbine unit, and energy storage unit, represents discount rate, and represents the service life of the equipment.(2)System annual operating cost: the annual operating cost of a virtual power plant consists of generator unit operation and maintenance cost , gas turbine unit fuel cost , gas turbine start-up and shutdown cost , and power grid interaction cost : where represents the number of types of generator sets, including wind turbine set, photovoltaic set, and gas turbine set, represents typical day types, , which are summer, winter, and transition season, respectively. represents the total scheduling period, , is the duration of typical days in a year, is the unit operation and maintenance cost of various generating sets, represents the unit operation and maintenance cost of energy storage equipment, represents the power of all types of generator sets in the virtual power plant in the typical day at time, , , and respectively, represent the output power of distributed wind turbine, photovoltaic unit, and gas turbine in the typical day at time, and , respectively, represent the charging power and discharge power of the energy storage equipment *i* in the typical day at time, represents the energy consumption of a standard cubic meter of natural gas, represents the heat generated after the complete combustion of a standard cubic meter of natural gas, represents the energy conversion efficiency of a gas turbine, represents gas turbine start-up and shutdown cost per unit time, represents the start-stop state, which is represented by state variables 0–1, 0 represents the shutdown state, and 1 represents the start-up state, and , respectively, represent the electricity price for sale and purchase between the virtual power plant and the main network in the typical day at time, and , respectively, represent the power sold and power purchased in the typical day at time and is the scheduling step, .(3)Environmental costs: virtual power plants distributed photovoltaic and distributed wind power are clean power generation systems, and their pollutant emissions can be ignored. The gas turbine uses fossil fuels, so it will produce certain air pollutants during the operation of the system. In addition, when purchasing electricity from the main network, it is assumed that thermal power is purchased, which also generates environmental pollutants. The annual pollutant treatment cost of the virtual power plant is expressed as follows: where represents the types of pollutants, , which are, respectively, , , and , is the unit emission treatment fee representing the pollutant, and , respectively, represent the emission coefficient of the pollutant when purchasing power from the grid and distributed gas turbine units in the virtual power plant, and and , respectively, represent the generation power of distributed gas turbine sets and power purchasing power of the grid in the typical day at time.(4)Residual value of the system: system residual value refers to the remaining cost of a certain equipment in the virtual power plant at the end of the project life cycle. The remaining cost can be calculated by using the proportional method, expressed as follows: where is the residual value income of the virtual power plant equipment, which is generated only at the end of the last year of the life cycle and represents the ratio of residual value return to the initial investment, usually 5% [14].

###### 3.1.2. Constraints

(1)Power balance constraint: where represents the period load.(2)Distributed power constraint.①Unit power constraint: for distributed wind power and distributed photovoltaic, the output power constraints of both should meet the following formula: where and are the start-stop state of wind turbine and photovoltaic unit and and are the minimum load rates of wind power and photovoltaic, respectively.②Unit capacity constraint: where and represent the minimum output of fan and photovoltaic, respectively, and represents the proportional coefficient of the total load at the same time.(3)Gas turbine confinement:①Power constraint:②Up and down climbing power constraints: where and , respectively, represent the up and down climbing power limits of gas turbine units.③Equipment output constraint: where is the start-stop state of each device at time and is the minimum load rate of the gas turbine set.④Capacity constraint: where represents the minimum gas turbine capacity and is the maximum load.(4)Energy storage constraints:①Power storage balance constraint: the electric quantity stored by the energy storage battery at time is equal to the electric quantity stored at time plus the actual charging quantity at time, minus the actual discharge quantity at time, and the expression is where represents the energy storage capacity of energy storage battery at time and and , respectively, represent the charge and discharge efficiency of energy storage equipment.②Constraints on upper and lower limits of charge: where and , respectively, represent state limits of energy storage battery capacity.③Constraint of equal power storage in starting and ending states: where represents the energy storage capacity of the initial energy storage battery and represents the electricity stored in the last scheduling period in a scheduling cycle.④Charge and discharge power constraints: in order to delay the life of energy storage battery, the charge and discharge power of energy storage equipment should be maintained within a certain range: where and , respectively, represent the maximum charging and discharging power of the energy storage equipment and and , respectively, represent the charging and discharging state of the storage equipment at time, which is represented by 0–1 variables. If the variable is equal to 0, it means that there is no charge/discharge at this time, and if the variable is equal to 1, it means that the charge/discharge occurs at this time. and , respectively, represent charge and discharge rates of energy storage.⑤Maximum discharge power constraint of energy storage: the maximum discharge power of the energy storage device should not exceed the maximum load, which can be expressed as follows:⑥Charge/discharge uniqueness constraint: The constraint is to avoid simultaneous charging and discharging of the same energy storage device in the optimization process.(6)Restrictions on purchasing and selling electricity:①Purchasing and selling power constraints: where and , respectively, represent the maximum value of power purchased from the main network by the virtual power plant in the time period, and , respectively, represent the power limits of the virtual power plant selling electricity to the main network in the time period, and and , respectively, represent the state variables of the virtual power plant purchasing and selling electricity from the main network, which are represented by 0–1 variables. When the value is equal to 1, it means that the purchasing/selling of electricity takes place at this moment; when the value is equal to 0, it means that the purchasing/selling of electricity does not take place at this moment.②Power purchase/sale uniqueness constraint: This means that electricity cannot be bought and sold at the same time.

##### 3.2. Operational Optimization Stage

In the operation stage, the capacity of each unit has been obtained from the first stage, the capacity is taken as the constraint condition, IDR is considered in the energy management of the virtual power plant, and the optimal operation scheduling scheme of the unit is obtained by taking the operation cost of typical day and IDR cost as the optimization objective.

###### 3.2.1. Objective Function

The daily operating cost modeling of the virtual power plant is the same as described above. IDR considers the compensation cost of transferable load, which is divided into upstream transfer load and downstream transfer load, expressed as follows:where represents the daily demand response cost of the typical day, including the compensation cost of upstream transfer load and compensation cost of downstream transfer load , and , respectively, represent the compensation coefficient of upstream transfer load and downstream transfer load, and and , respectively, represent the upward transfer load and downward transfer load in the first period of the typical day.

###### 3.2.2. Constraints

(1)Demand response constraints;①Transferable load transfer constraints: where represents the load of time period, represents the response proportion of the transferable load, and and , respectively, represent the state variables of upstream and downstream load transfer, which are represented by 0–1.②Balance constraint of transferable load: ensure that the amount of uplink is equal to the amount of cut in a scheduling period.③Upstream/downstream uniqueness constraints: This means that the uplink and downlink cannot be performed at the same time.(2)Other constraints: in addition to the demand response constraints, the optimization stage also contains the corresponding capacity constraints and operation constraints, which are the same as those in the planning stage. The difference is that the equipment capacity in the planning stage is a decision variable, and the equipment capacity in the operation stage is a known quantity.

#### 4. Methods

Unit output and energy storage constraints in the capacity planning stage and operation optimization stage contain both 0–1 variables and continuous variables, which are typical mixed integer nonlinear programming. In [15], a nested constraints are used for the nonlinear decoupling method, the core idea of the method is through the capacity constraint expanded output range of all equipment and then determines the equipment according to equipment start-stop state in output constraints, so as to realize decoupling between variables, which will eventually nonlinear constraints is converted to linear constraints. The following takes gas turbine unit as an example to illustrate the implementation steps of constraint nesting.

Since ,the output range of gas turbine equipment can be divided intowhich expand to

When , the output constraint of the device is

When , the output constraint of the device is

Similarly, the nonlinear constrained transformation of other devices is also treated with this method, which will not be described again.

After processing, the virtual power plant capacity optimization model is transformed from mixed integer nonlinear programming to mixed integer linear programming, which is modeled by YALMIP syntax in the Matlab environment and solved by a CPLEX solver.

#### 5. Case Study

##### 5.1. Parameters

Taking a certain region in north China as an example for example analysis, considering the seasonal characteristics of north China, this study selected one day in summer, winter, and transition season as a typical scene, with the duration of 108 days in summer, 139 days in transition season, and 118 days in winter, respectively. The load of three typical days is shown in Figure 3. Relevant technical and economic parameters are shown in Table 1, pollutant emission and environmental governance parameters are shown in Table 2, and real-time purchase and sale price parameters are shown in Table 3. Typical daily PV output forecast is shown in Figure 4. The forecast output of typical daily wind power is shown in Figure 5.

##### 5.2. Results of Capacity Planning Stage

In order to illustrate the effectiveness of the model and explore the impact of energy storage devices on capacity planning of the virtual power plant, the following scenarios are set up in this study. In scenario 1, the virtual power plant only aggregates distributed PV and distributed fan and gas turbine and calculates economic and environmental indicators. In scenario 2, an energy storage device is added to the virtual power plant based on scenario 1, including integrated energy storage, distributed PV, distributed fan, and gas turbine, and economic and environmental indicators are calculated.

To illustrate the effectiveness of the model and explore the impact of energy storage devices on capacity planning of the virtual power plant, the following scenarios are set up in this study. In scenario 1, the virtual power plant only aggregates distributed PV, distributed fan, and gas turbine and calculates economic and environmental indicators. In scenario 2, an energy storage device is added to the virtual power plant based on Scenario 1, including integrated energy storage, distributed PV, distributed fan, and gas turbine, and economic and environmental indicators are calculated.

Table4 shows the economic results of capacity configuration in the two scenarios. When energy storage is configured, the investment cost is 12.41% higher than that, without energy storage because new equipment needs to be invested. When no energy storage is configured, the annual start-up and shutdown cost of the gas turbine is 0, indicating that there is no energy storage for energy decoupling, and the gas turbine unit keeps running at all times. This will reduce the purchase of electricity from the main network of the virtual power plant, and the interaction cost of the grid in the scenario with energy storage is 19.34% lower. However, as the fuel cost of the virtual power plant only comes from the gas turbine unit, the fuel cost in the scenario without energy storage will increase by 33.60% compared with the scenario without energy storage. In addition, in the energy storage scenario, power purchase and storage can be carried out in the off-peak period of power grid load; that is, the electricity price is low. Therefore, the interaction cost of the power grid in the energy storage scenario is relatively high, which also leads to the relatively high environmental governance cost in the energy storage scenario.

This is because the environmental pollution of a virtual power plant consists mainly of emissions from within the gas turbine unit and emissions from the thermal unit when power is purchased. The emissions per unit power of thermal units are however much higher than the unit power output of gas turbine units. Therefore, the environmental cost mainly depends on the amount of electricity purchased from the main network by the system. The interaction cost of the main network with energy storage is high, and its environmental cost is relatively large. The annual environmental pollution emission is about 6,540,111 kg, which is 390,538 kg more than that without energy storage. Table 5 shows the planning results of each resource capacity.

In summary, the total annual cost of the scenario with energy storage is 14.910 million yuan and that of the scenario without energy storage is 15.2398 million yuan. From the point of view of environmental protection, the environmental benefit of not configuring energy storage is greater, but there is not much difference between the two as shown in Table 6. Therefore, investors should still choose the scheme with greater economic benefits; that is, the allocation of energy storage is the best scheme for virtual power plant planning, which also verifies the validity and rationality of the capacity planning model proposed in this paper.

##### 5.3. Results of Optimization Stage

In order to verify the impact of demand response on the operation optimization stage, the following scenarios are set in this study: IDR is not considered in scenario 1. Scenario 2 considers IDR's participation in load regulation and provides corresponding subsidies. First, the scheduling output plan and corresponding operating cost index of three typical days are calculated, respectively, in the two scenarios to verify the effectiveness of the proposed optimization model. Second, the results of dispatching output of each equipment and the state of charge of energy storage equipment with IDR participation are analyzed. Finally, the optimization effect of IDR participation on load curve was verified, and the sensitivity of IDR participation to optimization effect was explored.

###### 5.3.1. Analysis of the Effect of Demand Response

Table 7 shows the daily operating costs for the two scenarios in summer, transition season, and winter, respectively. The total operating cost of Scenario 2 is lower by 2,000 CNY/day relative to Scenario 1 because both scenarios operate the same PV and turbine base of the virtual power plant system in order to meet customer load, as the unit operating cost of Scenario 1 also does not participate in demand response and will be covered by the gas turbine generating units when system load demand increases and is met by purchasing power from the grid. Over three typical days, the average daily fuel cost for Scenario 1 is 13,600 CNY, 5.15% higher than Scenario 2, and the average daily main grid interaction cost for Scenario 1 is 33,100 CNY, 3.63% higher than Scenario 2. The lower fuel cost and main grid interaction cost in Scenario 1 are compared to the subsidy cost of demand response in Scenario 2 resulting in a lower total operating cost in Scenario 2. This indicates that the introduction of incentive demand response in the virtual power plant system can lead to better operational cost savings and validates the effectiveness of the operational optimization model with demand response proposed in this paper.

Figures 6–8 show the optimal scheduling results of unit daily operation in typical days and IDR in summer, transition season, and winter, respectively. During 00 : 00–5:00 at night, the pv output value is 0, and the electric energy is mainly maintained by fans, gas turbines, and the purchase of electricity from the main network, and the purchase of electricity from the main network accounts for a higher proportion. This is because the cost of purchasing electricity from the main network is relatively low. During the period of 6 : 00–14 : 00, the load continues to increase and reaches the peak value. The output of gas turbine, fan, and photovoltaic unit also gradually increases. The energy storage equipment also performs discharge energy supply during the peak load period. In summer and winter when the load value is relatively high, the load from 15 : 00 to 18 : 00 is still at a high level. Besides self-supply, electricity needs to be purchased from the main network again to meet the load demand. During 19:00-24:00, when the load is in the declining phase, the gas turbine is always on and provides more power. This is due to the peak power consumption period when purchasing power from the power purchasing entity will bear higher costs. It is more economical and reliable to use gas turbine units and discharge energy storage systems.

In order to verify the effect of IDR on load curve optimization, this study compared the load curve before and after participation in demand response in three typical days (see Figure 9) and the load response variation (see Figure 10). In the three typical days, when the electricity load is at a low point, the incentive demand responds to the user’s increase in electricity consumption and reduces the electricity consumption in the two peak periods, respectively, so as to realize the space-time transfer of electricity load. Therefore, the incentive demand response can effectively respond to the demand of system peak cutting and valley filling, so as to improve the stability and economy of the system.

In order to explore the influence of IDR participation degree on system optimal operation, a typical day in summer was taken as an example to set the participation degree to 10%, 15%, and 20%, respectively, and the parameter sensitivity analysis was conducted by comparing the system operation cost. The results show that, with the increase of the participation ratio of demand response, although the compensation cost of demand response increases, the total operating cost presents a downward trend. This is because the higher the proportion of demand response is, the user realizes the balance of power generation and consumption of the system through load transfer in peak hours and low hours, thus reducing the cost of purchasing power from the main network in the high price period when the original rigid power consumption mode is short of power. It is worth noting that the demand response participation ratio should not be too high and should be controlled within a reasonable range. Detailed results are shown in Table 8.

###### 5.3.2. Analysis of the Effect of Energy Storage

To verify the influence of energy storage on the operation optimization stage, the following scenarios are set in this study: scenario 1 does not consider aggregated energy storage; scenario 2 considers aggregated energy storage. In both scenarios, the dispatch output plan and the corresponding operating cost indexes are calculated for a typical day in summer, transition season, and winter to verify the effectiveness of the proposed optimization model, as shown in Table 9. It can be seen that the addition of energy storage equipment can maximize the use of renewable energy while purchasing power on the grid during periods of low electricity prices, thus reducing the total system operating costs.

Figure 11 shows the change of the charged state of the energy storage device. The initial charge is 0.3 KW. At 5 : 00–7:00 in the trough period, the user’s load demand is relatively low, and the real-time electricity price of the main network is low. At this time, the virtual power plant purchases electricity from the main network and stores part of the energy through the energy storage device so that the system can discharge during the peak load period to meet the peak load demand and to reduce the purchase of electricity in the high-price period of the main network. In addition, in order to delay the life of the energy storage device, the initial and final state charge of the energy storage device is equal to 0.3 kW. As far as the utilization rate is concerned, it can be found that VPP can largely utilize the energy storage equipment after aggregating the energy storage equipment and has a high utilization rate.

#### 6. Conclusion

This study focuses on capacity planning and operation optimization correlation of virtual power plant and establishes a two-stage progressive optimization model. Energy storage equipment is introduced in the planning and configuration stage of the virtual power plant, and incentive demand response is introduced in the optimization operation stage. The research conclusions are as follows:(1)Virtual power plants with energy storage are considered to make reasonable charging and discharging strategies according to real-time electricity price and actual load situation, which can effectively increase the flexibility of energy flow and significantly improve the rationality of system investment and economic operation. The results show that the virtual plant with aggregated load and energy storage has a 2.1% lower daily operating cost than the virtual plant without aggregation.(2)Taking the demand response into account, the optimized operation stage can effectively reduce the daily operation cost and optimize the power load curve of users, motivate users to participate in peak-cutting and valley-filling, and better realize the optimal allocation of resources.(3)Participation degree of demand response has a certain influence on the operation effect of the virtual power plant. There is a negative correlation between the degree of demand response participation and the daily operating cost of the system. It is very important to select the appropriate scale of responding users to participate in system regulation to improve the operation economy and stability of virtual power plants. The higher the level of demand response participation, the lower the daily operating cost. However, the impact on customer satisfaction with energy use cannot be ignored.(4)The two-stage capacity planning and operation optimization model proposed in this paper first determines the optimal capacity allocation scheme of resources and guides the virtual power plant operation with this output boundary, so the optimization results are more consistent with reality.

The model constructed in this study ignores the impact of scenery out uncertainty on capacity planning and operation optimization results and also does not consider the impact of the current carbon market on capacity allocation and operation optimization results. In the future, we will build on this study to model the uncertainty of scenery and consider the impact of multiple energy and environmental markets [21].

#### Data Availability

The data used to support the findings of this study are included within the article.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

The work was supported by the Science and Technology Project of State Grid Ningxia Electric Power Co., LTD (contract no. SGNXJY00DWJS2000019).