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

Authors: Mojtaba Partovi; Saeid Esmaeili; Morteza Aein
Journal: International Transactions on Electrical Energy Systems
 (2022)

---

## Abstract

Electrical vehicles (EVs) are among the fastest-growing electrical loads that change both temporally and spatially on distribution networks. The 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. The 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). The 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.


---

## Body

## 1. 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. This 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. The 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. The 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]. This 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. Thus, 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]. This 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. Therefore, 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. The 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–22]. The 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. These studies indicate that the potential of EV utilization in simultaneous active and reactive power management is more effective in improving power quality indices.At any time, the injection or absorption of EV’s reactive power is subjected to some restrictions, depending on the operating point. In most of the past research, only a determined range of reactive power was considered for EV chargers [8–22]. However, based on some research, the reactive power capability of the EV charger was affected by its current, voltage, and output active power [23–25].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. This 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 conditionsThe rest of this paper is organized as follows: Section2 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.


## 2. 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. Therefore, the physical details of the EVs structure are not considered. The EV specifications used in this article are presented in Table1.Table 1
The specifications of EVs [20, 28].
Vehicle typeNissan Leaf (EV)All-electric range (mile)73Battery capacity (kWh)24Charger capacity (kVA)PFC3.3FQB4.6AC charging/discharging power (kW)3.3Specific energy (kWh/mile)0.32Charging time (hour)7In 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. The histogram of the last trip arrival time and first trip departure time in a day, with 1-hour 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. This 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.Figure 1
The histogram and cumulative curves of EVs’ departure and arrival time and EVs’ availability profile.


### 2.1. 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. The 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 Figure2. 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)VPCC=Vmsinωt.Figure 2
The structure of EV in grid-connection mode.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](2)Iref=I1sinωt±φ1.According to the phase difference between voltage and current components (φ1), the following different cases will be possible:(i)
In the first case, the inverter output current will be in phase (0o) or opposite in phase (180o) with the voltage. So, the EV will be able to supply/absorb only the active power to/from the network(ii)
Ifφ=90o, due to the phase difference of 90° between voltage and current, only the reactive power can be bidirectionally transferred into the network(iii)
In this case,−90o≤φ≤90o, according to the phase angle, different levels of both active and reactive powers can be exported from the power grid to the charger and vice versaHence, 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.


### 2.2. 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. This 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].Figure 3
The structure of the onboard FQB charger.The operating area of an FQB charger is restricted by two main limitations, namely, transmittable power and charger capacity. The GSC has a certain maximum current-carrying capacity, which enforces a limit on the transmittable power of the EV charger. The circular constraint of active and reactive powers at the inverter current limit is expressed as follows [23–25]:(3)PEV2+QEV2=VPCCIINV2.Another limitation on transmittable power is enforced by the voltage of the GSC (VINV), which can be written as follows:(4)PEV2+QEV2+VPCC2Xc2=VINVVPCCXc2,where Xc is the total reactance of transformers and grid filters from the output terminal of the charger to PCC, and also VPCC is the voltage at the EV connection bus (Figure 3). This equation indicates a circle with a radius (r1=VINVVPCC/Xc) centered at (c=0,−VPCC2/Xc) 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. The maximum current-carrying capacity of the inverter (IINVmax) 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.(5)IINVmax=PEV,R2+QEV,R2VPCCmin.Figure 4
The capability curve of the EV charger.Considering that(6)QEV,R=PEV,RtanθR,(7)PFR=costan−1QEV,RPEV,R,(8)SEV,R=PEV,R,where PFR and SEV,R are the rated power factor and base megavolt ampere (MVA) of the EVs, respectively. According to equations (5) and (6), the value of IINVmax in per unit (p.u) is calculated as follows:(9)IINVmax=1+tan2θRVPCCmin.By adjusting thePEV, VPCC, and f parameters at their maximum values in equation (4), the maximum inverter voltage in p.u can be calculated by the following equation.(10)VINVmax=fmaxXcVPCCmax1+tanθR+VPCCmax2fmaxXc2.Accordingly, the maximum capability of reactive power injection by the EV charger is the minimum values ofQimax and Qvmax as follows:(11)QEVmax=minQimax,Qvmax,where Qimax and Qvmax 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 PEV, which are given in(12)Qimax=VPCCIINVmax2−PEV2,(13)Qvmax=VPCCVINVmaxXc2−PEV2−VPCC2Xc.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 Xc=0.3p.u, fmax=1.01p.u, VPCCmin=0.9p.u, and VPCCmax=1.05p.u. So, based on equations (9) and (10), the values of VINVmax and IINVmax are 1.17 and 1.17, respectively, and then, the reactive power capabilities of the charger are obtained. The reactive power functional areas of the EV charger for different values of active power and power factor are shown in 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.Figure 5
EV’s capability diagram forVPCC = 1 p.u.All available operating regions of the charger along with the transmittable power limits are depicted in Figure4. 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 reactive power request, it could act as a capacitor or inductor. Thus, 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.


