Battery electric buses charging schedule optimization considering time-of-use electricity price

Purpose – This paper aims to optimize the charging schedule for battery electric buses (BEBs) to minimize the charging cost considering the time-of-use electricity price. Design/methodology/approach – The BEBs charging schedule optimization problem is formulated as a mixed-integer linear programming model. The objective is to minimize the total charging cost of the BEB ﬂ eet. The charge decision of each BEB at the end of each trip is to be determined. Two types of constraints are adopted to ensure that the charging schedule meets the operational requirements of the BEB ﬂ eet and that the number of charging piles can meet the demand of the charging schedule. Findings – This paper conducts numerical cases to validate the effect of the proposed model based on the actual timetable and charging data of a bus line. The results show that the total charge cost with the optimized charging schedule is 15.56% lower than the actual total charge cost under given conditions. The results also suggest that increasing the number of charging piles can reduce the charging cost to some extent, which can provide a reference for planning the number of charging piles. Originality/value – Considering time-of-use electricity price in the BEBs charging schedule will not only reduce the operation cost of electric transit but also make the best use of electricity resources.


Introduction
As urbanization accelerates, the number of vehicles in the city is increasing rapidly, leading to a series of problems such as traffic congestion and air pollution (Rupp et al., 2020). Public transportation has received widespread attention as an important way to reduce vehicle numbers and ease traffic congestion (Meng and Qu, 2013;Wang et al., 2018;Bie et al., 2020;Hao et al., 2020;Peled et al., 2021). Meanwhile, transportation electrification has been well recognized as the key to the world's clean transport future due to its zero emissions, high energy efficiency and shareability (Jin et al., 2015;Xu et al., 2018;Lin et al., 2019;Qu et al., 2020;Zhang et al., 2021c;Ortúzar, 2021). As a combination of public and electric transportation, battery electric buses (BEBs) are gradually replacing diesel buses in many countries (Shahraki et al., 2015;Shahkamrani et al., 2021). For example, the market penetration of BEBs increased rapidly from 20% in 2015 to nearly 60% in 2020 in China (Yu, 2020). The electrification of buses is gradually becoming a reality. For the BEB system, researchers have done some work to reduce construction and operational costs. For example, An (2020) developed a charging station location and fleet size estimation model for a BEB system under the stochastic fluctuation of charging demand to minimize the charging cost. Ke et al. (2020) proposed an innovative idea of battery energy resale for BEBs, which reduces the peak load on the grid by discharging the electricity of BEBs to the grid side. The process of battery charging and discharging is optimized by a genetic The current issue and full text archive of this journal is available on Emerald Insight at: https://www.emerald.com/insight/2399-9802.htm algorithm to minimize the operation cost of BEBs. In addition, Liu and Ceder (2020) explored the BEBs scheduling problem with fixed battery charging piles installed at bus terminals. An equivalent bi-objective integer programming model was proposed to minimize the total number of charging piles.
Despite the fact that the environmental and economic advantages of BEBs compared with diesel buses, the limited driving range and unsatisfactory battery performance still hinder their potential for further development (Bi et al., 2018;Zhang et al., 2020). BEBs are usually unable to complete a fullday operation without charging during the day (Rui et al., 2019). The disorderly charging behavior of BEBs may be harmful to the power grid. For example, a large number of BEBs charging during peak power consumption periods will increase the load on the power grid and affect its security. At the same time, the disorderly charging behavior of BEBs may increase the charging cost of bus companies due to the different electricity prices during different periods (i.e. time-of-use electricity price) (Lin et al., 2021). Therefore, it is necessary to study the charging schedule optimization of BEBs for the safety of the power grid and the operating economy of bus companies.
Most of the existing literature on the BEBs charging schedule optimization focuses on modeling the charging process by considering different factors and constructing optimization models to obtain charging schedules. For instance, Zhang et al. (2021b) studied the charging schedule of the BEB fleet, considering battery degradation and nonlinear charging characteristics. Rogge et al. (2018) proposed a mixed-integer nonlinear programming model with the consideration of energy consumption, driving range limitation and required charging time to optimize the charging schedule. Moreover, some other special conditions, such as the combination of bus mobile charging and fixed charging (Zhang et al., 2021a), heterogeneous charging modes (Zhang et al., 2022) and charging resource constraints (Liu et al., 2021), were considered to obtain the charging schedule for BEBs. Researchers also applied real bus systems to verify the proposed charging schedule optimization models. For example, Ke et al. (2016) adopted the Penghu bus system to validate the BEBs operation and charging schedule model that accounts for the cost of onboard batteries, the cost of electricity and the number of charging piles. He et al. (2020) used two bus networks in Salt Lake City to verify the proposed optimal charging scheduling and management model for a fast-charging BEB system. Wang et al. (2017) proposed an optimal charging framework for BEBs in an urban public transportation network, which determines the charging time and the capacity and location of charging stations to minimize the total cost of operating the BEB system. The transportation network in Davis, CA, was selected to testify the proposed charging framework. The solution methods for the above charging schedule optimization models are relatively diverse, including heuristic algorithms (such as genetic algorithms) (Rogge et al., 2018), branch-and-bound methods (Zhang et al., 2021b) and column generation algorithms (Liu et al., 2021).
The existing literature on charging strategies for BEBs can help bus companies to plan the charge station locations and reduce operating costs to a certain extent. However, these studies still have the following drawbacks. Some models contain excessive variables and constraints for practical applications due to the inappropriate abstraction of the actual operation and charging process of BEB systems. The current operation of BEBs shows that some bus companies have imperfect or even no charging plans. The driver's empirical choice of whether to charge the BEB at the charging station may increase the charging cost, especially in the presence of time-of-use electricity price.
Regarding the above issues, we develop a charging schedule optimization model for BEBs fleet considering time-of-use electricity price to minimize the total charging cost and make better use of charging resources. The rest of this paper is organized as follows. Section 2 presents the description of the BEBs charging schedule problem. Section 3 builds the charging schedule optimization model. A numerical example is given in Section 4. Conclusions are summarized in Section 5.

