A Constrained Programming Based Algorithm for Optimal Scheduling of Aggregated EVs Power Demand in Smart Buildings

In this paper, a novel cooperative charging strategy for electric vehicles tuned by a constraint programming algorithm has been proposed. The implemented model handles heterogeneous and large-scale residential areas by not only reducing the EV peak charging load, but also improving the user satisfaction levels. The evaluation of the capability of the proposed model at both individual and aggregated levels is considered through various scenarios. The simulated results prove the potential of the proposed cooperative EV strategy in outperforming the uncoordinated EV charging model in terms of peak-to-average ratio reduction, user satisfaction level, and load factor improvement in addition to the suppression of the peak load increase. Furthermore, comparative analysis with existing models shows that the proposed algorithm can manage more complex policies and is performed significantly and efficiently.


I. INTRODUCTION
T HE major challenge of renewable energy integration is to control the intermittent power generation as much as possible under the hazard of continuously and short-term changing weather conditions (minutes or seconds). Demandside management (DSM) is a technique for balancing the electric power system by adjusting energy demand to match available electrical supply [1]. Demand response (DR) is a process of DSM that alleviates grid supply by providing an opportunity for users to take part in the power grid management by selectively reducing or shifting their smart loads in response to electricity pricing rates and ancillary service stress states [2]. Various DR methods and surveys are presented in the literature [3]- [5]. Direct load control (DLC) in the residential sector is the most widely discussed DR method for scheduling aggregated power of a group of participants [6], in which the utility remotely switches off electrical loads based on user preferences, such as electric water heaters (EWH), heating, ventilation and air-conditioning (HVAC) unit, clothes dryer system (CD), and electric vehicle(EV). As electric vehicles (EVs) present a great rate in the personal transportation market [7], EV load can be modeled as critical load (controllable), which could be shifted to alternative time periods to reach different goals [8]. Their uncoordinated charging behaviors will have a major negative impact on the power quality, the resiliency, and economics of the distribution grid [9] e.g. significant transformer overloading, indie circuit faults, and potential feeder congestion. Hence, the impact of EV charging on the infrastructure of the electric power system has been evaluated in multiple studies, and can be commonly outlined in two main effects: improving the shape of the energy demand profile (e.g. minimizing the peak load, and PAR) [10], or using the EV as a distributed energy storage appliance that could supply the electricity demand to user buildings or to the grid during on-peak periods to minimize energy bills and losses [11], [12]. Both contributions can significantly impact electricity generation, transmission, as well as distribution systems [9]. In the present study, the focus is on the reducing of the peak load, and PAR.
In the literature, the control of EV charging strategies is divided into three main groups: clustering, forecasting, and scheduling [13]. Their common objective is to reduce the impact of high EV charging penetration at the distribution level. Clustering approaches are used to examine the profiles of EV charging demand and data mining. In particular, it is based on gathering the corresponding daily demand profiles into identical clusters. Moreover, clustering methods are used to generate demand profiles that group consumer requirements based on their similarities [13], [14]. Forecasting methods have also been used for EV charging management and monitoring [15], [16]. Generally, it depends on the time horizon. Short-time strategies are applied for EV charging forecasting within one week to one year, mediumterm strategies are applied for EV charging forecasting within one week to one year, or long-term EV charging models that concern one year to many years of applications [17]. In the literature, substantial research has been addressed on scheduling methods for EV charging control tasks [18]- [20]. Generally, studies for multiple EV charging schedules are divided into centralized cooperative mechanisms [21], [22], and decentralized cooperative mechanisms [23], [24]. In one way, in the centralized schemes, the EV charging process of each participant is executed directly by the charging system manager. Therefore, the manager collects the charging data (charging time and rate) and sets a universal plan to arrange the EV charging operation. In [25], the authors employed a fuzzy control algorithm to smooth load profile and consider smart charging of EVs in the parking. The proposed scheduling minimized the transformer peak load, and smooth the load profile in a centralized manner. However, the high computational complexity of the model makes it incapable of handling large-scale EV charging coordination. The work presented in [22] proposed a hierarchical charging control of electric vehicles to ensure consumers' trip necessities. An optimal power allocation for a look-ahead time is developed based on the grid service's needs. The results demonstrate a reduction in computational complexity and communication levels compared with existing methods. While a coordinated stochastic optimization for system travel is envisioned in future works. Another centralized coordination of EV charging schemes through various aggregators is presented in [21]. Simulation results demonstrate electricity cost minimization and peak load control. On the other hand, in the decentralized cooperative strategies, each signal consumer determines its EV charging rate based on the local load controlled by the control operation center. Unlike centralized schemes, each owner is allowed to improve its system benefits without the need for a central operator [24], [26]. In our previous works [27]- [29], the impact of demand-side management strategies were evaluated for all home appliances. Although the economic aspects and profile of power systems were largely evaluated and effectively achieved, customer comfort was not taken into consideration. Therefore, the present study is conducted to analyze specifically the impact of EV load on the whole demand profile, including the user's satisfaction level.
Evs' charging strategies were presented in various works in the literature in which an optimal charging rate of each EV is adopted [30]- [34]. Dogan,Ahmet,et al.,in [30] present how the charging strategies of EVs are impacting the increase of peak load and improvement of load factor at a distribution network level. For this, the authors investigate the different EV penetration levels and charging modes to analyze the effectiveness of the proposed strategies. The resulting simulation demonstrated a negative impact on the peak load increase. Moreover, the EV charging protocol considered neither even a coordinated scheme, nor an optimization model. Jang, Han Seung, et al., proposed in [31] a coordinated approach for EV charging in large-scale residential areas in order to maintain a common profit in total power consumption. However, the study did not include the effect of different EV penetration rates on solving the scheduling charging problem. Despite the fact that the works presented in [30], [31]demonstrate significant performance, system contributions were considered simple protocols, because they did not propose realistic and complex policies when EV penetration did not exceed 50% of the total areas. Consequently, this does not guarantee that the proposed strategy performs well with 100% of the EV penetration level. In other words, when all consumers possess their own EV, this will yield to increase the computational complexity of the proposed EV charging rate. In this paper, a novel optimal EV charging control considering common profits is proposed.
The contributions of this study can be summarized in three main aspects: -A high efficient coordinated model for large-scale residential areas with heterogeneous charging targets is established to evaluate peak-to-average ratio (PAR), user dissatisfaction reduction, and load factor increase. -An EV charging priority level is created to coordinate the charging cycle of each EV based on its emergency state and the remaining time before the user's departure.
-The response status of each EV per minute is determined using a constraint programming (CP) model developed by artificial intelligence and provides more constraints and complexity than the existing work. The rest of this paper is organized as follows. Section.II presents a model of the considered system. The proposed cooperative charging strategy (CCS) is presented in Section.III. Section.IV is dedicated to the studied cases and analysis of results. Then, the main conclusions are highlighted in Section.V.

