Centralized and Distributed Optimization for Vehicle-to-Grid Applications in Frequency Regulation

: This paper proposes centralized and distributed optimization models for V2G applications to provide frequency regulation in power systems and the electricity market. Battery degradation and dynamic EV usages such as EV driving period, driving distance, and multiple charging/discharging locations are modeled. The centralized V2G problem is formulated into the linear programming (LP) model by introducing two sets of slack variables. However, the centralized model encounters limitations such as privacy concerns, high complexity, and central failure issues. To overcome these limitations, the distributed optimal V2G model is developed by decomposing the centralized model into subproblems using the augmented Lagrangian relaxation (ALR) method. The alternating direction method of multipliers (ADMM) is used to solve the distributed V2G model iteratively. The proposed models are evaluated using real data from the Independent Electricity System Operator (IESO) Ontario, Canada. Simulation results show that the proposed models can aggregate EV s for frequency regulation; meanwhile, the EV owners can obtain monetary rewards. The simulation also shows that including battery degradation and dynamic EV usage increases the model accuracy. By using the proposed approaches, the high cost and the low efﬁciency power generation units for frequency regulation can be compensated or partially replaced by EVs, which will reduce the generation cost and greenhouse gas emissions.


Introduction
As an important function of ancillary services, frequency regulation plays a pivotal role in power system operation and control. Power generation must be controlled to continuously meet demand, and an imbalance will cause frequency deviation [1]. Traditionally, fast response power generators are used for frequency regulation [2], e.g., burning gas turbines [3] and peak hydro [4]. However, these generators are less efficient and high cost [5].
Controlled EV charging and discharging connected to power systems-known as V2G applications-can be used as an efficient and economical source for frequency regulation [6][7][8][9][10][11]. In addition, the response of EV charging and discharging is fast, which makes EVs ideal sources for frequency regulation. Therefore, effective frequency regulation models using EVs are highly needed [12,13]. Since the individual battery capacity of EVs is insignificant compared with conventional generators [14], aggregators can be used to coordinate and manage the participation of a large fleet of EVs [15][16][17].
The studies on EV models for frequency regulation can be classified into two categories: unidirectional and bidirectional approaches. In the unidirectional models, the frequency deviation can be regulated by controlling the EV charging power and periods, i.e., EVs 1.
Both centralized and distributed V2G models with consideration of dynamic EV usage and battery degradation cost are developed and quantitatively evaluated for frequency regulation. Using the proposed methods, expensive resources responding to frequency regulation can be partially replaced by EVs.

2.
The proposed distributed V2G models can integrate a very large fleet of EVs, protect EV owners' privacy, and cope with the central failure problem of any centralized models.

3.
Dynamic EV usages such as driving and plug-in time/location are included in the V2G model, which better reflects the actual EV usage; therefore, the accuracy of the V2G model is improved.

4.
A linear battery degradation cost model is developed and incorporated into the proposed V2G model. This linearized model is accurate and computationally efficient. 5.
Two sets of parameters (N C and N D) are introduced to prevent undesired EV charging and discharging behavior, e.g., EV discharging to merely charging other EVs. 6.
Due to the introduction of N C, N D, and slack variables P slack i,t , both centralized and distributed V2G problems are formulated as LP models. Otherwise, a mixed-integer optimization model is required, which is much more difficult to solve. This paper is organized as follows. Section 2 presents the methodology. Section 3 shows the case studies and simulation results. The discussion is presented in Section 4. Section 5 draws the conclusion. Figure 1 shows the system architecture. The plug-in EVs are connected to the power distribution system. An aggregator contracts with both the system operator (electricity market) and EV owners. Specifically, the contract between an aggregator and the system operator specifies that the aggregator needs to schedule and aggregate EV charging or discharging energy to follow a reference signal. This reference signal is the energy required for frequency regulation, which is announced by the system operator. When the power system frequency is higher than the nominal frequency, the reference signal is positive, representing that the power generation is greater than the demand. In this situation, EV charging will be preferred. In contrast, when the power system frequency is lower, the reference signal is negative, and EV discharging will be preferred. The contract also specifies the reward (USD/kWh) that the aggregator can provide for the EV owners in a V2G for frequency regulation. The aggregated EV charging/discharging may not track the frequency regulation reference signal exactly because of the dynamic usage of EVs, such as driving and SOC limitation. The mismatch will be compensated for by the frequency regulation market. For example, PJM provides market-based compensation to resources that can adjust output or consumption in response to an automated frequency regulation signal [36]. Such resources in the PJM market include combustion turbines, hydro, storage, demand response, etc. PJM generates two different types of automated frequency regulation signals: Regulation A and Regulation D. Regulation A is a slow signal that is used to recover a larger, longer system frequency deviation. The Regulation D signal is a much faster, dynamic signal that needs resources to respond almost instantaneously. The resources that can respond almost instantaneously are extremely expensive and tend to be energy inefficient. Using the proposed method, such expensive resources can be partially replaced by EVs.