## 2.1. 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. The 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 Figure2. 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)VPCC=Vmsinωt.Figure 2
The structure of EV in grid-connection mode.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](2)Iref=I1sinωt±φ1.According to the phase difference between voltage and current components (φ1), the following different cases will be possible:(i)
In the first case, the inverter output current will be in phase (0o) or opposite in phase (180o) with the voltage. So, the EV will be able to supply/absorb only the active power to/from the network(ii)
Ifφ=90o, due to the phase difference of 90° between voltage and current, only the reactive power can be bidirectionally transferred into the network(iii)
In this case,−90o≤φ≤90o, according to the phase angle, different levels of both active and reactive powers can be exported from the power grid to the charger and vice versaHence, 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.


## 2.2. 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. This 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].Figure 3
The structure of the onboard FQB charger.The operating area of an FQB charger is restricted by two main limitations, namely, transmittable power and charger capacity. The GSC has a certain maximum current-carrying capacity, which enforces a limit on the transmittable power of the EV charger. The circular constraint of active and reactive powers at the inverter current limit is expressed as follows [23–25]:(3)PEV2+QEV2=VPCCIINV2.Another limitation on transmittable power is enforced by the voltage of the GSC (VINV), which can be written as follows:(4)PEV2+QEV2+VPCC2Xc2=VINVVPCCXc2,where Xc is the total reactance of transformers and grid filters from the output terminal of the charger to PCC, and also VPCC is the voltage at the EV connection bus (Figure 3). This equation indicates a circle with a radius (r1=VINVVPCC/Xc) centered at (c=0,−VPCC2/Xc) 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. The maximum current-carrying capacity of the inverter (IINVmax) 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.(5)IINVmax=PEV,R2+QEV,R2VPCCmin.Figure 4
The capability curve of the EV charger.Considering that(6)QEV,R=PEV,RtanθR,(7)PFR=costan−1QEV,RPEV,R,(8)SEV,R=PEV,R,where PFR and SEV,R are the rated power factor and base megavolt ampere (MVA) of the EVs, respectively. According to equations (5) and (6), the value of IINVmax in per unit (p.u) is calculated as follows:(9)IINVmax=1+tan2θRVPCCmin.By adjusting thePEV, VPCC, and f parameters at their maximum values in equation (4), the maximum inverter voltage in p.u can be calculated by the following equation.(10)VINVmax=fmaxXcVPCCmax1+tanθR+VPCCmax2fmaxXc2.Accordingly, the maximum capability of reactive power injection by the EV charger is the minimum values ofQimax and Qvmax as follows:(11)QEVmax=minQimax,Qvmax,where Qimax and Qvmax 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 PEV, which are given in(12)Qimax=VPCCIINVmax2−PEV2,(13)Qvmax=VPCCVINVmaxXc2−PEV2−VPCC2Xc.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 Xc=0.3p.u, fmax=1.01p.u, VPCCmin=0.9p.u, and VPCCmax=1.05p.u. So, based on equations (9) and (10), the values of VINVmax and IINVmax are 1.17 and 1.17, respectively, and then, the reactive power capabilities of the charger are obtained. The reactive power functional areas of the EV charger for different values of active power and power factor are shown in 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.Figure 5
EV’s capability diagram forVPCC = 1 p.u.All available operating regions of the charger along with the transmittable power limits are depicted in Figure4. 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 reactive power request, it could act as a capacitor or inductor. Thus, 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.


## 3. 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.


### 3.1. Objective Function

The 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. The 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 (f1) 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. The second term (f2) includes the summation of THDv deviation of grid nodes from the standard value over a 24 h period. The objective function can be defined as follows:(14)F=minf1=∑t=1NtKPPlosst+∑t=1Nt∑i=1NbλtPEi,t+−PEi,t−+λtK1QEi,t+−QEi,t−+∑t=1NtCBDt,f2=∑t=1Nt∑i=1NbTHDVi,t,,where KP is the cost of active power loss and based on [16] is equal to 50 $/MWh. λt refers to the cost of purchasing or supplying electric energy in $/kWh. Also, based on [22], K1 is a coefficient with a constant value equal to 0.08. The total active power loss for each hour is calculated through the following equation:(15)Plosst=∑i=1NlPlossi1+∑i=1Nl∑h=2NhPlossih,∀t.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). This is to guarantee that no unnecessary EVs’ battery charging/discharging occurs and also to prevent EVs’ battery degradation.(16)CBDt=18760×IR×1+IRLP1+IRLP+1×ibp×Callt,where CBD 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].The objective function that should be minimized is shown in the following equation:(17)Fx=ω1f1n+ω2f2n.The 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. f1n and f2n are the normalized values of f1 and f2, respectively, which are calculated through the following equation:(18)finx=fi,max−fifi,max−fi,min,where fi,max and fi,min are the maximum and minimum values of fi, respectively.


### 3.2. 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.


#### 3.2.1. Load Flow Constraints