II. MODEL OF THE AGGREGATED SYSTEM
Consider a typical model of the neighborhood residential area network (NRAN) that is composed of a total of participants arranged with a set of EV identified as i = {1, ..., N }, and a system manager (SM) that controls and schedules the consumed electricity demand presented by (1).
Let l EV (t) and l other (t) , respectively, denote the EV charging demand and other owned loads (i.e., energy consumed by other building types of appliances during the t-th time slot). These former include HVAC systems, EWH units, CDs, lighting, and refrigerators. Although the huge capacity of the grid can supply a maximum demand capacity, the NRAN's complex relies on contracting with a system manager to set a demand capacity limit called the restricted demand capacity l lim it . Accordingly, this constraint requires an upper limit to the total energy consumed in any time slot as expressed in (2): At the individual level, EV charging parameters are fed into the system manager through a decentralized communication layer in order to optimize the on/off plug-in status based on a coordinated scheduling mechanism. The on-off EV charging decision D i (t) is maintained by a binary variable, i.e., 1 if the EV is plug-in, otherwise it equals 0, as represented in (3).
In this system model, each i − th EV is required to charge during a number of time slots T req that is used as input variable for system scheduling. It is calculated as follows: where: The desired state of charge of the i-th EV unit before the departure. Soc i,t :State of charge level of the i-th EV unit at the t-th time period. η battery :Capacity of the battery (in kW h). ξ bat : The effciency of EV's battery. ∆t:Time step that is considered as 1 minute is in this study. P EV :the charging power of an EV (in kW ).
The EV charging level is assumed to be maintained at a certain target range Soc ideal i that has been settled by its owner. For this, at the first level of the coordinated scheduling method, the SM calculates the period of stay T stay i of each EV to require its charging cycle. T stay i is calculated as (6) T stay where: t int i : Arriving time of the i-th EV in min. t out i : Leaving time of the i-th EV in min.