System Architecture
In the centralized approach, an aggregator collects EV data such as plug-in times, driving times, and SOC. Based on the collected information, the aggregator solves the proposed centralized optimization model to match the frequency regulation signal. The model solution provides the scheduled EV charging and discharging profiles, which are used to control EV charging and discharging.
In contrast, in the distributed approach, each EV owner obtains global information, such as frequency regulation signals and the aggregated EV charging and discharging profile of the other EVs, from the aggregator. Based on this information, the EV schedules its charging and discharging energy by solving the proposed distributed optimization model. Through the coordination of the aggregator, a global optimal solution can be reached. Since each subproblem is much simpler than the centralized model, the distributed model can be solved more efficiently. Furthermore, EV owners do not need to share any information (e.g., driving periods, charging time, and daily energy consumption) with the other EV owners. They only need to share their charging/discharging profiles with the aggregator. The charging/discharging profiles are required to be shared with the aggregator for billing purposes anyways. Therefore, privacy can be preserved.
EVs can be plugged into the grid to provide the regulation service at both homes and workplaces. Both centralized and distributed V2G models incorporate dynamic EV usages and battery degradation cost.
We assume the communication infrastructure, such as power line communication, wireless communication, and ZigBee, is available [37]. We also assume the EV charging stations have bi-directional power flow and two-way communication capability. Figure 2 shows the dynamic driving and plug-in times. There are two driving periods: from home t 1 to workplace t 2 and from workplace t 3 to home t 4 . Due to similar daily routines, t 1 , t 2 , t 3 and t 4 tend to be normally distributed as follows [15].

Dyanmic EV Usage and Battery Degradation Cost
where µ and σ represent the average and the standard deviation values, respectively, and x is the distance along the horizontal axis. The EV battery consists of many lithium-ion cells and its capacity depends on the number of cells on it. Charging and discharging the battery over time, has a negative impact on this capacity. During charging and discharging, the ions move through the electrolyte and the two electrodes. Over time the physical structure of these components changes and causes a capacity loss. This process is called battery degradation [38].
Battery degradation cost can be modeled as follows [39]: where C b is the battery purchasing cost in USD/kWh, and LC is the replacement cost. E 0 is the battery capacity. DOD = 1 − SOC represents the depth of discharge; k is a constant value for the calibration purpose. The cycle life (C L ) expresses the lifetime of the battery based on the number of charging/discharging times before the capacity loss. The life cycle value relies mainly on the DOD. More precisely, if the DOD value is low, the battery degradation cost will decrease; hence the battery cycle life will increase. The relationship between C L and DOD is as follows: where L 0 represents the cycle life of the battery at 100 percent of DOD, while α is the decay coefficient.
In the proposed V2G models, we incorporated the battery degradation cost. To reduce the computational complexity, we linearized the degradation cost by piecewise linear unctions.
In Figure 3, the blue line shows the degradation cost modeled by Equation (2), and the red line shows the linearized version modeled by Equation (4).

