Optimization Model of EV Charging and Discharging Price Considering Vehicle Owner Response and Power Grid Cost

The problem of load fluctuation in the distribution network and increasing power grid cost input caused by the unpredictable behavior of electric vehicle (EV) users in response to electricity price is investigated in this paper. An optimization model method for the charging and discharging price of electric vehicles is proposed, considering the vehicle owner response and power grid cost. The rule of EV user travel is first analyzed, and the travel and battery state constraints are defined. Under the constraints of user charging and discharging behavior and battery characteristics, a user transfer rate and unit energy cost function is designed to construct a multi-objective model of charging and discharging price that minimizes electricity expenditure and avoids an increase in power grid investment. Finally, an improved multi-target fish swarm algorithm is presented to solve the model optimization problem. The example analysis shows that the proposed method can reduce the peak-valley load difference of the system and cost input of the power grid, as well as provide users with regulation ability to access the power grid at different time periods.


Introduction
Promoting the use of electric power can help mitigate the fuel crisis and increasing environmental pollution by gradually reducing the consumption of gasoline, diesel, and other automotive fuels, and alleviating pollution caused by exhaust emissions. Electric vehicles (EVs) are emerging as the focus of development in the transportation industry [1,2]. Energy for EVs is mainly sourced from the power grid, and largescale development of such vehicles can not be separated from the support of the power system. According to forecasting by the China Automobile Engineering Association [3], the number of electric vehicles in China will reach 80 million by 2030. If the average EV power battery is equipped with 60 kW h, the equivalent storage energy will reach 48 × 10 8 kW h, compared to the daily power consumption in China, which was only 160 × 10 8 kW h in 2016. The energy demand is considerable, whether it absorbs electricity from the system or releases electricity into the system. Therefore, optimal management of charging and discharging behavior of EV users can provide power supply for the power grid in cases of power shortage, alleviate the balance of power supply and demand, and has great significance for improving the stability of the power grid [4].
With the development of vehicle-to-grid (V2G) technology [5], electric vehicles can exchange power with the grid through charging station A/D and D/A devices, and participate in grid charging and discharging agent services. This two-way interaction of energy and information between users and the grid is illustrated in Fig. 1. The grid can optimize the charging and discharging behavior of electric vehicle users through V2G technology, so that more users can participate in grid peak shaving and frequency modulation and coordinated absorption of new energy services, providing benefits for both the grid and users.
Previous research has been conducted on the charging and discharging of electric vehicles. Literature [6] accounted for the state of charge (SOC) of EVs, and conducted modeling analysis based on time of utility (TOU) price. Literature [7] guided the orderly charging and discharging of EVs on the basis of load forecasting. In [8], the economic benefits of the power grid was analyzed, and the charging and discharging price of EVs was optimized according to the interests of the power grid. Literature [9] used Monte Carlo simulation method to extract the starting load state and charging time of EVs, and employed superposition simulation to formulate a total charging power curve of the EV after mass access to the grid. According to the division of the current regional TOU price, a method considering the two-stage effective charging strategy was proposed in literature [10]. In [11], the load and discharge curves of EVs in different periods were simulated according to the characteristics of charge and discharge batteries of different types of electric vehicles.
The remainder of this paper is organized as follows. An analysis of the charging and discharging behavior of EV users is introduced in Sect. 2. In Sect. 3, a multi-objective optimization model is constructed, which includes the minimization of additional costs and maximization of user satisfaction with charging and discharging. In Sect. 4, the simulation experiment is explained, and results are provided and discussed in Sect. 5. Finally, conclusions are presented in Sect. 6.

Analysis of Charging and Discharging Behavior of EV Users
It is assumed that the daily travel of EV users is known, that is, m times travel per day, in which there are s(i) times in the stroke of part i, and a day is divided into a 24 h period. Each trip is composed of a driving process and a stopping process, and the EV user will consider charging and discharging the EV during the j period of the stopping process s(i).

