Increasing the Penetration of Electric Vehicles in Distribution Networks Using Optimal Charging/Discharging Control and Reactive Power Support in the Presence of Nonlinear Loads

Electrical vehicles (EVs) are among the fastest-growing electrical loads that change both temporally and spatially on distribution networks. *e large-scale integration of EVs equipped with power electronic-based chargers into distribution networks, to meet new electrical load demands, can cause instability and power quality issues. Moreover, the absence of control strategies for the smart charging and discharging of EVs at their plug-in intervals poses serious challenges to them. Accordingly, the implementation of controlled charging/discharging scheduling of EV batteries along with the use of charger capabilities, such as reactive power support, is a must. Against this background, this paper introduces an integrated model to solve the problem of simultaneous active and reactive power management in distribution networks subject to network operation constraints imposed by EV batteries and chargers. To this end, this problem is modeled as an optimization problem. In this respect, minimization of the costs associated with power generation and losses and improvement of the total harmonic distortion of voltage (THDv) on network buses are two terms of the objective function. *e problem is solved by a hybrid technique named the “ PSO-GA algorithm” that takes advantage of both the genetic algorithm (GA) and the particle swarm optimization (PSO) method. Accordingly, the effectiveness of the proposed model is examined in a standard IEEE 33-bus distribution network populated with EVs and nonlinear devices (NLDs). *e results obtained show that the maximum possible penetration rate of EVs into the network is facilitated, while technical and financial goals of the network and parking lots are ensured.


