Bi-level optimal dispatching of distribution network considering friendly interaction with electric vehicle aggregators

The widespread application of electric vehicles (EVs) is a positive force driving green development. However, their widespread penetration also poses signi ﬁ cant challenges and threats to the security and stable operation of the power grid. To address this urgent issue, this article constructs a bi-level optimal dispatching model fostering collaboration between electric vehicle aggregators and the distribution network. The upper-level optimization targets the minimization of peak-valley differences in the distribution network via considerably arranging power outputs of gasturbines, whilethe lower-level one focuses on reducing the charging expense of EV aggregators via ef ﬁ cient charging transfer. Note that the charging expense is not only composed of electric cost but also a dynamic carbon emission factor-based cost, which contributes to the electricity economy and carbon reduction concurrently. A geometric mean optimizer (GMO) is introduced to solve the mode. Its ef ﬁ ciency is evaluated against three typical algorithms, i.e., genetic algorithm, great-wall construction algorithm, and optimization algorithm based on an extended IEEE 33-bus system with different charging behaviors of EVs on both a typical weekday and weekend. Simulation results demonstrate that the GMO outperforms other competitive algorithms in accuracy and stability. The peak-valley difference between the distribution network and the total cost of EV aggregators can be decreased by over 98% and 76%, respectively.


Introduction
With the increasingly prominent issue of climate change, reducing carbon emissions has become the common goal of the international community (Hu and Man, 2023).The power industry is widely regarded as one of the key areas to reducing carbon footprint because of its important position in global carbon emissions (Xu et al., 2020a).Meanwhile, the rapid popularization of electric vehicles (EVs) is considered to be a powerful means to reduce road traffic carbon emissions and improve urban air quality (Tan et al., 2023).However, largescale electric vehicles connected to the power grid for disorderly charging will bring problems such as the increase in power loss (Manzolli et al., 2022), the decline of power quality, and the difficulty of optimal control of power grid operation (Xu et al., 2020b).
To address these tricky problems, extensive studies have been undertaken regarding vehicle-to-grid (V2G) in the past few years, which can be classified into two aspects, i.e., economic optimization (Ahmadpour et al., 2022) and safety enhancement (Sperstad et al., 2020).For instance, reference (Gan et al., 2020) proposed a probabilistic evaluation method to investigate household EVs' dispatching potential when considering users' multiple h2h travel needs, which gave a significant foundation for EVs to participate in power grid regulation.Literature (Chen et al., 2017) constructed an EV aggregation model to participate in auxiliary services to achieve effective scheduling management and improve the economy of the system.Literature (Long et al., 2021) presented an ordinal optimization-based real-time scheduling method for largescale EV charging stations, which reduced 6% of operation cost.In reference (Liu et al., 2019), a two-stage economic charging framework for EV aggregators was developed.Reference (Manzolli et al., 2022) developed a charging schedule optimization model of battery electric buses considering the aging of the batteries, which pointed out that the charging cost is expected to reduce by 38% in 2030.Besides, extensive studies focused on the time-of-use (ToU) electricity price mechanismguided charging schedule (Manzolli et al., 2022;Yan et al., 2021).References (Mathioudaki et al., 2021;Ghosh and Aggarwal, 2018) designed a price-based service menu for EV charging to maximize profits.A deep reinforcement learning based approach was constructed to address optimal charging scheduling under uncertain electric prices (Wan et al., 2019).Li Z. et al. (2023) established a price-based transfer model to avoid charging congestion.
Nevertheless, the above-mentioned studies mainly concentrated on economic scheduling, which unfortunately ignored the effects of carbon emission.Recently, calls have come for carbon assessment to reflect the nature of the grid generation mix via dynamic approaches (Khan et al., 2018).The research on the carbon reduction of electric vehicle cooperative power grid dispatch has gradually emerged (Wu et al., 2023).Daneshzand et al. (2023) developed a scheduling framework for EVs and assessed the power grid carbon emissions under various tariff designs and multiple vehicle adoption levels.In Wang et al. (2023), the park EV agent participates in the carbon market by selling carbon emission allowances to increase profits.In Zhang G. et al. (2023), source-load coordinated carbon reduction based bi-layer economic scheduling models were established when EVs were considered as controllable loads and mobile energy storage.However, these current studies only calculated the total carbon emission on the source side.The real-time carbon emission on the load side was ignored, which resulted in an unideal emission reduction on EVs.
In this context, this paper proposes a dynamic carbon emissionfactor-based bi-level optimal dispatching of the distribution network considering friendly interaction with electric vehicles.Its main contributions are summarized as follows: ➢ A bi-level friendly interaction model between the EV aggregator and distribution network is established, upon which the upperlevel optimization attempts to reduce the peak-valley difference of the distribution network and the lower-level one aims to minimize the operation cost of the EV aggregator; ➢ Dynamic carbon emission-factor-based emission cost is combined with electric cost to guide the charging behaviors of EV aggregator effectively, thus reducing combined charging cost; ➢ A novel meta-heuristic algorithm, namely, geometric mean optimizer (GMO) (Rezaei et al., 2023), is induced to solve the upper-level model, while three typical competitive algorithms are used to validate the outperformance of GMO under an extended IEEE 33-bus system, i.e., genetic algorithm (GA), great-wall construction algorithm (GWCA), optimization algorithm (WOA).
The rest of this paper is organized as follows: Section 2 models the distribution network; Bi-level optimization framework is introduced in Section 3; Two case studies are executed in Section 4; Section 5 summarizes this paper.