Travel constraints of EVs
The discharge amount of the EV from the charging station to the power grid must ensure enough power remains for the subsequent trip. The discharge amount should be between the maximum and minimum of the battery capacity according to Eq. 1: among which, C B is the electric vehicle battery capacity, and S max , S min , S s are the maximum, minimum, and initial value of the battery charge state, respectively. The dimension is 1; p i,j up for discharge power in the j period of travel i, d i + 1 is the driving distance of the stroke of the i + 1 section, and W is the electricity consumption of the battery on average per kilometer.

Vehicle battery load state constraints
During the EV charging and discharging process, the charge and discharging amount should be kept between the maximum load and the minimum load of the power battery capacity, that is, the charge amount should be less than the maximum load of the power battery.
In addition, the discharged quantity should be greater than the minimum quantity of current electricity.
where p i,k down is the charge power in the k period of travel i.

Multi-objective Optimization Model for Charging and Discharging of EVs Based on User Transfer Rate
The EV user response behavior according to fluctuating electricity price is mostly reflected in changes to the load. When the stable operation of the power grid system fluctuates, the (1) Fig. 1 Relationship between power grid and EV users power grid company adjusts the user's electricity structure through incentive strategies or price optimization schemes, thereby reducing the charging and discharging load within a certain period of time. Therefore, the responsiveness of users to electricity prices will be the basis for power grid companies to formulate electricity prices.

Analysis of User Transfer Rate of Different Response
According to the user's response, saturation, and cut-off state to the price response, the charge-discharge load transfer rate curve of a period from a to b in the middle of the day is expressed as follows: where K ab is the slope of the response curve, and l ab is the intercept of the response curve, that is, the threshold of response. Subscript h ab is the threshold of maximum responsiveness, φ max is the maximum transfer rate of users, and Δx ab is the electricity cost change difference from period a to period b.
The peak-to-valley load curve, valley-to-peak load curve, and flat-to-valley load curve fitting load of charging and discharging for EV users is thus expressed as follows: where l(t) and L t are the load of T period before and after optimization, L p , L f , and L v are the average of the peak, flat, and valley period total load in the response period, in which L p is the transfer rate of the peak to the normal period of the peak φ pf peak period, L f is the transfer rate of the peak to the valley period of the φ pv peak period, and L v is the transfer rate of the φ fv flat to the valley period. Subscripts T p , T f, and T v are the peak, flat and valley period.
After price adjustment, the parameters of the load transfer rate curve before and after adjustment are fitted repeatedly by least square method, and the slope, response saturation value, and dead-time threshold of the curve are obtained. The relationship between load transfer rate and price change in different time periods is thus dynamically characterized.
1. Response analysis of user demand in response to charging electricity price After charging and discharging price adjustment, users responding to charging price will change the initial charging time according to the charging price, and enjoy preferential price expenditure. EV users charging from j period in i travel will transfer to the next preferential charging price k period. The electricity required to pay is determined according to: where η is the power grid conversion efficiency, η down is the charge efficiency (Dimension 1), ω d is the battery loss cost rate, ρ down i,k (t) is charging price in k period of travel i, t down i,j is the charge time of the j period in i travel, λ down is the charge coefficient of the battery (Dimension 1), and k ∈ (j, j + 1,…, j + 12 − t i,j down ). Therefore, for users responding to the charging price, after the optimization of the electricity price, the number of users moving from j time to k time in travel i is: in which N i,k is the number of EVs driving in k time in i travel.

User demand response analysis in reaction to charge and discharge price
After the charging and discharging price adjustment, users who participate in V2G discharging will respond to charging price to maximize revenue. In the process of discharging, the user should ensure that there is enough electricity in the next stage of discharging, and the cost of the previous charging period is less than the income of the following discharge period. The profits of EV users in the j time discharge are determined by: where ρ i,j up is the discharge electricity price of EVs moving to k period in travel i, η up is the efficiency of EV discharging to electric net (the dimension is 1), and λ up is the battery discharge coefficient (the dimension is 1).
The EV electricity cost to be paid from the start of charging j − 1 time to discharging j time of the same time length is determined according to: Therefore, for the user mode in response to the charging price, after implementation of peak-valley TOU price, the number of electric vehicles at time j of the travel i participating in V2G discharge is obtained as follows: The profit meeting discharging and charging cost to be paid is:

