Peak load minimization of an e-bus depot: impacts of user-set conditions in optimization algorithms

The transport sector is responsible for 25% of global CO2 emissions. To reduce emissions in the EU, a shift from the currently 745,000 operating public buses to electric buses (EBs) is expected in the coming years. Large-scale deployments of EBs and the electrification of bus depots will have a considerable impact on the local electric grid, potentially creating network congestion problems and spikes in the local energy load. In this work, we implement an exact, offline, modular multi-variable mixed-integer linear optimization algorithm to minimize the daily power load profile peak and optimally plan an electric bus depot. The algorithm accepts a bus depot schedule as input, and depending on the user input on optimization conditions, accounts for varying time granularity, preemption of the charging phase, vehicle-to-grid (V2G) charging capabilities and varying fleet size. The primary objective of this work is the analysis of the impact of each of these input conditions on the resulting minimized peak load. The results show that our optimization algorithm can reduce peak load by 83% on average. Time granularity and V2G have the greatest impact on peak reduction, whereas preemption and fleet splitting have the greatest impact on the computational time but an insignificant impact on peak reduction. The results bear relevance for mobility planners to account for innovative fleet management options. Depot infrastructure costs can be minimized by optimally sizing the infrastructure needs, by relying on split-fleet management or V2G options.


Introduction
The transport sector accounts for 25% of the global CO2 emissions (IEA 2020). Electric vehicles (EVs), ideally powered by renewable energy sources, have the potential to drastically cut these emissions. Public transport fleets, of which buses are the most widely used form in the EU (2050 long-term strategy -Climate Action), offer a massive electrification opportunity. Currently, about 745,000 buses operate in the EU, accounting for 55.7% of all public transport journeys and ferrying up to 32.1 billion passengers per year (2050 long-term strategy -Climate Action). As of 2019, only 4,500 electric buses operated in the EU, with a doubling in new registrations from 2018 to 2019 (Global EV outlook). Encouragingly, the use of electric buses (EBs) is expected to increase considerably in the coming years, spurred by greener policies and government incentives (Buses -ACEA -European Automobile Manufacturers' Association).
The introduction of electric buses in the public transport fleet will help governments fulfil requirements of recent environmental laws, meant to make the EU climate-neutral by 2050 (Rahman and Shrestha 1993), but at the same time poses several challenges. Large-scale deployments of EBs and EVs and the linked recharging infrastructures can have a significant impact on the local electric grid, creating network congestion issues and spikes in the electricity load profile (Clairand et al. 2020;Clement-Nyns et al. 2010;Valckx et al. 2019;Das et al. 2020;Ramabhotla et al. 2016), especially under uncontrolled charging activities. To mitigate such problems, many techniques have been suggested in literature. These include direct and indirect peak minimization through various optimization techniques -linear, mixed-integer linear, quadratic or dynamic programming -under a variety of optimization conditions such as different bus fleet sizes, battery sizes, preemption of the charging phase (that is, discrete charging slots with charging tasks unrelated to past or future charging tasks) and vehicle-to-grid (V2G), among others (see Related work section). Most existing approaches, however, consider a fixed set of optimization conditions (e.g., a linear optimization approach to minimize costs with fixed time intervals without V2G) and report optimal energy peaks without analyzing the impact of user-set optimization conditions on the results. This leads us to the following two research questions: RQ1: What is the impact of different user-set conditions during optimization (time granularity of the optimization, preemption, V2G and fleet size) on the final objective of peak minimization?
RQ2: What is the corresponding impact on computational time? We answer these questions by implementing an exact, offline, modular multi-variable mixed-integer linear optimization algorithm to minimize the daily power load profile peak and optimally plan an electric bus depot, under different user-set conditions. The algorithm was developed as part of Hitachi ABB Power Grids' (ABB 2020) projects for EB depot planning, hence with a focus on peak minimization without the inclusion of operating costs. Key results indicate that our optimization algorithm can reduce peak power load by 83% on average. Further, the results highlight the importance of enabling or disabling different user-set conditions in the optimization, which have impacts on both the reduction of the peak and the computational time. A larger time granularity of the optimization (i.e., smaller time interval) and enabling V2G have the greatest impact on peak reduction, whereas enabling preemption and fleet splitting have the greatest impact on the computational time reduction but an insignificant impact on peak reduction. These results imply lower initial investment costs due to optimum equipment sizing. EB depot planners can account for the impacts of these user-set conditions, such as the availability of V2G infrastructure and fleet-splitting, in order to manage EB fleet operation effectively.

Related work
Coordinated control strategies to flatten the EV charging load are divided into two types. Direct load flattening algorithms (Nguyen et al. 2014;Jahic et al. 2019;Turker and Colak 2018;Erdogan et al. 2018;Ranjan et al. 2014;Arango Castellanos et al. 2019) flatten the load profile by coordinating vehicle charging, shifting loads to minimize the peak. By contrast, the objective of indirect load flattening algorithms (Houbbadi et al. 2019;Tang and Zhang 2017;Xu and Wong 2011;Rotering and Ilic 2011;Sundström and Binding 2010) is to minimize the cost of charging. The former is a more relevant scenario when considering EB depots, since it is common for transport companies to buy electricity at a contracted rate from the local utility (Jahic et al. 2019). In such cases, the objective function of the type min(max(P t )) (Nguyen et al. 2014), where P t is the power consumed at an instant t, is usually translated into the quadratic form min(P t ) 2 (Houbbadi et al. 2019) that minimizes the load variance and spikes. Along with the objective function, several linear constraints must be taken into account, such as the arrival and departure of vehicles, the maximum charging power and the current state of charge (SOC).
Several methods to solve the stated optimization model can be deployed. These methods include linear programming (LP) (Hu et al. 2011;Sundström and Binding 2010;Turker and Colak 2018;Nageshrao et al. 2017) and mixed-integer linear programming (MILP) (Franco et al. 2015;Clemente et al. 2014;Ranjan et al. 2014), which are usually the fastest ones in terms of computational time. Since linear optimization cannot be directly exploited for peak minimization with a quadratic objective function, a workaround is presented in (Nguyen et al. 2014) through a bisection approach, which is adopted in this work and explained in the Methodology section. Other studies propose a quadratic programming approach (QP) (Houbbadi et al. 2019;Turker and Colak 2018) and dynamic programming (DP) (Xu and Wong 2011;Rotering and Ilic 2011;Korkas et al. 2017;Škugor and Deur 2014), and it has been shown that the computational time of DP is longer compared to QP with a negligible difference in the resulting charging profiles (Valckx et al. 2019).
In addition to the methods stated above, the existing literature proposes various heuristics (rule of thumb approaches), greedy algorithms, stochastic programming and even particle swarm and genetic algorithms (Jahic et al. 2019;Gao et al. 2018;Arango Castellanos et al. 2019;Yang et al. 2019). Many of these approaches have either longer computation times (particle swarm and genetic algorithms) or result in sub-optimal solutions and are applicable in specific scenarios only (heuristics) (Nageshrao et al. 2017).
Approaches are also classified and differentiated into open-loop (offline) and closedloop (online/real-time) based on the availability of external information about the vehicles and its parameters. An open-loop approach can be used if all information is available and sufficiently accurate (day-ahead scheduling) (Nguyen et al. 2014;Hu et al. 2011;Houbbadi et al. 2019;Xu and Wong 2011;Rotering and Ilic 2011). These methods can be computationally slower than closed-loop approaches since there is no need for immediate control action. If this information is not available or difficult to predict, a real-time approach can utilize closed-loop obtained information to solve the problem (Tang and Zhang 2017;Koutsopoulos and Tassiulas 2012;Xie et al. 2016;Yang et al. 2019;Erdogan et al. 2018). In this case, most common methods use Dynamic Programming and Model Predictive Control (MPC) to find a solution to the optimization task.
With further consideration of the nature of parameters and variables involved in the computation, peak shaving strategies can be divided even further. First, some studies speed up computation by considering an aggregate battery model of all batteries, instead of tracking the SOC of every single vehicle with an independent variable. Second, by employing a continuously controllable charging power, it is possible to solve the problem with classic optimization methods such as LP and QP. However, if the charging power is assumed to be fixed, the decision space is discrete and thus integer programming techniques must be deployed. Third, most studies consider the scheduling job to be preemptable, which implies that the controller can arbitrarily start or interrupt the charging of the connected vehicles at any time (Sundström and Binding 2010;Franco et al. 2015). This choice results in a faster calculation of the optimal solution for the corresponding linear programming model and a generally lower peak (Erdogan et al. 2018), although it can lead to battery degradation and should be avoided (Janovec and Koháni 2019). For this reason, some papers consider the charging procedure to be non-preemptable (Nageshrao et al. 2017;Koutsopoulos and Tassiulas 2012;Clemente et al. 2014). Table 1 organizes relevant literature reporting the values of nine different parameters relevant to the electric vehicle charging optimization problem. Since some studies do not explicitly report the values of the parameters, they are deduced by the authors based on critical analyses of the concerned studies. As can be seen from the table, studies on electric buses as well as electric vehicles, plug-in electric vehicles and generic power loads were accounted for. While there are obvious differences between these application contexts, insights are shared across the cited literature to improve the optimization result. For instance, an EB's schedule is usually known in advance but EV arrival and departure time at parking lots are often unknown. Nevertheless, the algorithms used for optimizing the charging process of the vehicles are, in many cases, interchangeable. Table 1 does not include computational time, since most cited literature does not state it. This further highlights the contribution of this work as computational times based on user-set optimization conditions are also presented.
The algorithm developed in this work is part of a planning tool for the construction of an electric bus depot with minimal infrastructure sizing. It is modular thanks to the ability to add and remove optimization constraints "on-demand" without the need to update the deployment's source code. This allows the authors to analyze the impact of each optimization variable and parameter on the peak load minimization and the computational time. To the knowledge of the authors, this is an aspect previously not documented in existing literature.

Optimization model
The objective of this research is to minimize the maximum peak of the daily power load profile absorbed from the grid, P G t : It is possible to formulate the problem using a set of binary decision variables that establish the charging or discharging command for each vehicle of the fleet, for each time interval considered during the day. We operate on two different sets, the vehicles i ∈[ 1, N] to be recharged and the discrete time slots t ∈[ 0, T]. The quadratic objective function therefore becomes:   where P chg stands for the power capacity of the charger, η chg represents the charger efficiency, η b represents the electric bus battery's charge-discharge efficiency and x i,t and y i,t are binary optimization variables which have a value of 1 and 0 when the vehicle is charging, and vice-versa when the vehicle is discharging. Using the approach described in (Hu et al. 2011), the quadratic formulation is translated into a mixed-integer linear programming formulation with an objective function as shown in Eq. 4, and an additional constraint in Eq. 5 reduced iteratively. Optimization parameters and further constraints of the optimization problem are outlined in Tables 2 and 3, respectively, and explained further in the sub-section Modular nature of the optimization.
The intuition is that there is only one optimal minimum value b for P G t since the charging power is considered constant. This value has a lower bound b m = 0 (no vehicles charged) and an initial upper bound b M = P chg × N where N is the number of vehicles in the fleet. The value of b is iteratively recomputed as b] in the alternate case. The optimal solution is found when the boundaries converge. Figure 1 displays the algorithm in a flow chart.