III. PROPOSED EVS CHARGING COORDINATION STRUCTURE
To enhance system scheduling benefits, a smart coordinated charging strategy is proposed. The developed algorithm performs coordinated control of large-scale participants to provide EVs peak load minimization and users' satisfaction improvement. As can be seen in Figure. with 10%, 30%, 50%, and 100% of EV penetration levels. For example, a 50% EV penetration level indicates that 500 consumers have their own EVs in NRAN within 1000 houses.
It is important to note that the coordinated management of an optimal scheduling model based on the CP approach involves satisfying several constraints and common objectives. In the proposed strategy two main indexes are defined: emergency charging index β Emergency i and EV charging priority level Pr i . The former one sorts the EV charging time slots depending on the ratio between the EV stay period and the required charging time slots, and the latter one is used to determine the EV charging scheduling vector depending on their need level as expressed in (7) and (8), respectively.
Step1: Data Collection 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  As a first step, the system collects EV charging load information for the following day. These include the arrival t int i and departure time t out i of each user, the charging rate that is assumed to be the same for all the consumers P EV , and the initial and required state of charge SoC initial Noting that each consumer sets its Soc ideal i to satisfy the proposed coordination strategy.
Step 2: Determining the scheduling key parameters Initially, the system calculates the stay time slots and the required period to fully charge each i-th EV's battery according to (4) and (6).Then, a coefficient is calculated according to (7). Finally, the algorithm sorts the emergency charging indexes in ascending order to give faster-charging preferences to users with a smaller β Emergency . Thereafter, β Emergency is divided into two categories; β urgent i (t) and β normal i (t) as follows: -A set of emergency charging indexes for urgent EVs: -A set of emergency charging indexes for normal EVs Step 3: Conducting the target priority time slot for the EV's charging cycle After categorizing the EVs load into two subsets, the charging priorities are selected according to the index Pr i . The EV with a smaller β Emergency i should obtain a higher charging preference Pr i . In other words, a priority management vector is generated using (8) Step 4:Optimization statement Following the proposed CCS algorithm, there are defined sub-objectives to comply with (1) the EV' target state of charge should be satisfied before consumer departure time, minimize the PAR expressed in (11) at both individual and NRAN levels, (3) improve the user satisfaction comfort level, and (4) avoid generating rebound peaks after the proposed schedules. For this, a constraint programming optimization is executed at this level to optimally indicate the EV status, including the proposed constraints and targets as will be explained in the next subsection. To this end, if the total maximum demand capacity exceeds the urgent EVs charging demand, the system manager starts to plug in EVs that need charging at the present time slot based on their priorities. Otherwise, only EVs with higher charging preference levels can be charged. Thereafter, the EV satisfaction index will be verified to judge if all EV loads are satisfied or not. If yes, then CCS must be ended. If no, step 2 is executed again to select the following required time slot with the updated EV charging data. Hence,the objective function is formulated as follows: M inimize ED (12) in which where: A is the total number of electrical appliances excluding EV units H is the total number of buildings in the aggregated community. X h i,t represents a binary variable denoting the responsive decision of i − th EV at t − th time slot.
α,t represents a binary variable denoting the responsive decision of α-th appliance at t − th time slot. P EV is the average charging power of an EV. P h α,t is the Rated power of an α-th unit.     Y h EW H,t is the responsive decision variable of the EWH. Similar to the thermal model of an HVAC load, the heat transfer operation of an EWH load is also depending on userspecified thresholds as presented in (16) . The water temperature should be maintained within between user-specified minimum and maximum water temperature;T max w ,T min w , respectively.
T max Y h CD,t is the responsive decision variable of the CD system. As demonstrated in (17), the CD is generally operated about ∆t req , and at a consumer-specified start time t CD .
∆t acc ≺ ∆t req ,and t t CD (17) where ∆t acc denotes the accumulated drying cycle. Appliances-level datasets are given in details extracted from [28], [29].

A. SOLUTION METHODOLOGY :
As explained in the preceding section, an optimal scheduling scheme is assessed in terms of PAR minimization, users' satisfaction improvement, and load factor increase. Moreover, the computational complexity increases with the heterogeneous conditions of consumers (departure time, required state of charge, etc.). To perform all of these, CP-based scheduling is used to solve these problems due to its capacity to handle combinatorial and large-scale optimization problems with a huge variety of formatting constraints [35]. To deal with the constraint satisfaction problem, there is a special triple T = (X; D; C) to be defined, where: X represents a set of decision variables (corresponds to an EV activity task). D denotes a sequence of domains (includes the EV start time, departure time, and length of EV task). C corresponds to the set of constraints limiting the values of the decision variables. Commonly, the backtracking search algorithm is the most used for solving a constraint scheduling programming (CSP) problem [36]. Indeed, if a decision variable takes a value that keeps the problem's constraints, a solution has been found. Otherwise, a backtracking step of one or more assignations is required (constraint violation). Figure.2 presents a simple

