Enhanced Coordination Strategy for an Aggregator of Distributed Energy Resources Participating in the Day-Ahead Reserve Market

The integration of distributed energy resources (DERs), e.g., electric vehicles (EVs) and renewable distributed generation (DG), in the electrical distribution system (EDS) brings advantages to society, but also introduces technical challenges (e.g., overloading and voltage issues). A DER aggregator, which has agreements with DERs to manage their consumption/generation, could collaborate with the EDS operator to mitigate those technical challenges. Previous approaches have mainly focused on the aggregator’s strategy to manage demand, aiming at the maximization of profits. Therefore, methods to support the aggregator’s strategy need to be extended to facilitate the integration of renewable DG, leading to an enhanced coordination of DERs. This paper proposes a linear programming model for the aggregator’s coordination strategy to maximize its profit through the management of DERs and the participation in the day-ahead reserve market. The model uses EV charging control to provide up/down reserve and reduces its cost taking advantage of DG. The proposed mathematical model represents the daily EDS operation (hourly resolution) to enforce voltage and current magnitude constraints. A case study carried out in an unbalanced 34-bus EDS with 660 EVs, demonstrates that the application of the proposed method enhances the DER aggregator’s strategy, leading to better outcomes in both profits and EDS operation.


Introduction
The great dependence of fossil fuels to accomplish daily activities in the globalized world has become a significant matter in the last years. As a result, many efforts are taking place to promote the usage of clean energies in order to reduce greenhouse gas emissions [1]. To this end, a high share of various distributed energy resources (DERs), particularly solar photovoltaic (PV) generation and electric vehicles (EVs), has been integrated into electrical power systems. PV generation has become the world's fastest-growing energy technology. Indeed, the demand for solar PV is expanding as it becomes a competitive option for electricity generation [1].
Considering environmental aspects, the high dependence on fossil fuels and the consequent emission of greenhouse gases can be decreased by integrating EVs and PVs into the electric and transportation sectors [2]. however, the aggregator does not offer reserve services, it is only an agent responsible for the PEV charging coordination. A method that introduces the aggregator, designed as an intermediary agent between end users and the DNO was proposed in [32], considering EVs as responsive loads, whereby the aggregator is a managing agent that receives information related to EVs and can offer reserve energy. On the other hand, the aggregator makes a forecast of renewable generation to inform the DNO about the amount of energy available. However, it does not make any profit due to the selling of renewable energy.
Many researches consider the integration of PVs and EVs into the distribution system without offering reserve services to the transmission network operator (TNO). On the other hand, several approaches consider the aggregator as a coordinator of EV charging that can offer energy reserve services to the system using the EV batteries [23][24][25]. Nevertheless, those approaches do not consider the aggregator as a coordinator of both the EV charging and the energy generated by the renewable DG units, maintaining communication between the DNO and the owners and helping to keep the operating limits of the EDS. Moreover, scheduling reserves services through the EVs charging control are also disregarded. Table 1 shows a summary of the works addressing this topic. In contrast to them, the focus of this paper is considering the aggregator as a coordinating agent of both PVs and EVs, i.e., a DER aggregator (DERA). The main goal is to maximize the aggregator's profit by taking advantage of the energy produced from PV units, EV charging control, and by the participation in the day-ahead market offering reserve services. A linear programming model for unbalanced EDSs is proposed considering EV users' preferences and the offering of reserve services to the TNO. The main contributions of this work are as follows: • A new approach for the aggregator's strategy to coordinate DERs and participation in the day-ahead market with reserve services, while considering the operation of the unbalanced electrical distribution system. • A method that maximizes the aggregator's profit, while satisfying EVs owners' preference (energy for motion).

•
An EV charging coordination strategy that allows the sale of reserve services to the TNO, offering up and down reserve without affecting the energy required for transportation and guaranteeing a suitable operation of the distribution system.  [13] [15] [16] [17] [18] [19] [21] [22] [23] [24] [25] [26] [27] [30] [31] [32] This work The remaining part of this paper is organized as follows: Section 2 presents the aggregator problem and the mathematical formulation. Section 3 introduces the case study and results, followed by the conclusions in the last section.

Aggregator Problem and Mathematical Formulation
As discussed in the previous section, the uncontrolled charging of EVs can produce serious problems to the EDS. The EV charging becomes an issue when both the operating limits of the EDS and the EV users' energy preference (i.e., energy for motion) need to be guaranteed. In this context, the proposed method considers the aggregator as the main electrical agent, who will be responsible for offering a proper charging schedule to EV owners, i.e., energy required by trips is always expected to be met. Furthermore, EV owners will pay a fixed charging-service tax to the aggregator; nevertheless, the energy used to charge the batteries for transportation purposes will be paid to the DNO, i.e., the aggregator does not act as a retailer. The owners pay the aforementioned fixed charging-service tax to get the required energy for the trip; in return, the DERA can use the energy in the battery of EVs to participate in the reserve market.
Considering the above, the aggregator offers reserve services in the day-ahead market to the TNO using the philosophy of charging or stop charging the EV battery. This, in turn, avoids battery degradation issues related to vehicle-to-grid services. In addition, since the DERA has under its domain solar PVs and distributed generators, it can sell the energy provided by these DERs to any stakeholder, e.g., DNOs/TNOs, and increase its profit.