Modular nature of the optimization
A key speciality of the optimization algorithm developed in this work is its modular nature. Additional constraints are included in the optimization model only if particular user-set conditions (see sub-section Scenarios) are toggled on/off to evaluate their impact. The need for additional constraints arises if V2G must be enabled or preemption disabled, but does not arise in case of varying the length of the discrete time slots or splitting the fleet into sub-fleets. Table 3 explains how this is employed. x i,t represent the binary variables to indicate if each bus i is charging in every time-slot t. In the case of enabling V2G charging capabilities, a new set of binary variables y i,t are created, while the z i,t variables are only activated when preemption is disabled.
The SOC of a bus at departure must be equal to a predefined level SOC Dep,i , set to 100% SOC Balance: The SOC at time t for bus i is equal to the SOC in the previous time slot plus/minus the amount charged/discharged in the current time slot.
By default, x i,t variables are independent of each other with respect to the time slot. This allows the bus recharging process to be interrupted and restarted later (preemption).
If there is a requirement to prevent the interruption of the charging phase, the following constraints are introduced. The first 3 equations derive from a common trick used in optimization to assign the value 1 to a variable (z i,t in this case) if and only if both other variables are equal to 1 (in this case the charging command in the time slot t and (t − 1)). The last equation constrains the number of occasions in which the vehicle is being charged at t but not in (t − 1) to be 1. Effectively, this leads to the optimization charging a bus in a single charging process across multiple time slots until the battery is fully charged.