Modeling of distribution network
A common distribution network with different distributed power sources and loads can be depicted in Figure 1, which includes power flow and carbon emission flow.

Charging model of electric vehicle
When the EV aggregator optimizes the scheduling of the single electric vehicle in the area, its charging time characteristics determine whether the single electric vehicle can participate in the scheduling task in this period of time.For electric vehicles in a charging station, the charging time characteristics mainly include plug-in time T n in (h), plug-out time T n out (h) and schedulable time T n s (h), which can be described as Eq.(1) where n represents the nth EV.
Besides, the charging demand of each EV is determined by Eq. ( 2) where E n d (kWh) means the charging demand of the nth EV; E n max (kWh) is the capacity of the nth EV.SoC n ecp and SoC n in stand for the excepted and initial SoC of the nth EV, respectively.Assuming that the charging demand of every EV can be met, the SoC n ecp can be calculated by Eq. ( 3) where P n c (kW) and E n max (kWh) are individually defined as charging power and battery capacity of the nth EV; t, Δt (h), and T denote the current period, scheduling interval, and the maximum number of intervals, respectively.The maximum number of interval T is determined by Eq. ( 4)

Dynamic carbon emission factor
According to the proportional sharing principle, the electric carbon factor of the node is carbon emission per unit of electricity of the power flow out of it, which yields Eq. ( 5) where δ i (kgCO 2 /kWh), δ j (kgCO 2 /kWh) and δ i G (kgCO 2 /kWh) represent the ECFs of the ith node, the jth node, and the generator connected with the ith node, respectively; P ij (kW) is the active power flow from the ith node to the jth one; P i L (kW) denotes the load power of the ith node (Zhang XS. et al., 2023).
3 Bi-level optimization framework of distribution network

Upper-level optimization
Upper-level optimization aims to reduce the regulation burden of grid operators.Thus its objective function is designed to minimize the difference of peak-valley power in slack bus, which can be expressed by Eq. ( 6), as follows: where P Slack represents injected active power of slack bus; x stands for decision-making variables, which can be set as the controllable elements in the distribution network.
The constraints of upper-level optimization composed of power balance, the voltage of nodes, the power output of generators, and the capacity of transformation lines, which can be mathematized as Eq. ( 7) where P Gi (kW) and Q Gi (kVar) stand for the active power and reactive power of the generator connected with the ith node, respectively; P D (kW) and Q D (kVar) are individually active and reactive power demands; P G min (kW) and P G max (kW) are upper and lower bounds of the active power of the generator, respectively; Q G min (kVar) and Q G max (kVar) are upper and lower bounds of the reactive power of the generator, individually; V i min (kV) and V i max (kV) represent the lower limitation and upper limitation of the voltage of the ith node, respectively; S i (kVA) and S i max (kVA) are respectively defined as the current value and maximum value of capacity of the ith line; N G , N B , and N L denote the number of generators, PQ nodes, and branches, respectively.