Aggregator and Interaction with the DNO and the TNO
The DNO sees the aggregator as an important agent that maintains the system operation through the charging coordination strategy proposed to EV owners. The aggregator ensures system stability and satisfies transport requirements. In order to avoid violations of operating limits in the EDS, grid constraints such as power balance, voltage and current magnitude limits, Kirchhoff's laws, and operating limits of renewable DG and PV units are taken into account in this formulation. With these mathematical considerations, the EDS is modeled as an unbalanced system, and the loads and circuits are modeled using a three-phase representation. This proposal focuses on the maximization of the aggregator's profit. However, the EDS has been included within the model to ensure a proper operation of the EDS. To this end, the aggregator will make sure that the contract signed with the EV owners and the EV charging scheduling guarantee a suitable operation of the EDS (i.e., operation of distribution assets within statutory limits). Moreover, the aggregator will ensure that enough energy is charged into the EV batteries so transportation requirements from EV owners are fulfilled.
The interaction between the DERA and the TNO is given by the reserve service that the former offers to the latter, especially in the reserve market. The reserve services are offered aiming at helping to maintain the security and supply of energy. Frequency regulation is required to maintain a certain amount of active power in reserve, establishing the balance between the load and the generation at all times. Thereupon, reserve services can be defined as the amount of available active power that has not been previously compromised [33]. The TNO sees the aggregator as a possible source of reserve services. Due to TNO's control obligations to maintain the reliable operation of the interconnected system, the reserve services can support the balance of energy flow and, therefore, maintain demand requirements. Thus, when demand exceeds generation, up reserve is called upon, and when generation exceeds demand, down reserve is called upon. The aggregator can take advantage of the unused active power of EVs (when it is not required for transportation) and present bids to the TNO in hourly basis for the next day in the reserve market [24]. Figure 1 shows the interaction of the aggregator with the electrical power system and the DERs. The charging control strategy performed by the aggregator is mathematically formulated as a non-linear programming problem (NLP) model. However, NLP models are highly complex to solve and pose scalability and tractability issues. Therefore, linearization techniques are used to transform the original problem into a linear programming model, which allows for the provision of good quality/optimal solutions within a reasonable computational time.

Objetive Function for the Aggregator Problem
The objective function maximizes the total aggregator's profit by taking into account the revenue for selling energy from renewable DG units to DNO/TNO or others stakeholders ( ), revenue for selling energy from dispatchable DG units ( ), revenue for offering reserve services to the TNO in the day-ahead reserve market ( ), and revenue for the EV charging control ( ). Although the aggregator has a profit due to the scheduling of the EV charging control, the charging costs must be assumed by the EVs owners and paid to the DNO. For this reason, the charging costs ( ) are considered within the objective function, as a way to minimize the EV owners' bill.
The calculations of those revenues and costs are presented in Equations (1)- (5). This set of equations is written in terms of the prices of services provided by the aggregator and the cost of energy in the spot market, the generation capacity of the DGs units, the up/down reserve capacity, and the charging power of the EV batteries. Thus, is the price per sale of energy supplied by PVs, is the price per sale of energy supplied by dispatchable DGs. The prices for the up and down reserve capacities are and , respectively. is the price that EV owners pay to the DERA for the charging control (a fixed payment). The cost of energy in the spot market is . , and , are the amount of power generated by PVs and DGs that will be sold by the DERA. and are the amount of power for up and down reserve that the DERA will offer in the dayahead reserve market.
The charging energy cost is represented by the difference between the energy charged in the EV batteries , ∆ and the energy programmed for up reserve , . The parameter in Equation (5) represents the probability of deployment of the offered reserve [25], i.e., the aggregator works with expected energies. If is equal to one, it means that all the reserve capacity that has been programmed by the DERA will be requested by the TNO. The charging control strategy performed by the aggregator is mathematically formulated as a non-linear programming problem (NLP) model. However, NLP models are highly complex to solve and pose scalability and tractability issues. Therefore, linearization techniques are used to transform the original problem into a linear programming model, which allows for the provision of good quality/optimal solutions within a reasonable computational time.

Objetive Function for the Aggregator Problem
The objective function maximizes the total aggregator's profit by taking into account the revenue for selling energy from renewable DG units to DNO/TNO or others stakeholders (R PV ), revenue for selling energy from dispatchable DG units (R DGS ), revenue for offering reserve services to the TNO in the day-ahead reserve market (R RS ), and revenue for the EV charging control (R CH ). Although the aggregator has a profit due to the scheduling of the EV charging control, the charging costs must be assumed by the EVs owners and paid to the DNO. For this reason, the charging costs (C Cp ) are considered within the objective function, as a way to minimize the EV owners' bill.
The calculations of those revenues and costs are presented in Equations (1)- (5). This set of equations is written in terms of the prices of services provided by the aggregator and the cost of energy in the spot market, the generation capacity of the DGs units, the up/down reserve capacity, and the charging power of the EV batteries. Thus, α pv t is the price per sale of energy supplied by PVs, α dg t is the price per sale of energy supplied by dispatchable DGs. The prices for the up and down reserve capacities are α Up t and α Dn t , respectively. α C f ix t is the price that EV owners pay to the DERA for the charging control (a fixed payment). The cost of energy in the spot market is γ cp t . P PV n,t and P DGS n,t are the amount of power generated by PVs and DGs that will be sold by the DERA. P RUp t and P RDn t are the amount of power for up and down reserve that the DERA will offer in the day-ahead reserve market.
The charging energy cost C Cp is represented by the difference between the energy charged in the EV batteries P EV v,t ∆ t and the energy programmed for up reserve E EVRup v,t . The parameter π d in Equation (5) represents the probability of deployment of the offered reserve [25], i.e., the aggregator works with expected energies. If π d is equal to one, it means that all the reserve capacity that has been programmed by the DERA will be requested by the TNO. (1) Therefore, the objective function is defined as:

Fundamental Constraints of the DNO
EDS operating constraints are taken into account to ensure a suitable operation of the distribution network, so the operation of the EDS is formulated using an unbalanced three-phase current-based formulation, as presented in [11]. Equations (7) and (8) represent the balance of the real and imaginary parts of the circuit currents, respectively. Equations (9) and (10) determine the currents demanded by the loads, while Equations (11) and (12) characterize the application of Kirchhoff's voltage law for each independent loop in the EDS (formed by each circuit). Constraints (13) and (14) represent the limits of the voltage magnitude and current capacity for each circuit, respectively.
P D n, f ,t = V re n, f ,t I Dre n, f ,t + V im n, f ,t I Dim n, f ,t ∀n, f , t Q D n, f ,t = −V re n, f ,t I Dim n, f ,t + V im n, f ,t I Dre n, f ,t ∀n, f , t