These 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. Therefore, PG, QG, and IG for all grid nodes except reference are considered zero. The other nodes consisting of linear and nonlinear loads, and EV parking lots, are PQ-type buses.(19)PGi,t−PDi,t−PEVi,t=∑j=1NbPLi,j,t,∀i,t,(20)QGi,t−QDi,t−QEVi,t=∑j=1NbQLi,j,t,∀i,t,(21)PLi,j,t=gi,j1Vi,t12+Vi,t1Vj,t1gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,∀i,j,t,(22)QLi,j,t=−bi,j1Vi,t12+Vi,t1Vj,t1bi,j1cosθi,t−θj,t−gi,j1sinθi,t−θj,t,∀i,j,t,(23)IGi,th−IDi,th−IEVi,th=∑j=1NbILi,j,th,∀i,t,h≠1,(24)ILi,j,th=yi,jhVi,th−Vj,th,∀i,j,t,h≠1.


#### 3.2.2. System Performance Limits

Equation (25) indicates that the root mean square (RMS) value of the voltage on each bus should lie in the standard range, in which Vmin and Vmax 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.(25)Vmin≤∑h=1NhVih2≤Vmax,∀i,t,(26)PGi,t2+QGi,t2≤SGimax2∀i,t,(27)PLi,j,t2+QLi,j,t2≤SLi,jmax2,∀i,j,t.


#### 3.2.3. 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).(28)PEVi,t=PBi,t+PLCi,t,∀i,t,(29)QEVi,t=QBi,t+QLCi,t,∀i,t,(30)PLCi,t=brPEVi,t+biQEVi,t,∀i,t,(31)QLCi,t=arPEVi,t+aiQEVi,t,∀i,t,(32)Wi,t=Wi,t0+TstepPBi,t,∀i,t=1,W≥0,(33)PEi,t2+QEi,t2≤SEimax2,∀i,t,(34)−PBi,tmax≤PBi,t≤PBi,tmax,∀i,t.The 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.(35)REi,t=1−SOCtBC,∀i,t,(36)SOCi,t=1−LAER,∀i,t,L≤AER,(37)TREi,t=∑NEVREi,t,∀i,t,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.


#### 3.2.4. Constraints of Harmonic Indices

To supply high-quality 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.Therefore, based on the harmonic standards, the THDv on each bus and the individual harmonic factor have been restricted to 5% and 3% ofVi,t1, respectively. The 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.(38)THDV,i,t=∑h=2NhVi,th2Vi,t1≤THDVmax,∀i,t,(39)Vi,th≤Vihmax,∀i,t,h≠1,(40)−IEi,thmax≤IEi,th≤IEi,thmax,∀i,t,h,(41)−IGihmax≤IGi,th≤IGi,thmax,∀i,t,h,(42)−ILi,jhmax≤ILi,j,th≤ILi,jmaxh,∀i,j,t,h.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. Therefore, 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.


## 3.1. Objective Function

The 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. The 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 (f1) 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. The second term (f2) includes the summation of THDv deviation of grid nodes from the standard value over a 24 h period. The objective function can be defined as follows:(14)F=minf1=∑t=1NtKPPlosst+∑t=1Nt∑i=1NbλtPEi,t+−PEi,t−+λtK1QEi,t+−QEi,t−+∑t=1NtCBDt,f2=∑t=1Nt∑i=1NbTHDVi,t,,where KP is the cost of active power loss and based on [16] is equal to 50 $/MWh. λt refers to the cost of purchasing or supplying electric energy in $/kWh. Also, based on [22], K1 is a coefficient with a constant value equal to 0.08. The total active power loss for each hour is calculated through the following equation:(15)Plosst=∑i=1NlPlossi1+∑i=1Nl∑h=2NhPlossih,∀t.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). This is to guarantee that no unnecessary EVs’ battery charging/discharging occurs and also to prevent EVs’ battery degradation.(16)CBDt=18760×IR×1+IRLP1+IRLP+1×ibp×Callt,where CBD 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].The objective function that should be minimized is shown in the following equation:(17)Fx=ω1f1n+ω2f2n.The 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. f1n and f2n are the normalized values of f1 and f2, respectively, which are calculated through the following equation:(18)finx=fi,max−fifi,max−fi,min,where fi,max and fi,min are the maximum and minimum values of fi, respectively.


## 3.2. 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.


### 3.2.1. Load Flow Constraints

These 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. Therefore, PG, QG, and IG for all grid nodes except reference are considered zero. The other nodes consisting of linear and nonlinear loads, and EV parking lots, are PQ-type buses.(19)PGi,t−PDi,t−PEVi,t=∑j=1NbPLi,j,t,∀i,t,(20)QGi,t−QDi,t−QEVi,t=∑j=1NbQLi,j,t,∀i,t,(21)PLi,j,t=gi,j1Vi,t12+Vi,t1Vj,t1gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,∀i,j,t,(22)QLi,j,t=−bi,j1Vi,t12+Vi,t1Vj,t1bi,j1cosθi,t−θj,t−gi,j1sinθi,t−θj,t,∀i,j,t,(23)IGi,th−IDi,th−IEVi,th=∑j=1NbILi,j,th,∀i,t,h≠1,(24)ILi,j,th=yi,jhVi,th−Vj,th,∀i,j,t,h≠1.


### 3.2.2. System Performance Limits

Equation (25) indicates that the root mean square (RMS) value of the voltage on each bus should lie in the standard range, in which Vmin and Vmax 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.(25)Vmin≤∑h=1NhVih2≤Vmax,∀i,t,(26)PGi,t2+QGi,t2≤SGimax2∀i,t,(27)PLi,j,t2+QLi,j,t2≤SLi,jmax2,∀i,j,t.