Lower-level optimization
Unlike upper-level optimization, the lower one attempts to protect the interests of the EV aggregator by optimizing EVs' charging strategies.Thus its objective is the cost minimization of the EV aggregator, expressed by Eq. ( 8) where C charge ($) represents electricity charging cost; C ems ($) denotes carbon emission cost, which can be measured by Eq. ( 9) where ρ ems ($/kgCO 2 ) means the unit price of carbon emission; δ EV (t) (kgCO 2 /kWh) is the carbon emission factor of the node connecting EV aggregators at time t; P charge EV (kW) represents the charging power of the EV aggregator, which is determined by Eq. ( 10) where cl and N cl denote the clth EV cluster and the total number of EV clusters, respectively; N(cl) is the total number of EVs in the clth cluster.
Additionally, the electricity charging cost C charge ($) of EV aggregators is given by Eq. ( 11) where ρ charge ($/kWh) stands for the unit cost of charging.The solution of the lower-level optimization consists of charging strategies of different EV aggregators, which yields Eqs (12), (13) where x cl EV denotes the charging and discharging strategy clth EV cluster.
To ensure the charging demand of each EV, lower-level scheduling satisfies the following power balance constraint: In Eq. ( 14), P cl (kW) represents the total charging power of the clth EV cluster.

Principle of basic GMO
GMO is a meta-heuristic algorithm that uses the behavior of multiple search agents in social interaction to search for the best results, and its optimization performance has been effectively verified in various test problems (Rezaei et al., 2023).
In GMO, the position X i and velocity V i of the ith agent are defined as Eqs ( 15), ( 16) where x id and v id stand for the dth dimension variables of the position and velocity, respectively; D is the maximum dimension of the problem to be solved.Unlike traditional mate-heuristic algorithms, GMO adopts a dual-fitness index (DFI) to evaluate current solutions, which can be calculated by Eq. ( 17) where DFI k i represents the DFI value of the ith agent at the kth iteration; N P denotes the population size; MF k j means membership function value of the jth personal agent, which can be measured by Eq. ( 18) where F k best,j stands for the fitness value of the jth personal best agent at the kth iteration; σ and μ are the standard deviation and mean of fitness values of all personal best-so-far agents, respectively; c o represents the Napier's constant.
A weighted average of all opposite personal best-so-far agents is designed to make full use of the advantages of these best agents, as follows: In Eq. ( 19), Y k i denotes the global guide vector for the agent i; X best j is the personal best position of the jth search agent; ε is a small constant to void singularity.Besides, a Gaussian mutation mechanism of global guide vector is introduced to preserve the diversity of the guide agents, which yields Eq. ( 20) where Y t i,mu is the mutated global guide vector; RV is a random vector generated from the standard normal distribution; Std t max and Std t stand for a vector composed of the maximum standard deviation values of the personal best agents' dimensions and the standard deviation vector, respectively; w is an adaptive parameter, which is determined by Eq. ( 21) The updating equations of position and velocity are defined as Eqs ( 22), ( 23) where φ represents a scaling parameter vector to delineate the steps between the agent i and its guide, which can be formulated by Eq. ( 24) where R is a random parameter distributed in [0,1].The specific process of GMO solving optimization problems can be referred to (Rezaei et al., 2023).

Execution framework of GMO-based bi-level optimal scheduling
Above all, the execution framework of GMO-based bi-level optimal scheduling is illustrated in Figure 2. GMO is utilized to find the most considerable power outputs of controllable resources (CS) in the distribution network.The interior point method (IPM) is applied to solve the lower-level model for the best charging strategies.Peak-valley difference of the slack bus and DECFs of EV access points obtained by power flow calculation are the interactive information optimized for upper and lower levels, respectively.