Aggregator's Coordination Strategy for the EV Charging Control and the Provision of Reserve Services
The EV charging coordination is carried out by the aggregator. However, the aggregator does not act as a commercial entity between the DNO and the EV owners. This means that the EV owners will pay for the energy used to charge the batteries for transportation purposes directly to the DNO. The aggregator only makes profits from the contracts made with the EV owners for offering an optimal and cost-effective charging strategy (i.e., a charging-service tax).
In this context, a contract between EV owners and the aggregator is signed, in which the owners commit to maintaining the controlled load profile; this type of profile comprises clients with known charging locations and time, and with a controllable charging rate [14]. Based on the EVCC approach presented in [11], the control strategy proposed here for the DERA assumes that the charging mode is at home, while satisfying the primary goal of the DERA, i.e., to guarantee enough energy for motion to the EV owners. The aggregator must constantly update information from the EV batteries, such as normal charge level, duration of the charging time, maximum charging rate, minimum charging status, and the electrical energy consumed by each EV. This can be achieved through bidirectional communication devices; this bidirectional communication refers to the preferences of charging and transportation from the EV owners to the aggregator and the charging strategy of the aggregator to the EV owners. Details of the communication structure required for this kind of implementations are described in [34].
On the other hand, the EV owners are committed to set a driving schedule for the current or following day, informing the minimum required SOC, the battery SOC required for the next trip, departure and arrival time, and the expected travel distance. With that information, the DERA can define the EV charging coordination by solving the mathematical model described in this section.
The aggregator can make profits by providing reserve services to the TNO via the charging control of the EV batteries. Reserve services offered by EVs include down and up reserve, and those services are known as secondary reserve in the day-ahead market [24]. The provision of up reserve could be achieved using bidirectional chargers, which allow the power injection to the grid through V2G enabled EVs (discharging mode). However, several studies have demonstrated that using the V2G mode to provide reserve services may reduce the batteries' life span [14,25].
The up-reserve provision is also possible via unidirectional charging, in which, instead of discharging the EV batteries, the charging process is interrupted (stop charging). In this paper, the up-reserve offering is considered via unidirectional charging aiming to avoid battery degradation issues. Thus, the DERA can stop the EV charging only if it has been previously scheduled, taking into consideration the energy required for transportation and the availability of the EV to offer this service.
In the case of the down reserve, the battery is charged to provide this service, taking into account the maximum battery energy level. EV owners get the energy required for transportation, while the aggregator may use the remaining energy in the battery to offer down reserve services.

Mathematical Modeling of the EV Charging Control and the Provision of Reserve Services
The set of Equations (15)- (28) represents the EV charging control and the reserve service in the day-ahead reserve market. These mathematical expressions allow the aggregator to schedule up and down reserve. However, before offers can be scheduled, it is necessary to meet the motion needs required by owners [21,25]. The powers for up and down reserves, offered by the aggregator in the reserve market, are represented by Equations (15) and (16), where the powers P RUp t and P RDn t are multiplied by the parameter π d to allow the reserve adjustment according to this probability. The active and reactive powers demanded by the EVs are defined by Equations (17) and (18). In those expressions, the real and imaginary parts of the voltage are V re n, f ,t and V im n, f ,t , n is the bus and f is the phase wherein the EV v is connected. The power limits for transportation and down reserve are established by Equation (19), and this limit is established by the charger power P CH v . The charging power demanded by the EV depends on the availability state, which is represented by the binary parameter ζ v,t (1 if the EV v is available for charging and 0 if is not connected to the system).
In (20), the energy stored in the first period is dependent on the initial SOC E SOC v , the power consumption of the EV P EV v,t , the energy required for motion E Trip v , and the motion schedule related to the binary parameter s v,t that indicates whether the EV is on a trip (s v,t = 1) or not (s v,t = 0). The expected energies for the up E EVRup v,t and down E EVRdn v,t reserves are taken into account in (20); since if the DERA charges the EV, this energy will affect the state of the battery. On the other hand, the aggregator will program up reserve only if the charging has been programmed; therefore, the expected energy for up reserve will also affect state of the battery.
The energy stored in every EV at each time interval is dependent on the previous state as indicated by Equation (21). Constraint (22) is added to limit the amount of charging power according to the battery capacity. The energy stored in the EV battery should be larger than the energy required for transportation, as established by Equation (23). Furthermore, the energy stored in each EV battery cannot exceed the minimum and maximum energy capacity, as indicated in Equation (24). If additional capacity is available in the battery, it can be used to provide down and up reserve services as shown in Equations (25) and (26). Constraint (27) limits the energy that can be offered for up reserve according to rated power of the charger and the EV availability. Finally, the DERA can only offer up reserve if the charging corresponding to the energy requirements of the EV (P EV v,t ) has been previously scheduled, as indicated by (28).
An example of using the energy of an EV battery to offer reserve services is illustrated in Figure 2.
The maximum charging power is P CH v = 4 kW and the energy capacity is E EV v = 24 kWh. Two periods are represented: t 5 and t 10 . The EV owner previously informed to the aggregator that he/she would make a trip, requiring E Trip v = 12 kWh, between t 6 and t 9 , i.e., the EV will be available for charging in t 10 . It is assumed that the EV energy before t 5 is E EV v,4 = 16 kWh and it is charged at P EV v,5 = 4 kW. Before starting the trip, the aggregator can use the additional capacity in the battery and charges the EV, offering down reserve E EVRdn v,5 = 4 kWh. On the other hand, in t 10 , the aggregator can schedule the charging (P EV v,10 = 4 kW) so the EV can be charged after the trip. Thus, it can also offer up reserve E EVRup v,10 = 4 kWh, stopping the charging if required by the TNO.

