#### Abstract

To push forward the development of electric vehicles while improving the economy and environment of virtual power plants (VPPs), research on the optimization of VPP capacity considering electric vehicles is carried out. In this paper, based on this, this paper first analyzes the framework of the VPP with electric vehicles and models each unit of the VPP. Secondly, the typical scenarios of wind power, photovoltaic, electric vehicle charging and discharging, and load are formed by the Monte Carlo method to reduce the output deviation of each unit. Then, taking the maximization of the net income and clean energy consumption of the VPP as the objective function, the capacity optimal allocation model of the VPP considering multiobjective is constructed, and the conditional value-at-risk (CVaR) is introduced to represent the investment uncertainty faced by the VPP. Finally, a VPP in a certain area of Shanxi Province is used to analyze a calculation example and solve it with CPLEX. The results of the calculation example show that, on the one hand, reasonable selection of the optimal scale of EV connected to the VPP is able to improve the economy and environment of the VPP. On the other hand, the introduction of CVaR is available for the improvement of the scientific nature of VPP capacity allocation decisions.

#### 1. Introduction

Though electric vehicles enjoy a rapid development with the support of national policies, they are confronted with the challenges, such as the increase of the peak-valley difference of the system and the decrease of power quality due to their characteristics of centralized charging [1]. The virtual power plant integrates distributed energy, energy storage systems, and controllable loads with refined control and demand response methods, which can effectively solve the problems brought by the centralized charging of electric vehicles. Therefore, at present, reasonable planning and utilization of virtual power plant have become the focus of research in this field [2, 3].

In planning of a virtual power plant, the rational allocation of distributed energy units, conventional energy units, and energy storage systems forms the basis for the coordination of investment and income. In terms of capacity configuration, Chen et al. [4, 5] used game theory to study the capacity planning schemes of various distributed power sources. Li et al. [6] constructed a model of random optimal allocation of microgrid power capacity by generating a confrontation network to simulate a large number of scenes of wind and solar output and using K-medoids clustering to reduce the scenes. Xue et al. [7] used the Latin hypercube scene generation method and scene reduction technology to generate random scenes and combined robust optimization to modify the microgrid configuration scheme. In addition to the configuration of distributed power sources and microgrids, there are also works of the literature on the capacity configuration of integrated energy systems. Zhang et al. [8] proposed a planning model of IES electric-gas combined operation to determine the optimal switching time and capacity configuration of generator sets, electric-to-gas, gas boilers, and other equipment. Zhang et al. [8, 9] used the improved k-means algorithm and Monte Carlo algorithm to reduce wind power scenarios and built a comprehensive energy system capacity configuration model with the minimum total system cost as the objective function. Regarding the annualized cost of the system as the objective function and taking into consideration the electric energy interaction between multiple networks, Lin et al. [10, 11] optimized the selection and capacity of system equipment. Based on the single-tier optimal configuration, some works of the literature have constructed a double-layer optimal configuration model of the system. Considering the uncertainty of wind and solar, Yao et al. [12, 13] constructed a double-layer collaborative optimization configuration model. The upper layer is used to determine the equipment selection with the lowest annualized total cost, while the lower layer is utilized to determine the equipment capacity with the highest annual average utilization rate of the equipment, thereby realizing simultaneous optimization of system economy and utilization efficiency. Xiao et al. [14] constructed a two-stage capacity allocation model considering the planning and operation of the integrated energy system. The first stage achieves the lowest economic cost, and the second stage designs the optimal operation plan. Taking into account the uncertainty of demand response, Liu et al. [15–17] constructed a double-layer capacity optimal allocation model. Fan et al. [18] proposed a two-tier optimal configuration model for the multiregion integrated energy system. From the perspective of capacity allocation subjects, most of the existing researches focus on the distributed energy and integrated energy systems, but there are few studies on the capacity allocation of VPP. In terms of uncertainty analysis of capacity allocation, existing research studies mainly analyze the uncertainty of wind power, photovoltaics, and demand response, but there is no literature on the impact of the uncertainty of electric vehicle charging on the capacity allocation results. On the other hand, no attention was paid to the income uncertainty faced by the investors. For capacity allocation goals, though environmental protection goals need to be fully considered in the context of today’s carbon neutrality and environmental protection, existing research studies mainly consider the economy.