Case studies
In this section, an extended IEEE 33-bus system is introduced to verify the validation of the proposed method, as depicted in Figure 3, which mainly attaches two same gas turbines (GTs), a wind turbine (WT), a PV unit, and three types of EV clusters on the basis of the standard system.The slack bus is connected to a main grid to ensure the power balance of the distribution network.Its time-of-use (ToU) electricity prices and DCEF are employed to guide economic low-carbon operations, illustrated in Figure 4A.The price of carbon emission is 0.0068 $/kg.
In addition, the power outputs of two GTs and the charging strategies of EV aggregators are set as decision-making variables for upper-level and lower-level optimizations.The upper and lower bounds of power outputs of GTs are set as 1,240 and 0 kW, and their unit generation cost is both 0.0822 $/kWh (Cao et al., 2022).For EV aggregators, charging behaviors of EV users on a weekday and weekends are taken into account.The initial state of charge (SoC) of EVs can be characterized by a normal distribution from 20% to 50% (Li YP. et al., 2023), as shown in Figure 4B.Their other critical parameters are offered in Table 1.Note that the dwell time of EVs are individually increased by an hour at night and decreased by two hours by day on weekend against weekday (Zheng et al., 2023).The scheduling time and interval are 24 and 1 h, respectively.
GMO and three competitive algorithms, i.e., GA (Wang et al., 2022), GWCA (Guan et al., 2023), and WOA (Mirjalili and Lewis, 2016), are adopted to solve the bi-level optimization model.For fair and objective comparisons, the population size and iteration number of each algorithm are identically set to 30 and 100, respectively.Results obtained by different approaches in 10 independent runs are recorded, upon which the best result of each method is selected and compared.Additionally, the main parameters of competitive algorithms are tabularized in Table 2.

Interactive scheduling test on a weekday
Here, an interactive scheduling test on a weekday is executed to evaluate the performance of various algorithms.Figure 5A depicts the convergence curve of upper-level optimization obtained by various algorithms, which indicates GMO outperform others.Specifically, while GA enjoys the fastest convergence speed, its final fitness value is the largest, which means it traps in the local optimum.After around 30 additional iterations, GMO searches for the smallest fitness value, which validates the high accuracy of GMO.

FIGURE 2
The flowchart of GMO-based bi-level optimal scheduling.
Frontiers in Energy Research frontiersin.org05 Xin et al. 10.3389/fenrg.2023.1338807Furthermore, a boxplot comparison based on 20 independent runs of different algorithms is given in Figure 5B.One can observe the boxplot of GMO exhibits the smallest distribution, upper bound, and lower bound, which demonstrates GMO also wins other competitive algorithms in stability performance.Table 3 statistics the optimum results and mean computation time of various algorithms, including the fitness value of upperlevel optimization, electricity cost, carbon emission cost, and total cost of lower-level optimization, upon which the best indicator is highlighted in bold.WO means without optimization: the power outputs of two GTs only depend on ToU price and each EV is charged via average power.When the generation cost of GTs is lower than the ToU price, its power output is set to the rated value, otherwise, it is equal to zero.GMO obtains the best indicators in the upper-level optimization task.Its fitness value is only 6.018 × 10 -4 times that obtained by WO, which indicates GMO significantly helps minimize power fluctuation of the distribution network.Under lower-level optimization, various algorithms acquire slightly different results.Based on satisfactory optimization results of GMO, the total cost of the EV aggregator is decreased by 76.18% (from 108.9666 $ to 25.9558 $) a day.
Figure 6 provides the optimal solutions on a weekday.The power outputs of GTs are obviously decreased from 5:00 to 16: 00 and increased at night to minimize the peak-valley difference of the distribution network, as shown in Figure 6A.As illustrated in Figure 6B, the charging power of EVs is significantly transferred from 18:00-24:00 and 0:00-2:00 to 3:00-5:00, which is mainly because the electric price is the lowest at 3: 00-5:00.
Figure 7A gives the cost comparison of various algorithms on a weekday.Figure 7B illustrates the CEFs of each EV cluster obtained by WO and GMO, in which the CEF of EV cluster #2 is significantly reduced from 7:00 to 17:00 after optimization via GMO.The CEF of EV cluster #3 is always equal to zero because it is only charged by WT.   (Cao et al., 2022;Li YP. et al., 2023).