IV. CASE STUDIES AND SIMULATION RESULT ANALYSIS
To examine the impact of coordinated EV charging scheduling on the total load demand, a simulation is required. The proposed CCS is carried out with a slotted time of 24 h and an on-off status based on system manager decisions. One day cycle starts from 6 A.M of the current day to 6 A.M of the following day with 1440 time slots per day in the total (time slot interval of 1 min), assuming that the NRAN involved 1000 participants with different proportions of EVs penetration. According to [37] around 5:30 P.M is the standard EV arrival time with one hour of deviation while the objective state of charge Soc ideal i is randomly selected and distributed as shown in Figure.3, with the proportion case of 100% EV penetration. The distribution of t out i is illustrated in Figure.4. Hence, for the comparison with the existing work, thermal and technical data of individual home appliances are extracted from [28], [29] and are accessed in [30]. Although similar devices are considered for all users in this study, the proposed approach can include different load profiles as tested in [28].The study is carried out on a typical day in May. The proposed optimization scheme is solved using open-source software for combinatorial optimization (OR-Tools) using a constraint programming solver that is programmed in C#.   To validate the effectiveness of the proposed approach in terms of peak load reduction and users' satisfaction level improvement, several scenarios are examined: The first one is selfish charging which refers to the charging methodology in which EVs start charging at random time periods [t int i t out i ] and are disconnected when their batteries are fully charged,(uncoordinated EV charging model). The second scenario is the proposed coordinated scheduling scheme, and the last one refers to that conventional charging scheme in which the restricted power is not taken into consideration and EVs are connected to the grid at a constant charging power once arrived building area. For quantitative analysis of the impact of EV charging scheduling on the smoothness level of a load profile, we measure PAR. It is defined as the ratio of maximum aggregate demand power l peak to average aggregate consumed power l average . The PAR of the proposed coordination strategy compared to two other scenarios can be plotted for seven sets of maximum power capacity using different EV penetration levels, as shown in Figure.(5a),(5b),(5c), and (5d). It is clear that using the proposed coordination model and uncoordinated scheme, the PAR increases with l lim it increases. However, the conventional model takes a constant PAR value for each EV penetration level, which reveals the incompetency of this model to control EV charging in the whole community. Moreover, comparing the different simulation cases, it is noticed that the curve of PAR using the proposed model presents the lowest value of PAR and its increase ramp is the smallest. Obviously, this result infers that the proposed coordination Total load expecting EVs load Total EVs load using uncoordinated charging load Total EVs load using proposed model FIGURE 9: Simulation resuts for 1000 EVs strategy is completely effective for decreasing the peak load level compared to two other models.
In another way, we should measure the required Soc ideal i in the studied scenarios. For example, when the CCS system coordinates a large community with 1000 EVs under a smaller maximum power capacity (3500 kW-4500 kW), this may be more complex to satisfy the whole Soc ideal i of all 1000 EVs. To evaluate this dissatisfaction level, a defined SoC dis i of ith EV is given in (18).
where Soc i (t out i ) and Soc ideal i denote the required SoC level (50%-100%) and the SoC level (0%-100%) at the left of the i-th EV, respectively. The average SoC dis i of all EV penetration levels of the proposed scheduling strategy reduced as l lim it increased, and come closer to zero SoC dis i over l lim it = 7000kW , as shown in Figure. In other words, a higher PAR value results from a smaller SoC dis i level. For example, with a l lim it = 5000kW , the PAR of the proposed scheduling model with 1000 EVs as shown in Figure.5a equals 1,84, which is reduced by 0,31 and 0,11, respectively,when compared to the conventional EV charging model and the uncoordinated EV charging. In addition, as illustrated in Figure.(7d), more than 630 EVs are accommodated to a complete state of charge (achieving their Soc ideal i ) which is mainly higher with 582 EVs than the uncoordinated EV charging scheme.
To prove the efficiency of the proposed EV charging strategy on the accuracy of both the individual and aggregated results, different spectra of three typical EVs are chosen from the case illustrated in Figure.(8a)and(8b) . It is obvious from Figure.8b that all the three EVs are started charging randomly at the 10th time slot (as soon as to their time arrivals). The EV1, EV2, and EV3 are connected to the grid with Soc i (t int i ) equal to 37,5% and charged up to their required Soc ideal 1 = 80%, Soc ideal 2 = 100%, and Soc ideal 3 = 100% respectively. However, from Figure.8a it can be found that the first EV based on the proposed scheme has a similar power spectrum using the uncoordinated EV charging model due to its emergency coefficient and priority using (13). The EV2 postpones charging until the 11th hour and disconnects from the grid at the 15th hour with the Soc ideal 2 of 100%. Whereas, the third EV is plugged into the grid at the 16th time slot and finishes its charging cycle at the 1th hour with a full charge battery soc-target Soc ideal 3 = 100%. Therefore, it is clear that the power spectrums of EV2 and EV3 based on the proposed coordinated charging model are thoroughly different from those based on uncoordinated EV charging models, that alleviate quietly the pressure on the grid. Figure.9 illustrates another series of simulation results when there are one thousand EVs involved, the distribution of total charging power under two EV charging scheduling models, in addition to the load profile of other home appliances. In the case of using an uncoordinated EV charging scheme, all the EVs are charged as soon as they are at home, so that the load power can be successfully allocated to the same periods of time. As a result, it generates a high peak value of total load power of. On the other hand, the proposed coordination strategy shows significant schedules by allocating the EV charging power during the valley hours of the total power profile, so as to successfully reduce the peak value of the  total EVs load power from 3600 kW to 1202,4 kW, resulting in a significant minimizing rate of 66,6%. Figure.9 shows a comparison of peak load demand between the uncoordinated EV charging protocol and CCS model considering all the l lim it runs. From Figure.(10a), it is observed that the longer whisker is on the maximum , indicating a longer tail towards the highest values, which in turn suggests that around 50% of load profiles correspond to the more extreme values of peak load demand. Contrarily, as shown in Figure.(10b) the CCS algorithm is capable of yielding the most uniform minimum compared to the uncoordinated EV charging model. In Figure.11, load factors are summarized in the 3-D plot for various EV penetration levels and different l lim it using the implemented strategy CCS. It illustrates the stress on the distribution grid and the effects of coordinated EV charging on the electricity demand profile. In particular, it is clear that the load factor is improved with the restricted demand capacity and achieved high values in 100% of EV penetration. These show the high effectiveness of the proposed model in reducing peak demand load, especially with a large number of EVs.

