###### Abstract  
Recently due to air pollution concerns, a large number of electric vehicles have been integrated into the electric distribution system. However, the uncoordinated charging of this technology can cause different voltage issues. This paper proposes a two-stage optimization approach with active and reactive power control to coordinate electric vehicles with both grid-to-vehicle and vehicle-to-grid capabilities to satisfy both grid requirements and electric vehicle prosumer requirements. The system requirements considered are voltage deviation and unbalance and the electric vehicle prosumer requirements considered are minimization of charging and battery degradation costs. The coordination problem is formulated as an optimization problem, where the first stage objectives are: minimization of voltage unbalance, customer charging and battery degradation costs. The first stage optimization problem is solved using the meta-heuristic optimization algorithm known as particle swarm optimization to obtain an optimized real power schedule for the electric vehicles. The second stage is then solved of which the objective is to minimize the bus voltage deviation and provides the reactive power schedule for electric vehicles. All the analyses were carried out on the IEEE 34 bus distribution system and the study results show that the proposed method allows prosumers to charge at a minimum cost without any grid voltage unbalance factors and under/over voltage problems under different scenarios. Thus, this work can be beneficial for system operators or electric vehicle aggregators to create a day-ahead schedule. b 20 April 2021  
* [1] 202  
charging. From an EV aggregator perspective, the management of an EV fleet should consider different significant constraints related to the electricity grid, ecosystem, and customers. The authors of [7] used the EVSCP model, which aims to control an EV fleet to minimize the charging cost. Their results showed the efficiency and effectiveness of the model, but there was no mention about the grid effect. The authors of [8] presented an intelligent fleet disposition algorithm, mixed with electricity generating companies, which mitigate both financial and ecological parameters by collecting customer behavior (including V2G) and power generating profiles (including renewable energy). Their results showed that charging cost and CO2 were decreased by 22% and 33% respectively a year. Yet the method lacked an energy management system that made the method difficult to implement in the real-world. Three novel algorithms for the integration of EV to control a large fleet so as to flatten the duck curve in California was proposed in [9]. The researchers of [10] proposed V2G scheduling for a railway station to increase the load factor and minimize the annual energy invoice of the station. However, [9; 10] did not considered the benefits to customers if they participated in the time scheduling. Most power system issues use multi-objective optimal power flow (MOOPF) to achieve objective functions in power systems, and have now become an essential application to deal with several objectives [11; 12; 13; 14; 15]. Strategies for smart charging then used multi-objective meta-heuristic optimization algorithms [16], of which the objectives are to benefit either some grid requirements, such as voltage unbalance and frequency stability, or customer requirements, such as minimize charging costs, battery degradation costs, etc. [17]. The constraints to this optimization problem are normally EVs charging, also called Grid2 Vehicle (G2V), or discharging EVs, also called Vehicle2 Grid (V2G). This optimization problem is solved using some meta-heuristics to find an optimized schedule for EVs. Reference [18] proposed a method to mitigate problems, such as peak shaving and valley filling, and the method to mitigate power quality is given in [19; 20].