Mathematical Modeling of Dispachable and Renewable DG Units
The aggregator is able to control distributed generators, specifically PV units. Thus, the DERA can sell the energy generated by DG units to the DNO, TNO, or to any interested agent in the electricity market. The owners of the EVs controlled by the aggregator have also the opportunity to charge their cars using energy coming from DERs (green charging option). In that regard, the purchase of green energy could be considered as a way of showing commitment to the environmental problem, so although the energy produced by renewable DG units is more expensive, EV owners can decide if they are or not committed to climate change. Nowadays, there are many programs designed to compensate for the rapidly advancing environmental damage, for instance, Australian airline Qantas has an incentive program to compensate greenhouse gas emissions through a carbon-offset portfolio [35].

Mathematical Modeling of Dispachable and Renewable DG Units
The aggregator is able to control distributed generators, specifically PV units. Thus, the DERA can sell the energy generated by DG units to the DNO, TNO, or to any interested agent in the electricity market. The owners of the EVs controlled by the aggregator have also the opportunity to charge their cars using energy coming from DERs (green charging option). In that regard, the purchase of green energy could be considered as a way of showing commitment to the environmental problem, so although the energy produced by renewable DG units is more expensive, EV owners can decide if they are or not committed to climate change. Nowadays, there are many programs designed to compensate for the rapidly advancing environmental damage, for instance, Australian airline Qantas has an incentive program to compensate greenhouse gas emissions through a carbon-offset portfolio [35].
On the other hand, the charging of EVs with renewable resources will depend on the availability of EVs in the aggregator-controlled charging station, which in this proposal is at home, so the owners can charge the EVs with this type of energy only on days when the EV stays at home, and in times with high solar energy production. Regarding other stakeholders such as DNO or TNO, the energy generated by the PVs will be offered in the energy market and thus the aggregator will make profits by selling this energy.

Mathematical Representation of Dispatchable and Renewables DG Units
The expressions that represent the operation limits of the dispatchable DG units are represented by Equations (29)-(31), while Equations (32) and (33) correspond to the definition of the active and reactive power of the DG units.
The expressions related to the operation of the PVs are represented by Equations (34)- (38). The maximum available generation is set according to the generation levels in solar PV modules (34)-(36), while Equations (37) and (38) correspond to the definition of the active and reactive power of the PV units. On the other hand, the charging of EVs with renewable resources will depend on the availability of EVs in the aggregator-controlled charging station, which in this proposal is at home, so the owners can charge the EVs with this type of energy only on days when the EV stays at home, and in times with high solar energy production. Regarding other stakeholders such as DNO or TNO, the energy generated by the PVs will be offered in the energy market and thus the aggregator will make profits by selling this energy.

Mathematical Representation of Dispatchable and Renewables DG Units
The expressions that represent the operation limits of the dispatchable DG units are represented by Equations (29)-(31), while Equations (32) and (33) correspond to the definition of the active and reactive power of the DG units.
Q DG n,t ≤ P DG n,t * tan(arccos(p f n )) ∀n, t The expressions related to the operation of the PVs are represented by Equations (34)- (38). The maximum available generation is set according to the generation levels in solar PV modules (34)-(36), while Equations (37) and (38) correspond to the definition of the active and reactive power of the PV units.

Linearization of the Aggregator Problem Formulation
Equations (9) and (10), associated with the active and reactive powers of the loads, limits for voltage magnitude in Equation (13) and current magnitude in Equation (14), the active and reactive powers related to EVs (17) and (18), the active and reactive powers related to DG units in Equations (32) and (33), and the active and reactive powers related to PV units in Equations (37) and (38), are nonlinear expressions. In this section, these equations will be linearized, in order to obtain a linear programming problem.

Linearization of the Load Currents
Equations (9) and (10) that represent the active and reactive power related to the loads can be expressed in terms of the power, voltage, and current for the load as shown in Equations (39) and (40), in which g and h are nonlinear functions of the real and imaginary parts of the voltage.
Expressions (39) and (40) can be linearized using an estimated operation point (V re * n, f ,t , V im * n, f ,t ), as shown in Equations (41) and (42). This is possible because of the small and limited range variation of the voltage magnitude in EDSs. The quality of the estimated operation point will define the approximation error.

Linearization of the Voltage Magnitude Limits
The voltage magnitude limit in each node of the system, given by (13), also presents nonlinear terms. However, it can be transformed into linear expressions using the set of constraints (43)-(47) considering that the phase angle variation around the reference voltage for each phase in the EDS is small. Constraints (43)-(47) represent the voltage limit specifically for phase A. Those constraints allow the variation of the voltage magnitudes between [V, V] and the phase angles between [θ f − θ 1 , θ f + θ 2 ] as detailed explained in [36]. The vector [0 • , +120 • , −120 • ] represents the reference phase angles θ for all phases (i.e., A, B, and C); θ 1 and θ 2 are the maximum negative and the maximum positive deviation of the phase angle around the reference for each phase. Similar expressions are used to linearize the limits of the voltage magnitude for the other phases B and C.

Linearization of the Current Magnitude Limits
The nonlinear expression for the current magnitude limit in (14) is linearized through the set of Equations (48)-(57) [11]. The terms , where σ mm,λ and δ mn are constant parameters, as defined by Equations (56) and (57).

Linearization of the Active and Reactive Powers of DERs
The active and reactive powers of the EVs represented by Equations (17) and (18), active and reactive powers of the DG units in Equations (32) and (33), and active and reactive powers of the PV units in Equations (37) and (38) are approximated using an estimated operation point V re * n, f ,t , V im * n, f ,t , as shown in Equations (58)-(63).
The proposed linear programming model considers the constraints of the EDS, the equations related to the operation of the DERs and the reserve offers. As a variation of the MILP for the EVCC problem presented in [11], in this proposal, the binary variables were eliminated, considering continuous power enabled charges. Classical optimization techniques were applied and the ideal solution to the aggregator problem can be guaranteed, as will be shown in the next section.