Demand response analysis of unresponsive users
After adjusting the peak-valley time-of-use tariff, the unresponsive EV users neither change the charging time nor participate in V2G, exhibiting the same charging and discharging behavior as before the tariff adjustment. Therefore, the change of user charging and discharging load for unresponsive users has nothing to do with tariff adjustment, and the number of non-responding users at time j of travel i is: In summary, the average total load of different responses at any time is obtained as follows:

Minimizing peak-valley difference of power grid
The goal of power grid companies is to alter user charging and discharging habits when adjusting electricity prices in an effort to minimize the peak load and peak-valley difference in the system. Therefore, the objective function of the grid company is: among which, minG 1 is the smallest peak load, minG 2 is the smallest peak-valley difference, and L t0 is the original daily load data.

Minimizing power grid cost input
The benefit goal of power grid companies is to control the cost input. The fixed cost is the construction of the charging pile at charging stations, and the variable cost is the power loss during charging and discharging, the battery charge and discharging loss subsidy, and the conversion cost of the basic service fee. Therefore, assuming that the fixed cost input of the grid company is certain, the variable cost input is minimized to reduce the overall expenditure. The unit power cost of EVs in the process of charging and discharging in the power grid is thus obtained as: where c S is the conversion cost of basic service fee, and c EL is the unit power loss cost caused by energy conversion during charging and discharging, which can be expressed as: After adjusting the peak and valley charging and discharging price, the centralized charging and discharging of EVs in peak period can be reduced, meaning the grid company save costs and investment according to Eq. 18:

Maximizing EV user satisfaction
To avoid new costs, grid companies adjust peak and valley charging and discharging prices. However, varying electricity prices will lead to changes in the way customers use electricity, which will affect user comfort and their ability to respond to electricity prices. Therefore, when adjusting the price of electricity, it is necessary to ensure the satisfaction of users in responding to the price of electricity. Customer satisfaction is expressed as the power load change ratio after price adjustment as follows:

Multi-objective Optimization Model for Charging and Discharging Price of EV
To summarize, under the constraints of charging and discharging habits and battery characteristics of EVs, a multi-objective model of peak-valley charging and discharging price is established to coordinate the interests of users and power grids. Taking into account the peak-valley difference of power grids, the minimization of cost input by power grids companies, and the maximization of user satisfaction with electricity consumption, the model is denoted as follows: where F = (Pay, minG 1 , minG 2 , -Cost) is the objective function, x is a vector group composed of optimized variables, and U k (x) is an inequality constraint function.

Solution of Multi-target Immune Fish Model Based on Shrinking Space
To achieve the goal of minimizing peak-valley difference and peak load, user satisfaction with electricity consumption must be ensured, and added investment by grid companies should be avoided. Obviously, there are clear contradictions among the three objective functions, and the proposed multiobjective optimization will determine the optimal solution satisfying the conditions by balancing the solution values of each group. Therefore, for solving multi-objective problems, a multi-objective immune fish swarm algorithm (MOIFSA) is designed based on artificial fish swarm algorithm combined with immune algorithm and Pareto optimal solution set. Utilizing the fast convergence rate of artificial fish swarm algorithm, the multi-objective peak-valley charging and discharging price model is solved. The immune algorithm is then introduced to prevent the algorithm from prematurely converging to a local inferior solution.

Fish Swarm Optimization Method Combining Immune Antibody Fitness
The probability of antibody concentration selected by immune algorithm is regarded as the probability of artificial fish swimming to the current food source. The location of the first fish is x i , i.e. the first antibody. The food concentration y i of the current position is then set as the fitness value f(x i ) of the antibody at that position. The artificial fish swims from one position to another, that is, it produces new immune antibodies. According to the behavior of fish in the process of searching for food, the position of the optimal solution is found.

