A Novel Optimization of Plug-In Electric Vehicles Charging and Discharging Behaviors in Electrical Distribution Grid

In most countries, the problems of energy and environment are becoming worse. To deal with the environmental impacts and the dependence on fossil energy, many solutions were proposed. Plug-in electric vehicles (PEVs) is one of the best technique among these solutions. However, the large number of PEVs connected to the power grid simultaneously might increase power fluctuation or even cause the electricity shortage and thus affecting the typical use of the basic load. To cope with this issue and inspire PEV users coordinating with scheduling results, an algorithm was proposed to ensure the power transmission safety of branches and maximize the economic benefits. Considering the cost of both PEV owners and the power grid, a two-phasemodel of optimizing PEVs charging and discharging behaviors was built. According to the traveling purpose of PEV owners and the current electricity price, in the first phase, a novel model which defines each PEV’s charging or discharging status was established. *e number of PEVs’ charging and discharging in each charging station can be obtained. Considering the constraints on the power transportation of branch, in the second phase, we built a mathematical model tomaximize the benefit of both power grid and PEV owners.*e genetic algorithmwas used to optimize the charging and discharging power of PEVs. Simulation results show that the optimizationmethod proposed in this paper has a better performance on the daily power curve compared with the uncoordinated PEVs charging.


Introduction
Nowadays, the problems of air pollution and the fossil fuel shortage have attracted public concern in many countries. As a potential solution to protect the environment and reduce the dependence on traditional fossil fuel, plug-in electric vehicles (PEVs) play an especially important role in the development of raising energy efficiency and alternative to traditional fuel-based automobiles [1][2][3]. When largescale PEVs are connected to an electric distribution network simultaneously, some issues including the location of PEVs charging or discharging at a given time, the power fluctuation, active power loss, the state of charge (SOC) of PEVs, and the degree of PEV owners' satisfactory should be concerned [4,5]. Considering that PEVs can be regarded as both distributed energy source and load that can be scheduled, vehicle-to-grid (V2G) system was proposed by researchers. In V2G system, power can flow between the power grid system and PEVs. Meanwhile, PEVs can reduce the operation cost of power grid and relieve daily power curve. However, uncoordinated charging and discharging behaviors of PEVs may cause circuit damage, power congestion, electricity shortage, and other grid problems [6,7]. erefore, the optimization of PEVs charging and discharging is necessary.
ere are many existing studies on the optimal scheduling of PEVs' charging and discharging behaviors. A new mathematical model was established in the literature [5], to increase the degree of satisfaction of PEV owners and decrease the power grid's operation cost. Based on the Monte Carlo simulation algorithm, the charging load curves of different types of PEVs were established in the literature [8,9]. Considering the economic benefit of power grid and PEV owners, a bilayer system was designed in [9]. It verified that the electricity price can adjust the time and the location of PEVs charging and discharging. In [10,11], an aggregator was used to exchange information between power grid and PEV owners through VANWT, Wi-Fi, or cellular network. Several studies established optimization model aiming at minimizing the peak-to-valley di erence and using the genetic algorithm to optimize the users' charging time in valley electricity price period [12,13]. e literature [14] introduced V2G robust energy-scheduling problems, and proposed an algorithm to adjust the trade-o between economic performance and reliable operation. In [15], an algorithm was proposed, which not only can e ciently shift the peak load and reduce the total operation cost, but also can provide great exibility in adjusting the trade-o between economic performance and reliable operation. In [16], a combined control and communication approach considering distributed features and vehicle preferences was proposed. e literature [17] used the exibility and schedulability of PEVs to relieve the power uctuation in power distribution network. To solve the optimal dispatch problem of renewable generators and PEVs, Liu et al. [18] developed a novel algorithm to solve the optimal dispatch problem of renewable generators and PEVs. Most PEVs and power grid problems in V2G system are multiagent problem, and a novel method to solve the multiagent problems was used by [19].
Most of the current researches have focused solely on the management of the distribution grid or economic bene ts. However, few researches so far put the two problems together and rarely the literature refers to the PEVs' traveling purpose.
is paper proposed a novel optimization method of PEVs charging and discharging based on the previous methods; meanwhile, the bene t of power grid and PEV users, the traveling purpose of PEV users, and the initial SOC of each PEV were taken into account. To reduce the impact of PEVcentralized charging on the branch in power grid, the main contribution of this paper is considering both the bene t of the power grid and PEV users to ensure the stable operation of the power grid and satisfy the traveling purpose of PEV users. We dominate this problem as the Max Power Grid and PEV Users Pro t problem. Considering the initial SOC of PEVs arriving at charging stations, the traveling purpose of PEV users, and the load power without PEVs plugging in at this time, this paper proposed a novel charging and discharging model for PEV users to determine the PEV users' charging and discharging status and time. Meanwhile, the charging and discharging power of PEVs at a given time is optimized to reduce the power uctuation of distribution network. Daily basic load power curve is shown in Figure 1 [1]. e rest of the parts of this paper are organized as follows: In Section 2, considering about the current electricity price, the traveling purpose of PEV users, and the SOC ini of each PEV, the number of PEVs charging and discharging is dened. According to the Max Power Grid and PEV Users Pro t problem and the number of PEVs charging and discharging that is obtained from Section 2, Section 3 builds a mathematical model to optimize PEVs' charging and discharging power. is paper used genetic algorithm (GA) to calculate the optimal result. Section 4 gives the speci c algorithm ow. Section 5 shows the simulation results of the mathematical model which is built in the Section 3. Finally, the conclusion of this paper and future work are given in the Section 6.