Case Study
The effectiveness of the method proposed is verified considering different test cases in a 34-bus EDS with the DERA controlling 660 EVs and renewable DG units, as well as participating in the day-ahead reserve market. The model has been implemented in AMPL [37] and solved via the commercial solver CPLEX [38], using a computer with an Intel i7-7770 processor. To validate the performance of the proposed cases, two intervals for charging control and offering of reserve services have been considered, namely ∆ t = 1 h and ∆ t = 0.5 h. The time for the solution process was 16 s for ∆ t =1 h and 34 s for ∆ t = 0.5 h. The test cases and the results are discussed below.

Test System
The proposed model is tested in a 34-bus distribution system with a medium-voltage (MV) level of 24.9 kV and a low-voltage level (LV) of 220 V [39]. The system frequency is 60 Hz. The limits for the maximum and minimum voltage magnitude were defined as 1.00 and 0.90 p.u., respectively. The voltage magnitude at the substation was fixed at 1 p.u. The parameter λ was set at 10, while I mn was 500 A for all feeders. The parameters θ 1 and θ 2 were 5 • and 3 • , respectively. A three-phase EDS with secondary networks connected through medium-voltage level nodes is considered for the system representation, as shown in Figure 3. Figure 4 illustrates the topology of each secondary network, which is connected at a medium-voltage node through a MV/LV transformer represented by "xx". The test system has 33 secondary networks connected at the MV nodes of the 34-bus distribution system.
The proposed linear programming model considers the constraints of the EDS, the equations related to the operation of the DERs and the reserve offers. As a variation of the MILP for the EVCC problem presented in [11], in this proposal, the binary variables were eliminated, considering continuous power enabled charges. Classical optimization techniques were applied and the ideal solution to the aggregator problem can be guaranteed, as will be shown in the next section.

Case Study
The effectiveness of the method proposed is verified considering different test cases in a 34-bus EDS with the DERA controlling 660 EVs and renewable DG units, as well as participating in the dayahead reserve market. The model has been implemented in AMPL [37] and solved via the commercial solver CPLEX [38], using a computer with an Intel i7-7770 processor. To validate the performance of the proposed cases, two intervals for charging control and offering of reserve services have been considered, namely = 1 h and = 0.5 h. The time for the solution process was 16 s for =1 h and 34 s for = 0.5 h. The test cases and the results are discussed below.

Test System
The proposed model is tested in a 34-bus distribution system with a medium-voltage (MV) level of 24.9 kV and a low-voltage level (LV) of 220 V [39]. The system frequency is 60 Hz. The limits for the maximum and minimum voltage magnitude were defined as 1.00 and 0.90 p.u., respectively. The voltage magnitude at the substation was fixed at 1 p.u. The parameter λ was set at 10, while was 500A for all feeders. The parameters 1 and 2 were 5° and 3°, respectively. A three-phase EDS with secondary networks connected through medium-voltage level nodes is considered for the system representation, as shown in Figure 3. Figure 4 illustrates the topology of each secondary network, which is connected at a medium-voltage node through a MV/LV transformer represented by "xx". The test system has 33 secondary networks connected at the MV nodes of the 34-bus distribution system.    Figure 4. Topology of each LV network.

EVs and Reserve Services
The energy capacity of EV batteries is 22.8 kWh with a maximum charging power rate of 3.3 kW [40]. It is estimated that the is updated in each initial period of charging control through communication devices. The aggregator has a contract with 660 EV owners. The values of the initial SOC of the battery vary within a range of 13-30%. EVs are connected to the secondary network, at nodes xx01-xx20 as shown in Figure 4.
It is assumed that the EVs are connected uniformly among the phases of the EDS. In order to participate in the day-ahead reserve market, the aggregator may present hourly bids for the 24 h of the next day. Market prices are taken from [25].

Renewable DG Units
The aggregator can control two dispatchable DG units, which are connected at nodes 10 and 22. The aggregator sells the energy produced by DG units to the DNO/TNO or other stakeholders on the spot market at a cost of 0.036 $/kWh. The maximum active power of these units is 500 kW, and the minimum and maximum reactive power is equal to −200 and 200 kVAr. The minimum power factor for the operation of the DG units is 0.90. In the case of PV units, the aggregator offers renewable energy of 10 units at a price that varies according to the availability of generation [41]. PVs are connected at nodes 07, 11,13,17,23,25,27,29,31, and 33 of the MV network. In addition, their maximum active power is defined as 500 kW, and the minimum and maximum reactive power are −200 and 200 kVAr. The minimum power factor for the operation of the PVs units is 0.90.

Test Cases
Four test cases have been proposed to validate the performance of the proposed method:  Case I: EV charging coordination and offering of reserve services during a weekday with ∆ = 1ℎ, in which it is assumed that the EVs are only available for charging at home between 18:00 h and 07:00 h.  Case II: EV charging coordination and offering of reserve services during a weekend day with ∆ = 1ℎ, assuming that most of the owners use their EVs two hours in the morning and two hours at night; therefore, the charging control and reserve service offerings are done between 01:00 h and 06:00 h, 09:00 h and 15:00 h, and 18:00 h and 06:00.  Case III: EV charging coordination and offering of reserve services during a weekday with ∆ = 0.5ℎ; similar to Case I, which allows studying the scalability of the method.  Case IV: EV charging coordination and offering of reserve services during a weekend day with ∆ = 0.5ℎ, similar to Case II, which allows studying the scalability of the method. Table 2 summarizes, for each case, the control charging and offering of reserve services that the DERA performs. For the tests during a weekday, it has been assumed that the EVs will be unavailable or on trips between 7:00 h and 18:00 h. During this period, the DERA will not be able to carry out EV charging control or schedule reserve services. In the case of tests during the weekend, it has been

EVs and Reserve Services
The energy capacity of EV batteries is 22.8 kWh with a maximum charging power rate of 3.3 kW [40]. It is estimated that the E SOC v is updated in each initial period of charging control through communication devices. The aggregator has a contract with 660 EV owners. The values of the initial SOC of the battery vary within a range of 13-30%. EVs are connected to the secondary network, at nodes xx01-xx20 as shown in Figure 4.
It is assumed that the EVs are connected uniformly among the phases of the EDS. In order to participate in the day-ahead reserve market, the aggregator may present hourly bids for the 24 h of the next day. Market prices are taken from [25].