(a) Foraging behavior
In the current position of the artificial fish in x i field of vision range, another location x j is randomly selected, and the food concentration in this position is Y i . If it is determined to meet Y j > Y i , then the individual moves in that direction. If not, the next location x j is randomly selected to determine whether the next position satisfies the move condition. If it still does not satisfy the forward condition, it moves forward randomly: where Visual is the range of the artificial fish random field of vision, and x inext is the next target of an artificial fish in which the artificial fish in this position is a new antibody. Subscript P s (x i ) is the probability of antibody concentration for the immune algorithm [13], that is, the probability of selecting artificial fish to swim to the current food source, and rand() is the random variable of artificial fish swimming, with a value between 0 and 1.

(b) Cluster behavior
The number of partners n f in the artificial fish field of position x i and its central position X center is calculated. When the Y center /n f > δY i is satisfied, one step is made toward the position, otherwise, foraging behavior is performed.
where δ is crowding factor.

(c) Tail following behavior
The number of partners n f in the artificial fish field of position x i is calculated (i.e. ||x i − x j || < Visual), and the best place to feed among partners x best is determined. When Y best /n f > δY i is satisfied, it indicates that the x best location partner is low in density and has a high physical concentration around the fish. In this case, a step is taken in the direction of x best position, otherwise, foraging behavior is performed.
Taking the probability of antibody concentration as the probability of artificial fish choosing to swim to the current food source, the algorithm reduces the redundant calculation of distance to the target position when simulating the artificial fish swarm foraging solution. This ensures the uniqueness of the vector path from different points to the optimal solution, and avoids the convergence of the whole population in the optimal solution of artificial fish swarm.

Solving Steps of the Charge-Discharge Price Model by Multi-objective Optimization Algorithm
Using MOIFSA can obtain a superior set of Pareto solutions among the solutions obtained by the original algorithm.
Here, the non-inferior optimal solution function under other objectives constitutes a non-inferior optimal target region, thus solving the optimization problem with multi-objective constraints. The solution process is shown in Fig. 2.
The steps of solving the multi-objective model are as follows: 1. For parameter initialization, input EV battery parameters and parameter of user transfer rate; 2. Set the fish swarm size to S (simulating the number of EVs), and in the solution space, randomly initialize S antibody to generate artificial fish swarm M. The number of iterations is k; 3. For determination of objective function, F i (x) and U k (x) are used as antigens in the multi-objective optimization model of the charge-discharge price. The hierarchical clustering method is used to stratify the population. All individual artificial fish in each layer are assigned to the initial Pareto solution bulletin board. 4. For the optimization process, biological behavior of artificial fish is simulated. The artificial fish with the best behavior in the foraging process of artificial fish is selected, and the individual fish is updated. 5. To evaluate the affinity between all antigens and antibodies (artificial fish), the individual fish with the highest affinity is selected and assigned to the bulletin board, and the external bulletin board of Pareto optimal solution is updated. 6. Determine if the maximum number of iterations has been met. If satisfied, the optimal charge and discharge price solution set is output and the algorithm is terminated. If not, return to step 3.

User transfer rate initialization parameters
The user transfer rate initial value parameter [12,17] was set as shown in Table 1, and the user transfer rate parameter is updated with each optimization.

Initial charge and discharge price and load data
In this experiment, PJM real time load data was used as historical load data [15], California TOU electricity price data was used as the charging electricity price [16], and Table 2 provides the mean value of the TOU electricity price and the corresponding historical load data.

Battery parameters for EV
In this paper, Nissan's EV lithium-ion battery and the lithium iron battery used by BYD electric vehicles were selected for analysis [18,19]. They are abbreviated as NS battery and BYD battery in the following discussion, and the main parameters are provided in Table 3.
The minimum and maximum SOC of the EV during charge and discharge were set to 15% and 95%, respectively. Electric vehicle battery charge and discharge efficiency η up and η down was 0.97, the power grid to charge and discharge energy conversion efficiency η was 0.85, c f = 1.2 cent/ (kW h), and V2G charge and discharge coefficients λ down and λ up were set as 0.1. According to the development of EVs [20], the number of analog electric vehicles was simulated as N = 3 × 10 6 , and the BYD and Nissan vehicle ratio