Centralized V2G Model
The aggregator solves the following centralized model, and the charging and discharging signals from the optimal solution are used to control EVs. It is assumed that the aggregator has all the required information from EVs such as SOC, battery operation cost, and EV driving time.
In the objective function, Equation (5), M, and i represent the number of vehicles and the index of each vehicle, respectively; t is time, and T is the time horizon. In addition, P EV i,t is the operating power of EV batteries in which positive represents charging and negative represents discharging; P slack i,t is a set of slack variables to cancel the energy for driving. The reward for frequency regulation is given by the variable r i,t ; ζ is a penalty coefficient, and DC is the degradation cost.
The cost for frequency regulation from the i-th EV at time t is represented by c i,t . The cost can be different among EVs depending on the preference of the EV owners and their satisfaction for participation in the frequency regulation program. For example, the cost of discharging an EV with 100% of SOC is lower than that of an EV with 10% of SOC.
The objective is to find a trade-off between maximizing the reward and minimizing the degradation cost.
Equation (6) illustrates the EV discharging constraint. Here, P EV rated is the rated power, Moreover, N D stands for needs discharging, which represents a set of time slots that the EV should be standing by or discharging. For example, when the load reference signal is negative, i.e., the system frequency is lower than the nominal frequency, EVs will be in the state of N D. For example, based on the frequency regulation signal, N D = {4, 5,6,7,8,12,13,14,15, · · · }.
On the other hand, Equation (7) represents the EV charging limit. Here, N C stands for needs charging, which represents a set of time slots that the EV should be standing by or charging. For example, based on the frequency regulation signal, N C = {1, 2, 3, 9, 10, 11, 23, 35, 37, · · · }. Both N C and N D are parameters which coordinate EVs to charge or discharge. These parameters can prevent undesired EV charging/discharging behavior. For example, some EVs discharge to merely charge other EVs.
In Equations (8) and (9), Here, E i,0 is the battery capacity of the ith EV, and β i ≤ 1 is the fraction of the battery capacity used for driving the i-th EV. Equation (8) is the energy consumption (discharging) for driving indicated by negative values. However, since the discharging does not provide energy to the power system, the discharging in this period should not be reflected in frequency regulation. Therefore, slack variables are introduced in Equation (9) and added into the objective to cancel the effect of P EV i,t during driving times. Equation (10) calculates the SOC i,t through the time horizon for each EV, where SOC 0 represents the initial SOC for each EV assuming that all EVs have the same initial values. Equation (11) illustrates the SOC limits through the time horizon.
In Equations (12) and (13), SOC acc is the accepted SOC right before driving; t 1 and t 3 are the times to start driving. In other words, each vehicle should have a sufficient amount of energy for driving.
The re f t in Equation (15) is the reference signal for frequency regulation; P Ma t is the electrical power from/to the electricity market. The aggregated charging and discharging of the EVs and the electrical power from/to the electricity market should track re f t . The aggregated EV charging/discharing may not exactly track the frequency regulation reference signal because of the dynamic usage of EVs such as driving and SOC limitation. The mismatch will be absorbed by the electricity market. For example, the EV aggregator will purchase more energy from the electricity market when EV discharging cannot provide enough energy to track the reference signal. In contrast, when the EV charging cannot use the required energy, the electricity market will absorb the excess energy.

Distributed V2G Model
The centralized model requires private information to solve the optimization model. The EV owners generally hesitate to share this information, which can lead to an unsuccessful V2G application. In addition, the centralized model is not linearly scalable and has a central failure challenge. Moreover, it needs a central computer with a large memory and good computational capability to optimize a large number of EVs. Therefore, it is not suitable for large-scale networks.
In this section, we propose a distributed optimal V2G model to cope with such problems. In the distributed model, EVs (agents) solve their optimization problem locally while the global optimal solution is achieved.
As discussed in the previous section, Equation (15) illustrates the global constraint of the centralized model. This equation can be relaxed to decompose the optimization model into subproblems, and each subproblem can be solved by an EV (agent) and the electricity market (agent). In this case, the local information for each agent is used to solve these subproblems. Therefore, privacy can be preserved. In addition, the subproblem requires much less computational power. An ALR method is used to reform the centralized optimization model as follows.
subject to: Equations (6)- (14), where the weighted quadratic term makes the first derivative of the objective function continuous and its value is zero at the optimal point; γ is a penalty parameter. This model can be decomposed into M + 1 subproblems and solved by the ADMM [40] method in the decomposed manner. The i-th subproblem among M EVs is shown in Equation (17), and the one subproblem shown in (18) is for the electricity market. ThesSubproblem for the i-th EV is: subject to: Equations (6)- (14).
Note that the term λ re f t − P Ma in Equation (16) is reduced to −λP EV i,t in Equation (17). This is because the terms re f t , P Ma t and M ∑ j=1 P EV j,t , ∀j = i are constant numbers for the i-th EV and therefore can be ignored.
The subproblem for the electricity market is: The ADMM algorithm is shown in Algorithm 1. In each iteration (ν), each agent (i) optimizes its own problem separately to obtain the P EV i,t and P Ma t values These values are sorted according to their closest value to the average value which was obtained from the previous iterations. Then, the dual variable (λ) is updated to be used in the next iteration. Once error ( ) is equal to or less than a minimum value, the algorithm converges.

Simulation Results
This section presents the simulation results for the following scenarios. Scenario #5 has 500 EVs, and the rest of the scenarios have 50 EVs: Scenario #1: This is our reference scenario, with no V2G for frequency regulation. The electricity market is solely responsible for frequency regulation.