Renewable DG Units
The aggregator can control two dispatchable DG units, which are connected at nodes 10 and 22. The aggregator sells the energy produced by DG units to the DNO/TNO or other stakeholders on the spot market at a cost of 0.036 $/kWh. The maximum active power of these units is 500 kW, and the minimum and maximum reactive power is equal to −200 and 200 kVAr. The minimum power factor for the operation of the DG units is 0.90. In the case of PV units, the aggregator offers renewable energy of 10 units at a price that varies according to the availability of generation [41]. PVs are connected at nodes 07, 11, 13, 17, 23, 25, 27, 29, 31, and 33 of the MV network. In addition, their maximum active power is defined as 500 kW, and the minimum and maximum reactive power are −200 and 200 kVAr. The minimum power factor for the operation of the PVs units is 0.90.

Test Cases
Four test cases have been proposed to validate the performance of the proposed method:

•
Case I: EV charging coordination and offering of reserve services during a weekday with ∆t = 1 h, in which it is assumed that the EVs are only available for charging at home between 18:00 h and 07:00 h.

•
Case II: EV charging coordination and offering of reserve services during a weekend day with ∆t = 1 h, assuming that most of the owners use their EVs two hours in the morning and two hours at night; therefore, the charging control and reserve service offerings are done between 01:00 h and 06:00 h, 09:00 h and 15:00 h, and 18:00 h and 06:00.

•
Case III: EV charging coordination and offering of reserve services during a weekday with ∆t = 0.5 h; similar to Case I, which allows studying the scalability of the method.