e Model of PEVs Connected to the Power Grid and Initial SOC.
is paper analyzed the private PEV-centralized charging and discharging behaviors in the workdays mainly. According to the surveys, the annual average mileage of a vehicle in China is about 15,000∼20,000 km and the average daily mileage is 40 km. e peak hours of private PEVs to go to work are from 7:00 to 8:00 and the charging time is during the working hours. e peak hours of private PEVs to come home from work are from 17:00 to 19:00 and the charging time is from 19:00 to 6:00 the next day. So, a PEV can connect to the power grid twice a day, and the initial SOC obeys the normal distribution N(0.6, 0.01) [8].
Considering the traveling purpose of PEV users, the SOC after PEV charging or discharging must be higher than 0.6.
In this part, we assumed that each PEV's charging power is constantly equal to 3.12 kW, the start time of charging obeys the normal distribution N(9, 0.25), N(19, 1.25), respectively, [5] and the corresponding probability of PEVs connected to the power grid is 0.5 and 0.7, respectively [8].
e Monte Carlo simulation method is used to extract the initial SOC, the charging start time, and the charging nish time of PEVs. en, we can obtain the result of load calculation under the constraint conditions of meeting the charging time requirements [8]. e calculation model of PEVs charging load based on the Monte Carlo simulation method is shown in Figure 2. We assumed that the maximum capacity in each charging station is 10 PEVs.

e Cases of PEVs Charging and Discharging.
To achieve the peak shaving of the power grid and to ensure the power transportation of each branch smooth, considering the bidirectional ow of energy between PEVs and power grid, the charging and discharging behaviors of PEVs can be coordinated to restrain the power uctuation of power distribution network.
In this article, we improved the interests of PEV users to stimulate PEV users join in the optimal scheduling of power distribution network. e electricity price at a given time interval is formulated thanks to Figure 1; the principle of formulation is that when the basic load power is higher, the electricity price is higher and when the basic load power is lower, the electricity price is lower, simulating the PEV users charging at the low-load time period and discharging at the high-load time period on the basis of satisfying the traveling purpose. Due to the di erent electricity prices and to make calculation easier, 24 hours a day can be divided into 3 parts: low-price period, normal-price period, and high-price period, and the time interval is 24:00-10:00, 10:00-18:00, and 18:00-24:00, respectively. According to the initial SOC of PEV users and the di erent time period, the optimization system de nes the charging or discharging status for each PEV user, which connected to the power grid. Just take one PEV as example, and all of the PEVs charging load could get after adding. e situations of a PEV charging or discharging are divided into the following four types: Case 1. During the high-price period (S 10). When the SOC ini ≤ 0.6 PEV charges to its SOC 0.6, if it is still in the high-price period, PEV would charge again when the low-price period starts.

Case 2.
During the high-price period (S 10). When the SOC ini > 0.6 PEV discharges to its SOC 0.6, if it is still in the high-price period, PEV would charge when the low-price period starts. Case 3. During the normal-price period (S 01). When the SOC ini ≤ 0.8 PEV charges to its SOC 0.8, if it is still during the normal price period or turning to the highprice period, PEV would charge again when the lowprice period starts. Case 4. During the low-price period (S 00). PEV charges to its SOC 1. e algorithm owchart of calculating the number of PEVs charging and discharging in each time interval (0.5 h) is shown in Figure 3. N c,t and N d,t represent the number of PEVs charging and discharging at the given time. We assumed that each node of the distribution network can accommodate at most 10 PEVs, the PEVs' charge and discharge power is constantly equal to 3.12 kW, the maximum capacity of each PEV battery is 24 kWh [8], and the parameter inputted include the initial SOC, arrival time, and departing time of PEVs. According to the initial SOC of PEVs and the level of electricity price when PEV users connected to power grid, the charging or discharging behaviors of PEVs could be coordinated on the basis of satisfying the propose of PEVs traveling. e SOC of PEVs is updated after each time interval, and the number of PEVs charging and discharging is exported.