Experimental Setup
The distribution network was assumed to have 500 homes. Some 10% of the households have EVs, i.e., there were 50 EVs. Nissan leaf e-plus with the capacity of 62 kWh was utilized in the proposed models. The frequency regulation data on 1 December 2017 to 2 December 2017 in the Ontario area from the Independent Electricity System Operator (IESO) [36] was used as the reference signal as shown in Figure 4. The aggregated EV charging and discharging was supposed to track this set of reference signals for frequency regulation. We conducted a two-day simulation and showed the results from 9 a.m. of the first day to 9 a.m. of the second day. Table 1 summarizes the major parameters. The time horizon was 48 h with a time interval of 5 min. EVs could be plugged in at both home and workplace with the rated charging/discharging power as 10 kW.
The daily EV energy consumption (E i ) for driving was calculated based on the daily driving distance (d i ) and energy consumption per km (E km ), as follows.
Based on the studies in [15,41,42], we assumed that the daily driving distance follows a normal distribution. The average value was 30 km, and the standard deviation was 10 km. The average energy consumption per km was 0.2 kWh/km [43].
The daily energy consumption (E i ) can then be calculated based on Equation (19), which also follows a normal distribution. The average daily energy consumption was 8 kWh, and the standard deviation was 2 kWh. Figure 5 shows the bar chart of the daily energy consumption for 50 EVs.
The parameter β i can then be calculated as β i = E i /E i,0 , where E i,0 = 62 kWh for the Nissan leaf EV used in this study.
The parameters of the linearized degradation cost model are also shown in Table 1. The minimum and maximum SOC were 0% and 100%. The initial was 50%, and the accepted SOC before driving (at t 1 , t 3 ) was 50%. The electricity market price for frequency regulation was 0.687 USD/kWh [44]. The EV charging cost was 0.14 USD/kWh [45]. The reward to EV owners because of participating in the V2G for frequency regulation was 0.3 USD/kWh [46]. The centralized and distributed models were solved using CVX with Mosek solver [47][48][49]. MATLAB 2020a was used to simulate all algorithms.

Parameters Value
Step The mean approximation percentage error (MAPE) and mean approximation error (MAE) were used to calculate how close the charging and discharging can track the reference signal. MAPE is shown in Equation (20) and MAE is shown in Equation (21) [51].
where X i and X . i are the reference and model signals values, respectively, throughout the time horizon T.
In each scenario, we calculated the EV charging cost, the battery degradation cost, the reward from participating in the V2G, and the revenue. Although, the degradation cost was not included in the objective function in Scenarios #2-#6, we still calculated the degradation cost to show the fact. In Scenario #7, the degradation cost was included in the objective function.

Scenario #1: No V2G for Frequency Regulation
In Scenario #1, it is assumed that there is no EVs participating in frequency regulation. The electricity market is responsible for regulating the frequency deviation and match the reference signal. The electricity market adjusts the power generation to regulate the frequency. For example, in the PJM market, the regulation price includes capability and performance. The regulation capacity requires a resource to be available to provide this service and the regulation performance ensures that the resource can respond to frequency regulation signals [52]. In our study, we assume the regulation price was 0.687 USD/kWh [50]. The energy needed from the electricity based on the regulation signal shown in Figure 6 was 865 kWh. Then, the frequency regulation cost was calculated as USD 599.5. Figure 6. Aggregated EV charging and discharging profile from 9 a.m. on the first day to 9 a.m. on the second day for frequency regulation in Scenario #2.

Scenario #2: Centralized Model
In this scenario, we implemented the centralized V2G model without including the battery degradation cost in the objective function (i.e., ζ = 0). The charging and discharging of the EVs were optimized to maximize rewards and track the reference signal.
In Figure 6, the blue line shows the reference signal, which is the required energy for frequency regulation. The red line shows the aggregated EV charging and discharging energy. The aggregated EV charging and discharging were calculated from the centralized model. As can be seen, the aggregated EV charging and discharging were controlled to match the reference signal; however, there is a small mismatch due to the unavailability of EVs during driving periods as shown in Figure 6. The MAPE was 0.32%. and the MAE was 0.014 kW. This small mismatch was compensated for by the electricity market as shown in Figure 7.   The EV charging cost was USD 158.08. The obtained rewards from V2G participation were USD 261.8. Although, the degradation cost was not incorporated into the objective function, we still calculated the degradation cost, which was USD 51.12. The revenue was then calculated as Reward − ChargingCost − DegradationCost = USD 52.59.
The main problem in this model is that it takes a long time to solve the optimization problem when we increase the number of EVs. Therefore, this method is not suitable for a large-scale network.