•
Case IV: EV charging coordination and offering of reserve services during a weekend day with ∆t = 0.5 h, similar to Case II, which allows studying the scalability of the method. Table 2 summarizes, for each case, the control charging and offering of reserve services that the DERA performs. For the tests during a weekday, it has been assumed that the EVs will be unavailable or on trips between 7:00 h and 18:00 h. During this period, the DERA will not be able to carry out EV charging control or schedule reserve services. In the case of tests during the weekend, it has been assumed that EVs will be on trips between 7:00 h and 8:00 h (in the morning) and between 15:00 h and 16:00 h (in the afternoon). In this case, the proposed method is evaluated considering 660 EVs under contract with the aggregator charging their batteries at home, and during the period between 18:00 h and 7:00 h. The aggregator's total profit from renewable energy supply, reserve services sales and charging control is $1362.60, the amount of power for up and down reserve offered by the aggregator is 19.99 MW and 10.18 MW respectively. The charging behavior of EVs is illustrated using EV #4. Figure 5 shows the EV charging scheduling as well as the offers for up and down reserve. In this case, note that at 2:00 h the EV charges but the aggregator sets the charging power to provide down and up reserve. The maximum charging power is 3.3 kW. Then, as the aggregator controls the EV charging, the EV charges at 0.4 kW to meet energy requirements for motion, this charging power is achieved by taking advantage of down reserve, while the aggregator uses the remaining 2.9 kW to offer up reserve on the day-ahead market. Note that the maximum energy of the EV is never exceeded and the EV always achieves the energy needed for transportation. The SOC values of the first 14 EVs are shown in Figure 6. The aggregator coordinates the charging in such a way that the EVs achieve the energy needed for transportation before leaving home, which occurs in this test at 7:00 h, with approximately 80% of SOC. After the trip, the SOC drops due to the energy consumption during the trip. Thus, at 18:00 h, the EVs have SOC values above 30%, while at the end of the charging horizon, the EVs reach an SOC of 35%.
Energies 2020, 13, x FOR PEER REVIEW 14 of 22 assumed that EVs will be on trips between 7:00 h and 8:00 h (in the morning) and between 15:00 h and 16:00 h (in the afternoon). In this case, the proposed method is evaluated considering 660 EVs under contract with the aggregator charging their batteries at home, and during the period between 18:00 h and 7:00 h. The aggregator's total profit from renewable energy supply, reserve services sales and charging control is $1362.60, the amount of power for up and down reserve offered by the aggregator is 19.99 MW and 10.18 MW respectively. The charging behavior of EVs is illustrated using EV #4. Figure 5 shows the EV charging scheduling as well as the offers for up and down reserve. In this case, note that at 2:00 h the EV charges but the aggregator sets the charging power to provide down and up reserve. The maximum charging power is 3.3 kW. Then, as the aggregator controls the EV charging, the EV charges at 0.4 kW to meet energy requirements for motion, this charging power is achieved by taking advantage of down reserve, while the aggregator uses the remaining 2.9 kW to offer up reserve on the day-ahead market. Note that the maximum energy of the EV is never exceeded and the EV always achieves the energy needed for transportation. The SOC values of the first 14 EVs are shown in Figure  6. The aggregator coordinates the charging in such a way that the EVs achieve the energy needed for transportation before leaving home, which occurs in this test at 7:00 h, with approximately 80% of SOC. After the trip, the SOC drops due to the energy consumption during the trip. Thus, at 18:00 h, the EVs have SOC values above 30%, while at the end of the charging horizon, the EVs reach an SOC of 35%.   In this test, the total profit of the aggregator has been improved. The fact that the aggregator takes control of DERs in a larger time-resolution allowed for higher profits, obtaining a total of $2215. 40 In this test, the capacities for up and down reserves have been increased: 33.14 MW for up reserve and 13.26 MW for down reserve, so the DERA can offer more reserve services during the weekend and increase the availability of services for the TNO. The energy of battery is maintained within the limits as shown in Figure 7. Figure 8 shows that, at 16:00 h, EVs have an SOC above 70%, since the DERA has controlled the charging in such a way that the batteries have enough energy for the return trip, which in this case occurs at 17:00 h. The aggregator offers renewable energy from PVs to DNO/TNO, EVs and other stakeholders. In this case, Figure 9 shows the charging behavior of 660 EVs and the generation of the PV units controlled by the DERA. Note the that the power that the PV units can inject in the weekend is higher due to the larger load (conventional and from EVs) in that period. So, EV owners at home during the day, can consume the energy generated by PV units. For those customers interested in clean energy, the DERA can offer this energy and show commitment to environmental issues. On the other hand, the power consumed by the EVs increases over the weekend and follows a ratio with the power generated by the PVs.  In this test, the total profit of the aggregator has been improved. The fact that the aggregator takes control of DERs in a larger time-resolution allowed for higher profits, obtaining a total of $2215.40 in this test, the capacities for up and down reserves have been increased: 33.14 MW for up reserve and 13.26 MW for down reserve, so the DERA can offer more reserve services during the weekend and increase the availability of services for the TNO. The energy of battery is maintained within the limits as shown in Figure 7. Figure 8 shows that, at 16:00 h, EVs have an SOC above 70%, since the DERA has controlled the charging in such a way that the batteries have enough energy for the return trip, which in this case occurs at 17:00 h. The aggregator offers renewable energy from PVs to DNO/TNO, EVs and other stakeholders. In this case, Figure 9 shows the charging behavior of 660 EVs and the generation of the PV units controlled by the DERA. Note the that the power that the PV units can inject in the weekend is higher due to the larger load (conventional and from EVs) in that period. So, EV owners at home during the day, can consume the energy generated by PV units. For those customers interested in clean energy, the DERA can offer this energy and show commitment to environmental issues. On the other hand, the power consumed by the EVs increases over the weekend and follows a ratio with the power generated by the PVs. In this test, the total profit of the aggregator has been improved. The fact that the aggregator takes control of DERs in a larger time-resolution allowed for higher profits, obtaining a total of $2215. 40 In this test, the capacities for up and down reserves have been increased: 33.14 MW for up reserve and 13.26 MW for down reserve, so the DERA can offer more reserve services during the weekend and increase the availability of services for the TNO. The energy of battery is maintained within the limits as shown in Figure 7. Figure 8 shows that, at 16:00 h, EVs have an SOC above 70%, since the DERA has controlled the charging in such a way that the batteries have enough energy for the return trip, which in this case occurs at 17:00 h. The aggregator offers renewable energy from PVs to DNO/TNO, EVs and other stakeholders. In this case, Figure 9 shows the charging behavior of 660 EVs and the generation of the PV units controlled by the DERA. Note the that the power that the PV units can inject in the weekend is higher due to the larger load (conventional and from EVs) in that period. So, EV owners at home during the day, can consume the energy generated by PV units. For those customers interested in clean energy, the DERA can offer this energy and show commitment to environmental issues. On the other hand, the power consumed by the EVs increases over the weekend and follows a ratio with the power generated by the PVs.    This case was proposed to verify the model scalability when offering reserve services (up and down reserve services). In this test, the total profit of the aggregator was $1370.93, the profit per sale of reserve services was $135.776. The powers for up and down reserve were 19.6 MW and 10.6 MW, so the proposed model manages to keep the supply of reserve services still decreasing the time delta. Figure 10 shows detailed information on EV #4. Note that DERA has no control over EVs between 7:00 h and 18:00 h. In this time window, the aggregator cannot offer reserve services in the day-ahead market, but the control strategy ensures that the powers for up and down reserve continue to be offered, guaranteeing an almost fixed amount of MW, regardless of the control periods (during weekends or during a weekday).  This case was proposed to verify the model scalability when offering reserve services (up and down reserve services). In this test, the total profit of the aggregator was $1370.93, the profit per sale of reserve services was $135.776. The powers for up and down reserve were 19.6 MW and 10.6 MW, so the proposed model manages to keep the supply of reserve services still decreasing the time delta. Figure 10 shows detailed information on EV #4. Note that DERA has no control over EVs between 7:00 h and 18:00 h. In this time window, the aggregator cannot offer reserve services in the day-ahead market, but the control strategy ensures that the powers for up and down reserve continue to be offered, guaranteeing an almost fixed amount of MW, regardless of the control periods (during weekends or during a weekday). This case was proposed to verify the model scalability when offering reserve services (up and down reserve services). In this test, the total profit of the aggregator was $1370.93, the profit per sale of reserve services was $135.776. The powers for up and down reserve were 19.6 MW and 10.6 MW, so the proposed model manages to keep the supply of reserve services still decreasing the time delta. Figure 10 shows detailed information on EV #4. Note that DERA has no control over EVs between 7:00 h and 18:00 h. In this time window, the aggregator cannot offer reserve services in the day-ahead market, but the control strategy ensures that the powers for up and down reserve continue to be offered, guaranteeing an almost fixed amount of MW, regardless of the control periods (during weekends or during a weekday). In this case, the offers for up and down reserve were 32.4 MW and 13.94 MW, respectively. The aggregator's profit for selling renewable energy was $1548.04 and $177.57 for selling reserve services. Note that the power reserves are very close to those found in Case II (with ∆ = 1ℎ), which indicates that there is not a significant improvement when a smaller time interval is adopted.
The operation of the EDS is initially verified under an uncontrolled EV charging scenario. Figure  11 shows the minimum and maximum voltages of the system in each time interval for Case I, without considering the charging coordination strategy of the DERA. Note that, under this scenario, voltage magnitude violations cannot be avoided. Similar results were observed for the other cases.
To validate the proper operation of the DNO during the control of the DERA, the minimum and maximum voltages in each time interval for the four Cases are presented in Figure 12; Figure 13. Note that during the operation of the proposed strategy, the voltage limits never are violated, always staying within the statutory limits. Finally, Table 3 presents a summary of the aggregator profits for each case. All profits are calculated on the day-ahead market and the charge control aggregator profit is always equal because the number of contracted EVs is fixed.  The aggregator's profit for selling renewable energy was $1548.04 and $177.57 for selling reserve services. Note that the power reserves are very close to those found in Case II (with ∆t = 1 h), which indicates that there is not a significant improvement when a smaller time interval is adopted.
The operation of the EDS is initially verified under an uncontrolled EV charging scenario. Figure 11 shows the minimum and maximum voltages of the system in each time interval for Case I, without considering the charging coordination strategy of the DERA. Note that, under this scenario, voltage magnitude violations cannot be avoided. Similar results were observed for the other cases. In this case, the offers for up and down reserve were 32.4 MW and 13.94 MW, respectively. The aggregator's profit for selling renewable energy was $1548.04 and $177.57 for selling reserve services. Note that the power reserves are very close to those found in Case II (with ∆ = 1ℎ), which indicates that there is not a significant improvement when a smaller time interval is adopted.
The operation of the EDS is initially verified under an uncontrolled EV charging scenario. Figure  11 shows the minimum and maximum voltages of the system in each time interval for Case I, without considering the charging coordination strategy of the DERA. Note that, under this scenario, voltage magnitude violations cannot be avoided. Similar results were observed for the other cases.
To validate the proper operation of the DNO during the control of the DERA, the minimum and maximum voltages in each time interval for the four Cases are presented in Figure 12; Figure 13. Note that during the operation of the proposed strategy, the voltage limits never are violated, always staying within the statutory limits. Finally, Table 3 presents a summary of the aggregator profits for each case. All profits are calculated on the day-ahead market and the charge control aggregator profit is always equal because the number of contracted EVs is fixed.  To validate the proper operation of the DNO during the control of the DERA, the minimum and maximum voltages in each time interval for the four Cases are presented in Figure 12; Figure 13. Note that during the operation of the proposed strategy, the voltage limits never are violated, always staying within the statutory limits. Finally, Table 3 presents a summary of the aggregator profits for each case. All profits are calculated on the day-ahead market and the charge control aggregator profit is always equal because the number of contracted EVs is fixed.