### 3.2.3. 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).(28)PEVi,t=PBi,t+PLCi,t,∀i,t,(29)QEVi,t=QBi,t+QLCi,t,∀i,t,(30)PLCi,t=brPEVi,t+biQEVi,t,∀i,t,(31)QLCi,t=arPEVi,t+aiQEVi,t,∀i,t,(32)Wi,t=Wi,t0+TstepPBi,t,∀i,t=1,W≥0,(33)PEi,t2+QEi,t2≤SEimax2,∀i,t,(34)−PBi,tmax≤PBi,t≤PBi,tmax,∀i,t.The 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.(35)REi,t=1−SOCtBC,∀i,t,(36)SOCi,t=1−LAER,∀i,t,L≤AER,(37)TREi,t=∑NEVREi,t,∀i,t,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.


### 3.2.4. Constraints of Harmonic Indices

To supply high-quality 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.Therefore, based on the harmonic standards, the THDv on each bus and the individual harmonic factor have been restricted to 5% and 3% ofVi,t1, respectively. The 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.(38)THDV,i,t=∑h=2NhVi,th2Vi,t1≤THDVmax,∀i,t,(39)Vi,th≤Vihmax,∀i,t,h≠1,(40)−IEi,thmax≤IEi,th≤IEi,thmax,∀i,t,h,(41)−IGihmax≤IGi,th≤IGi,thmax,∀i,t,h,(42)−ILi,jhmax≤ILi,j,th≤ILi,jmaxh,∀i,j,t,h.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. Therefore, 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.


## 3.2.1. Load Flow Constraints

These 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. Therefore, PG, QG, and IG for all grid nodes except reference are considered zero. The other nodes consisting of linear and nonlinear loads, and EV parking lots, are PQ-type buses.(19)PGi,t−PDi,t−PEVi,t=∑j=1NbPLi,j,t,∀i,t,(20)QGi,t−QDi,t−QEVi,t=∑j=1NbQLi,j,t,∀i,t,(21)PLi,j,t=gi,j1Vi,t12+Vi,t1Vj,t1gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,gi,j1cosθi,t−θj,t+bi,j1sinθi,t−θj,t,∀i,j,t,(22)QLi,j,t=−bi,j1Vi,t12+Vi,t1Vj,t1bi,j1cosθi,t−θj,t−gi,j1sinθi,t−θj,t,∀i,j,t,(23)IGi,th−IDi,th−IEVi,th=∑j=1NbILi,j,th,∀i,t,h≠1,(24)ILi,j,th=yi,jhVi,th−Vj,th,∀i,j,t,h≠1.


## 3.2.2. System Performance Limits

Equation (25) indicates that the root mean square (RMS) value of the voltage on each bus should lie in the standard range, in which Vmin and Vmax 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.(25)Vmin≤∑h=1NhVih2≤Vmax,∀i,t,(26)PGi,t2+QGi,t2≤SGimax2∀i,t,(27)PLi,j,t2+QLi,j,t2≤SLi,jmax2,∀i,j,t.


## 3.2.3. 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).(28)PEVi,t=PBi,t+PLCi,t,∀i,t,(29)QEVi,t=QBi,t+QLCi,t,∀i,t,(30)PLCi,t=brPEVi,t+biQEVi,t,∀i,t,(31)QLCi,t=arPEVi,t+aiQEVi,t,∀i,t,(32)Wi,t=Wi,t0+TstepPBi,t,∀i,t=1,W≥0,(33)PEi,t2+QEi,t2≤SEimax2,∀i,t,(34)−PBi,tmax≤PBi,t≤PBi,tmax,∀i,t.The 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.(35)REi,t=1−SOCtBC,∀i,t,(36)SOCi,t=1−LAER,∀i,t,L≤AER,(37)TREi,t=∑NEVREi,t,∀i,t,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.


## 3.2.4. Constraints of Harmonic Indices

To supply high-quality 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.Therefore, based on the harmonic standards, the THDv on each bus and the individual harmonic factor have been restricted to 5% and 3% ofVi,t1, respectively. The 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.(38)THDV,i,t=∑h=2NhVi,th2Vi,t1≤THDVmax,∀i,t,(39)Vi,th≤Vihmax,∀i,t,h≠1,(40)−IEi,thmax≤IEi,th≤IEi,thmax,∀i,t,h,(41)−IGihmax≤IGi,th≤IGi,thmax,∀i,t,h,(42)−ILi,jhmax≤ILi,j,th≤ILi,jmaxh,∀i,j,t,h.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. Therefore, 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.


## 4. Problem-Solving with an Optimization Algorithm

The 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 population-based 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. The 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. Therefore, 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. The 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, velocityvit and position xit, are updated according to(43)vit+1=wvit+c1r1pbesti−xit+c2r2gbest−xit,(44)xit+1=xit+vit+1,(45)w=2φ−2+φ2−4φ,∀φ=φ1+φ2,where t is the number of iterations, and r1 and r2 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, c1 and c2 are learning factors that are equal to φ1w and φ2w, 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. This 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.