The Mathematical Model that Optimized PEVs' Charging and Discharging Power
In this section, we established a mathematical model that the goal is to maximize the bene t of PEV users and minimize the uctuation of the daily load curve in distribution network; meanwhile, the PEVs' charging and discharging behaviors do not a ect the normal work of basic loads and the power transmission constraints of each branch as the constraint conditions. e power uctuation of distribution network is reduced, and the stable power transportation of branch is guaranteed through the optimization of charging and discharging power of PEVs.

e Objective Function.
To raise the power grid companies' pro t, the power uctuation needs to be reduced. erefore, reducing the power uctuation is an objective. So, the optimization objective function of power uctuation g 1 is denoted as where P c,t and P d,t represent the charging and discharging power of PEV users at time t, respectively, N c,t and N d,t represent the number of PEV users' charging and discharging at time t, respectively, P Load,t represents the basic load power at time t, and P represents the average load power during a day without PEVs. P Load,t and P can be got by gathering the historical data. Journal of Electrical and Computer Engineering 3 To raise the PEV users' pro t, the optimization objective function g 2 is denoted as where ρ c,t and ρ d,t represent the charging and discharging electricity price at time t and Δt represents time interval (0.5 h).
We put all the objective functions together, so the method can be regarded as a multiobjective optimization problem. Because coupling does not exist between the objective functions in this paper, the problem can be translated into a single-objective optimization problem by weighted linear combination in the following equation: where the α 1 and α 2 is the weight of g 1 and g 2 , respectively, g 2 represents the bene t of PEV owners , and g 1 represents the bene t of power grid where it is more important than g 2 because of the demand of reality. erefore, we set α 1 0.6, α 2 0.4.

3.2.
Constraints. e following constrains in the mathematical model must be met at each time interval Δt, and the de nitions of corresponding parameters are shown in Table 1.
Constraint (4) ensures the total PEV users' charging energy cannot exceed the surplus energy of distribution network, where the maximum capacity of PEV's battery (C max ) is identically equal to 24 kWh. Constraint (5) indicates that the limit of active power transportation of each branch, which ensures the branch safety at power distribution network would not be influenced by PEVs' charging and discharging behaviors. e constraints (6) and (7) represent the scope of charging and discharging power of PEVs, respectively. e PEVs would be broken if charging or discharging power exceeds the maximum power of PEVs; meanwhile, the excessive charging and discharging power would increase the fluctuation of the power grid. However, if the PEVs' charging and discharging power is lower than P c, min and P d, min , the waiting time would become so long that the owners' degree of satisfaction would decrease. Constraints (8)- (11) represent that the total number of PEVs cannot exceed the maximum accommodation capacity of charging stations, which is to reduce the PEV owner's waiting time.

Power Optimization Algorithm
e key of the power optimization algorithm for PEVs charging and discharging is how to deal with the optimal power flow model, which is a nonlinear, nonconvex, largescale, static optimization problem with both continuous and discrete control variables. Genetic algorithm is applied to find optimal result, the algorithm considered the parameter (P c,t , P d,t ) as optimal variables. e optimal charging and discharging power of PEVs and the daily power curve of distribution network can be obtained under the PEV users' responsiveness δ.
We can obtain the number of PEVs charging and discharging in each charging station at the given time from Section 3. e total PEVs charging power in a charging station equals the sum of charging power of each PEV in the charging station, which is denoted as Equation (12). Similarly, the total PEVs discharging power is denoted as Equation (13). According to the optimization objective functions in the Section 3, choose the excellent parameter (P c,t , P d,t ).
e main process of algorithm is as follows: (1) Initialize grid load parameters and PEVs load parameters, which include PEV users' responsiveness, basic load power without PEVs connecting to the power grid in each time interval, average load power during one day without PEVs, the maximum battery capacity of PEVs, initial SOC, arriving time, leaving time, and average energy consumption. (2) Calculate the number of PEVs charging and discharging at the current time interval. (3) Generate 100 initial populations of EV charging power and discharging power (P c,t , P d,t ) randomly. (4) Calculate the constraint value of populations, which include equality constraints and inequality constraints, and eliminate the populations that unsatisfied the constrains of the mathematical model. en, calculate the interests of PEV users charging and discharging and the PEVs charging and discharging power at the current time interval according to the initial populations that satisfied constrains. Based on the basic load power at the current time, PEVs charging and discharging power after coordinating and the average basic load power during one day, the power fluctuation of distribution network can be calculated. (5) According to the power fluctuation of distribution network and the charging and discharging interests of PEV users, calculate and sort the fitness value. Select and retain excellent individuals through the roulette rule to ensure that the superior genes are retained. (6) e surviving genes were crossed and mutated to generate offspring populations, where the probability of crossover and mutation is 0.7 and 0.2, respectively. (7) Repeat the iterative optimization, until reaching the maximum genetic algebra, and then output the optimal result (P c,t , P d,t ) . (8) Calculate PEVs charging and discharging power in each charging station (P c,total , P d,total ). (9) Output the daily load power curve that before and after optimization of distribution network.
e optimization algorithm flowchart of charging and discharging power is shown in Figure 4.