Case study
The data used to evaluate the optimization model comprises the daily schedule (arrival and departure times at the bus depot) of 138 diesel buses over a 24-hour period, obtained from Hitachi ABB Power Grids' client (ABB 2020) and can be found in the linked https:// github.com/tonxxd/depot_optimization. There are three types of buses, as shown in Table 4. Since the data set is based on conventional fossil-fuel vehicles, the distances travelled in a day are too large for an electric bus to traverse with one full charge. Hence, the distance travelled during service is shortened by a factor of 1.6 in order to not lose trip data, while keeping the departure and arrival times of the buses the same. The number of buses parked at the depot during the day is not constant: most of the buses are parked in the depot during the night and leave in the morning for service, as can be seen in Fig. 2. The DC charging power P chg was set at 150 kW based on industry standards (Hitachi ABB Power Grids). Each bus is charged to 100% SOC at departure, and allowed a depth of discharge of 95%. In order to simulate an electric bus depot with the same schedule, these buses are assumed to be electric with a 95% charge-discharge efficiency η b and the SOC for each bus i on arrival at the bus depot is calculated based on the energy consumption E b as described in Table 4, the bus battery capacity E bat and distance travelled (dist i ) using the following equation: Each optimization run considers a random set of 100 buses from the original dataset, and 50 runs are employed in each scenario in order to achieve a meaningful distribution of results. The computation of the optimal schedule (find the x i,t , y i,t that minimizes max P G t ) is achieved using the commercial solver Gurobi while the input optimization problem is formulated in Python using the Python-MIP library.