### 4.2. Solution Procedure

As mentioned before, EVs’ optimal power management in distribution networks considering reactive power compensation, is a nonlinear optimization problem. Therefore, 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. The 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. The process of the mentioned problem-solving at each interval can be described in the following steps:(i)
First of all, the initial data of the PSO-GA, such as population size, the maximum number of iterations, and the number of variables, are determined based on the problem structure. Moreover, the initial coefficients associated with both GA and PSO should be specified along with the power network data.(ii)
In the next step, the random position and velocity vectors are determined based on the initially obtained coefficients by executing the initialization of PSO-GA. Then, the harmonic power flow is executed 24 hours a day and the harmonic values of each node such as voltage and THDv are calculated and stored.(iii)
In this step, the obtained vectors, including best values, will be applied to the next step as the initial input vectors.(iv)
The PSO-GA enters the main loop, and in each iteration, the personal best and global best are updated according to the previous step.(v)
This process is repeated until the certain stop criterion is satisfied, and finally, the output results are separately stored and analyzed.The details of the solution method are presented in a flowchart according to Figure6.Figure 6
Flowchart of the solution procedure.


## 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. The 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. Therefore, 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. The 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, velocityvit and position xit, are updated according to(43)vit+1=wvit+c1r1pbesti−xit+c2r2gbest−xit,(44)xit+1=xit+vit+1,(45)w=2φ−2+φ2−4φ,∀φ=φ1+φ2,where t is the number of iterations, and r1 and r2 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, c1 and c2 are learning factors that are equal to φ1w and φ2w, 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. This 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.


## 4.2. Solution Procedure

As mentioned before, EVs’ optimal power management in distribution networks considering reactive power compensation, is a nonlinear optimization problem. Therefore, 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. The 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. The process of the mentioned problem-solving at each interval can be described in the following steps:(i)
First of all, the initial data of the PSO-GA, such as population size, the maximum number of iterations, and the number of variables, are determined based on the problem structure. Moreover, the initial coefficients associated with both GA and PSO should be specified along with the power network data.(ii)
In the next step, the random position and velocity vectors are determined based on the initially obtained coefficients by executing the initialization of PSO-GA. Then, the harmonic power flow is executed 24 hours a day and the harmonic values of each node such as voltage and THDv are calculated and stored.(iii)
In this step, the obtained vectors, including best values, will be applied to the next step as the initial input vectors.(iv)
The PSO-GA enters the main loop, and in each iteration, the personal best and global best are updated according to the previous step.(v)
This process is repeated until the certain stop criterion is satisfied, and finally, the output results are separately stored and analyzed.The details of the solution method are presented in a flowchart according to Figure6.Figure 6
Flowchart of the solution procedure.


## 5. 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. The 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. The 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.Figure 7
IEEE 33-bus test distribution system.Figure 8
Daily load profile.Table 2
The hourly electricity energy price [35].
HourPrice ($/kWh)1–70.0168–170.02418–220.0323–240.024Table 3
The bus categories and the number of EVs in each parking lot.
GroupingNumber of EVsBus numbersGroup 1215, 6, 9–13, 15–17, 26–28, 33Group 2302–4, 14, 18–25, 29Group 3607, 8, 30–32The harmonic current spectrum of EV chargers and NLDs in percent, as shown in Table4, 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), the coefficients ar, ai, br, and bi for all EVs are equal to 0.09, 0.0475, 0.02, and 0.02, respectively. Also, the values of IEhmax for 2≤h≤20 and h≥21 are equal to 0.1SEmax and 0.05SEmax, 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.Table 4
The harmonic current spectrum of EV chargers and industrial nonlinear loads [16, 36].
Harmonic orderEV chargerSix-pulse converterMag (%)Phase (deg)Mag (%)Phase (deg)11000100052−6720072−6714.3091.5−469.10111.8−467.70Table 5
Maximum harmonic current injection of a single-phase bidirectional charger [37].
Harmonic orderMaximum current distortion (%)OddEvenh<114111≤h<1720.511≤h<231.50.37523≤h<350.60.1535≤h0.30.075


### 5.1. Case Studies

In this paper, the proposed problem is solved by implementing PSO-GA in the MATLAB R2020a software. The simulations were performed on a computer with an Intel Core i7-6500u @ 2.5 GHz processor and 16 GB of RAM. The 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 Table6, the EV capabilities in different case studies are described to investigate employing EV’s active and reactive power control in distribution network operation.Table 6
EV capabilities in different case studies.
Case studyEV control capabilityDescriptionActive powerReactive powerCharging modeDischarging modeCase 1×××Without the capability of EVs’ active and reactive power controlCase 2××√With the capability of only EVs’ reactive power controlCase 3√××With the capability of only EVs’ active power controlCase 4√×√With the capability of EVs’ active and reactive power control, simultaneouslyCase 5√√×With the capability of only EVs’ active power controlCase 6√√√With the capability of EVs’ active and reactive power control, simultaneouslyFor a better comparison of case studies, the base case is introduced in which there is no EV in the distribution network. Figure9 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.Figure 9
The THDv values at different buses for the base case at peak hour.The proposed problem and the PSO-GA optimization algorithms are applied to under six following case studies.