Description of the charging schedule problem for battery electric buses
We consider a network of multiple BEB lines, each of which has a fixed path. Each line consists of one or two terminals and some bus stops. The round lines have one terminal, and the others have two. We define the journey (one-way) along a BEB line from one terminal to another as a trip. The starting station and ending station of the trip are marked as O and d, respectively. Charging piles are provided at each terminal to promptly supply power to BEBs, i.e. the O or d is taken as a charging station. The BEB can only replenish the power at the charging station. A bus can only run on one line, but there can be more than one bus on one line. BEBs on different lines can share the same charging station.
The service definition of a BEB trip is as follows: a BEB starts from o, arrives at the bus stops along the line in turn and finally arrives at d. The BEB has a period for recharging energy at the charging station. Because the o and d of the trips in opposite directions in the same line are exactly opposite, we set that the BEB driver can choose to charge at the charging station after each trip (i.e. the BEB driver will always choose to charge at d for each trip if they choose to charge).
We consider the problem of optimizing the charging schedule for BEBs under a time-of-use electricity price. Because the urban electricity price changes over time, the choice of charging results in different charging costs. The optimization model established in this paper optimizes the charging of each BEB at the charging station, given the fleet size and the existing timetable, to minimize the charging cost of the entire BEBs fleet.
To simplify the optimization problem, we give the following assumptions.
Assumption 1: The BEBs fleet operates according to the current timetable, and the power consumption of the BEB is known for each trip.
Assumption 2: A BEB needs to be charged once for every two trips.
Assumption 3: When a BEB enters the charging station, if it decides to charge and there is an available charging pile, it will charge immediately rather than waiting for a period of time before charging.
Assumption 4: The BEBs will be fully charged every time before leaving the charging station.
Assumption 1 is given because the optimization of the operation timetable and the estimation of energy consumption are beyond the scope of this study. According to the parameters and actual operating conditions of the BEB, Assumption 2 can ensure that the remaining power meets the operating demand and does not run out of power during the trip. Relaxation of this assumption will increase the complexity of the model. Assumption 3 ensures that the charging resource of the charging piles is not wasted. Because it takes about 5 min to get in and out of the charging bay, and most of the actual charging time is about 10 min, Assumption 4 ensures that the BEB makes full use of every charging opportunity. Notations used in this paper are summarized in Appendix.