Scenario #3: Centralized Model with the Central Failure Problem
In this scenario, we assumed that there was a failure in the centralized model for two hours from 12:00 to 14:00 due to the breakdown of the computer or communication. Figure 9 shows the EV charging/discharging from 9 a.m. of the first day to 9 a.m. of the second day.
During this failure, due to the absence of control on EVs' charging or discharging, EVs worked as a load; hence they charged their batteries. Furthermore, the behavior of EVs during this period increased the imbalance between demand and supply and hence increased the frequency deviation. Figure 10 shows the SOC value of one EV for one day. It can be seen that the EV SOC is increasing during the failure period.

Scenario #4: Distributed Model
Although the centralized model shows a good performance in solving the frequency regulation problem, many drawbacks and limitations make it undesirable. These drawbacks include: (1) The centralized model sacrifices EV owners' private information where each customer needs to provide the driving time, the driving periods, the plug-in time, the contracted rewards, and the battery SOC. (2) The centralized model is unreliable for providing the frequency regulation service where one central computer is responsible for optimization and scheduling the charging and discharging power for each EV. Once there is a failure due to communication or any other reason, there will not be any control or regulation, as discussed in Scenario #3. (3) The centralized model has a mishandling problem for large-scale networks. In Scenario #4, the distributed model was developed to overcome these limitations and determine the optimal scheduling for the aggregated EVs to provide the frequency regulation. The degradation cost model was not considered in this scenario (i.e., ζ = 0).
The subproblems were solved in parallel, which decreased the computational complexity. The ADMM was used to solve the model. Each EV was considered as an agent that solves its own optimization problem individually and locally. Figure 11 shows the EV charging and discharging power that follows the regulation reference signal. The MAPE was 0.028% and the MAE was 0.0067 kW. The small MAPE and MAE values show the mismatch between the charging/discharging profiles and the reference signals is very small. The small mismatch can be compensated for by the electricity market.
The EV charging cost was USD 158.55 and the battery degradation cost was USD 51.27. The obtained rewards from V2G participation was USD 262.57. The revenue was USD 52.75. Figure 11. Aggregated EV charging and discharging profile for frequency regulation in Scenario #4.

Scenario #5: Distributed Model for a Large Number of EVs
To check the power of the distributed model, we ran the same model with a large-scale network. To validate the proposed model with a high-scale network, the reference signal was scaled up, and 500 EVs were integrated into the distributed network. Figure 12 shows the regulation profile. Figure 13 shows the individual EV charging and discharging energy from t 1 on the first day to t 1 on the second day.

Scenario #6: Distributed Model Considering Some EVs Fail in the Commitment
We assumed that 10 vehicles failed in their commitments due to the individual EV computer system failure or communication failure. Figure 14 shows the simulation results. As can be seen, the remaining 40 EVs could regulate the frequency and match the reference signal similar to the 50 EVs. The MAPE and MAE values were 0.83% and 0.11 kW, respectively.

Scenario #7 Distributed Model with Degradation Cost
In this scenario, we incorporated the battery degradation into the objective function to better reflect the reality because the battery is one of the most expensive and important components in EVs.
In the objective function (Equation (17)), ζ is a penalty coefficient to find the trade-off between the reward and the battery degradation cost. More specifically, a small/large value of ζ may decrease/increase the impact of the degradation cost on the objective function. Therefore, ζ should be chosen carefully. Based on our previous work, ζ = 0.05 was chosen [15].
Comparing the aggregated EV charging and discharging with the reference signal, the MAPE was 20% and the MAE was 0.57 kW. The electricity market could compensate for the mismatch.
The EV charging cost was USD 150.7, and the battery degradation cost was USD 49.3. The obtained rewards from V2G participation were USD 255.88. The revenue was USD 55.87. Figure 15 shows the revenue in the frequency regulation in Scenarios #2, #4 and #7. It shows the effect of incorporating the degradation cost to the objective function on increasing the revenue for each agent. The daily revenue for each agent fluctuates between USD 0.5 and USD 1.7. In this study, the EV SOC at the start of driving time (t 1 and t 3 ) was set at 50%, which provides a sufficient amount of energy for driving.