Interactive scheduling test on weekend
In addition, the interactive scheduling test on weekends is designed to further validate the feasibility of the proposed method.Similar to the upper optimization on a weekday, GMO acquires the smallest fitness value with the most powerful stability compared with other algorithms, as shown in Figure 8.
Statistic results of various algorithms on weekends are tabulated in Table 4.The lowest total cost and carbon emission cost are simultaneously acquired by GMO.There are only slight differences between the smallest fitness value and shortest mean computation time and those obtained by GMO.In particular, the fitness value of upper-level optimization and total cost of the EV aggregator is decreased by 99.82% and 77.27%, respectively.Besides, the optimal solutions on a weekend are illustrated in Figure 9, in which the power outputs of GTs are obviously transferred from daytime to night duration.Similarly, EVs are assigned to charge with maximum power from 3:00 to 5:00 to maximize total cost.Figures 10A, B offer the cost comparison of various algorithms and the CEFs of each EV cluster obtained by WO and GMO on weekends, respectively.One can easily observe that similar optimization results are acquired compared with those on the weekdays.

Conclusion
This paper develops a bi-level optimal dispatching of distribution network considering friendly interaction with electric vehicles, in which a dynamic electrical carbon emission factor is introduced to precisely calculate the carbon emission of each node.According to two typical case studies based on an extended IEEE 33 bus system, three conclusions can be summarized as follows: ➢ The proposed bi-level optimal dispatching framework significantly contributes to the security and stability of the distribution network and the cost decrease of EV aggregators by considerable planning in power outputs of GTs and charging transformation of EVs.Peak-valley difference of the distribution network and the total cost of the EV aggregator can be decreased by over 98% and 76%, respectively; ➢ Compared with competitive algorithms, GMO acquires more satisfactory optimization indicators both in interactive scheduling tests on the weekday and weekend, which especially outperform others in convergence accuracy and stability; ➢ Due to the small cost of carbon emissions compared to electricity consumption, the reduction in electricity prices is dominant in the lower-level optimization, and the effect of electric vehicles participating in carbon reduction is not obvious.Higher carbon emission prices or multi-objective optimization may achieve more carbon reduction.
Notably, meta-heuristic algorithms used in this paper may be limited in accuracy and speed when various complex constraints are taken into consideration, such as start-stop constraint and climbing constraint of gas turbines, discharge constraint of electric vehicles, etc.

Data availability statement
The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding author.

FIGURE 1 A
FIGURE 1A common distribution network with power and carbon emission flows.

FIGURE 4
FIGURE 4Initial conditions of IEEE 33-bus system: (A) ToU price and DCEF of the slack bus; and (B) initial SoC of EVs.

FIGURE 5
FIGURE 5Comparisons of various algorithms for upper-level optimization on a weekday: (A) Convergence curve; and (B) Boxplot.

TABLE 1
Main parameters of different clusters of EVs

TABLE 3
Statistic results of various algorithms on a weekday.Optimal scheduling solutions on a weekday: (A) Upper-level; and (B) Lower-level.FIGURE 7 Result comparison of lower-level optimization on a weekday: (A) Costs; and (B) CEFs.FIGURE 8 Comparisons of various algorithms for upper-level optimization on weekend: (A) Convergence curve; and (B) Boxplot.FIGURE 9 Optimal scheduling solutions on a weekend: (A) Upper-level; and (B) Lower-level.Frontiers in Energy Research frontiersin.org08 Xin et al. 10.3389/fenrg.2023.1338807

TABLE 4
Statistic results of various algorithms on weekend.
FIGURE 10Result comparison of lower-level optimization on weekend: (A) Costs; and (B) CEFs.