#### 5.1.1. 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.The daily pattern of the average apparent power delivered from the primary substation for different levels of EV penetration is shown in Figure10. 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. Therefore, 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.Figure 10
Obtained results of case 1 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile at peak time. (c) THDv profile at peak time.
(a)(b)(c)Table 7
Obtained results for EV numbers and energy losses in cases 1 and 2.
Case studyBase caseCase 1Case 2Limiting factor—THDvSmaxTHDvSmaxPenetration rate (%)014.521.518.5100Number of EVs0143212182984Energy losses (kWh)2171.522262.492308.022012.782178.26


#### 5.1.2. 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. The 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 Figures11(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 Smax and THDV 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.Figure 11
Comparison of obtained results in case 1 and case 2 with 21.5% penetration rate. (a) Daily apparent power profile supplied from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour. Results of case 2 for different penetration rates. (d) The daily apparent power profile of substation bus in case 2. (e) Voltage profile of network buses at peak hour in case 2. (f) THDv profile of network buses at peak hour in case 2.
(a)(b)(c)(d)(e)(f)Table 8
Simulation results of network operation indices in cases 1 and 2 (21.5% penetration rate).
Operation indicesDelivered energy (kWh)Peak load losses (p.u.)Minimum voltage (p.u.)Average of THDv (%)Maximum delivered power (p.u.)Case 160986.52.3080.89892.8464.8Case 260682.72.0040.90832.8374.54Improvement (%)0.4913.171.040.315.41


#### 5.1.3. 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. The daily apparent power curve of substation bus, the voltage profile of buses, and the THDv level of grid nodes are shown in Figures12(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). This 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.Figure 12
Obtained results of case 3 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)


#### 5.1.4. Case Study 4

The results of this scenario are shown in Figure13. 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. Thus, owing to the maximum grid capacity, more penetration rates of EVs can connect to the power grid compared 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
Obtained results of case 4 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)Figure13(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%).The values for three terms of the objective function are presented in Table9 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).Table 9
Objective function values for different weighing coefficients (ω1 and ω2).
Weight coef.ω1 = 0, ω2 = 1ω1 = 1, ω2 = 0ω1 = 0.5, ω2 = 0.5Power loss (kW)2223.317901843Energy cost ($)1834.941723.11738.3THDv (%)2.7942.8332.815NEB021


### 5.2. Comparing the Maximum Penetration Rates in Different Case Studies

The maximum permissible percentage of EV penetration rate into the network corresponding to each case study is provided in Table10. The results show that among 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.Table 10
Maximum EV penetration rates into the network in case studies.
Case studyLimiting factorCase 1Case 2Case 3Case 4Maximum penetration rate (%)Smax21.5100200335THDv14.518.5-126


### 5.3. 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.


#### 5.3.1. 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.


#### 5.3.2. 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%). The 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 Figure14. 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 plugged-in EVs in these intervals operate in discharging mode, which causes the reduction in sufficient reactive control support in comparison with other cases.Figure 14
(a) Daily apparent power profile of primary substation. (b) The daily pattern of all EVs’ active power consumption in the network. (c) The daily pattern of all EVs’ reactive power injection in the network.
(a)(b)(c)Figure15 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. This 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 15
(a) Voltage profile of network buses at peak hour. (b) Daily profile of voltage at bus 18.
(a)(b)Figure16 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 16
Daily power factor pattern of network primary substation.The THDv of each node for all cases is shown in Figure17. 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. The 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.Figure 17
(a) THDv profile of network buses at peak hour. (b) Daily profile of THDv at bus 18.
(a)(b)The 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 Table11. 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. The 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.Table 11
Results of the optimization problem for different case studies and solutions.
Power quality indicesBase caseCase 2Case 3Case 4Case 5Case 6Total active power loss (kW)2171.52178.22635.51967.91711.11126.3Total reactive power loss (kVAr)1469.81490.31786.31342.61146.2754.77Average of voltage (p.u.)0.94530.94920.94420.96140.96490.9798Minimum voltage magnitude (p.u)0.90370.90460.90210.9380.94550.9687Average of THDv (%)2.77383.09282.80322.8132.19752.1788Maximum THDv magnitude (%)4.89335.64594.94355.08873.58533.7815The performance of convergence to the optimum value versus the number of iterations of the different algorithms obtained for scenario 2 is shown in Figure18. 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. Therefore, 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.Figure 18
Convergence characteristics of CSA, GSA, GA, PSO, and PSO-GA algorithms for case 6.


### 5.4. 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. The obtained economic results are shown in Table12. 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. The 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. This can be considered an advantage of EVs from an economic point of view. The 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.Table 12
Comparison of economic results in case studies.
Economic indicesBase caseCase 2Case 3Case 4Case 5Case 6Costs of EVs’ charging and battery degradation ($)1662.91908.81870.71845.515561473.1Income of EVs’ discharging ($)0000139.96304.7Income of reactive compensation ($)064.533060.303055.226Total cost ($)1662.91844.21870.71785.114161113.1Similar 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.


## 5.1. Case Studies

