Abstract
The increasing number of photovoltaic (PV) generation and electric vehicles (EVs) on the load side has necessitated an aggregator (Agg) in power system operation. In this paper, an Agg is used to manage the energy profiles of PV generation and EVs. However, the daily management of the Agg is challenged by uncertain PV fluctuations. To address this problem, a robust multi-time scale energy management strategy for the Agg is proposed. In a day-ahead phase, robust optimization is developed to determine the power schedule. In a real-time phase, a rolling horizon-based convex optimization model is established to track the day-ahead power schedule based on the flexibilities of the EVs. A case study indicates a good scheduling performance under an uncertain PV output. Through the convexification, the solving efficiency of the real-time operation model is improved, and the over-charging and over-discharging problems of EVs can be suppressed to a certain extent. Moreover, the power deviation between day-ahead and real-time scheduling is controllable when the EV dispatching capacity is sufficient. The strategy can ensure the flexibility of the Agg for real-time operation.
Keywords
Aggregated electric vehicle (EV); aggregator (Agg); photovoltaic (PV); robust optimization; convex optimization
IN recent years, the penetration of renewable energy sources (RESs) and distributed energy sources (DERs) on the load side has increased significantly [
In terms of system energy management, two mainly used time scales are day-ahead and real-time. For the day-ahead optimization, as some system parameters are unknown before the day, the prediction-based day-ahead optimization will be challenged by uncertainty. Multiple scenario based stochastic programming and robust optimization are the effective methods for dealing with the uncertainty in day-ahead optimization. To maximize the consumption of renewable energy, the optimal charging management of EV fleets is described in [
In the phase of real-time operation, [
Based on the day-ahead and real-time scheduling mechanism, a robust multi-time scale energy management strategy for an Agg, distributed photovoltaic (PV), and EVs is proposed. The main contributions of this paper are twofold. Firstly, a day-ahead robust optimization model which can manage the inaccuracy of the forecasted PV output is established, to minimize the cost of the Agg in the electricity market. As a risk-averse approach to modeling uncertainties, robust optimization has advantages in managing the stochastic fluctuation of RESs. Secondly, a real-time convex optimization model is established to track the day-ahead scheduled power plan. The developed convexification method is easy to implement. Using the convex optimization model, the power deviation between the day-ahead and real-time phases can be adjusted according to operation demand. Moreover, from the perspective of EV users, the over-charging and over-discharging problems of each EV can be suppressed.
The remainder of this paper is organized as follows. Section II explains the overall system energy management strategy. The proposed day-ahead and real-time optimal scheduling model is provided in Section III. Section IV presents the simulation setup and results. Conclusions are summarized in Section V.
The Agg energy management framework consists of the electricity market, the Agg, grid-connected EVs, PV generation, and regular load, as shown in

Fig. 1 Illustration of multi-time scale energy management process.
As an electricity price taker, the Agg first participates in the day-ahead electricity market to import or export the electricity, and then aims to track the day-ahead power schedule in real time. It is presumed that Agg will be punished by the utility if the deviations exceed a certain percentage of the day-ahead settlement. In addition, we assume that it is not economical for the Agg to reschedule the energy via participating in the real-time energy market. The process of multi-time scale energy management is as follows.
The day-ahead operation is carried out 24 hours before the operation day. The Agg makes a power schedule for the EV, to reduce the cost of electricity consumption based on predicted electricity prices, PV outputs, EV charging requirements, and regular load. However, the stochastic features of PVs and EVs cause the deviations between the plan and reality. To reduce unexpected electricity costs and avoid being punished, it is necessary to carry out a real-time operation.
During the real-time operation, the Agg utilizes the flexibility of the EVs. In particular, it implements optimization scheduling for the charging/discharging power of connected EVs every 15 min to track the day-ahead power plan based on the actual behavior of the EVs, PV, and regular load.
For comparative analysis, two evaluation indexes for a scheduling strategy in a real-time operation phase are defined in (1) and (2), respectively.
(1) |
(2) |
where is the tracking error at time step t, and is equal to the actual Agg power including the EV power , the regular load , and the PV power , minus the day-ahead scheduling Agg power ; is the tracking accuracy; and T is the total number of scheduling time steps.
For the day-ahead scheduling, the Agg aims to minimize the cost of the energy exchange to the external grid. The objective function is expressed as follows. The objective of the day-ahead optimization model is to minimize the cost of the Agg.
(3) |
s.t.
(4) |
(5) |
(6) |
(7) |
(8) |
(9) |
(10) |
(11) |
(12) |
(13) |
where is the electricity price in the day-ahead market; is the transfer power between the Agg and grid at each time step, represents the power consumption of the Agg, and represents the export power from the Agg to the grid; is the length of each time step in the day-ahead market; and are the charging and discharging decision variables of the
Notably, the day-ahead optimal dispatching model above does not consider the uncertainty, and the optimized solution may fail to cope with the uncertain fluctuations of PV output. Robust optimization has advantages in managing uncertainties in which the probability distribution of uncertain parameters is unknown, and only the fluctuation range of the parameters is given. The uncertain sets are used to describe the fluctuation of the PV output. As long as the uncertain parameters are within the range of the uncertain sets, the feasibility of the solution can be guaranteed [
(14) |
where and are the actual and predicted outputs of the PV generation, respectively; is the deviation between the actual and predicted outputs; and and are the upper and lower limits of the uncertainty, respectively.
Thus, in the day-ahead optimization model is formulated as:
(15) |
The introduction of the uncertain variable makes it difficult to solve the optimization model. We formulate an equivalent model by using duals of (14) and (15) [
(16) |
s.t.
(17) |
where and are the dual variables which are equivalent to Lagrange multipliers. The optimization (16) and (17) is further formulated as:
(18) |
s.t.
(19) |
From the weak duality of dual theory, any feasible and in (18) and (19) will be the upper bound for the maximization of (16) and (17). Hence, we can drop the minimization term in (18) and (19), and the achieved solution for both the primal and dual will be the same:
(20) |
(21) |
(22) |
Therefore, a robust optimization model without uncertain variables in (3), (5), (6)-(13), and (20)-(22) is established for this day-ahead schedule. After solving the day-ahead model, the power plan for the Agg can be obtained, and is denoted as , which will serve as the targeted baseline in the real-time operation.
(23) |
In real-time operation, based on the actual behavior of the EVs, load, and PV in real-time operation, the Agg employs the flexibility in the charging and discharging of EVs in the vehicle-to-grid mode to track the expected power plan. Therefore, as defined in (1), the following equation holds for each time step in the real-time operation if the tracking error is 0:
(24) |
where is the total EV power, which is equal to in (1); and is the number of grid-connected EVs at time step t.
As the PV power and regular load do not have the flexibility, the Agg can only realize the tracking of the expected power by scheduling the charging and discharging power of EVs. To facilitate the analysis, the expected power of the EVs is defined as:
(25) |
where is the expected power of the EVs at time step t. Thus, the EVs’ tracking of is equal to the Agg’s tracking of in the real-time operation.
Moreover, to meet the energy requirements of the EVs over a relatively long period, we use rolling horizon optimization [
(26) |
s.t.
(27) |
(28) |
(29) |
(30) |
(31) |
(32) |
(33) |
(34) |
The objective function (26) consists of two parts: the objective of the current time step t, and the objective of the future time step , which is the time step of the rolling horizon . We use k to indicate the time steps from t to . The constraints in (27)-(34) can be explained in a similar manner as the constraints in (6)-(13). The real-time operation has a high demand for computation time. It is preferable to remove the nonlinear constraints in (27)-(34), so that the solving time of the model can be shortened. Inspired by [
(35) |
In that regard, the added barrier terms and , in the objective function (35) have two barrier factors, and . Evidently, the differences between the objective function of (26) and (35) can be ignored when and are small enough.
Then, we show that the optimal solutions of the model (35) satisfy (27)-(34).
The introduction of binary variables in (27)-(34) guarantees that the charging and discharging of the
Assuming that for any i and t, there are two types of solutions, i.e., (36) and (37), leading to the same tracking result when the scheduling target for the power of the EV is greater than 0. Notably, (36) is mathematically feasible, but physically impossible.
(36) |
(37) |
Assume (36) and (37) can be represented as (38) and (39), respectively. If and , we have .
(38) |
(39) |
By substituting (38) and (39) into the objective function of (35), the
(40) |
(41) |
where is the scheduling target for the
Considering that and , we can infer that:
(42) |
As the scheduling objective is to minimize the objective function of (35), (42) shows that a pair of solutions with a discharging power of 0 is the optimal solution in a set of solutions with the same tracking effect.
Similarly, the pair of solutions with the charging power of 0 is the optimal solution when the scheduling target for the
It has been proven that the optimal solution of model (35) does not contain any simultaneous charging and discharging for each EV, i.e., model (35) is exact in modeling the characteristics of EVs, even though there are not any 0-1 binary variables in (35). The model (35) is a convex quadratic optimization model, which can be solved more conveniently and quickly compared with the model (26)-(34).
Notably, the addition of barrier terms achieves a controllable tracking error when the dispatching capacity is sufficient. A concise proof is given below.
We assume that the dispatching capacity is sufficient at time step t, i.e., the expected power of the EVs does not exceed the upper limit of (35). As one of the charging and discharging power of the EVs is 0 at any time step, we find the minimum of (35) from the perspective of charging as (43). Similarly, from the perspective of discharging, the minimum of (35) can be obtained from (44).
(43) |
(44) |
where is the objective function in (35); and and are the total charging and discharging power at time step t, respectively.
We further assume that the dispatching capacity of the EVs is sufficient. If the expected power of the EVs at time step t is within the feasible region surrounded by the constraint of (35), compared with (1), we can conclude that by rearranging (43) and (44), the minimum solution of any t satisfies when charging, and when discharging, respectively. Otherwise, the minimum of (35) cannot be obtained, owing to the limitations of the feasible region. From the characteristics of the objective function (quadratic function), we can infer that the solution in this situation is , and that the absolute value of is less than when charging, or less than when discharging. Compared with (1), the tracking error will be within for all the solutions.
Therefore, the value of the tracking error at each time step can be controlled within by setting the barrier factors and , if the dispatching capacity is sufficient.
The addition of barrier terms in (35) also avoids the over-charging and over-discharging of each EV in real-time operation. In that regard, both and are greater than 0, so any non-zero value of charging and discharging power will increase the value of the objective function. As the objective of optimization is to minimize the objective function, it is necessary to reduce the absolute value of the charging and discharging power for any i, t. This avoids the occurrence of large charging and discharging actions in dispatching. Reference [
To implement the multi-time scale energy management for the Agg, the day-ahead and real-time optimal scheduling models need to be solved in turn. The day-ahead cost minimization model for the Agg is a mixed-integer linear programming problem, whereas the real-time EV operation model is a convex quadratic programming problem. The YALMIP toolbox is combined with the intlinprog and guadprog solvers in the MATLAB2014a platform to address day-ahead and real-time optimization, respectively.

Fig. 2 Framework of multi-time scale energy management implementation.
In the simulation, the scheduling horizon of the simulation is from 12:00 one day to 12:00 the next day. We use an hourly interval in day-ahead optimization, and a 15 min interval in real-time operation. The rolling horizon is set to 1 hour.

Fig. 3 Predicted electricity price in day-ahead market.

Fig. 4 Actual and expected values of PV output.
N(x,
The day-ahead power scheduling plan for the Agg, with different EV numbers, is shown in

Fig. 5 Day-ahead power scheduling plan.
As shown in
We calculate the cost for the Agg with different numbers of EVs participating in scheduling compared with that with uncoordinated charging of EVs, as shown in Table II. With an increasing number of EVs in the day-ahead scheduling, greater cost savings will be achieved. This is because a large number of EVs improves the scheduling capacity of the Agg, so that the Agg can respond to electricity prices more actively.
The uncertainties of the PV output are considered in the day-ahead scheduling, by using an RO model. A cost comparison between RO and deterministic optimization (DO) for dispatching 100 EVs is shown in Table III. A comparison of power scheduling results between RO and DO is shown in

Fig. 6 Scheduling results of RO and DO.
By comparing the scheduling results for the power with RO and DO, it can be seen that the difference in power curves mainly exists in the period of PV output. The purchasing power of the Agg with RO is greater than that with DO. That is because RO fully considers the worst situation of PV output, i.e., 80% of expected PV output in this paper, to cope with uncertain PV fluctuations in real time. Sufficient electricity can be guaranteed, even if the real-time PV fluctuations are the worst case. Although the RO method increases the total operation cost of the Agg, it greatly increases the robustness of Agg under the fluctuations of PV output.
The output of EV power with RO is more conservative compared to that with DO. EVs avoid large-scale charging and discharging behavior in the period of PV output, but reserve discharging power to fill the possible insufficient PV output centrally such as in the period of 07:00-09:00. It should be noted that there are not many parked EVs in the period of PV output, so the power of EVs is not greatly affected by the uncertain fluctuations of PV power, resulting in small changes to the power of EV.
To verify the accuracy and validity of the relaxation of the non-convex constraints in the real-time model, respective simulations are conducted for a convex quadratic programming (CQP) model with barriers from objective function and linear constraint (35), a mixed integer programming (MIP) model with original objective function (26) and non-linear constraint (27)-(34), and a contrastive MIP (CMIP) model with barriers from objective function in (35) and non-linear constraint (27)-(34). Simulation results from real-time operation using CQP, MIP, and CMIP models are shown in Table IV.
The objective values obtained by the CQP and CMIP models are identical for different EV numbers. It can be inferred that the constraints (27)-(34) and the constraint of (35) are equivalent with the same objective function in (35). The value of the objective function obtained by the MIP model is less than that obtained by the CQP and CMIP models. This is because the barrier terms in (35) cause the value of the objective to increase 10 times with the output of the EVs in this simulation. In fact, the objective function of the CQP model has no physical meaning. The term of physical significance in the objective function of (35) is the square of the tracking error, which reflects the value of the tracking error. It does not matter that the objective function values of the CQP and CMIP models are quite different from those of the MIP model, as the tracking error of the EVs obtained by the CQP model is small.
Moreover, we can obtain in the solution of the CQP model, which means that each EV has only one state of charging or discharging at each time step in the optimal solution, even if there are no specific constraints in the model. Hence, the accuracy and validity of the CQP model are verified.
The average solution time of the MIP and CMIP models are almost the same, whereas the average solution time of the CQP model is much shorter than that of the MIP and CMIP models for different numbers of EVs. The effect of accelerating the solving process in the CQP model is more evident as the number of EVs increases. This is because the 0-1 binary variables introduced by constraints (27)-(34) increase the number of decision variables in the process of solving, and the introduction of the 0-1 binary variables involves a branch-and-bound solving approach. This leads to a longer solution time, especially for the quadratic objective function in this paper. After establishing the CQP model, there is no binary variable, so the solving time of the CQP model is much shorter than that of both the MIP and CMIP models. As a real-time operation must be solved in a short time, the improvement of the solution speed is meaningful. And the real-time operation of large-scale aggregated EVs is allowed over a shorter time scale.

Fig. 7 Tracking error of Agg in real-time with or without rolling horizon optimization.
To illustrate the effects of the barrier factors on the real-time scheduling results, 100 EVs are respectively simulated using a series of barrier factors. Selected scenarios, with different values of barrier factors, are listed in Table V. To better demonstrate the controllability of the tracking error, it is assumed that the real-time dispatching has two stages: stage 1 is from 12:00 to 24:00, and stage 2 is from 24:00 to 12:00 the next day.
As the Agg needs to track the day-ahead scheduling power plan as accurately as possible to avoid extra costs in real-time operation, it is necessary to pay attention to the tracking error in the real-time process. The tracking errors of different scenarios are shown in

Fig. 8 of Agg in real-time operation. (a) Scenario A. (b) Scenario B. (c)Scenario C. (d) Scenario D.
The tracking errors of all scenarios are within during the majority of the time steps, even in scenario D. However, there are some tracking errors that exceed the expected range at approximately 14:45, 16:00-16:45 and 11:15-11:30 in all scenarios except scenario C. It is noted that these errors are all negative. Taking scenario B as an example, the real-time operation results for EV charging are shown in

Fig. 9 Real-time operation results of EV charging in scenario B.
Compared with the day-ahead scheduled power plan, there are not enough EVs to provide sufficient capacity for real-time operation in these periods. The Agg schedules almost all connected EVs to charge with rated power. Some EVs cannot be charged at rated power owing to SOC limitations, but it is still not enough to track the power plan, resulting in uncontrollable tracking errors. Naturally, there may be differences in the EV scheduling capacity between the real-time data and day-ahead forecast data, as EV owners are not completely obedient to the Agg. Thus, the above phenomenon is likely to occur when the obedience rate of EVs is low. In scenario C, the Agg reduces the dispatching power for each EV owing to large values of barrier factors, so the dispatching capacity is relatively sufficient. And the tracking errors of scenario C are within the expectations. Thus, it can be verified that the tracking error in this model is determined by the values of and when the dispatching capacity is sufficient.
A negative error means that the Agg imports more electricity in the day-ahead market than it actually consumes. In fact, this type of phenomenon is not accidental. To cope with the uncertainties of PV output, the Agg considers the worst case and imports a surplus amount of electricity in the day-ahead market, resulting in a negative error when the PV output is not in the worst case and the dispatching capacity of the EVs is insufficient. However, sufficient electricity can be ensured if the PV output is in the worst case. This strategy avoids the risk of the Agg in purchasing the electricity in the real-time electricity market when the dispatching capacity of EVs is insufficient.
The tracking accuracies obtained from the simulation results are shown in Table VI. With an increasing value of barrier factors, the tracking accuracy decreases. In all simulation scenarios, the tracking accuracies are higher than 95%. As a high tracking accuracy can be achieved in the real-time scheduling phase, the Agg can avoid being punished for the deviation between the day-ahead settlement and actual electricity consumption in all of the simulation scenarios.
To verify the effects of the barrier factors on each EV, the SOC of four randomly-selected EVs are compared and analyzed for scenario A and scenario C.

Fig. 10 SOC of each EV. (a) EV78. (b) EV38. (c) EV69. (d) EV94.
In actual operation, the values of and can be set to larger values which satisfy the requirements for tracking accuracy. To ensure tracking accuracy, the over-charging and over-discharging of EVs can be restrained, and the satisfaction of EV users participating in dispatching can be improved.
This paper presents a day-ahead and real-time energy management strategy for an Agg to manage internal sources under the uncertainties of PV output. In particular, a day-ahead RO model and a rolling horizon optimization based real-time convex optimization model are respectively established. Case studies validate that the day-ahead scheduling is robust. The economic operation of the Agg in real-time can be guaranteed, even if the PV output is in a worst-case scenario. The rolling horizon optimization based convex optimization in real-time operation is more efficient and convenient for determining the EV dispatching power, because of the relaxation of the non-convex constraints. The tracking error of the day-ahead scheduled power plan is controllable when the dispatching EV capacity is sufficient, and the convex optimization model can restrain the over-charging and over-discharging of EVs.
References
L. Hattam and D.V. Greetham, “Green neighbourhoods in low voltage networks: measuring impact of electric vehicles and photovoltaics on load profiles,” Journal of Modern Power Systems and Clean Energy, vol. 5, no. 1, pp. 105-116, Jan.2017. [百度学术]
S. Valero, M. Ortiz, C. Senabre et al., “Methods for customer and demand response policies selection in new electricity markets,” IET Generation, Transmission & Distribution, vol. 1, no. 1, pp. 104-110, Jan.2007. [百度学术]
S. P. Durrani, S. Balluff, L. Wurzer et al., “Photovoltaic yield prediction using an irradiance forecast model based on multiple neural networks,” Journal of Modern Power Systems and Clean Energy, vol. 6, no. 2, pp. 255-267, Mar.2018. [百度学术]
B. Khorramdel, C. Y. Chung, N. Safari et al., “A fuzzy adaptive probabilistic wind power prediction framework using diffusion kernel density estimators,” IEEE Transactions on Power Systems, vol. 33, no. 6, pp. 7109-7121, Nov.2018. [百度学术]
D. Arunima and D. Sanjoy, “Frequency regulation in deregulated market using vehicle-to-grid services in residential distribution network,” IEEE Systems Journal, vol. 12, no. 3, pp. 2812-2820, Sept. 2018. [百度学术]
Z. Yang, K. Li, Q. Niu et al., “A self-learning TLBO based dynamic economic/environmental dispatch considering multiple plug-in electric vehicle loads,” Journal of Modern Power Systems and Clean Energy, vol. 2, no. 4, pp. 298-307, Dec.2014. [百度学术]
M. Pantoš, “Stochastic optimal charging of electric-drive vehicles with renewable energy,” Energy, vol. 36, no. 11, pp. 6567-6576, Nov.2011. [百度学术]
C. Jin, J. Tang, and P. Ghosh. “Optimizing electric vehicle charging: a customer’s perspective,” IEEE Transactions on Vehicular Technology, vol. 62, no. 7, pp. 2919-2927, Sept. 2013. [百度学术]
S. Pirouzi, J. Aghaei, and V. Vahidinasab et al., “Robust linear architecture for active/reactive power scheduling of EV integrated smart distribution networks,” Electric Power Systems Research, vol. 155, pp. 8-20, Feb.2018. [百度学术]
J. Soares, Z. Vale, N. Borges et al., “Multi-objective robust optimization to solve energy scheduling in buildings under uncertainty,” in Proceedings of 19th International Conference on Intelligent System Application to Power Systems (ISAP), San Antonio, USA, Sept. 2017, pp. 1-6. [百度学术]
Q. Huang, Q. Jia, Z. Qiu et al., “Matching EV charging load with uncertain wind: a simulation-based policy improvement approach,” IEEE Transactions on Smart Grid, vol. 6, no. 3, pp. 1425-1433, May 2015. [百度学术]
N. Liu, Q. Chen, J. Liu et al., “A heuristic operation strategy for commercial building microgrids containing EVs and PV system,” IEEE Transactions on Industrial Electronics, vol. 62, no. 4, pp. 2560-2570, Apr.2015. [百度学术]
Q. Chen, F. Wang, B. Hodge et al., “Dynamic price vector formation model-based automatic demand response strategy for PV-assisted EV charging stations,” IEEE Transactions on Smart Grid, vol. 8, no. 6, pp. 2903-2915, Nov.2017. [百度学术]
R. Wang, P. Wang, G. Xiao et al., “Two-stage mechanism for massive electric vehicle charging involving renewable energy,” IEEE Transactions on Vehicular Technology, vol. 65, no. 6, pp. 4159-4171, Jun.2016. [百度学术]
H. Yang, H. Pan, F. Luo et al., “Operational planning of electric vehicles for balancing wind power and load fluctuations in a microgrid,” IEEE Transactions on Sustainable Energy, vol. 8, no. 2, pp. 592-604, Apr.2017. [百度学术]
N. Erdogan, F. Erden, and M. Kisacikoglu, “A fast and efficient coordinated vehicle-to-grid discharging control scheme for peak shaving in power distribution system,” Journal of Modern Power Systems and Clean Energy, vol. 6, no. 3, pp. 555-566, May 2018. [百度学术]
R. Jiang, M. Zhang, G. Li et al., “Two-stage robust power grid optimization problem,” in Proceedings of 62nd IIE Annual Conference and Expo, Orlando, USA, May 2012, pp. 885-893. [百度学术]
S. Hanif, H. B. Gooi, T. Massier et al., “Distributed congestion management of distribution grids under robust flexible buildings operations,” IEEE Transactions on Power Systems, vol. 32, no. 6, pp. 4600-4613, Nov.2017. [百度学术]
R. Xu, C. Zhang, Y. Xu et al., “Rolling horizon based multi-objective robust voltage/var regulation with conservation voltage reduction in high PV-penetrated distribution networks,” IET Generation, Transmission & Distribution, vol. 13, no. 9, pp. 1621-1629, May 2019. [百度学术]
G. Wenzel, M. Negrete-Pincetic, D. E. Olivares et al., “Real-time charging strategies for an electric vehicle aggregator to provide ancillary services,” IEEE Transactions on Smart Grid, vol. 9, no. 5, pp. 5141-5151, Sept. 2018. [百度学术]
B.Y. Liaw, M. Dubarry, V. Svoboda et al., “Capacity and power fading mechanism identification from a commercial cell evaluation,” Journal of Power Sources, vol. 165, no. 2, pp. 566-572, Mar.2007. [百度学术]
Z. Liu, Q. Wu, M. Shahidehpour et al., “Transactive real-time electric vehicle charging management for commercial buildings with PV on-site generation,” IEEE Transactions on Smart Grid, vol. 10, no. 5, pp. 4939-4950, Sept. 2019. [百度学术]