Discussion
This study develops both centralized and distributed optimization models for EVs to participate in frequency regulation of power systems. Case studies were conducted in seven scenarios using real data to evaluate the proposed models. Table 2 summarizes the MAPE and MAE in Scenarios #2, #4, and #7. Table 3 summarizes the reward, degradation cost, charging cost, and revenue in Scenarios #2, #4, and #7, where As can be seen from Table 2, there is a mismatch between aggregated EV charging and discharging and the reference signal since the EVs are not available for frequency regulation during driving or the SOC reaches its limit. This shows the importance of modeling the dynamic EV usages. Both the centralized model (Scenario #2) and the distributed model (Scenario #4) show good performance in frequency regulation. Specifically, as can be seen from Table 2, the MAE of using the distributed model was 0.0067 kW. This performance is as good as the centralized model, in which the MAE is 0.014 kW. Furthermore, the total revenue in Scenario #4 is USD 52.75 compared with USD 52.59 in Scenario #2 as shown in Table 3.
However, EV owners may hesitate to share their private information such as the driving time, the driving periods, plug-in time, contracted rewards, and battery SOC. Furthermore, EV owners want to have complete decision making over their EVs, and the centralized model takes this right away from them. This can lead to an unsuccessful V2G application. In the distributed approach, each EV owner obtains global information such as frequency regulation signals and the aggregated EV charging and discharging profile of the other EVs from the aggregator. Based on this information, the EV schedules its charging and discharging energy by solving the proposed distributed optimization model. Through the coordination of the aggregator, a global optimal solution can be reached. Because the EVs do not need to share their private information with the other EV owners, privacy is preserved.
In addition, the central failure problem represents a major defect of the centralized model. For Scenario #3, Figure 9 shows that when the central computer is down from 12:00 to 14:00, charging and discharging of all the vehicles are not under control. In other words, all vehicles become passive load and start to charge themselves, which increases the frequency deviation. In contrast, by using the distributed model, Scenario #6 shows that even with 10 out of 50 EVs failing in their commitment, the rest of the EVs could regulate the frequency without noticeable underperformance.
Another major problem of the centralized model is that the model complexity increases quickly when the number of EVs increases. In other words, powerful computers with large memory are needed to solve the centralized model for a large number of EVs. In contrast, the distributed model needs much less memory and computational power since each subproblem is much simpler than the centralized model. For example, the distributed model is solved with 500 EVs in Scenario #5. In addition, the computation time of using the distributed model in Scenario #4 was 21 s, while the computation time of the centralized model in Scenario #2 was 1815 s.
Frequent EV charging and discharging to provide frequency regulation services can reduce battery lifetime; therefore, the proposed model includes the battery degradation cost in the objective function. The performance was evaluated in Scenario #7. From Table 3, we can see that the reward is reduced from USD 262.57 in Scenario #4 to USD 255.8 in Scenario #7 due to less frequent charging and discharging. However, the degradation cost also decreases. In fact, the total revenue increases from USD 52.75 to USD 55.87, which shows the importance of incorporating the degradation cost into the objective function. This also shows that including degradation cost can make the model more accurate and useful.
In addition, V2G participation does not affect EV usage since a minimum accepted SOC before the driving time is included in the models. Specifically, the SOC right before driving is maintained greater than or equal to 50%, which is sufficient for EV daily driving.
The obtained results show that the proposed models not only provide a frequency regulation service to the power system but also increase revenue to the EV owners without sacrificing privacy. Furthermore, the whole system saves more than USD 337.5 due to using EVs for frequency regulation. The system pays approximately USD 262.0 per day for EVs as a reward; otherwise, it would spend USD 599.5 in the electricity market for frequency regulation.

Conclusions
This study proposes both centralized and distributed optimal V2G models for frequency regulation. Dynamic EV usage patterns and battery degradation are modeled. By introducing three sets of variables (N C, N D, and P slack i,t ), undesired EV charging and discharging behavior is avoided. In addition, V2G problems are formulated as LP models, which can be solved efficiently by the embedded energy management system in EVs. Simulation results show that the centralized model can aggregate EVs to match the required regulation signals while EV owners can obtain rewards. The centralized model can be used by aggregators, utilities, and system operators to plan V2G applications. However, it may not be suitable for real-time implementation due to privacy concerns, high complexity, scalability limitation, and central failure issues. The proposed distributed V2G model can overcome these limitations and shows promising results. Simulation results also show that dynamic EV usage and battery degradation have significant impact on the V2G application and including them can improve the model accuracy. The proposed approaches can be used to turn the fleet EVs to an eco-friendly energy source for frequency regulation and to encourage EV owners to participate in V2G applications.