Given the uncertainty of income faced by the investors, many methods are commonly used, including the value-at-risk (VaR) method [19], the profit variance method [20], and the conditional value-at-risk method (CVaR) [21]. Among them, CVaR presents the conditional value-at-risk, and the average loss of the portfolio, reflecting the “tail risk” related to VaR, is often used in systematic risk management. Shi et al. [22] introduced the CVaR method to optimize the heat storage and power storage capacity of the multienergy complementary system. Zheng et al. [23] used CVaR to characterize the severity of economic risks and verified that it is reasonable to use this method with an example. Guo et al. [24] applied CVaR to the optimal dispatch of microgrids in the spot market to reflect the uncertainty of real-time electricity prices. Wang et al. [25, 26] utilized CVaR to deal with the uncertainty of wind power output and established the optimal dispatch model of the power system while taking CVaR into account the integrated energy system. Yang et al. [27, 28] equivalently converted the difficult part of VaR in CVaR into a relatively simple function and used Monte Carlo and other sampling simulation methods to convert CVaR into linear programming, thereby reducing the difficulty of solving. Wei et al. [29] used CVaR as an indicator of risk measurement based on which the influence of risk preference on the power capacity configuration of virtual power plants was analyzed. Wang et al. [30, 31] used CVaR theory to measure the risk of system uncertainty to the scheduling in the virtual power plant scheduling process, thereby constraining the uncertainty risk to obtain the maximum benefit of the virtual power plant under acceptable conditions. The existing literature studies show that CVaR can effectively characterize economic risks. In order to further analyze the necessity of this study, this study is compared with other studies, as shown in Table 1.

Compared with existing research studies, this paper constructs a virtual power plant capacity optimization configuration model that takes into account electric vehicles. The innovations are as follows:(1)Innovatively propose a capacity allocation model of virtual power plant that takes into account electric vehicles; on the one hand, it fills the gaps in the research of virtual power plant capacity configuration. On the other hand, it generates a set of typical scenarios and determines the optimal scale of electric vehicle access to VPP considering the uncertainty of electric vehicle charging load, thus enriching the research subject of capacity allocation, and pushing forward the development of electric vehicles.(2)Innovatively propose to maximize the net income of VPP and clean energy consumption, thereby achieving the multiobjective capacity allocation. At the same time, it takes into account the environmental protection and economy of the virtual power plant, reduces the emission of pollutants, and responds to the goal of achieving carbon neutrality as soon as possible.(3)In addition to the consideration of wind power, photovoltaics, and load uncertainty, the innovative introduction of CVaR that can effectively quantify risk characterizes the uncertainty faced by virtual power plant investors and improves the scientificity of virtual power plant capacity allocation.

The rest of the paper is organized as follows: Section 2 designs a virtual power plant framework with electric vehicles, which is followed by the modeling of each unit in the virtual power plant. In Section 3, to maximize the net income of VPP and the consumption of clean energy, a multiobjective capacity optimization configuration model is established. Section 4 designs a multiobjective solution process. Section 5 takes Shanxi Province, China, featuring the rapid growth of electric vehicles, as an example to conduct empirical analysis, thus verifying the validity of the model.

##### 1.1. Nomenclature

The summary of parameters and variables is shown in Table 2.

#### 2. Framework and Unit Modeling of VPP with EV

##### 2.1. Framework of VPP with EVs

In addition to renewable energy, such as wind power and photovoltaics, VPP can also gather resources, such as EVs and user-side controllable loads. However, there are uncertainties in the controllable load of renewable energy, EVs, and users. To maintain the balance between supply and demand, thermal generators, energy storage systems, and other equipment are installed in the VPP to reduce the uncertainty, with the specific framework of the VPP shown in Figure 1.