Charging schedule optimization model
The charging schedule optimization model of electric buses built in this paper can finely manage the charging behavior of BEBs and reduce the charging cost considering time-of-use electricity price. Therefore, the following conditions must be met: The model should ensure that the remaining electricity of each BEB can meet the requirements of the operation of the current trip.
The total charging cost should be minimized.
The model should be as simple as possible and easy to be solved.
The inputs to the model are the timetable of the BEBs fleet (departure, arrival time of each BEB in the fleet) and the power consumption per trip. The output of the model is the charging choice of each BEB after each trip.

Objective function
The objective of the charging schedule optimization model is to minimize the total charging cost. The following objective function can be constructed: where v denotes BEB v and (v, j) denotes the jth trip of BEB v. V denotes the set of BEBs. c (v,j) denotes the electricity price of BEB v at the end of trip j. e (v,j) denotes the amount of power consumed by BEB v in trip j. x (v,j) denotes whether BEB v is charged at the end of trip j. n v denotes the total trip number of BEB v. When the BEB enters the charging station, it will choose whether to charge or not. If the BEB chooses not to charge, the charging cost will be zero. If the BEB chooses to charge, the charging cost will be the amount of electricity charged multiplied by the price. The price of the electricity for each time period is a known parameter. The amount of charge is related to the amount of electricity consumed during the current trip and whether or not it was charged after the previous trip. If BEB v charges at the end of trip jÀ1, according to Assumption 4, its electric quantity at the beginning of trip j is the maximum. The BEB's electricity consumption amount is e (v,j) during trip j. If the BEB chooses to charge at the end of trip j, it still needs to be charged to the maximum electric quantity according to Assumption 4. Therefore, the BEB's electricity charging amount will be e (v,j) at the end of trip j. If BEB v is not charged at the end of trip jÀ1, it must be charged at the end of trip jÀ2, according to Assumption 2. In that case, the electric quantity of BEB v at the beginning of trip jÀ1 is the maximum. The electricity charging amount at the end of trip j will be the sum of the power consumption of trip jÀ1 and trip j. The objective function can accurately calculate the BEB's charging cost. The objective function is linear, making the optimization model easy to solve.