Baseline
As a reference scenario, we calculate the baseline peak load based on a simple first-infirst-out (FIFO) rule to charge the vehicles. Buses charge as soon as they arrive at the bus depot and remain attached to the grid until the state of charge of the battery reaches 100%. The algorithm employs discrete time intervals of 10 min.

Heuristic
To further compare results obtained, the algorithm proposed by Jahic et al. (Jahic et al. 2019) (an adaptation of the algorithm developed by Yaw et al. (Yaw and Mumey 2017)) was evaluated on the dataset. The heuristic suggested by these authors considers nonpreemptable charging jobs and a fixed charging rate. It is articulated in the following three steps: where a b is the arrival time, l b is the number of intervals required to fully charge the vehicle, s b is the selected slot to start charging and δ b is the shifting time of the vehicle b calculated as δ b = d b − a b − l b . 2 Organize all buses ascending by their shifting time δ b . 3 For each task, iterate over the possible charging tuples and select the one that outputs the lowest peak in the final profile.

Optimization condition scenarios
In order to analyze the impact of varying optimization conditions on the peak load minimization and the computational time, we perform a sensitivity analysis: Table 5 outlines the range of values different conditions take within the scenarios.
• Time Granularity (TG): The length of the discrete time intervals considered by the algorithm is varied as 60 min, 30 min and finally 10 min long. It is expected that the larger the time granularity (i.e., smaller time interval), the lower the final profile peak and the greater the computational time.  Bold fonts indicate the parameters varied in the corresponding scenario vehicle in a time-slot and interrupt charging in the next to reduce the overall peak. However, this is detrimental to the battery life. In this scenario, the time-slots are not independent of each other; the impact of disallowing the interruption of the charging procedure at each time-slot independent of the other time-slots (no preemption) on the peak reduction and computational time is assessed, without concern about the battery life. The aim is to identify ways to speed up the computations while preserving the peak minimization effect. We assess 50 randomly chosen sub-fleets for each sub-fleet size.
The combination of optimization conditions leading to the greatest reduction in peak as well as fastest computation, as compared to the baseline, are highlighted as well. The optimizations are run on a MacBook Pro with 2.6 GHz Intel Core i7 quad-core processor with 16 GB RAM.