Taking a day of a year in a virtual power plant as an example, the wind power generation, photovoltaic power generation, thermal power generation, electric vehicle charging, and discharging and load are predicted at 7 : 00 on the day before the actual operation. Compare the output and load at 7 : 30. When the output is greater than the load demand, judge whether the multimargin exceeds the maximum energy storage of the energy storage system at 8 : 00 before the day-ahead market starts (assuming that the day-ahead market starts at 9 : 30). If the answer is positive, the energy is first stored in the energy storage system to its maximum extent, and the remaining energy is then sold to the grid at a price lower than the current market price; otherwise, the surplus is stored in the energy storage system. When the output is less than the load demand, judgement on whether the shortfall exceeds the maximum discharge energy of the energy storage system will be initiated. If the answer is positive, the energy storage system will discharge energy first, and the remaining shortfall will be purchased from the grid at a price higher than the previous market price; otherwise, the shortfall energy is discharged by the energy storage system.

Among them, the bidding process of the VPP in the day-ahead market is shown in Figure 2.

It can be seen from Figure 2 that the Market Control Center announced the bidding information before 9 : 30 on the bidding day. From 9 : 30 to 10 : 00, power is submitted by each wind power, photovoltaic power generating unit, and thermal power generating unit. In the meantime, the user submits the load demand, and the VPP operator submits the declaration to the control center based on the output and load. At 10 : 30 on the bidding day, the day-ahead market clearing will be carried out to form the day-ahead market-clearing price. Besides, the real-time clearing is carried out in 15 minutes within the operating day.

##### 2.2. Unit Modeling of VPP with EV

(1)Wind turbine: the output of the wind turbine generator mainly depends on the wind speed. Specifically, when the wind speed is less than the cut-in wind speed, or greater than the cut-out wind speed, the output of the wind turbine is 0, while in the case that the wind speed is between the cut-in wind speed and the rated wind speed, the output of the wind turbine generator is positively related to the wind speed. The specific output is shown in the following equation [32]: where refers to the output of the *j*-th wind turbine at time *t*; represents the rated output of the *j*-th wind turbine; denotes the wind speed at time *t*; and , and are the cut-in wind speed, cut-out wind speed, and rated wind speed of the *j*-th wind turbine, respectively.(2)Photovoltaic panels: the output of the photovoltaic panel depends on the light intensity and the area of the photovoltaic panel, as shown in the following equation [33]: where refers to the output of the photovoltaic panel at time *t*; represents the photoelectric conversion efficiency; denotes the area of the photovoltaic panel, and is the light intensity.(3)Thermal power generating set: the output of thermal power generators depends on the amount of coal burned and the conversion efficiency, as shown in the following equation: where refers to the output of the *j*-th thermal power generating unit at time *t*; represents the conversion efficiency of the *j*-th thermal power generating unit; and denotes the amount of coal burned by the thermal power generating unit at time *t*.(4)Controllable load: controllable load is also called a flexible load, which includes the transferable load and the interruptible load. Among them, the transferable load depends on the transferred load and the load transferred from the rest of the time; the interrupted load depends on the ratio of the interrupted load, as shown in the following equations, respectively: where refers to the transfer load at time *t*; represents a Boolean variable, which indicates whether the load is transferable or not during *t*; in the case that the load can be transferred in the period of *t*, , otherwise, ; represents the load before the transfer of the load, and the load is not reduced at time *t*; denotes the transfer ratio at time *t*; is the load reduction at time *t*; and refers to the reduction ratio at time *t*.(5)EV charging load: after considering the access of electric vehicles to the virtual power plant, the charging and discharging of electric vehicles are random and subjective, which aggravates the overall uncertainty of the virtual power plant. Therefore, the accurate analysis of electric vehicle charge and discharge load is the key.

EVs mainly include taxis, private cars, and electric buses. Among them, taxis and electric buses cannot be charged for a long time due to their operating hours; therefore, fast charging is mainly used. In contrast, private cars are mainly used for driving from home-workplace-home, which makes the long charging time acceptable; in that case, slow charging is mainly adopted. The selection of the charging strategy for EV in each period is related to the EV’s state of change which is closely related to the EV’s driving distance. The mileage of EVs obeys a normal distribution, as shown in the following equation [34]:where and refer to the mean and standard deviation of mileage, respectively.