Simulation Results
According to the optimization strategy that proposed in this paper, simulation results can be shown by MATLAB.
Just consider the charging behavior of PEVs and without any coordination, a branch of daily load power curve shown is in Figure 5. As can be seen from the figure, the peak-to-valley difference of a branch increased due to the behavior of PEVs uncoordinated charging, especially between 19:00 and 21:00 hours, the load power become too high, which might impact on the power transportation or even damage the branch.
Journal of Electrical and Computer Engineering e load power curve after price optimized coordination is shown in Figure 6. Compared with the load power curve of distribution power grid that uncoordinated charging, peak and o -peak di erence of the load power curve is decreased thanks to the optimization strategy of electricity price and thus ensure the stable operation of each branch. However, as shown, the power uctuation is large and PEVs' charging and discharging power needs to be optimized for each time period in a day.
According to the power optimization in Section 3, the simulation results of one branch and the whole power are  shown in Figures 7 and 8. As can be seen from Figure 7, the peak and o -peak di erence in power curve of one branch would increase if PEVs are connected to the power grid while without charging coordination, especially during the 18:00-22:00 hours, which might lead to the electricity shortage of basic load or even damage the circuit. Considering V2G system, the peak and o -peak di erence in power curve of one branch can be reduced through the electricity price control and the optimization of charging and discharging power, which ensures the normal operation of branch. is paper used an IEEE 33-bus distribution network to simulate the whole distribution network, and the speci c data can be obtained by [20]. Figure 8 shows the load curve comparison chart of three kinds of cases: basic load without considering the PEVs, uncoordinated PEVs charging and discharging behaviors, PEVs joined in the optimal dispatch of distribution network. As can be seen from Figure 8, the optimization strategy of charging and discharging behaviors of PEVs has a better property on the peak and o -peak di erence; meanwhile, daily load power curve is smoother compared with uncoordinated charging and no PEVs.

Conclusions
In this paper, we have relieved the intensifying power uctuation of power grid caused by a large-scale PEVs connecting to the power grid simultaneously. To this aim, we have investigated optimization of the PEVs charging and     discharging behaviors to balance the profit of power grid and PEV owners. A novel two-phase optimization method is proposed for PEVs charging and discharging. e first phase is about optimization of electricity price. According to the historical daily power curve, the status of electricity price is defined based on the principle of high load and high price. is phase ensures the maximum profit of both the power grid and PEV owners, and the PEV owners' traveling purpose is taken into account at the same time. e second phase is about optimization of PEVs' charging and discharging power. is phase aims to reduce the fluctuation and ensures the power transmission safety of distribution network. Compared with the power curve of uncoordinated charging and non-PEVs, simulation results have shown that the optimization strategy proposed in this paper can reduce the peak and off-peak difference of distribution network and protect each branch of power transportation which is not damaged obviously.

Data Availability
Daily basic load power data were used to support this study and are available in Reference [4]. ese prior studies (and datasets) are cited at relevant places within the text as Reference [4]. Electricity price data were used to support this study and are available in Reference [5]. ese prior studies (and datasets) are cited at relevant places within the text as Reference [5]. Specific data of IEEE 33-bus distribution network were used to support this study and are available in Reference [20]. ese prior studies (and datasets) are cited at relevant places within the text as Reference [20].

Conflicts of Interest
e authors declare that there are no conflicts of interest exist.