In this paper, the proposed problem is solved by implementing PSO-GA in the MATLAB R2020a software. The simulations were performed on a computer with an Intel Core i7-6500u @ 2.5 GHz processor and 16 GB of RAM. The 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 Table6, the EV capabilities in different case studies are described to investigate employing EV’s active and reactive power control in distribution network operation.Table 6
EV capabilities in different case studies.
Case studyEV control capabilityDescriptionActive powerReactive powerCharging modeDischarging modeCase 1×××Without the capability of EVs’ active and reactive power controlCase 2××√With the capability of only EVs’ reactive power controlCase 3√××With the capability of only EVs’ active power controlCase 4√×√With the capability of EVs’ active and reactive power control, simultaneouslyCase 5√√×With the capability of only EVs’ active power controlCase 6√√√With the capability of EVs’ active and reactive power control, simultaneouslyFor a better comparison of case studies, the base case is introduced in which there is no EV in the distribution network. Figure9 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.Figure 9
The THDv values at different buses for the base case at peak hour.The proposed problem and the PSO-GA optimization algorithms are applied to under six following case studies.


### 5.1.1. 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.The daily pattern of the average apparent power delivered from the primary substation for different levels of EV penetration is shown in Figure10. 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. Therefore, 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.Figure 10
Obtained results of case 1 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile at peak time. (c) THDv profile at peak time.
(a)(b)(c)Table 7
Obtained results for EV numbers and energy losses in cases 1 and 2.
Case studyBase caseCase 1Case 2Limiting factor—THDvSmaxTHDvSmaxPenetration rate (%)014.521.518.5100Number of EVs0143212182984Energy losses (kWh)2171.522262.492308.022012.782178.26


### 5.1.2. 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. The 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 Figures11(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 Smax and THDV 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.Figure 11
Comparison of obtained results in case 1 and case 2 with 21.5% penetration rate. (a) Daily apparent power profile supplied from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour. Results of case 2 for different penetration rates. (d) The daily apparent power profile of substation bus in case 2. (e) Voltage profile of network buses at peak hour in case 2. (f) THDv profile of network buses at peak hour in case 2.
(a)(b)(c)(d)(e)(f)Table 8
Simulation results of network operation indices in cases 1 and 2 (21.5% penetration rate).
Operation indicesDelivered energy (kWh)Peak load losses (p.u.)Minimum voltage (p.u.)Average of THDv (%)Maximum delivered power (p.u.)Case 160986.52.3080.89892.8464.8Case 260682.72.0040.90832.8374.54Improvement (%)0.4913.171.040.315.41


### 5.1.3. 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. The daily apparent power curve of substation bus, the voltage profile of buses, and the THDv level of grid nodes are shown in Figures12(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). This 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.Figure 12
Obtained results of case 3 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)


### 5.1.4. Case Study 4

The results of this scenario are shown in Figure13. 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. Thus, owing to the maximum grid capacity, more penetration rates of EVs can connect to the power grid compared 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
Obtained results of case 4 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)Figure13(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%).The values for three terms of the objective function are presented in Table9 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).Table 9
Objective function values for different weighing coefficients (ω1 and ω2).
Weight coef.ω1 = 0, ω2 = 1ω1 = 1, ω2 = 0ω1 = 0.5, ω2 = 0.5Power loss (kW)2223.317901843Energy cost ($)1834.941723.11738.3THDv (%)2.7942.8332.815NEB021


## 5.1.1. 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.The daily pattern of the average apparent power delivered from the primary substation for different levels of EV penetration is shown in Figure10. 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. Therefore, 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.Figure 10
Obtained results of case 1 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile at peak time. (c) THDv profile at peak time.
(a)(b)(c)Table 7
Obtained results for EV numbers and energy losses in cases 1 and 2.
Case studyBase caseCase 1Case 2Limiting factor—THDvSmaxTHDvSmaxPenetration rate (%)014.521.518.5100Number of EVs0143212182984Energy losses (kWh)2171.522262.492308.022012.782178.26


## 5.1.2. 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. The 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 Figures11(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 Smax and THDV 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.Figure 11
Comparison of obtained results in case 1 and case 2 with 21.5% penetration rate. (a) Daily apparent power profile supplied from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour. Results of case 2 for different penetration rates. (d) The daily apparent power profile of substation bus in case 2. (e) Voltage profile of network buses at peak hour in case 2. (f) THDv profile of network buses at peak hour in case 2.
(a)(b)(c)(d)(e)(f)Table 8
Simulation results of network operation indices in cases 1 and 2 (21.5% penetration rate).
Operation indicesDelivered energy (kWh)Peak load losses (p.u.)Minimum voltage (p.u.)Average of THDv (%)Maximum delivered power (p.u.)Case 160986.52.3080.89892.8464.8Case 260682.72.0040.90832.8374.54Improvement (%)0.4913.171.040.315.41


## 5.1.3. 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. The daily apparent power curve of substation bus, the voltage profile of buses, and the THDv level of grid nodes are shown in Figures12(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). This 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.Figure 12
Obtained results of case 3 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)


## 5.1.4. Case Study 4