Since the state of charge of an electric vehicle at every moment is constrained by the minimum state of charge, that is, when the electric vehicle is not charged at time *t*, the charge value at time *t* minus the power consumption at time *t* + 1 still needs to meet the minimum state of charge. Combining mileage accordingly, the EV’s state of charge is judged by equation (7). If equation (7) is satisfied, the EV does not need to be charged at time *t*; otherwise, the EV is charged [35]:where refers to the *k*-th EV’s state of charge at time *t*; represents the power consumption of the *k*-th EV per kilometer; denotes the EV capacity; and is the minimum value of the EV’s state of charge; and are the mileage of the *k*-th electric vehicle at time and , respectively.

According to the EV’s state of charge, the charging time of the EV is calculated based onwhere refers to the charging time of the EV; represents the parking time of the EV, and denotes the charging time of the EV; is the charging power of the electric vehicle at time :

By continuously updating the EVs’ state of charge, the cumulative charging load of EVs can be obtained. is the accumulation of the charging power at time *t* of three types of electric vehicles: taxis, private cars, and electric buses, as shown inwhere refers to the cumulative charging load of EVs; represents taxis, private cars, and electric buses, respectively.

#### 3. Capacity Optimal Allocation Model of VPP considering Multiple Objectives

The investment and construction model of VPP is the BOT model, namely, build operation transfer. The VPP service provider shall invest in construction and operation, and after the operation expires, the VPP service provider will transfer the VPP to the government.

Because wind power generation, photovoltaic power generation, controllable load, and electric vehicles all have uncertainty and randomness, they are a random problem. In the process of solving, the random problem needs to be transformed into a deterministic problem. The Monte Carlo method is used to form the output scenario set of wind power generation, photovoltaic power generation, electric vehicle charging load, interruptible load, and reducible load. Due to the space limitation, the Monte Carlo method is no longer described, mainly in reference [36]. s , , , , and are considered to reduce the load. The total number of scenes is . And the probability of each scene is , , , and , respectively.

##### 3.1. Objective Function

EV may have a certain impact on the load curve by its charging load when connecting to a VPP. From the economic point of view, the goal of the VPP is to maximize the net income; while for social benefit, the VPP also pursues the largest consumption of clean energy; therefore, it is necessary to construct a VPP capacity optimization configuration model that considers multiple objectives.

###### 3.1.1. Maximize Net Income

The net income of the VPP is the difference between the total system revenue and the total system cost. At the same time, is used to represent the values of variables in scenes , , , , and , respectively, as shown inwhere refers to the net income of the VPP; represents the total revenue of VPP sales; , , , , , , , and are VPP investment and construction cost, operation and maintenance cost, thermal power generation cost, interruptible load compensation cost, transferable load cost, environmental cost, power purchase cost from the grid, and energy storage system cost, respectively:(1)Investment and construction cost Investment and construction costs mainly refer to the costs incurred in purchasing and installing each unit: where , , and refer to the number of wind turbines, thermal generators, and energy storage systems, respectively; represents the number of photovoltaic panels; and denote the number of fast-charging piles and slow-charging piles, respectively; , , , , , and are the unit investment and construction costs of unit wind turbines, photovoltaic panels, thermal power generators, fast-charging piles, slow-charging piles, and energy storage systems, respectively; is the discount rate; and refers to the operating life of the system.(2)Annual operation and maintenance cost The annual operation and maintenance cost depends on the output of each unit and the operation and maintenance rate, as shown in where , , , , and refer to the operation and maintenance rates of wind turbines, photovoltaic panels, fast-charging piles, slow-charging piles, and thermal generating sets, respectively; , , , , and represent the unit operation and maintenance costs of wind turbines, photovoltaic panels, fast-charging piles, slow-charging piles, and thermal generating sets, respectively.(3)Thermal power cost where , , and refer to the power generation cost coefficients.(4)Interruptible load compensation cost where refers to the unit interruptible load compensation cost.(5)Transferable load cost where represents the unit transferable load compensation cost.(6)Environmental cost where denotes the type of pollutant; refers to the total discharge of pollutants ; denotes the fine’s magnitude of the pollutant ; and is environmental value.(7)Grid purchase cost where refers to the unit price of electricity purchased from the grid.(8)Energy storage system cost where is a Boolean variable, indicates that the energy storage system is started, and indicates that the energy storage system is not started; and are the start and stop cost of energy storage system; is also a Boolean variable, indicates that the energy storage system is charged, and indicates that the energy storage system is not charged; is the operation and maintenance rate of the energy storage system; is the unit operation and maintenance cost of the energy storage system.(9)Electricity sales revenue: the electricity sales revenue of the VPP includes the charging fee paid by the EV owner, the energy usage fee paid by the general user, and the revenue obtained by selling electric energy to the grid:where refers to the user energy unit price; represents the unit price of energy sold to the grid; and denotes the charging price of EVs.