Results
Baseline and heuristic Figure 3 shows the baseline and heuristic power profiles. The daily average peak of 7,959 kW in the uncontrolled charging scenario of the baseline occurs in the evening between 7 -8 PM, when most buses arrive back to the depot with empty batteries. The heuristic profile already leads to a considerable flattening of the power profile, with the peak reducing by 75.9% with respect to the baseline. The charging load is more evenly spread through the night, which helps flatten the evening peak. Figure 4 shows the resulting load profiles with optimized bus schedules at three time granularities, with and without preemption. The irregularity in the resulting power profiles is explained by the fixed high charging power considered in this work. Buses charge  quickly and reach 100% SOC before the current time-slot ends, thereby dropping out of the charging process and creating a trough in the power profile. In the next time-slot, the optimization schedules the same number but different buses for charging, so that the power peak remains the same. This variation reduces at large time granularities, due to the optimization being able to charge buses for a smaller time duration. The plots for the 10-min time granularity can be directly compared with the baseline and heuristic scenarios. By spacing out charging tasks equally during the night hours, our optimization algorithm results in an average peak of 1350 kW -a reduction of 83%. Figure 4a highlights the impact of the time granularity on the peak of the charging power profile of the bus depot. Shorter time-slots (large time granularity) lead to lower peaks -the peak with 10-min time granularity is 1350 kW, 33% smaller than the peak for a time granularity of 60 min. It thus becomes evident that scheduling EB charging benefits the depot sizing when the charging slots considered by the optimization are small. Figure 4b shows the resulting optimal profiles without preemption. Although there are slight differences in the load profile shape as compared to the profiles when preemption is enabled (Fig. 4a), the load peaks are equal in both cases, irrespective of the time granularity. Enabling or disabling preemption has no significant impact on the peak reduction. However, the computational time severely increases when preemption is disallowed (see Table 6). For instance, the mean computation times for a time granularity of 10 min are 32.97s and 1932.10s with and without preemption, respectively -60 times more, without bringing any peak reduction, as is the case with other considered time granularities.

Bi-directional power flow (Bi-PF)
Enabling V2G leads to only 30% of optimization runs (15/50) to have a peak 11.1% lower than a bus depot without V2G. The median profiles show no difference in the peak (see Fig. 5).

Fleet splitting (FS)
Fleet splitting is one way to reduce the computational time at the expense of a higher peak. With sub-fleets, the optimization algorithm is unaware of the entire fleet. It optimizes each sub-fleet independently and aggregates the resulting schedules. Figure 6 shows how the power profiles change if the optimization is run with smaller sub-fleets in parallel. Smaller sub-fleets lead to a higher peak, as evident by the curves for sub-fleet sizes of 10 which have an aggregated average peak of 1,746 kW, 20% greater than with a sub-fleet

Best-case scenarios
The bottom row of Table 6 displays the best results from individual runs. Achieving the lowest peak (1200 kW, 84.9% lower than the baseline scenario) is possible only with a large time granularity of 10 min, V2G enabled and fleet splitting disabled, with preemption being enabled having no impact on the peak as shown before. Fast solutions need a disabling of V2G -without fleet splitting a small time granularity (60 min) is necessary to reduce computational time. With fleet splitting enabled, the time granularity can be increased to 10 min and still achieve the same optimal peak as without fleet splitting.