Constraints
The constraints of the charging schedule optimization model are as follows: X where A and A v are the total trip set and the trip set of BEB v, respectively. K (v,k) denotes the set of trip numbers for BEB v within the driving range prior to trip (v, k). Q (i,k) is the set of trips that have charging conflicts with the trip (i, k). n charger denotes the number of charging piles in the charging station. Equation (2) is the constraint that ensures the trip is feasible. The trip graph for BEB v with a marked driving range is shown in Figure 1. We use charging stations (i.e. terminal stations of the BEB line) as the nodes and trips as the edges. The length of the edge is the distance of the trip. In Figure 1, D indicates the driving range of BEB v. According to Assumption 1, the operation timetable of each BEB is fixed. We cannot ensure that each trip is feasible by adjusting the timetable. In the meantime, we know the electricity consumption for each trip. Hence, we can figure out the trip number within the driving range of each BEB. If we want to make trip (v, k) feasible, the BEB must be charged at least once within the driving range prior to the trip, i.e. the BEB must be charged at least once from trip (v, j) to trip (v, kÀ1) in Figure 1. We should note that constraint 1 [i.e. equation (2)] is constructed for each trip in a charging schedule. This constraint ensures that the BEB will not run out of power on each trip, and a charging schedule that meets this constraint is feasible.
Equation (3) is the constraint for the total number of charging piles in a charging station. We must ensure that the charging demand does not exceed the supply in the same time period of the same charging station. For each trip, we look for all the trips that may conflict with its charging. Constraint (3) should be established when the total number of conflicting trips is more significant or close to the number of charging piles in the charging station, which ensures that there will be no shortage of charging piles at any time. Figure 2 shows the schematic diagram of trips with potential charging conflict zones. Similar to Figure 1, we use charging stations as the nodes in Figure 2. The solid edges represent trips. The dashed edges represent the BEB charging at the station. We should note that the dashed nodes that are connected by the dashed edge represent the same charging station. The dashed boxes indicate potential charging conflict zones. T (i,k) and t (i,k) denote the departure time and trip time of trip (i, k), respectively. According to Assumption 3, once the BEB enters the charging station, it will be charged immediately without waiting. We analyze here the charging decision behavior of each BEB in the chronological order of arrival at the charging station to determine whether there is a potential charging conflict. We assume that BEB i is the first arriving at the charging station. If it chooses to charge, there is a potential charging conflict between the BEB arriving at the same charging station during BEB's charging period (i.e. t charge in Figure 2). In other words, there will be potential charging conflict between the BEBs arriving at the charging station during [T (i,k) 1 t (i,k) , T (i,k) 1 t (i,k) 1 t charge ] and BEB i. From Figure 2, we can consider the set Q (i,k) ={(i, k),(l, m),. . .,(u, w)}. Then, equation (3) can be rewritten as follows: When x (i,k) = 1, equation (5) is established, otherwise, there will be an unreasonable situation that the number of charging BEBs is larger than the number of charging piles in a charging station. When x (i,k) = 0, equation (5) becomes x (l,m) 1 . . . 1 x (u,w) n charger . We analyze here BEB's potential charging conflicts after trip m. The BEBs that arrive at the charging station during [T (l,m) 1 t (l,m) , T (l,m) 1 t (l,m) 1 t charge ] will have potential charging conflicts with BEB l. Because BEB l arrives at the charging station is not earlier than BEB i and not later than other BEBs, T others 1 t others holds. Hence, {(l, m),. . .,(u, w)}(Q lm and equation (5) is also valid. Equation (4) is the integer constraint of the charging decision variable. When a charging decision is made, x (v,j) takes the value of 1. Otherwise, x (v,j) takes the value of 0. Compared with previous models related to BEB charging scheduling, our proposed model has the following advantages. We simplify the model as much as possible based on the actual operating characteristics of the BEBs. The decision variable of the model is whether the BEB is charged after reaching the charging station at the end of the trip, without the need to discretize the time. The proposed model reduces redundant variables and constraints, which reduces the complexity of the model and makes it easy to apply the model to actual BEB operations.

Numerical test
In this paper, we use the actual operation data of a BEB line in Beijing, including the timetable and electricity consumption data and the actual time-of-use electricity price data, to verify the proposed charging schedule optimization model. The required input parameters of the model are extracted from the original data. By solving the mixed-integer linear programming problem, the optimized charging schedule is obtained. The actual charging data is chosen as the benchmark to verify the effectiveness of the proposed model.

Parameters
The selected BEB line consists of 34 stops, with a total length of around 16 km. There are 24 BEBs operating on the line during the day, for a total of 114 trips. The average departure interval  Figure 2 Schematic diagram of trips with potential charging conflict zones

Trip
Stop Potential charging conflict zone Note: is about 10 min. The electricity price selected in this paper is the time-of-use electricity price for industrial use in urban areas. The specific electricity price is shown in Figure 3. The peak periods are 10:00-15:00 and 18:00-21:00, when the electricity price is 0.9864 CNY/kWh. The flat periods are 7:00-10:00, 15:00-18:00 and 21:00-23:00, when the electricity price is 0.677 CNY/kWh. The low period is 23:00-7:00, and the electricity price is 0.3766 CNY/kWh. A fixed value of 20 min is set as t charge in the example to ensure sufficient charging time for each BEB. The number of charging piles n charger is set as 2.

Simulation results
The charging schedule optimization model for BEB constructed in this paper is a mixed-integer linear programming model, which contains fewer constraints and variables. This optimization model can be easily solved by mature commercial optimization software. We use Gurobi software in the Anaconda environment to solve the problem. There are 114 0-1 variables and 135 constraints in the charging schedule optimization model. The optimized charging schedule for the BEB fleet is shown in Table 1.
Based on the charging schedule and industrial time-of-use electricity price, we calculate the optimized charging cost and actual charging cost of the selected BEB fleet for one day, as shown in Table 2.
From Table 2, we can find that the actual total charging cost of the BEB fleet in one day is 2,339.601 CNY, whereas the optimized one is 1975.57 CNY. The total charging cost is reduced by 15.56%. We can also find that the charging cost of BEB 19 is increased, which means that the charging schedule given by the proposed model can guarantee the reduction of the total charging cost but cannot guarantee the reduction of the charging cost for each BEB.
We also analyze the influence of n charger on the optimization result. When the number of charging piles is 3, the optimized total charging cost is CNY 1,931.11. When the number of charging piles is larger than 4, the optimized total charging cost is always CNY 1,904.78. The above results suggest that increasing the number of charging piles may reduce the cost of charging, but only to a certain extent. There might be an optimal value for charging piles in terms of total charging cost. The optimal number of charging piles is related to the departure interval and electricity price. Therefore, a sensitivity analysis of the proposed model can be performed to provide a reference for planning the number of charging piles. Here, we should note that increasing the number of charging piles will provide more charging resources (i.e. the solution space of the charging schedule), and thus, is expected to decrease the charging cost. However, increasing the number of charging piles will also increase the capital cost. The charging piles planning should be a trade-off between the charging and capital costs, which should be further studied.
Given the input parameters, the proposed charging schedule optimization model generally has feasible solutions, which indicates that there are multiple charging schedules available for the BEB fleet. There should not be a situation where the normal operation of the BEB line is affected by the charging schedule. However, in some special cases (e.g. when the number of charging piles is 1 in the above example), the model has no feasible solution, which indicates that there is no feasible charging schedule for the given setup. The reasons for the above situation may be as follows: the number of charging piles in the charging station is not enough to support the charging demand; BEBs pile up into the charging station, and the charging behavior will affect the daily operation of BEB lines; the charging time is set too long. Therefore, the charging schedule optimization model of BEBs can also be used to determine whether there is a possibility of adjusting the charging schedule to ensure the normal operation of the BEB line.

Conclusion
The charging behavior of BEBs is mostly determined by drivers due to the characteristics of fixed lines, multi-vehicle shared charging stations and nighttime charging that cannot meet daily operational needs. In the presence of time-of-use electricity price, the lack of inter-vehicle charging coordination for the BEB fleet can result in some undesirable consequences, such as higher charging costs and wasted charging resources and even affect the normal operation of BEB lines due to charging.
To address the above issues, we propose a BEB charging schedule optimization model with the consideration of time-of-  use electricity prices. The proposed model transforms the charging schedule optimization problem into a mixed-integer linear programming problem using as few variables and constraints as possible, given some reasonable assumptions. The linear programming model includes the objective function of minimizing the total charging cost and two types of constraints of trip feasibility and the total number of charging piles limitation. It can provide a charging schedule to make the BEB's power meet the operation demand and reduce the charging resource contention among vehicles. Finally, we use the actual daily operation data of a BEB line in Beijing to verify the proposed model. The optimized charging schedule can save 15.56% of the charging cost compared with the actual charging schedule. The charging schedule optimization model proposed in this paper can provide a reference for planning the number of charging piles and judging the effectiveness of the charging schedule.
In this paper, we assume that the energy consumption of the BEB is known for each trip. However, the energy consumption of BEB can be affected by several factors. An electricity consumption estimation model needs to be proposed as a more accurate input. In view of the complexity of the actual problem, it would be a meaningful research direction to relax some assumptions in this paper so as to propose a more flexible and practical charging schedule optimization model.  v (v,j) The jth trip of BEB v V The set of BEBs c (v,j) The electricity price of BEB v at the end of trip j e (v,j) The amount of power consumed by BEB v in trip j x (v,j) The charging decision of BEB v at the end of trip j n v The total trip number of BEB v A The total trip set A v The trip set of BEB v K (v,k) The set of trip numbers for BEB v within the driving range prior to trip (v, k) The set of trips that have charging conflicts with trip (i, k) n charger The number of charging piles in the charging station T (i,k) The departure time of trip (i, k) t (i,k) The trip time of trip (i, k) t charge The charging time of each BEB t (i,k) The trip time of trip (i, k)