To effectively measure the uncertainty risk of wind turbines, photovoltaic panels, EV charging loads, and controllable loads, CVaR is introduced and multiplied by the investor’s risk preference to represent the risk . The degree of investor’s risk preference indicates the investor’s attitude towards risk, and its value range is . When is smaller than 0.1, it means that investors are risk preference type. Investors want to exchange for higher returns with greater risks. When is larger than 0.5, it means that investors are risk averse and their investment strategies are conservative. Investors should choose the risk preference coefficient according to their risk preference. As shown inwhere refers to the VaR value and represents the confidence coefficient.

Combined with the degree of risk, the objective function for maximizing net income can be obtained based on

###### 3.1.2. Maximize Clean Energy Consumption

The consumption of clean energy is characterized by the ratio of clean energy output to the total output of the VPP (including the output of clean energy and the output of thermal power units), as shown in

##### 3.2. Restrictions

The constraints of the multiobjective capacity optimization configuration model include unit output and climbing constraints, EV constraints, controllable load constraints, energy storage system constraints, grid interaction constraints, power balance constraints, and scenario probability constraints [37, 38].

(1) Unit output and climbing constraints: the output and climbing constraints of wind turbines, photovoltaic panels, and thermal generators are shown in equations (24) and (25), respectively:where and refer to the minimum and maximum output of unit *i*, and and represent the minimum and maximum values of the climb of unit , respectively.

(2) EV constraints: EV constraints include charging power constraints and capacity constraints, as shown inwhere refers to the maximum charging power of the *k*-th EV; represents the Boolean variable of the *k*-th EV’s charging state, and means that the electric car is being charged; otherwise, it is not being charged. And is the maximum capacity of the *k*-th EV.

(3) Controllable load constraint: controllable load constraints include transferable load constraints and interruptible load constraints:where and refer to the maximum values of transferable load and interruptible load, respectively.

(4) Energy storage system constraints: energy storage system constraints include balance constraints and energy discharge limit constraints, as shown inwhere refers to the capacity of the energy storage system at time *t*; and represent the energy storage and release efficiency of the energy storage system, respectively; denotes the maximum capacity of the energy storage system; and is the Boolean variable of the energy storage state of the energy storage system. When , the energy storage system stores energy; otherwise, it releases energy. and are the maximum value of energy storage and release of energy storage system, respectively.

(5) Grid interaction constraints: the grid interaction constraint means that the VPP cannot exceed the maximum value when purchasing from and selling electricity to the grid:where refers to the maximum power that the VPP exchanges with the grid.

(6) Power balance constraint: power balance constraint refers to the balance between supply and demand in each period:

(7) Scene probability constraints: the scene probability constraint means that the sum of the probabilities of each scene is 1, as shown in

#### 4. Model Calculation and Solution

To coordinate the multiobjective strategy for maximizing the net income of VPP and the clean energy consumption, the specific solution is as follows:(1)Step 1: transform the maximization of net income and clean energy consumption into that of objective functions. Let and , and the transformation result is shown in the following equations:(2)Step 2: use CPLEX to solve the optimal solutions under different objective functions, and count them as and .(3)Step 3: the fuzzy membership method is used to scalar the two objective functions. Among them, the optimal solution obtained by the solution is taken as the lower limit, and the maximum values of and in the single-objective optimization result are taken as the upper limit. The membership functions of the objective functions of and can be obtained based on the following equations:(4)Step 4: use the weighted comprehensive index method to convert the multiple targets into the single target. The conversion result is shown in the following equation:

#### 5. Example Analysis

##### 5.1. Basic Data

Because of the rapid development of EVs and renewable energy in Shanxi Province, a certain area in Shanxi Province is taken as the example for empirical analysis. Specifically, select the wind speed, light intensity, EV charging load, interruptible load, and reduced load in the past three years from 2017–2019 to prepare 3 typical scene sets, and all the scene probabilities are set at 0.33. The specific situation is shown from Figures 2–6 [39, 40].

Figures 3 and 4 show the historical wind speed and light intensity from 2017 to 2019, respectively. The horizontal axis represents the number of hours in a year, with a total time of 8760 hours. The ordinate corresponds to the wind speed and light intensity at different times. The data of 2017 are in black, the data of 2018 are in blue, and those of 2019 are in yellow.

Figures 5 and 6 show the historical interruptible load and transferable load from 2017 to 2019, respectively. The horizontal axis refers to the number of hours in a year, with a total time of 8760 hours. The ordinate corresponds to the interruptible load and transferable load at different times. The data of 2017 are in black, the data of 2018 are in red, and those of 2019 are in blue.

Figure 7 shows the average load from 2017 to 2019. The axis represents the number of hours in a year, with a total time of 8760 hours. The ordinate corresponds to the load at different times.

The prices for EV charging and user energy are based on time-of-use electricity prices, as shown in Table 3 [41].

The fine quantity set and environmental value of each pollutant are shown in Table 4 [42].

The specific parameters of wind turbines, photovoltaic panels, thermal generators, energy storage systems, and various types of EVs are shown in Table 5 [43].

Set the compensation cost of the transferable load at 0.0122 $/, and the compensation cost for interruptible load at 0.0183 $/. The VPP purchases electricity from the grid at the price of 10.1986 $/ and sells it to the grid at the price of 0.1604 $/. The coal price is 71.8160 $/ton, the discount rate is 8%, and the degree of risk appetite is 1. The weight coefficients for the maximization of net income and that of clean energy consumption are 50% and 50%, respectively. There are a total of 8,000 EVs for which electric taxis, electric buses, and electric private cars account 40%, 20%, and 40%, respectively.

##### 5.2. Example Results

###### 5.2.1. Analysis of the Impact of EV Access on Capacity Allocation Results

To study the impact of EVs on the VPP’s optimal configuration, the impact of different EV access scales on VPP capacity configuration is first analyzed, which is followed by the analysis of each unit.

(1) Analysis of the impact of different EV access scales on capacity allocation results: when 100% of EVs are connected to the VPP, a total of 8,000 vehicles will be set, and the connection ratio varies between 50% and 120%. And through CPLEX to optimize the solution, with 1 hour as the step size for simulation, the simulation results stabilized after 48 iterations, and the optimized calculation time was 10.4 seconds. The capacity configuration optimization results are shown in Table 6.

As shown in Table 6, with the continuous increase of the scale of EV access, the net income, clean energy consumption value, and comprehensive objective function value of VPP all increase first and then decrease. This is due to the fact that the increase in the scale of EV access has led to an increase in the charging load demand of EVs. To maintain the balance between supply and demand, the VPP has to increase its output and the number of units configured. When the scale of EV access is [50%, 80%], the wind turbines and photovoltaic panels are increased to meet the requirements of the increased charging load, and the clean energy consumption rate will increase at this time. At the same time, because the increase in charging load is greater than the increased cost of the VPP, the net income of the VPP increases.

In the case that the scale of EV access is [80%, 100%], the increase in wind turbines and photovoltaic panels is less, and that in thermal power generation and energy storage systems is greater. The increased charging load is mainly met by thermal power generating sets and energy storage systems. This is because that the greatly increased demand for EV charging has greatly increased the risk of disorderly charging. To ensure the safety and reliability of power supply, the selected output is more reliable for the thermal power generating units and energy storage systems to meet. Therefore, on the one hand, this reduces the consumption rate of clean energy. On the other hand, due to the high investment and construction cost of the energy storage system, the net income of the VPP is reduced.