Discussion
The results highlight the importance of optimizing charging schedules, by reducing the peak by 83% on average compared to the baseline scenario and by 29.5% on average with respect to the heuristic scenario. This reduction implies a reduced need for EB charging plugs and smaller equipment sizing, leading to lower initial investment costs to realize the bus depot. It is common for industrial consumers like EB depots to procure electricity directly from electricity providers at tariffs dependent on the peak load -the optimization algorithm hence directly helps in reducing electricity costs based on such tariffs. Even though the optimization does not explicitly account for operational costs (in particular the retail cost of daily electricity needs under dynamic tariffs, for instance), the resulting load profiles are very likely to generate substantial savings in terms of operational costs. We see that, after the optimization, the total average daily electricity cost is reduced by up to 44%, using simple time-of-use tariffs for electromobility needs in Zurich (EWZ). In fact, the algorithm developed shifts charging tasks to off-load periods like night, when electricity prices are typically lower.
The results also help highlight the relative importance of the time granularity of the optimization -the greater the time granularity, the lower the peak but the greater the computational time. Ideally, with discrete time intervals, a 1-min interval would provide the greatest reduction in the profile peak, although being computationally expensive. However, the resulting solution may not be practical, as having charging stations react every minute and changing the charging load abruptly can be detrimental to both the chargers and the bus batteries. A trade-off exists between EB charging slot lengths and the overall power peak, and depot planners must strive for a balance between the two.
Disabling preemption, that is, having charging slots be related to each other and thus disallowing frequent start-stops of the charging process, avoids the aforementioned problems. Since toggling preemption on/off has no impact on the peak reduction and hence the sizing of the EB depot, future research and EB depot planning can choose to always disable preemption and still achieve the same peak reduction. It leads to a more practical schedule for EB depot employees to follow as well -once a bus is plugged-in to charge, it will charge until it reaches a pre-defined level.
Empirical observations confirm the intuition that smaller sub-fleets lead to lower peak reductions, due to the limited visibility of the optimizer on the global fleet. While it does not make sense to split fleets from a pure peak reduction perspective, the computational time is much smaller for smaller sub-fleets. In time-sensitive optimizations, for instance in real-time algorithms, such fleet splitting can offer fast results in exchange for fairly modest peak increases, which could be well manageable in terms of installation and operating costs. With two small sub-fleets of 50 buses each, the peak is only 7.4% larger (corresponding to one extra charger operating in parallel), while the computational time is 81.1% lower as compared to the complete fleet. The optimization can thus be designed to achieve depot-specific planning and operational goals. However, the sub-fleet size strongly depends on the conformation of the original fleet since the aim is to maintain a similarity in terms of the distribution of the bus parking times at the depot between the sub-fleet and the global fleet.
The results also show that V2G does provide the scenario with the lowest peak load, but depot planners must be cautious. The underlying bus schedules and the variance between them are important -V2G may not help lower the peak in case of varying bus schedules. Depot planners must be wary of assuming V2G to always reduce the peak, and only invest in V2G infrastructure if such optimization results on differing bus schedules provide a definite benefit.
Overall, the greatest peak reduction is possible by considering the entire fleet with the greatest time granularity of 10 min and V2G enabled. Faster results are possible by either fleet splitting or assuming the smallest time granularity of 60 mins. These 'best case' conditions, however, may not be true for different data sets. Even though the method considered is not dependent on the input data itself, computation time and peak reduction are strongly correlated to the conformation of the fleet under consideration. Nevertheless, the methodology used in the paper which involves splitting the original 138-bus dataset into random subsets of 100 buses for the analysis allows a confident assertion of the general applicability of the algorithm and the peak reduction magnitude. In any case, future research needs to test and compare the impacts of the user-set conditions considered in this work on other data sets. Limitations in the optimization algorithm also include the simplistic modelling of the EB depot, without consideration of daily operating costs, battery chemistries, weather related energy consumption, and parking space constraints. However, these limitations were acceptable, given the focus of the work to explore the impacts of user-set conditions on peak-load minimization. Future research should also consider continuous variables in the optimization algorithm, which can better replicate future EV chargers with variable power, for instance. Alternative methods to optimize the quadratic objective function, such as direct minimization instead of linearization as employed in this work, offer further opportunities for new research. Further, smart techniques for fleet splitting, such as through careful considerations of time of arrival or departure of the buses could provide a different insight into the advantages of fleet splitting for such optimization problems.

Conclusion
The modular optimization approach developed in this work takes advantage of a flexible problem formulation while maintaining the computational time reasonably low. A major difference compared to other approaches is the ability to enable preemption of the charging tasks or enable V2G and fleet splitting on demand. This helped to highlight the impact of different user-set optimization conditions on the peak load and the computational time. We find that the peak is 33% lower with greater time granularities and 11.1% lower with V2G enabled, but not in all cases. Compared to the complete fleet, a smaller sub-fleet with 10 vehicles leads to a reduction in the computational time by 96% but raises the peak by 30%. These results help bus depot planners account for specific conditions, like the availability of V2G, in the implementation and installation of infrastructure in a new EB depot. A translation of the optimization approach used in this work to reduce operational costs is possible, but depot planners must be aware of the trade-offs between peak reduction and computational time under different user-set conditions.