A. PERFORMANCES COMPARISON
To highlight the contributions of the presented research, a comparison with a previous counterpart of the main metrics at the community level can then be derived in this subsection and depicted in Table.1. Peak load increase: the gap between the daily peak load before the EV charging management and after applying the proposed model. Load factor improvement: the increased rate of load factor after applying the proposed EV charging strategy.
In summary, the impact of different penetration degrees of EV on the increase of maximum demand power and load factor improvement are listed in Table 1. It clearly shows that the presented CCS model offers higher efficiency than the scheme established in [30]. As demonstraed, the proportion between the conventional and the proposed models can achieve 32% in the load factor maximization rate using the developed CCS algorithm. In addition, in [30] the EV charging strategy is negatively affecting the peak load demand by creating a peak load increase with more than 10 kW. In contrary, the adopted model achieves 0 kw in the peak load increase rate. With no doubt, these results highlight the benefits of the CCS to manage large-scale residential areas with even than 1000 EVs.

V. CONCLUSION
This paper presented an effective coordinated EV charging model for a largely residential area with above 1000 EVs that is expected to achieve 100% of the EV penetration level. A system manager controls the charging cycles under heterogeneous EVs charging targets without exceeding the system power constraints. CP optimization-based technique was used for reaching the optimum EV load profile with two main parameters to conduct the charging schedules, viz., emergency charging index, and EV charging priority level. The resulting simulations are conducted for several cases to demonstrate the applicability of the proposed CCS model. The results reveal that the charging strategy with the proposed collective charging strategy algorithm can greatly remove the negative impacts on power grids of total peak load increase from the EV loads by achieving 0% of the total peak load raise after implementing CCS. Furthermore, the proposed model improves the load factor by 32%, accommodates more than 930 EVs to a complete charge, and ensures 0% of end-users dissatisfaction level. Moreover, the presented model is much better in handling the complexity of high and multiple EV penetration levels and achieving high efficient performances. Future extensions of this study could explore the opportunity of considering the EV's batteries as a distributed energy storage device to limit the grid dependence according. For this purpose, introducing the uncertainty of renewable energy generation constraints, and the EV battery life simultaneously with the user preferences and the power demand patterns in the optimization objective is envisaged. In addition, a comparison of users' profits in the case of presence and absence of EV to the grid interactions will be assessed