It can also be seen from Table 4 that the number of fast-charging piles is higher than that of slow-charging piles. The reason is that electric buses and taxis usually use fast-charging methods due to the operating hours, while private cars usually use slow-charging methods. The proportions of various types of EVs are 40%, 20%, and 40%, respectively, which means that the scale of electric buses and electric taxis is larger than that of private cars. Therefore, in the VPP capacity configuration results, the number of fast-charging piles is greater than that of slow-charging piles.

From Table 6 and related analysis, it can be seen that when the scale of electric vehicles is 80%, the net income and clean energy consumption rate of the virtual power plant are the highest, and the maximum comprehensive objective function value is 0.4988. Therefore, under the current conditions, the optimal ratio of electric vehicles connected to the virtual power plant is 80%.

When the access scale of electric vehicles exceeds 100%, the net income and clean energy consumption rate of the virtual power plant will decrease compared with the scale not exceeding 100%. This is because the scale of more than 100% will lead to an increase in charging and discharging power, and more standby units need to be configured in the virtual power plant to ensure the safe and stable operation of the virtual power plant. However, if these electric vehicles can be guided in an orderly way, the net income and clean energy consumption rate may exceed the scenario that the scale of access is less than 100%.

(2) Result analysis of VPP output: when selecting a typical day of 2592–2615 h and analyzing the EV access ratio of 80%, the output of each unit of the VPP is shown in Figure 8.

According to Figure 8, the time frames from 1–5 h to 13-14 h refer to the low electricity consumption period, the output is greater than the energy consumption, and the interruptible load is 0. The energy storage system is called first to store energy; however, the thermal power generation unit shows less output which maintains at around 400 kW. The remaining power is sold to the grid. The time frames from 9–14 h to 18–22 h represent the peak electricity consumption period when the output is less than the energy consumption, and the energy storage system is given the priority to discharge, thereby satisfying the load demand. On the one hand, part of the load is interrupted and transferred to the valley period; besides, the interrupted load is maintained at about 134 kW. In the meantime, the output of thermal power generator sets is increased from 400 kW in the valley period to about 1000 kW. And the shortfall is purchased from the grid.

###### 5.2.2. Analysis of Capacity Allocation Results under Different Risk Preferences

The EV access ratio is set at 80%, and the risk preference coefficient varies between [0.25, 1.50]. The result of capacity optimization configuration is shown in Figure 9.

As shown in Figure 9, as the risk preference coefficient increases from 0.25 to 1.50, the CVaR value gradually decreases, reflecting the increase in investors’ aversion to risk. In another word, when the risk preference coefficient is relatively small, while the number of wind turbines and photovoltaic panels is large, thermal power generation sets are mainly used to reduce the uncertainty of renewable energy output. Since the cost of energy storage technology is relatively high and the cost of VPP can be reduced through thermal power generation units, the configuration optimization results include more thermal power generation units and less energy storage systems. However, when the degree of risk preference is large, to reduce the uncertainty of the system, the number of wind turbines and photovoltaic panels is reduced. On the other hand, to meet the load demand, the energy storage system and thermal power generator set are required to meet the demand of the shortfall load. At this time, the number of energy storage systems and thermal power generator sets is large.

###### 5.2.3. Considering the Influence of Multiobjective and Electric Vehicle Access on VPP

In order to further analyze and consider the impact of multiobjective and electric vehicle access on the VPP, this paper sets four scenarios as shown in Table 7 for example analysis.

It can be seen from Table 6 that scenario 2 and scenario 3 configure the capacity of the virtual power plant with a single objective; scenario 1 and scenario 4 configure the capacity of the virtual power plant with multiple objectives. The objective function values of virtual power plants under different scenarios are shown in Table 8.

According to Table 7, compared with the single objective, the optimal solution can be obtained by considering the optimal configuration of multiobjective virtual power plant compared with the single objective. The comprehensive effect is 0.4988. However, scenario 3 with the highest clean energy consumption rate has the lowest comprehensive target value of 0.4702.