Introduction
In recent years, the widespread use of intermittent resources, such as electrical vehicles (EVs), due to public concerns about environmental issues and the considerable reduction in diesel fuel consumption, has attracted a great deal of attention as the best alternative for gasoline-powered vehicles. In view of this, the US Energy Information Administration (EIA) has anticipated that the penetration level of EVs will grow from 0.7% of the global transport fleet in 2020 to 31% in 2050, amounting to about 670 million EVs [1]. Moreover, distribution networks are facing destructive power quality problems due to the high penetration level of EVs and other inverter-based distributed generations, such as photovoltaic (PV) devices, fuel cells (FCs), and wind turbines (WTs) in electric power systems, especially at peak load intervals.
By now, considerable attempts have been made to show that the uncoordinated charging and discharging of EVs during peak hours can affect safe operating limitations of the power grid even at a modest rate of EVs' penetration. is issue can turn into a restriction for distribution network operators (DNOs) on plugging in a high penetration level of EVs into the network. Accordingly, various recent studies on distribution automation have been focusing on studying the impact of EVs' penetration growth on power systems and managing the charging and discharging of plug-in electric vehicles (PEVs) to reduce power quality problems.
As the battery is one of the main components in the EV structure, there is a necessity for smart charging/discharging strategies such that the cost associated with vehicle battery degradation should be taken into account. Accordingly, the EV battery continuously charges/discharges during connection times, affects its performance and cycle life, and consequently causes battery degradation. To achieve an authentic economic evaluation, the battery degradation cost (BDC) should be considered in the operation cost. In much research, the various BDC models are proposed for optimal system operation. In [2], a cost-benefit analysis is proposed for optimal coordination of PEVs in which the degradation cost in coordinated charging is not considered. However, in V2G mode, a fixed amount of 6.5 cents per kWh is considered a degradation cost without any calculation. A mathematical expression of PEVs' BDC and the investigation of the effect of V2G on the battery were presented in [3]. In [4], a BDC model of Li-ion battery is developed taking into account the effects of temperature and depth of discharge (DOD) on battery performance. e proposed model includes aging factors that provide a practical degradation cost model for batteries using real data. Authors in [5] have proposed a battery aging model for a plug-in electric aggregator-scheduling problem. e degradation model is based on some basic parameters related to the PEV battery and also the probability of the aggregator being called by the independent system operator (ISO). In [6], a new formulation of the BDC for the optimal scheduling of battery energy storage systems (BESSs) has been developed.
Each EV is equipped with an onboard charger composed of power converter modules, or more precisely, an AC-DC and a DC-DC converter serving as an interface for linking the EV battery to the power network [7]. is structure is capable of controlling active power (P) to flow in two directions from EV batteries to the power network, and vice versa. Moreover, the charger can be designed to be capable of exchanging reactive power (Q) with the network using a controlled switching algorithm that is, in turn, a great advantage to reactive power management. us, EVs can act as an accessible energy resource able to simultaneously supply or absorb both batteries' active power and chargers' reactive power to or from the power grid, and therefore, their penetration into the distribution network could be increased [8,9]. is type of capability has considerable potential for tackling network power quality issues, such as system losses, bus voltage fluctuations, harmonic distortions, power factor corrections, and congestion in feeders. Several studies have reported the concept of active and reactive power controllability in EVs with various control strategies for solving distribution network problems. References [10,11] have focused more specifically on incorporating EVs into the reactive power market. In [12,13], different mechanisms were proposed for active and reactive power management in smart distribution networks by employing EVs to minimize energy costs and voltage fluctuations. Another research introduced a two-stage optimization method for minimizing energy losses of microgrids using active and reactive power control in EVs at different penetration levels [14]. In the mentioned reference, the daily required energy of EVs was investigated based on probabilistic modeling of EV owner behavior at any time. In [15], a two-stage linear optimization program was developed for managing the active and reactive (proactive) powers to both compensate for reactive power in smart home environments with different components and appliances, including EVs, energy storage systems (ESSs), and shiftable loads (SLs), and also to reduce customer billing costs associated with active power.
In fact, the main purpose of all scientific studies reviewed was to support active and reactive power management through coordinating the charging and discharging of EVs in the power system. However, the effects of harmonic perturbations on the optimal performance of power systems should be considered due to the high permeation level of harmonic sources and NLDs. Moreover, equipping EVs with power electronic-based chargers and their current harmonic injection into power networks can cause some concerns in distribution networks and poor power quality issues. erefore, the effects of nonlinear EV chargers on the power quality of power networks should be investigated, especially under conditions of the availability of a maximum number of plugged-in EVs. In [7], plug-in electrical vehicles were employed to mitigate harmonics and reactive power in a residential installation and to provide active power support. e authors in [16] developed a new centralized nonlinear online strategy to minimize costs associated with generation and losses and to improve the power quality of the network by incorporating the total harmonic distortion of voltage (THDv) on network buses into the objective cost. In the aforementioned study, the individual bus voltage profiles, and the THDv level of the network, could be controlled within the standard limit by delaying PEV charging periods. In [17], the effects of simultaneous integration of PVSs and PEVs on the daily load profiles of feeders and the daily voltage and THDv profiles in the power distribution system were examined.
To decrease the rate of harmonic current injection into the power grid, some studies propose the use of bidirectional EV chargers for the concurrent management of the battery's active power and the charger's reactive power in two directions [8,9,[18][19][20][21][22]. e use of EV chargers for providing simultaneous vehicle-to-grid (V2G) services and reactive power compensation while reducing the total harmonic distortion of the current in the residential electricity network was discussed in [19,21]. In [18], a multiobjective optimization problem was proposed for harmonic compensation of networks by plug-in hybrid electric vehicles (PHEVs). Accordingly, each PHEV was considered as a harmonic current source in which the injected harmonic current of the PHEV and the THDv of grid nodes were simultaneously minimized. ese studies indicate that the potential of EV utilization in simultaneous active and reactive power management is more effective in improving power quality indices.
Against this backdrop, this study introduces a comprehensive scheme in which the possibility of the reciprocal control of both active and reactive powers between the network and EV batteries under different penetration conditions is provided by employing EVs equipped with onboard bidirectional chargers. Using this feature, a greater number of EVs can be plugged in to be charged, with reduced detrimental impacts of the high penetration rate of EVs into the distribution network. Moreover, EV owners can earn income from their vehicles by discharging EV batteries. In the introduced model, minimizing the total cost and power losses, and improving the THDv of network buses are considered objectives of the optimization problem, being subject to network and EV constraints. Moreover, to take into account the impact of EV penetration on network indicators, modeling is performed at different EV penetration rates.
Since this optimization problem is a relatively extensive research field with several constraints, it is required to use an efficiently appropriate optimization method. In this paper, a hybrid PSO-GA algorithm was used, which was considered by some references [26,27] as an effective and reliable algorithm by taking advantage of both genetic algorithm (GA) and particle swarm optimization (PSO) methods to solve the problem. is hybrid procedure can strike a balance between exploitation and exploration capabilities at a fast speed and high accuracy.
In general, the main goals and contributions of this study are summarized as follows: (i) Proposing a framework for EVs to simultaneously participate in active and reactive power management in distribution networks (ii) Providing the possibility of reactive power compensation as one of the capabilities of chargers and, consequently, reduction in dependency on the other reactive power resources (iii) Designing the power capability curve of EV chargers according to the reactive power-limiting factors (iv) Increasing the EV penetration rates in the power network through the charging/discharging management mechanism for EVs during the reactive power compensation process (v) Performing harmonic analysis on the distribution network by investigating the nonlinear EVs' performance in the harmonic conditions e rest of this paper is organized as follows: Section 2 describes the EV capability as a reactive power compensator in detail. In section 3, the mathematical formulation of the problem is scrutinized. A solution methodology of the optimization approach is presented in Section 4. Section 5 elaborates on the case studies, and also, the simulation outcomes are presented for each case study. Eventually, some concluding remarks will come in Section 6.

EVs' Characteristics
In this study, similar to other research works, the impact of EVs in the parking lots on power grid parameters has been examined. erefore, the physical details of the EVs structure are not considered. e EV specifications used in this article are presented in Table 1.
In this paper, the reported data such as electrical energy consumption per mile and daily distance driven by EV owners that are presented in the National Household Travel Survey (NHTS) [29] are utilized to estimate the mileage and arrival time at the parking lot. e histogram of the last trip arrival time and first trip departure time in a day, with 1hour intervals, are shown in Figure 1. It can be observed that the peak arrivals occur in the afternoon at around 18 : 00 with almost 15% of total EVs. In this figure, the cumulative curve shows that 80% of all EVs have plugged in after 20 : 00 and will be there until the next morning. is figure also shows that the peak departure time happens in the morning at around 8 : 00 with about 17% of total EVs. Also, nearly 80% of all EVs are connected in the parking lots before 8 : 00 as shown in the cumulative curve. Moreover, according to the plugged-in curve, more than 80% of EVs are joined to the power grid from 18 : 00 to 8 : 00 of the next day. So, in this period, there is the greatest capability for exchanging power between parking lots and the power network.

EV's Performance in the Grid-Connection Mode.
As mentioned before, EVs are charged through power electronic-based converter interfaces, and these devices can act as flexible distributed energy resources with the ability to operate in more than one operating mode. So, it is possible to simultaneously transfer the active and reactive powers in two directions by adjusting the output voltage of the inverter, the phase difference of voltage between the inverter and the grid, and the output voltage frequency, respectively. e EV's structure and its equipment connecting to the network, including AC/DC and DC/DC converters, DC link capacitor, and control unit, are shown in Figure 2. In this model, the required active and reactive powers can be transmitted from the utility to the EV's battery and vice versa by setting an appropriate switching pattern and phase-shifted control strategy in a central control unit. It is assumed that the voltage waveform at the point of common coupling (PCC) is symmetrical as follows: (1) In this condition, the desired power components can be injected or absorbed between the EV battery and grid by choosing the correct reference current in [8] According to the phase difference between voltage and current components (φ 1 ), the following different cases will be possible: Hence, apart from the two-way active power transmission for EVs' battery charging and discharging, EVs will also be able to operate as a reactive power compensator, at a slightly additional cost, capable of supplying appropriate reactive power to the grid in all conditions.

Proactive Power Performance Areas of EV Charger and
Limitations. So far, different structures for chargers have been proposed. A common configuration of unidirectional chargers, which is utilized in EVs' structure, is the "Power Factor-Corrected" (PFC) chargers [13,20,30]. In this type of charger, the active power flow only transfers in one direction between the power grid and the EV battery and operates with a power factor close to unity. According to research that has been performed in [13,20,30], it is possible to incorporate more than one operating mode in a charger through a bidirectional structure of charger. is type of charger is known as "Four Quadrants Bidirectional" (FQB) charger with the capability to fulfill the power quality requirements of the power grid such as reactive power compensation, voltage regulation, harmonic filtering, and power factor correction without the need for occupying the battery capacity and thereby reducing its lifetime. Moreover, by using this structure, the possibility of a higher penetration rate of EVs in distribution networks can be operational. Based on Figure 3, the FQB charger consists of an AC-DC rectification and a DC-DC conversion, which are known as grid-side converter (GSC) and battery-side converter (BSC), respectively. Accordingly, in this research, it is assumed that each EV is equipped with an onboard FQB charger. More details about the structure of FQB chargers have been presented in [20]. e operating area of an FQB charger is restricted by two main limitations, namely, transmittable power and charger capacity. e GSC has a certain maximum current-carrying capacity, which enforces a limit on the transmittable power of the EV charger. e circular constraint of active and reactive powers at the inverter current limit is expressed as follows [23][24][25]: Another limitation on transmittable power is enforced by the voltage of the GSC (V INV ), which can be written as follows: where X c is the total reactance of transformers and grid filters from the output terminal of the charger to PCC, and also V PCC is the voltage at the EV connection bus ( Figure 3). is equation indicates a circle with a radius (r1 � V INV V PCC /X c ) centered at (c � (0, −V PCC 2 /X c )) on the Q-axis of the PQ plane as represented in Figure 4. To evaluate the performance area of the EV charger, the inverter's voltage and current values must be calculated. e maximum current-carrying capacity of the inverter (I max INV ) can be calculated when the active and reactive output powers of the charger are set at the rated values and the voltage of PCC is minimum.      International Transactions on Electrical Energy Systems Considering that where PF R and S EV,R are the rated power factor and base megavolt ampere (MVA) of the EVs, respectively. According to equations (5) and (6), the value of I max INV in per unit (p.u) is calculated as follows: By adjusting the P EV , V PCC , and f parameters at their maximum values in equation (4), the maximum inverter voltage in p.u can be calculated by the following equation.
Accordingly, the maximum capability of reactive power injection by the EV charger is the minimum values of Q max i and Q max v as follows: where Q max i and Q max v are the reactive power constraints of EV charger considering the maximum current-carrying capacity and the maximum voltage of inverter for a certain value of P EV , which are given in It is considered that the EVs' structure is designed to operate at a rated power factor (leading or lagging) equal to 0.95. Also, based on [25], it is assumed that  Figure 5. It can be observed that for a specified amount of active power, two minimum and maximum values for reactive power will be achieved. Also, as the power factor increases, the upper and lower limits of reactive power are reduced. All available operating regions of the charger along with the transmittable power limits are depicted in Figure 4. It can be seen that in quadrants I and Ш of the PQ power plane, the charger operates in the charging mode and, depending on the requested reactive power, will operate in one of the capacitive and inductive modes to inject or absorb reactive power to or from the power grid. In quadrants II and IV, despite the operation in discharging mode, depending on the  International Transactions on Electrical Energy Systems reactive power request, it could act as a capacitor or inductor. us, it can operate in all four areas of the PQ axis provided that the working point must be located inside the circular constraints as shown in Figure 4.

The Mathematical Expression of the Model
In this section, the mathematical formulation of battery active power management along with charger reactive power compensation problem in a distribution network employing EVs is introduced as a nonlinear multiobjective problem with the objective function of equation (14) subjected to equality and inequality constraints of EVs and the network. In this model, both economic and power quality issues are considered as the objectives of the optimization problem.

Objective Function.
e model presented in this paper is a multiobjective problem in which, after normalizing each of the objectives individually first, and then summing up all normalized terms as one objective, the optimization algorithm is performed using the PSO-GA method. So, the solution using the normalization method is in the form of a scalar function, which is incorporated into the objective function. e objective function of the problem is settled based on the minimization of the total payment to the wholesale market and the improvement of the summation of the THDv deviation of grid nodes from the standard value, over the operation planning horizon. In equation (14), the first term (f 1 ) includes the costs associated with harmonic power losses, electricity purchased by the DNO from the upstream grid, and battery degradation, and the income from supplying active and reactive power to the network.
e second term (f 2 ) includes the summation of THDv deviation of grid nodes from the standard value over a 24 h period. e objective function can be defined as follows: where K P is the cost of active power loss and based on [16] is equal to 50 . λ t refers to the cost of purchasing or supplying electric energy in h. Also, based on [22], K 1 is a coefficient with a constant value equal to 0.08. e total active power loss for each hour is calculated through the following equation: From an economic point of view, the charging and discharging of a battery during connection times of an EV to the power grid reduce the battery cycle life, which, in turn, leads to the EVs' degradation cost. So, for the optimal operation of the proposed model, the BDC has been added as a cost term to the objective function (16). is is to guarantee that no unnecessary EVs' battery charging/discharging occurs and also to prevent EVs' battery degradation.
where C BD is the cost of battery degradation, LP and ibp are the life period and initial price of EV battery equal to 5 years and 20,000 $, respectively, IR is the inflation rate of EV batteries in percent equal to 10%, and finally, Call refers to the probability of calling the EV aggregator by the DNO at each hour, which is educed from [5]. e objective function that should be minimized is shown in the following equation: e coefficients of ω 1 and ω 2 are the weighting factors of the first and second parts of the objective function, respectively, which are obtained from the experience of multiple iterations. f 1n and f 2n are the normalized values of f 1 and f 2 , respectively, which are calculated through the following equation: where f i,max and f i,min are the maximum and minimum values of f i , respectively.

Problem Constraints.
To maintain the security and stability of the power grid, it is essential to exert network constraints in power optimization problems. Hence, the constraints of the problem are categorized in four parts, namely, load flow constraints, system performance limits, EVs and parking lot restrictions, and the constraints of harmonic indices, as follows.

Load Flow Constraints.
ese constraints are concerned with the relations between the power grid parameters. For instance, equations (19) and (20) indicate the fundamental components of active and reactive power balance equations in the bus i and time t. Also, the active and reactive power flow between lines i and j are shown in equations (21) and (22). Equations (23) and (24) have similar descriptions except for the current and voltage transmission between buses i and j in time t, and harmonic frequency h. It should be noted that, in this model, there is only one generation bus as a slack that is connected to the upstream network. erefore, P G , Q G , and I G for all grid nodes except reference are considered zero. e other nodes consisting of linear and nonlinear loads, and EV parking lots, are PQ-type buses. (25) indicates that the root mean square (RMS) value of the voltage on each bus should lie in the standard range, in which V min and V max are the minimum and maximum values of bus voltage equal 0.95 (p.u) and 1.05 (p.u), respectively. Under system operating conditions, the generation capacities are limited according to equation (26) and the capacities of the lines are restricted according to equation (27), which causes problems owing to maximum flow capacity in the transmission line.

EV and Parking Lot Restrictions.
In this subsection, equations (28) and (29) illustrate the active and reactive power balance between the power grid and all EVs in the parking lots, equations (30) and (31) represent the active and reactive power losses of EV chargers in the parking lots, and equation (32) relates to the available capacity of all EV batteries in each parking lot per hour, respectively. Based on the nonlinear equation (33), the maximum apparent power of all EVs in the parking lot is confined to their maximum capacity. Finally, the EVs' charging/discharging rate limitation in the parking space is signified in equation (34).
e energy needed and the state of charge (SOC) of the EV battery, and the total energy required of all EV batteries in the parking lot at any given time, are expressed in equations (35), (36), and (37), respectively.
where SOC is the percentage of energy preserved in the battery and depends on the mileage by each EV in electric mode (L). AER is the maximum distance that EV can travel in an electric mode according to its battery capacity. Based on equation (35), both RE and SOC are dependent on L.
International Transactions on Electrical Energy Systems

Constraints of Harmonic Indices.
To supply highquality electricity without any distortion for consumers, the harmonic circumstances of the power network should be exactly evaluated by DNO. To compute harmonic components, the harmonic load flow (HLF) should be implemented to impose some constraints on the power network. Before applying the HLF procedure to the harmonic analysis of the power grid, the conventional load flow should be performed in order to calculate the fundamental components. In this paper, the backward-forward technique is used to solve the load flow of the network. Based on this, the HLF corresponding to each harmonic order will be solved. By calculating the harmonic values of voltage and current using the previous equations (23) and (24), the harmonic variables of equations (38) to (42), including the THDv of the network buses, the harmonic currents generated and passing through the lines, and the harmonic losses of the network according to equation (15) will be calculated. erefore, based on the harmonic standards, the THDv on each bus and the individual harmonic factor have been restricted to 5% and 3% of V (1) i,t , respectively. e current limitation of all EVs in the parking lot and the station and the current line restrictions at a certain harmonic frequency are presented in equations (38)-(42), respectively.
It should be noted that the switching of the charger's power converter modules is controlled to fast charge the EV, and to provide reactive power compensation for voltage regulation and power factor correction. erefore, the bidirectional EV charger is capable of supplying sufficient reactive power to the grid in all situations, which is a great advantage in reactive power management.

Problem-Solving with an
Optimization Algorithm e GA and PSO are two popular evolutionary algorithms that have been used in much research work due to their simplicity and acceptable performance. GA is a populationbased and widely used exploration tool inspired by biological techniques, such as natural selection, crossover, and mutation to transfer valuable attributes from one generation to the next in an iterative process [31]. PSO is a simple and exact swarm-based methodology with the capability of precise exploration through the search space whose particles can learn and simultaneously communicate in an area including the global or near-optimal solution. It utilizes social behavior-inspired techniques, such as the manner of a group of birds, and a bunch of bees or fish [32].

4.1.
Overview of the Hybrid PSO-GA Algorithm. In this study, a hybrid technique was employed to enhance the performance of both basic GA and PSO in the MATLAB software environment. e PSO-GA algorithm introduced in [27] is an efficient optimization method to explore global optima, particularly for large-scale optimization problems involving a large number of decision variables. In this algorithm, PSO operates in the direction of improving the evolution and GA plays the role of an assistant by modifying decision vectors by participating in genetic operators, namely, crossover and mutation. erefore, the main idea of the hybrid PSO-GA is to improve the search accuracy and convergence speed by using the ability of social behavior in PSO along with the local search capability of GA. e process of hybrid PSO-GA is explained as follows.
First, the initial parameters such as population size, maximum iteration, and the number of variables are determined, and the constriction coefficients are defined. After the initialization, in the next step, a random position is assigned to each particle, and the generated positions are assessed. Afterward, the algorithm enters its main loop in which the two main characteristics of particles, namely, velocity v i (t) and position x i (t), are updated according to where t is the number of iterations, and r 1 and r 2 are the random numbers in the range of [0,1]. w is the inertia weight that performs the role of criterion in balancing global and local exploration abilities. φ 1 and φ 2 are two constant variables with the same values equal to 2.05 according to numerical experiments. Also, c 1 and c 2 are learning factors that are equal to φ 1 w and φ 2 w, respectively. In each iteration, new parameters of personal best position (pbest) and global best position (gbest) are reserved. In the next stage, the particle's personal best-known position is evolved with the crossover and mutation operator of GA to improve the optimum searchability. is process is executed until the predefined termination condition is met, and finally, the latest global solution will be chosen as the optimal answer to the problem.

Solution
Procedure. As mentioned before, EVs' optimal power management in distribution networks considering reactive power compensation, is a nonlinear optimization problem. erefore, it is required to solve this problem with a precise optimization methodology to achieve an acceptable level of accuracy in the behavior of power system conditions. e proposed model is simulated in the deterministic case with certain input data. In this study, the population size and maximum iteration are adjusted to 70 and 500, respectively. e process of the mentioned problem-solving at each interval can be described in the following steps:

Simulation Results and Discussion
In this paper, the 33-bus radial distribution network is used as a test case in which specifications such as grid line data, and active and reactive load demands at peak hours are provided in [33]. Also, it is assumed that the locations and values of harmonic sources are already determined at all time intervals and are located on specified buses as shown in Figure 7, instead of linear loads with the same values. e load values in nonpeak intervals are calculated by multiplying the active and reactive values at peak hours in the load percent profile as depicted in Figure 8 [34]. It should be noted that all of the customers have the same active and apparent load demands, which follow a typical shape with a peak time in the evening. e hourly tariff rates of electricity prices in three main periods are shown in Table 2. According to Table 3, each node consists of a parking lot to situate a set of EVs, and based on the range of their base, active loads are divided into three groups in which the number of EVs and their locations are presented in each column. Moreover, the initial simulation interval starts from 6 : 00 Based on [10,13], the nominal capacities of PFC and FQB types of chargers are considered as 3.3 kVA and 4.6 kVA, respectively. e harmonic current spectrum of EV chargers and NLDs in percent, as shown in Table 4, consists of five harmonic orders. Also, the harmonic current limitations of a single-phase bidirectional charger corresponding to different harmonic orders are shown in Table 5. In equations (32) and (33) International Transactions on Electrical Energy Systems 0.05S max E , respectively [22]. Meanwhile, it is assumed that the EVs return to the parking lot after the last route. Finally, the minimum and maximum standard domains of voltage at each node are considered to be 0.95 (p.u) and 1.05 (p.u), respectively.

Case Studies.
In this paper, the proposed problem is solved by implementing PSO-GA in the MATLAB R2020a software. e simulations were performed on a computer with an Intel Core i7-6500u @ 2.5 GHz processor and 16 GB of RAM. e present study aims to investigate the penetration rate of plugged-in EVs in network operation by employing different capabilities of EV batteries' active power management and charger's reactive power control. As summarized in Table 6, the EV capabilities in different case studies are described to investigate employing EV's active and reactive power control in distribution network operation.
For a better comparison of case studies, the base case is introduced in which there is no EV in the distribution network. Figure 9 shows the percentage of THDv values on different buses in this case. According to the figure, the value of THDv in all network buses at peak load time is below the standard value of 5%. It should be noted that the network is designed so that the THDv values of the network buses are close to the allowable value (5%), and with the connection of EVs to the network and lack of management, the network power quality conditions will deteriorate.      10 International Transactions on Electrical Energy Systems e proposed problem and the PSO-GA optimization algorithms are applied to under six following case studies.

Case Study 1.
In this case, the PFC charger is used in which the charger capacity is assigned to the battery active power equal to its nominal charge rate and the reactive power is zero. In this situation, EVs will charge immediately upon arrival in the parking lot and stop charging until meeting the required charging level of the battery. e daily pattern of the average apparent power delivered from the primary substation for different levels of EV penetration is shown in Figure 10. According to the results in Figure 10(a), as the penetration rate of EVs rises, more increase occurs in the delivered power from the upstream network, especially during peak demand intervals. erefore, only a limited percentage of EVs (21.5%) can connect to the network, because of the maximum apparent power limitation. However, the maximum THDv values are not acceptable for DNO and should be decreased. Hence, the penetration rate should be reduced to 14.5%, taking into account THDv as the evaluation factor. Table 7 shows the number of EVs and energy losses at the peak load moment concerning the obtained penetration rates. As could be seen, with the growth of EV's penetration level in the power grid, the energy loss is increased to about 2308 kW (for 21.5% penetration). In both conditions, the number of plugged-in EVs in the network is restricted to only 212 and 143 EVs, respectively. Figures 10(b) and 10(c) show the daily voltage and THDv profiles of grid nodes at the peak load time, respectively. As the results indicate, by connecting as many cars as possible to the network, the hourly voltage of grid nodes decreases, and the THDv level of buses slightly exceeds over the standard limit of 5% as defined by IEEE-519 standards.

Case Study 2.
In this case, the onboard FQB structure of chargers is used so that the chargers operate in the capacitive mode, and the active power is equal to the battery charging rate depending on the EVs' connection time.
e daily apparent power imported from the upstream grid, the voltage profile of buses, and the THDv level of each node at peak load time are shown in Figures 11(a)-11(f ), considering the EVs' penetration rate as 14.5% and 21.5%. As could be seen, by the capability of reactive power support in FQB chargers, some network power quality indices such as voltage profile and grid power losses are improved. Figure 11(f ) shows that the maximum of THDv for 21.5% penetration is 5.64%, which is not acceptable from the DNO's viewpoint in terms of PQ standards. Consequently, the implementation of the charger's reactive power capability has little effect on the improvement of THDv, meaning that by increasing the penetration rate of EVs, the chargers would not be able to successfully control the THDv level of grid nodes within the acceptable limit of 5%. According to Table 7, the maximum number of EVs, which can connect to the network in case 2, is limited to 182 and 984 when EVs' penetration rate is considered as 18.5% and 100% (maximum possible penetration rate in case 2 for S max and THD V indices). So, EVs' integration would increase more in case 2 compared with case 1. Also, the comparison of network operation indices in cases 1 and 2 and their improvement percentages are depicted in Table 8. According to the results, the capability of reactive power support in case 2 causes the network power quality indices such as voltage profile, grid power losses, and THDv to be improved. Indeed, the maximum received power from the reference bus, in this case, is 5.41% less than the same amount in case 1, which, in turn, rises the EVs' penetration rate in case 1.   International Transactions on Electrical Energy Systems

Case Study 3.
In this case, the PFC type of charger is used in EVs' structure in which the charger's operation is only in inductive mode and there is no reactive power compensation capability. e daily apparent power curve of substation bus, the voltage profile of buses, and the THDv level of grid nodes are shown in Figures 12(a)-12(c), respectively. As could be seen in Figure 12(a), by increasing the EVs' penetration into the grid, the apparent power capacity delivered from the upstream network is increased insofar as the EVs' penetration level could reach over 100% (full penetration rate of EVs). is is due to the high bid prices at peak hours and consequently shifting the EV charging periods to the off-peak intervals. Based on Figure 12(b), due to the lack of reactive power support capability in PFC chargers, the algorithm would not be able to be successful in decreasing the voltage level of grid nodes to values lower than in case 1. It can be observable in Figure 12(c) that the THDv values of each node effectively retain the normal level, considering all EV penetration rates, in which the maximum and average THDv levels are obtained at 4.94% and 2.80%, respectively.

Case Study 4.
e results of this scenario are shown in Figure 13. In this case, the EVs are equipped with onboard FQB chargers so that the capabilities of battery charging rate along with the charger reactive power support are controllable, simultaneously. Figure 13(a) illustrates the profile  of delivered apparent power from the upstream network for three different levels of penetration. According to the obtained results, during the peak load intervals, a significant percentage of EV capacities is assigned to the reactive power compensation. Meanwhile, EV batteries would absorb a small amount of their required energy from the power grid. us, owing to the maximum grid capacity, more penetration rates of EVs can connect to the power grid compared International Transactions on Electrical Energy Systems 13 with other cases. It could be seen, with a penetration rate of 66% and 100%, that the apparent power of the reference bus, from 7 : 00 to 22 : 00, is less than the same amount in the base case (without EVs), due to the reduction in EVs' reactive power compensation and shifting the EV charging schedules to the last hours of the night. Figure 13(b) indicates the voltage profile of grid nodes for different penetration rates. It is seen that the significant improvement of the voltage profile has been occured. So that the minimum voltage value increased from 0.9037 (p.u) in the base case to 0.938 (p.u) in case 4 (for 100% penetration rate) by employing active and reactive power control of EVs, concomitantly. Furthermore, the THDv value of network buses after using the FQB components is depicted in Figure 13(c) at peak hours. It is observed that by increasing the EVs' penetration into the network, the EVs can be successful in adjusting the THDv to the standard level (under 5%). e values for three terms of the objective function are presented in Table 9 according to the different values assigned to the weighing coefficients in each column. In the case of ω 1 � 0 and ω 2 � 1, only the first term of the objective  function is considered, and similarly for ω 1 � 1 and ω 2 � 0, the objective function just contains the THDv as the objective of the optimization problem. Also, in the third case, ω 1 and ω 2 have the same values equal to 0.5. According to Table 9, the obtained minimum and maximum values of the objective function for power loss and energy cost are equal to 1790 kW and 2223.3 kW and 1723.1$ and 1834.94$, respectively. Conversely, the minimum and maximum values of THDv are equal to 2.794% and 2.833% related to the first and second columns of the table, respectively. Accordingly, the maximum variation range of the first and second parts of the objective function is equal to 433.3 kW, 111.84$, and 0.039% related to power loss, energy cost, and THDv, respectively. Also, the number of exceeded buses (NEB) index, which refers to the buses whose THDv values have exceeded 5%, is presented in the last row. All in all, the importance of the terms in the objective function will be affected by changing the values of weighting factors (ω 1 and ω 2 ).

Comparing the Maximum Penetration Rates in Different
Case Studies. e maximum permissible percentage of EV penetration rate into the network corresponding to each case study is provided in Table 10. e results show that among  Weight coef. the case studies and results, the highest penetration factor belonged to 335% of case study 4 with simultaneous battery charging control and charger's reactive power management. However, this rate is decreased to 126% while the standard THDv level of 5% is considered the limiting factor. Also, employing the PFC and FQB types of chargers in cases 2 and 3 can increase the EVs' penetration rate to more than full penetration level (100%) considering the network's apparent power as the evaluation factor. However, the network operation indices such as the THDv level cause these rates to decrease to 18.5% and 100%, respectively. It should be noted that the maximum possibility of plugged-in EVs in case 2 will not be restricted considering THDv as a limiting factor.

Investigating Power Quality Indices with EVs' Charging/ Discharging Management.
In this subsection, we consider that there is the possibility of charging and discharging in EVs' batteries so that, depending on the grid requirements, a part of the load active power is supplied by EVs. Accordingly, the following case studies similar to the previous section with the new capability of EV batteries in discharging mode are considered for a better comparison of the EV's performance.

Case Study 5.
In this case, it is assumed that each EV is equipped with a PFC charger in which the charge and discharge rate of its battery is controllable and the reactive power is zero.

Case Study 6.
In this case, FQB chargers are used so that EVs can inject or absorb active power during the reactive power compensation process. It is assumed that all EVs are accepted to be involved in this structure, and the results of this state are investigated with the full EVs' penetration rate (100%). e daily patterns of the average apparent power in the primary substation, and the summation of EVs' active and reactive powers in different case studies are shown in Figure 14. According to the results in Figure 14(a), due to the mismanagement of EVs' charging and their uncoordinated charging in case 2, most EVs are connected to the network during peak hours (18 : 00 to 22 : 00). In addition, having the ability to supply or absorb active power during the compensation process in other cases leads to reducing the penetration rate of EVs during peak periods and consequently releasing the extra network capacity during these hours. Also, owing to the maximum grid capacity, only a limited number of EVs in case 1 can connect to the parking lots. Figures 14(b) and 14(c) show the active and reactive power exchange between parking lots and power grid in different case studies, respectively. Obviously, to motivate the owners of EVs to participate in the V2G applications, as a financial motive, the bid tariffs at peak times should be considered higher than those of the nonpeak region. From Figure 14(b), due to the low bid electricity prices from 18 : 00 to 22 : 00, it is observed that most EV owners prefer to participate in discharging operation mode. Also, from 22 : 00 to 24 : 00, the active power consumption of the distribution network has increased in cases 5 and 6, because a great percentage of EVs operating in charging mode. As seen in Figure 14(c), due to the existing voltage term in the objective function, a significant percentage of EVs' capacities is assigned to reactive power injection to improve the voltage profile throughout the daytime. Also, in cases 4 and 5, EVs' reactive power injection into the network is high from 16 : 00 to 24 : 00, due to the growing of EVs' penetration level into the network. In case 6, most pluggedin EVs in these intervals operate in discharging mode, which causes the reduction in sufficient reactive control support in comparison with other cases. Figure 15 illustrates the voltage profile of different case studies. As can be seen in Figure 15(a), by using reactive power support and active power control of EVs, the voltage profile is significantly improved, in particular over the peak intervals. So, the best voltage profile belongs to case 6 in which both reactive power and battery charge/discharge rate are controllable. In this case, the minimum and average values of the voltage profile are increased from 0.9037 (p.u) and 0.9453 (p.u) in the base case to 0.9687 (p.u) and 0.9798 (p.u), respectively. For example, the voltage profile on bus 18 as a node with the lowest voltage values compared to other buses has been shown in Figure 15(b). According to the results, due to the lack of reactive power compensation capability of the charger in cases 2 and 3, the EVs would not be able to maintain the voltage level at bus 18 to more than 0.95 at most intervals. is figure shows that the significant improvement of the voltage profile of bus 18 is related to case 6 by performing the active and reactive power control of EVs, concurrently. Figure 16 shows the daily profile of the network power factor for all cases. According to the obtained results, the power factor of the base case in the primary substation has a constant value (0.85) at all hours. Also, the power factor has been improved concerning the minimum acceptable value at all hours in cases of the EVs' capability in reactive power management. In case 6, the network power factor between 10 : 00 and 22 : 00 is lower compared to cases 2 and 5, due to the reduction in reactive power capacity of the charger for discharging the battery. From the figure, it is clear that because of the impossibility of reactive power injection in the charger structure in cases 3 and 5, the network power factor is less than the permissible limit (0.9) at all times, and also during some hours, especially between 18 : 00 and 22 : 00, has been dropped to under 0.85.  Figure 17. According to the results, it is evident that based on the THDv profile at peak intervals as shown in Figure 17(a), the combined mechanism of charging/discharging management of EVs' batteries and reactive power management of EVs' chargers in case 6 is successful in mitigating    harmonics in all nodes, owing to the decreasing the THDv level to lower than 5%. Also, the ability of proactive operation in cases 3 and 4 is efficient for the improvement of THDv of network buses. It is worth noting that the improvement percentage of THDv in case 5 is slightly more with respect to case 6 because a part of the maximum charger capacity in case 6 is allocated to the reactive power exchange with the network. e results of daily THDv on bus 18 for all cases are depicted in Figure 17(b). As can be observed, by the implementation of simultaneous capabilities of charging/ discharging along with reactive power controllability of EVs in the last case, the THDv related to most of the nodes is reached lower than 5 percent, which is the desired value. e obtained results through six defined case studies contain statistical data such as total active and reactive losses, and some network and harmonic indices are reported in Table 11. As can be seen, the main reason for the total active and reactive loss decrement in case 2 is the possibility of reactive power support, while EVs are plugged in, especially in the states without operating in discharging mode. In case 3, there is an increase in network power losses to about 21% relative to the base case because of only EVs' charging coordination. According to Table 11, the average voltage in cases 4, 5, and 6 are within the permissible range, which is defined as 5% of nominal voltage. e simulation results for harmonic studies indicate that both optimal charging/discharging scheduling of EV batteries and reactive power support of chargers affect the harmonic performance of the network. According to the results shown in the last row in Table 11, simultaneous performance of the charging/discharging mechanism and reactive power compensation resulted in more improvement of voltage and THDv indices and more reduction in power losses in case 6 compared with those of other cases. For instance, the THDv values of each node attain the standard range in which the average and the maximum of THDv have been obtained, at 2.178% and 3.781%, respectively. Furthermore, the maximum and minimum values achieved by the average voltage magnitude belong to case 3 and case 6, equal to 0.9442 p.u and 0.9798 p.u, respectively. Similarly, the same values for minimum voltage magnitude are related to case 3 and case 6, equal to 0.9021 p.u and 0.9687 p.u, respectively. All in all, the EV management in this new framework leads to reaching lower THDv levels at grid nodes and a significant improvement of the voltage profile, which is acceptable from the DNO's viewpoint. e performance of convergence to the optimum value versus the number of iterations of the different algorithms obtained for scenario 2 is shown in Figure 18. In this paper, GA, PSO, CSA [38], GSA [39], and PSO-GA have been selected and implemented to solve the proposed model. As can be observed in Figure 18, the CSA, GSA, GA, and PSO algorithms trap in local minimum points and are not able to decrease their fitness values after a specific number of iterations. However, the proposed PSO-GA algorithm, which takes the advantages of each independent algorithm, has a better convergence property and gives better results. erefore, the search accuracy and convergence rate of the joint PSO-GA algorithm can be enhanced although the total time is somewhat slower than that of the individual algorithms, which, at least for our offline problem, is not critical. Reference [40] is introduced for more information on hybrid optimization algorithms.

Comparing the Cases from an Economic Point of View.
In this subsection, it is assumed that there is a payment mechanism for energy consumption scheduling, through which the charging and the revenues from active power discharging and reactive power compensation are paid between DNO and EV owners. It should be noted that the cost of battery degradation is added to the EVs' charging cost. e obtained economic results are shown in Table 12. It is assumed that these results are calculated under the full EV penetration rate (100%) for all cases. Indeed, the cost of reactive power compensation is considered to be 8% of the active energy price at all intervals. e comparison of corresponding values in the case studies confirmed that case 6 resulted in the highest benefits and lowest costs so that the net payment was reduced to 1113.1$. Also, the income from discharging EVs with the value of 304.7$ is more than the cost of battery degradation, equal to 233$. So, EVs' discharging in this case has reduced the total costs by 71.7$. It can be observed that performing the charging/discharging coordination in cases 5 and 6 leads to a reduction in charging cost by 7.47% and 13.27% in comparison with the base case, respectively. Based on the outcomes, the existence of reactive power control capability of EVs in cases 2, 4, and 6 obtains 64.53$, 60.3$, and 55.22$ financial savings for DNO, respectively. is can be considered an advantage of EVs from an economic point of view. e gained results in case 3 show the highest net payment of almost 1870.7$ in comparison with all cases, which are related to the lack of both battery discharging and reactive power support capabilities in EVs. Overall, due to operating in discharging mode, the maximum decrement of the total cost belonged to cases 5 and 6 that equals 17.26% and 38.44%, respectively, compared with the base case.
Similar results can be obtained by using the proposed framework for any desired network so that the required substructures such as two-way communication between EV parking lots and DNO are available. In this regard, by using this structure, new and existing information could be exchanged between EVs and DNO, and consequently, DNO  can have comprehensive control over the optimal performance of EVs. Moreover, these results can give important signals to DNOs who intend to investigate the least adverse impacts on the network operation.

Conclusions
is paper introduced a comprehensive optimization model for simultaneous active and reactive power management in distribution networks using EV capabilities, upon considering the power management requirements of DNO and charging requirements of EV owners. Using this framework, the large-scale penetration of plugged-in EVs into the network could be operational while network operation indices are improved. In fact, the proposed problem both minimized network costs and improved power quality and performance of the network by stabilizing harmonic and voltage indices within permissible limits. Furthermore, simulation results showed the effectiveness of the introduced model upon exercising active and reactive power control of EVs so that charging costs of EV owners would be significantly reduced, without violating the grid power quality indices, such as THDv, voltage profiles, and power losses. Accordingly, the use of the introduced model, given the joint distribution network operation constraints and EV constraints, leads to the more reliable performance of DNOs, thereby significantly ensuring the supplying of the energy required for all plugged-in EVs.

Abbreviations t, i, l, h:
Index for time intervals, buses, lines, and harmonic order N t , N b , N l , N h , N EV : e number of time intervals, buses, lines, harmonics, and EVs Variables a r , a i : Active power loss coefficients b r , b i : Reactive power loss coefficients AER, L: All electrical range and mileage in electric mode BC, RE: Capacity and required energy of EV battery (kWh) DNO: Distribution network operator g, b, y: Conductance, susceptance, and admittance of line I E : Total current of the parking lot I G : Generated current in each bus I D : e current of the load I L : Current flowing through the line I ref : Reference current injection by the charger I h , φ h : Magnitude and phase angle of hth harmonic current MOP: Multiobjective problem NLDs: Nonlinear devices P B : Charge rate of all batteries in the parking lot (kW/h) P EV , Q EV : Injected active and reactive powers to grid by EV P + E , Q + E : Positive part of active and reactive power of parking P G , Q G : Active and reactive power generation P D , Q D : Active and reactive power of load P L , Q L : Active and reactive power of line P G ref : Active power generation in reference bus Q G ref : Reactive power generation in the reference bus S max G : Maximum capacity of generation S max L : Maximum capacity of lines S max E : Maximum capacity of all EV chargers in the parking lot TRE: Total required energy of parking lot THD V : Total harmonic distortion of voltage TEV: Total EVs in the parking lot T step : e time interval for cost function updating (hour) V c , I c : Voltage and current of the converter V PCC : e voltage of point of common coupling V, θ: Magnitude and phase angle of the voltage W: e total energy of batteries in the parking lot θ R : e rated phase angle of EV φ 1 : e phase difference between voltage and current ω 1 and ω 2 : Weighting factors of the objective function.

Data Availability
All data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.