The results of this scenario are shown in Figure13. 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. Thus, owing to the maximum grid capacity, more penetration rates of EVs can connect to the power grid compared 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
Obtained results of case 4 for different penetration rates. (a) Daily apparent power delivered from the upstream network. (b) Voltage profile of network buses at peak hour. (c) THDv profile of network buses at peak hour.
(a)(b)(c)Figure13(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%).The values for three terms of the objective function are presented in Table9 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).Table 9
Objective function values for different weighing coefficients (ω1 and ω2).
Weight coef.ω1 = 0, ω2 = 1ω1 = 1, ω2 = 0ω1 = 0.5, ω2 = 0.5Power loss (kW)2223.317901843Energy cost ($)1834.941723.11738.3THDv (%)2.7942.8332.815NEB021


## 5.2. Comparing the Maximum Penetration Rates in Different Case Studies

The maximum permissible percentage of EV penetration rate into the network corresponding to each case study is provided in Table10. The results show that among 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.Table 10
Maximum EV penetration rates into the network in case studies.
Case studyLimiting factorCase 1Case 2Case 3Case 4Maximum penetration rate (%)Smax21.5100200335THDv14.518.5-126


## 5.3. 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.


### 5.3.1. 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.


### 5.3.2. 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%). The 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 Figure14. 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 plugged-in EVs in these intervals operate in discharging mode, which causes the reduction in sufficient reactive control support in comparison with other cases.Figure 14
(a) Daily apparent power profile of primary substation. (b) The daily pattern of all EVs’ active power consumption in the network. (c) The daily pattern of all EVs’ reactive power injection in the network.
(a)(b)(c)Figure15 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. This 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 15
(a) Voltage profile of network buses at peak hour. (b) Daily profile of voltage at bus 18.
(a)(b)Figure16 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 16
Daily power factor pattern of network primary substation.The THDv of each node for all cases is shown in Figure17. 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. The 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.Figure 17
(a) THDv profile of network buses at peak hour. (b) Daily profile of THDv at bus 18.
(a)(b)The 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 Table11. 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. The 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.Table 11
Results of the optimization problem for different case studies and solutions.
Power quality indicesBase caseCase 2Case 3Case 4Case 5Case 6Total active power loss (kW)2171.52178.22635.51967.91711.11126.3Total reactive power loss (kVAr)1469.81490.31786.31342.61146.2754.77Average of voltage (p.u.)0.94530.94920.94420.96140.96490.9798Minimum voltage magnitude (p.u)0.90370.90460.90210.9380.94550.9687Average of THDv (%)2.77383.09282.80322.8132.19752.1788Maximum THDv magnitude (%)4.89335.64594.94355.08873.58533.7815The performance of convergence to the optimum value versus the number of iterations of the different algorithms obtained for scenario 2 is shown in Figure18. 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. Therefore, 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.Figure 18
Convergence characteristics of CSA, GSA, GA, PSO, and PSO-GA algorithms for case 6.


## 5.3.1. 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.


## 5.3.2. 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%). The 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 Figure14. 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 plugged-in EVs in these intervals operate in discharging mode, which causes the reduction in sufficient reactive control support in comparison with other cases.Figure 14
(a) Daily apparent power profile of primary substation. (b) The daily pattern of all EVs’ active power consumption in the network. (c) The daily pattern of all EVs’ reactive power injection in the network.
(a)(b)(c)Figure15 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. This 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 15
(a) Voltage profile of network buses at peak hour. (b) Daily profile of voltage at bus 18.
(a)(b)Figure16 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 16
Daily power factor pattern of network primary substation.The THDv of each node for all cases is shown in Figure17. 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. The 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.Figure 17
(a) THDv profile of network buses at peak hour. (b) Daily profile of THDv at bus 18.
(a)(b)The 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 Table11. 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. The 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.Table 11
Results of the optimization problem for different case studies and solutions.
Power quality indicesBase caseCase 2Case 3Case 4Case 5Case 6Total active power loss (kW)2171.52178.22635.51967.91711.11126.3Total reactive power loss (kVAr)1469.81490.31786.31342.61146.2754.77Average of voltage (p.u.)0.94530.94920.94420.96140.96490.9798Minimum voltage magnitude (p.u)0.90370.90460.90210.9380.94550.9687Average of THDv (%)2.77383.09282.80322.8132.19752.1788Maximum THDv magnitude (%)4.89335.64594.94355.08873.58533.7815The performance of convergence to the optimum value versus the number of iterations of the different algorithms obtained for scenario 2 is shown in Figure18. 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. Therefore, 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.Figure 18
Convergence characteristics of CSA, GSA, GA, PSO, and PSO-GA algorithms for case 6.


## 5.4. 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. The obtained economic results are shown in Table12. 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. The 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. This can be considered an advantage of EVs from an economic point of view. The 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.Table 12
Comparison of economic results in case studies.
Economic indicesBase caseCase 2Case 3Case 4Case 5Case 6Costs of EVs’ charging and battery degradation ($)1662.91908.81870.71845.515561473.1Income of EVs’ discharging ($)0000139.96304.7Income of reactive compensation ($)064.533060.303055.226Total cost ($)1662.91844.21870.71785.114161113.1Similar 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.


## 6. Conclusions

This 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.



---

*Source: 3838113-2022-08-29.xml*