The equivalent load curve and output of each unit under different scenarios are further analyzed, as shown in Figures 10–13 . The equivalent load curve of virtual power plant is the superposition of total output and total load of virtual power plant.

As can be seen from Figures 10–13, scenario 2 only considers the maximization of net income. At this time, because the output of conventional thermal power units is stable, it will increase the output of conventional thermal power units and reduce the consumption of clean energy. For scenario 3, which only considers the maximum clean energy consumption, in order to maximize the clean energy consumption, the output of thermal power generation units will be reduced. However, in order to ensure the security and stability of the system, more reserve capacity needs to be configured, which reduces the economy of the system. Compared with scenario 4, the equivalent load of virtual power plant in scenario 1 is steeper. The peak-valley difference of scenario 1 is 175.5 kw, which is much larger than that of scenario 4. The increase of peak-valley difference leads to the increase of operation and maintenance cost of virtual power plant, which reduces the net income of virtual power plant. It shows that the peak-valley difference can be effectively reduced when the electric vehicle is connected to the virtual power plant and guided orderly.

###### 5.2.4. Sensitivity Analysis of the Influence of Different Target Weight Coefficients on the Capacity Allocation Results

The weight coefficient for maximizing net income and clean energy consumption is changed for sensitivity analysis. When the weight coefficients reach 50%, it means that the ratio of the importance for maximizing net income and clean energy consumption is 1. Allowing the importance of the two to change between [0.5, 5], the sensitivity analysis results are shown in Figure 14.

As shown in Figure 14, as the ratio of the importance of maximizing net income to maximizing clean energy consumption increases, the value of net income first increases and then decreases, while the proportion of clean energy consumption continues to decline. This is because that as the importance ratio increases, the VPP based on the economic net income value will increase the proportion of thermal power generation output and reduce the uncertainty of clean energy output. At this time, the proportion of clean energy consumption will decrease. However, when the importance ratio increases to 3, the output of thermal power generating units will account for a relatively high proportion, leading to a faster increase in environmental costs, and exceeding the benefits it brings in. In the meantime, the net income begins to decline at this time. The results of this optimized configuration show that the requirements of economy and environmental protection should be coordinated according to the requirements of the country’s external policy environment, thus maximizing the comprehensive income value of the VPP.

#### 6. Results and Conclusions

To enrich the research results of capacity configuration, this paper first takes the VPP capacity configuration as the research object, including EVs, which is followed by the modeling of each part of the VPP. Aiming at the reduction of the uncertainty of wind power generation, photovoltaic power generation, EV charging, and load, the problem of uncertainty is transformed into that of certainty with the scene generation method. To take into account the economics and environmental protection of VPP, and the uncertainty of investors’ income, conditional value-at-risk was introduced, thereby constructing a multiobjective capacity optimization model with net income and clean energy consumption maximization. Meanwhile, Shanxi Province is taken as an example for the analysis of the calculation example, and the results are as follows:(1)For VPP that includes EVs, the optimal scale of EV access should be selected reasonably to achieve the highest comprehensive income of VPP. As the scale of EV access increases, on the one hand, the demand for EV charging increases, leading to the increase of the revenue of VPP. On the other hand, the security of VPP and the cost of capacity allocation are reduced. Therefore, it is necessary to select the scale of access reasonably to achieve a balance between benefits and costs.(2)The risk aversion of decision-makers increases with the increase of the risk preference coefficient. Therefore, when the risk preference coefficient is relatively small, the number of wind turbines and photovoltaic panels becomes relatively large. In contrast, when the risk preference is relatively large, the number of energy storage systems and thermal power generating sets becomes relatively large.(3)As the importance ratio of maximizing net income to maximizing clean energy consumption increases, the value of net income first increases and then decreases, while the proportion of clean energy consumption continues to decline. Therefore, decision-makers should fully consider the country’s external environmental requirements and coordinate the balance between the economy and environmental protection of VPP.

#### Data Availability

The basic data used to support the findings of this study are included in the paper.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.