Conclusions
An optimization approach for the coordination strategy of a distributed energy resource aggregator (DERA), which maximizes its profit, has been proposed in this paper. The profits of the DERA are obtained via the charging coordination of electric vehicles (EVs), the selling of energy from dispatchable and renewable distributed generation (DG) units, particularly solar photovoltaic, and the participation in the day-ahead market offering reserve services. The proposed method makes it possible to find an optimal DERA control strategy in which the amount of power generated by the DG units will be available to those EV users who are committed to climate change.
A linear programming model was developed to define the EV charging strategy, which allows the offering of up and down reserves whilst guaranteeing enough energy for the motion of the EV and without affecting the minimum and maximum energy level in the batteries. The aggregator strategy for participation in the reserve service market ensures that, even with different EV owner's preferences or periods of control, the aggregator adjusts the strategy to maintain competitiveness in the day-ahead market.
The tests carried out in a 34-bus distribution system make it possible to conclude that the proposed method is efficient, allowing for the definition of a strategy for the aggregator that

Conclusions
An optimization approach for the coordination strategy of a distributed energy resource aggregator (DERA), which maximizes its profit, has been proposed in this paper. The profits of the DERA are obtained via the charging coordination of electric vehicles (EVs), the selling of energy from dispatchable and renewable distributed generation (DG) units, particularly solar photovoltaic, and the participation in the day-ahead market offering reserve services. The proposed method makes it possible to find an optimal DERA control strategy in which the amount of power generated by the DG units will be available to those EV users who are committed to climate change.
A linear programming model was developed to define the EV charging strategy, which allows the offering of up and down reserves whilst guaranteeing enough energy for the motion of the EV and without affecting the minimum and maximum energy level in the batteries. The aggregator strategy for participation in the reserve service market ensures that, even with different EV owner's preferences or periods of control, the aggregator adjusts the strategy to maintain competitiveness in the day-ahead market.
The tests carried out in a 34-bus distribution system make it possible to conclude that the proposed method is efficient, allowing for the definition of a strategy for the aggregator that

Conclusions
An optimization approach for the coordination strategy of a distributed energy resource aggregator (DERA), which maximizes its profit, has been proposed in this paper. The profits of the DERA are obtained via the charging coordination of electric vehicles (EVs), the selling of energy from dispatchable and renewable distributed generation (DG) units, particularly solar photovoltaic, and the participation in the day-ahead market offering reserve services. The proposed method makes it possible to find an optimal DERA control strategy in which the amount of power generated by the DG units will be available to those EV users who are committed to climate change.
A linear programming model was developed to define the EV charging strategy, which allows the offering of up and down reserves whilst guaranteeing enough energy for the motion of the EV and without affecting the minimum and maximum energy level in the batteries. The aggregator strategy for participation in the reserve service market ensures that, even with different EV owner's preferences or periods of control, the aggregator adjusts the strategy to maintain competitiveness in the day-ahead market.
The tests carried out in a 34-bus distribution system make it possible to conclude that the proposed method is efficient, allowing for the definition of a strategy for the aggregator that simultaneously increases profits, contributes to guarantee the operation of the electrical distribution system, and satisfies the charging requirements for the motion of the EVs.
In the future, the authors intend to implement the strategy for the aggregator by adding real characteristics related to EVs' uncertain behavior, considering response to EV demand, stochastic programming, and participation in the real-time reserve market. Moreover, additional technical aspects, such as load balancing and system stability, could be included as services provided by the DERA upon agreement with the DNO/TNO to increase its profit and improve the power system operation.   Binary parameter corresponding to the state of EV v, 1 when the EV v is on trip and 0 otherwise.
ζ v,t Binary parameter corresponding to the availability for charging of EV v, 1 when the EV v can charge the battery and 0 otherwise. ∆ t Duration of the time interval t. δ mn Discretization step for the current of circuit mn. λ Number of blocks of the square current piecewise linearization. θ Vector of reference phase angles. θ 1 Maximum negative deviation of phase angles.