Experimental Comparison and Analysis of MOIFSA
The ZDT test function set is used in this paper [14]. The test function has good distribution and convergence, and has two kinds of functions with two kinds of objectives, as shown in Eqs. (24) and (25).
The convergence, diversity index, and error ratio of MOIFSA and multi-objective artificial fish swarm algorithm (MOAFSA) were compared. The experimental data is shown in Tables 4, 5, and 6. The algorithm ran 30 times and the results were average.
As can be seen from Table 4, MOIFSA does not demonstrate much improvement to convergence performance compared with MOAFSA.
As illustrated in Table 5, the uniformity index value of MOIFSA algorithm increased by approximately 18%. Table 6 shows that the average error of MOIFSA algorithm is 11.9% less than that of MOAFSA algorithm.

Example Analysis of Optimization Model
To solve issues with the model, MOIFSA is proposed in this paper. The relevant parameters are used as follows: population size S is 100, maximum number of iterations k = 100, Visual = 0.5, and δ = 0.25.     Figure 3 shows the optimization of the random access load superposition curve based on historical load and random access of the EV load.
After random access of the EV, the peak load of the system increased from 95,693 to 97,042.76 MW, and the peakvalley difference increased from 18,222 to 19,397.7 MW. For the common purpose of minimizing peak load and peakvalley load difference, the optimization of the charging and discharging price of EVs can be divided into three situations as discussed below: 1. Minimizing power grid cost input as the target According to the proposed model, to avoid the maximization of investment into the power grid, only the minimum input of the power grid is considered, and the load curve of the EV can be obtained after optimization.
The result is shown in Fig. 4. If avoiding a large investment in the grid is the only target, the charging and discharging price will be dramatically adjusted in the peak and valley period, and the users of the response charge begin to shift to the flat period and the valley period. In response to the discharge, the users begin to discharge in the peak period, leading to a large change in the mode of user charging and discharge. User satisfaction is the lowest at this time.

Maximizing EV user satisfaction as the target
The result of the proposed model for maximization of EV user satisfaction and the load curve of the EV obtained after optimization shown in Fig. 5. Users charge and discharge according to their own wishes, so that load changes are mainly concentrated in peak and valley periods, increasing the peak and valley period of the grid charge and discharge pressure.

Multi-objective optimization model
The results of the multi-objective optimization model are provided in Figs. 6 and 7.
The daily load curve before and after optimization is shown in Fig. 8. It can be seen that the peak load has been reduced by 1057.91 MW, and the peak and valley difference has decreased by 29,020.41 MW.
As shown in Fig. 7, the load of the peak period is reduced, the charge and discharge load begin to shift to peak time and valley period, and the system load changes smoothly. The response mode of the user begins to change compared to before the optimization, in which the user of the response discharge price begins to discharge to the power grid in the peak period of the system load. This  relieves the demand for charging load after EV access, and users responding to the charging price change their charging time in the low valley peak period, reducing the rush hour charging pressure of electricity.
Combined with the above optimization results, this paper compared and analyzed the charge and discharge price, user expenditure, power grid input, and total satisfaction of the peak, flat, and valley period. The results are provided in Table 7.
According to the results in Fig. 7 and Table 7, the multiobjective model is superior to other models for load regulation and power grid input reduction, and has good user satisfaction. If only one objective is optimized, only one objective can be achieved, and other objectives will be affected.

Conclusion
The unpredictable behavior of EV users in response to electricity price was investigated in this paper, considering the fluctuation of the power grid load, the new cost input of operators, and the satisfaction of users in responding to electricity price. An optimization model was constructed for the charging and discharging price of EVs, considering vehicle owner response and power grid cost. An improved immune fish swarm algorithm was then proposed to optimize the multi-objective model of charging and discharging price. Experimental analysis illustrated that the multiobjective electricity price optimization method can reduce the peak-valley load difference of the system and the cost input of operators. Using this method, the ability of users to respond to electricity prices was maximized, along with the regulation ability for users to access the power grid during different time periods.