## 3 The Construction Model of Virtual Power Plant  
### Objective Function  
1 Minimum Daily Average Cost  
The output power of the VPP at each time period is planned, and the power generation cost and charging cost are also considered. The punishment cost is used to indicate the degree of actual output deviating from the planned output, the power generation cost refers to the DG cost, and the charging cost refers to the ES cost. The objective function is:  
\[ \begin{array}{l}\min f_{1}=C^{DG}+C^{ES}+C^{SN}\\ =\sum\limits_{k=1}^{n}\sum\limits_{i=1}^{m}C_{ki}^{DG}P_{ki}^{DG}X_{i}^{DG}+ \sum\limits_{i=1}^{m}n_{i}C_{i}^{ES}X_{i}^{ES}+C_{s}\Big{|}\sum\limits_{k=1}^{n }\left[\sum\limits_{i=1}^{m}\left(-P_{ki}^{DG}X_{i}^{DG}+P_{ki}^{ES}X_{i}^{ES}-P _{ki}^{DR}X_{i}^{DR}\right)+P_{k0}\right]\Big{|}\end{array}  \tag{12}\]  
where \(k\) is a time series, taking 1 h as a time period, \(k=1,\,2,\,\ldots,\,24;f_{1}\) is the daily cost of VPP; \(C^{DG}\) is the daily average generation cost of DR; \(C^{ES}\) is the daily charging cost of ES device; \(C^{SN}\) is the punishment cost for the VPP to pay the grid; \(P_{ki}^{DG}\) is the DR output of area \(i\) at time period \(k\); \(X_{i}^{DG}\) represents whether there is a DR generation in area \(i\), and if satisfied, the value is 1, and vice versa 0; \(n_{i}\) is the daily average charging times of ES devices; \(P_{ki}^{ES}\) is the charging power of ES device of area \(i\) at time period \(k\); \(X_{i}^{ES}\) represents whether there is a ES device in the area \(i\), and if satisfied, the value is 1, and vice versa 0; \(P_{ki}^{DR}\) is the controllable load power of area \(i\) at time period \(k\); \(C_{s}\) is the unit punishment cost; and \(P_{k0}\) is the planned output at time period \(k\). When there is a deviation between the actual output and the planned output of the VPP, the power grid needs to reserve the reservation to compensate for the deviation, which will produce the cost at this time; most of the electric power in the power grid is thermal power, so the unit punishment cost can be considered as the thermal power cost. 2 Optimal Daily Load Characteristics  
If the curve \(L\) represents the difference between the actual output and the planned output of the VPP, the daily load characteristics can be measured by the volatility of the curve \(L\). Volatility is defined as the ratio of standard deviation to geometric mean of active power. The standard deviation of the load reflects the degree of the load dispersion, the geometric mean of the load reflects the degree of the load concentration, and the ratio of the standard deviation to the geometric mean reflects the relative size of the load dispersion [27]. The objective function is:  
\[\left\{ \begin{array}{l}\min f_{2}=\frac{\sigma}{\mu}=\frac{\sqrt{\frac{1}{ \sum\limits_{k=1}^{n}\left(L_{k}-\overline{L}\right)^{2}}{\sum\limits_{k=1}^{ n}\left(L_{k}-\overline{L}\right)^{2}}}}{\frac{\sqrt{n}\prod\limits_{k=1}^{n}L_{k}}}\\ L_{k}=\sum\limits_{i=1}^{m}\left(-P_{ki}^{DG}X_{i}^{DG}+P_{ki}^{ES}X_{i}^{ES}-P_ {ki}^{DR}X_{i}^{DR}\right)+P_{k0}\end{array} \right. \tag{13}\]  
where \(f_{2}\) is the volatility of the curve \(L\); \(\sigma\) is the standard deviation; \(\mu\) is the geometric mean; \(L_{k}\) is the difference between the actual output and planned output of the VPP at time period \(k\); and \(\overline{L}\) is the arithmetic mean of output power. The smaller the difference between the actual output and the planned output, the smoother the curve \(L\) is, the better the stability of the system is, and the easier the power grid is to be dispatched. 3 Highest Degree of Distributed Generation Consumption  
One of the functions of the VPP construction is to promote the consumption of DG, reduce the abandoned wind the power rate and abandoned PV rate, and make full use of clean energy. In this paper, the optimal objective is to maximize the daily average power of DG, that is, when the power ofthe VPP is less than the planned power, the DG can be fully utilized.