A Comprehensive TCO Evaluation Method for Electric Bus Systems Based on Discrete-Event Simulation Including Bus Scheduling and Charging Infrastructure Optimisation

: Bus operators around the world are facing the transformation of their fleets from fossil-fuelled to electric buses. Two technologies prevail: Depot charging and opportunity charging at terminal stops. Total cost of ownership (TCO) is an important metric for the decision between the two technologies, however, most TCO studies for electric bus systems rely on generalised route data and simplifying assumptions that may not reflect local conditions. In particular, the need to re-schedule vehicle operations to satisfy electric buses’ range and charging time constraints is commonly disregarded. We present a simulation tool based on discrete-event simulation to determine the vehicle, charging infrastructure, energy and staff demand required to electrify real-world bus networks. These results are then passed to a TCO model. A greedy scheduling algorithm is developed to plan vehicle schedules suitable for electric buses. Scheduling and simulation are coupled with a genetic algorithm to determine cost-optimised charging locations for opportunity charging. A case study is carried out in which we analyse the electrification of a metropolitan bus network consisting of 39 lines with 4748 passenger trips per day. The results generally favour opportunity charging over depot charging in terms of TCO, however, under some circumstances, the technologies are on par. This emphasises the need for detailed analysis of the local bus network in order to make an informed procurement decision.


Introduction
Municipal governments and public transport operators around the world have committed to transforming their fossil-fuelled bus fleets to zero-emission fleets, using either battery electric or fuel cell electric buses. The choice of technology has profound implications on the operational characteristics of the vehicles and the infrastructure required.
In recent years, significantly more battery electric buses were deployed than fuel cell buses, and the majority of bus operators in Europe appears to strategically favour this technology [1]. We therefore focus on battery electric buses in this work. However, even within the realm of battery electric buses, several charging strategies exist with vastly different operational characteristics ( Figure 1). We differentiate between depot charging (DC), opportunity charging at stationary charging points (OC) and in-motion charging (IMC). Opportunity charging can take place at terminal stops (OC-T), intermediate stops (OC-I) and at central charging stations (OC-C). Opportunity charging at intermediate stops (OC-I) and at central charging stations (OC-C) is rarely encountered. In Germany, for example, only two electric bus projects (out of approximately 40 in total) used OC-I, one of which has been declared obsolete [2,3]. Our interviews with bus operators also suggest that OC-I is not desired due to the complex nature of planning infrastructure on public roads. OC-C has also seen only a few applications [1]. In-motion charging (IMC) is limited to cities that already have a trolleybus network, one exception being Berlin where building new trolley bus lines with in-motion charging is currently being discussed [4]. The majority of bus electrification projects focuses on depot charging (DC) and opportunity charging at terminal stops (OC-T) 1 .
For operators facing a decision between the two technologies, the total cost of ownership (TCO) is an important metric [5]. However, despite a wealth of publications dealing with the TCO analysis of electric bus systems, several aspects have received insufficient attention in the literature, as we will show in our literature review in Section 3 (after introducing a suitable structure for literature comparison in Section 2). In particular, many works circumvent the problem of re-scheduling bus operations to satisfy the range and charging time constraints imposed by electric buses. This can lead to unrealistic results for the electric bus fleet size. The issue of increased staff demand is also commonly neglected. Most methods do not use real timetable and route data as an input, but generalised data. Delay data is not considered in any of the studies we evaluated, yet, as we will show, it has significant influence. We conclude from our literature evaluation that the existing methodologies are of limited applicability for bus operators planning the electrification of their fleet and seeking the most cost-effective option.
In Section 4 of this paper, we provide details on a simulation, planning and TCO assessment method first introduced in [6]. The method has since been further developed and currently includes • an object-oriented, discrete-event simulation framework, enabling the energetic simulation of large bus fleets -including charging events en-route and in the depot -based on exact, non-idealised scheduling data, • a scheduling algorithm to construct electric bus schedules adapted to range and/or charging time constraints and service delays, • a genetic algorithm to enable cost-optimised placement of opportunity charging stations and • a TCO calculation module based on dynamic costing.
In Section 5, we conduct a case study for a set of 39 real-world bus lines for which exact timetable, scheduling and delay data were available. By analysis of the existing (diesel bus) schedules, we will illustrate that a 1:1 exchange of diesel to electric vehicles often assumed in the literature is infeasible. We then apply the charging infrastructure optimisation and scheduling algorithms to construct fully electrified operational scenarios using depot and opportunity charging. The resulting vehicle schedules serve as input for a fleet and depot simulation that yields fleet size, fleet energy consumption, driver hours etc. These values are then fed into the TCO module to obtain total system cost for each scenario. 1 Also, battery swapping exists, but it is nearly exclusively applied in China. Since our focus is on the European market, battery swapping will not be further regarded in this study.
We close our paper with a discussion of our methodology and results (Section 6) and a final conclusion and outlook (Section 7). Detailed model equations are given in the Appendix.

General Workflow in Electric Bus System Planning and TCO Analysis
During recent years, an abundance of publications has emerged in the field of electric bus systems with very different scopes. Many publications focus on individual aspects of system design (for example, methods to obtain a feasible vehicle configuration or charging infrastructure layout for a given bus network) or system simulation (for example, vehicle energy consumption simulation). On the other hand, several publications deal with complete electric bus systems, mostly in order to compare different system configurations in terms of TCO. The latter studies vary considerably in the level of detail with which certain aspects are treated.
To facilitate a well-structured comparison of existing works, we propose a generalised representation of the electric bus system analysis workflow, illustrated in Figure 2. Based on comprehensive literature evaluation as well as our own developments, we identified four main steps: 1. Problem formulation and input data definition 2. System design methods 3. System simulation methods

TCO calculation methods
It should be pointed out that definitions in the literature may differ. For example, in our previous work [7], the entire process consisting of steps 1 to 4 is regarded as system design. Generally, steps 2 to 4 are not semantically separated in the literature. They are also often not carried out sequentially, but simultaneously. This is especially the case in works utilising optimisation routines where some or all of the tasks are integrated into an objective function. For example, electric bus scheduling methods must incorporate some sort of vehicle model to determine energy consumption and vehicle range. In our generalised workflow, the scheduling algorithm is part of the system design methods and the vehicle model contained therein is part of the system simulation methods. This separation of design and simulation aspects enables us to systematically compare existing methodological contributions, even if scope and context of the respective publications differ.

Literature Review
In the following subsections, existing works corresponding to each of the four steps introduced in Section 2 will be evaluated.

Problem Formulation and Input Data Definition
Many different problem formulations related to electric buses have been addressed in the literature (some examples were provided above). The selection of input data is highly dependent on the problem formulation. For instance, vehicle configuration -in particular, battery capacity -may be fixed and thus provided as an input parameter [6,8], or it may be part of the design problem [5,7,9]. The same applies to the location of charging infrastructure. An aspect of high practical relevance is the form of vehicle operation profile that is used as an input. Various types of operation profiles are observed: • Driving profiles, i. e., a time series of velocity and elevation. These may be measured in real-world operation [10], taken from standard dynamometer driving cycles [7,11] or generated from microscopic traffic simulation [12]. • Simplified bus line and timetable data. Real-world timetables are reduced to headway and trip duration (sometimes variable over the course of the day), neglecting absolute departure and Step 1 Vehicle parameters (available battery capacities, charging interfaces etc.) Vehicle duty data (bus network data, timetables, driving profiles etc.) Charging strategies to be modeled (DC, OC-T, OC-I, IMC etc.) Charging infrastructure data (possible charging locations, available power etc.) Others (ambient conditions, ridership data etc.) Possible input data:

Problem formulation and input data definition
Vehicle configuration Charging infrastructure layout Vehicle schedules Charging schedules Etc.
Methods to determine: Step 2 Step 3 Step 4 Figure 2. Generalised workflow of electric bus system planning and TCO evaluation, including examples of methods and data commonly used in the literature arrival times; bus lines are commonly reduced to a single route variant 2 [5,8,9,[13][14][15]. A slightly more detailed timetable representation is found in Ke et al. [16] where absolute departure times and variable trip durations are considered, but resampled to 5-minute intervals.
Timetable data is often complemented with driving profiles to determine trip energy consumption [5,9,14,15]. • Exact bus line and timetable data. No simplifications are made to timetable data; any sequence of trips on any line and any route variant can be considered. This approach is common to all works specifically dealing with bus scheduling (see Section 3.2), but seldom encountered in electric bus TCO studies, exceptions being Rogge et al. [17], Lindgren [18] and Jefferies and Göhlich [6]. • Transportation demand data. Some publications do not assume fixed timetables, but regard the timetable as part of the design problem. They use demand data (e. g., passengers per hour) as an input [19,20].

System Design Methods
Depending on the problem description, considerably different methodologies are employed in this step. A common design task carried out in electric bus publications is to determine a feasible set of vehicle parameters, such as the battery capacity required for a given bus line [7,9,21] or a TCO-optimised battery capacity and/or charging power [22,23].
Also, various methods to determine charging infrastructure locations have been developed. They commonly use mixed-integer linear programming (MILP) and place charging infrastructure such that total system cost is minimised, e. g. [24,25]. Some approaches also simultaneously determine cost-optimised battery capacities [22,23]. Lindgren [18] uses an optimisation heuristic to determine charging infrastructure locations and then sets the vehicles' battery capacities such that a certain lifetime is achieved. However, all aforementioned methodologies assume unchanged vehicle schedules. Their applicability is therefore limited to situations where charging at intermediate stops (OC-I), or, in the case of Lindgren [18] and Liu and Song [23], in-motion charging (IMC) is allowed. If charging is only desired at terminal stops (OC-T), a feasible solution may not be found depending on the dwell times available. Kovalyov et al. [20] formulate an optimisation problem to determine cost-optimised fleet mix, departure frequencies and charging infrastructure layout; however, no implementation is provided and it is thus unknown if real-world problem instances can be solved.
If it is not possible to operate existing vehicle schedules with electric buses -due to range or charging time limitations -the issue of vehicle scheduling arises. We consider scheduling to be a central part of electric bus system design and a prerequisite for TCO analysis [6]. However, like the literature on charging infrastructure optimisation, publications dealing with electric bus TCO analysis often do not address the scheduling problem.
In TCO studies dealing with depot charging (DC), the scheduling problem is commonly circumvented by assuming that the daily distance covered by each vehicle does not exceed the electric buses' range [11,26] or by setting a sufficiently high battery capacity, even beyond what is available on the market [13]. When treating opportunity charging (OC), the need for rescheduling is eliminated in several works by assuming charging at intermediate stops (OC-I) and deploying a sufficient amount of charging stations such that dwell times at the terminal stops can remain unchanged [5,9,13,18] 3 . These assumptions result in unchanged vehicle demand compared to the existing, conventional bus fleet. However, we have previously shown this not to reflect the reality of a metropolitan bus network [6] and will further elaborate on this in Section 5.2. 2 It is common for bus lines to have full-length services operating "from end to end" as well as services operating on a shorter route inbetween, or to have several different branches. We term each of these a route variant. 3 The work by Lindgren [18] does make use of a scheduling algorithm, however it is only used to generate diesel bus schedules because original scheduling data was not available, and no details of the algorithm are given.
• Wang and Shen [28] • This work differs from the others in that timetable creation is part of the problem formulation, so timetables are not given explicitly. In constructing the timetable, however, different vehicle capacities are considered based on passenger demand. The aforementioned works do not provide a solution for depot charging if schedule lengths exceed vehicle range; neither do they allow opportunity charging exclusively at terminal stops (OC-T). The work by Pihlatie et al. [26] does deal with OC-T, but assumes sufficient dwell times are available to recharge at the termini. We have also shown this assumption not to hold true in real-world bus operation, especially if service delays are taken into account [6].
We are currently aware of only two contributions (other than our own) that determine electric bus system TCO utilising electric vehicle scheduling. Rogge et al. [17] developed a genetic algorithm to determine feasible, TCO-optimised schedules for depot charging, including a charging sequence at the depot minimising vehicle and charging infrastructure demand. This method yields a set of vehicle schedules that satisfies exact, real-world timetables and therefore enables a realistic determination of the resulting fleet size. However, it is applicable to depot charging (DC) only. In the TCO study by Ke et al. [16], a scheduling algorithm for opportunity charging at central charging stations (OC-C) and depot charging (DC) is developed. Timetable data resampled to 5-minute intervals is used as an input. However, the algorithm does not consider the duration of deadhead trips -as a result, vehicles may be assigned trip sequences they cannot actually serve -and is subject to arbitrary restrictions, the rationale of which remains unexplained: Opportunity charging can take place only once an hour, and depot charging commences only after all vehicles have completed all trips.
Due to the lack of universally applicable scheduling methods found in electric bus TCO studies, we conducted a survey of publications focusing exclusively on electric bus scheduling. Table 1 gives  7 of 43 an overview of these works as well as those already discussed above. They are compared with respect to the following criteria: • Whether or not an optimal solution to the vehicle scheduling problem (VSP) is sought (column "optimisation").

•
The ability to handle multiple depots.

•
The ability to specify vehicle type restrictions for each trip. This is highly relevant to practical operation as different trips are often served by different vehicle types (e. g., small or large vehicles). • The charging strategies considered (see Section 1 for their respective definitions). • Whether route restrictions are imposed in terms of energy (i. e., battery capacity), time or distance. • Whether charging duration is evaluated based on the actual vehicle state of charge (SOC) or assumed constant. • Whether partial charging is allowed or a full charge is assumed at each charging event. • Whether charging stations and/or depots have a limited number of charging points (capacity constraints).

•
Whether a variable fleet mix is determined, e. g. an optimal combination of short-range and long-range electric buses or an optimal combination of diesel and electric buses. • Whether or not the approach determines the optimal location of OC charging stations (OC charging location optimisation).
Most works focus on finding an optimal solution to the VSP which, when considering battery capacity limitations, is NP-hard [29]. The central task in solving such problems is to develop feasible solution heuristics. Discussing these solution procedures is beyond the scope of this paper; it should be noted, however, that application is not always proven for large problem instances of several thousand trips. For example, the time-space-energy network approach by Li et al. [19] -the approach in Table 1 with the most general problem formulation -was not able solve an instance consisting of a comparatively small route network with four terminal stops, despite time being discretised to 30-minute intervals. The methods by Wen et al. [31] and van Kooten Niekerk et al. [33] were successfully applied to instances with around 500 trips, the method by Li [29] to around 900 trips. Adler and Mirchandani [30] demonstrated successful application for over 4000 trips and Reuer et al. [32] for over 10000 trips. The approaches by Ke et al. [16], Paul and Yamada [27] as well as our own [6] employ greedy algorithms and therefore do not yield optimal solutions, but are considerably less cumbersome to implement than optimisation methods and provide fast results even for very large problem instances. They are, however, applicable only to single-depot problems and are limited to DC and OC-T charging strategies.
As mentioned above, the ability to consider different vehicle types in the timetable is of great significance for real-world applications. Most works, however, do not enable this and would therefore require generating a separate problem instance for each vehicle type. This would provide feasible results only if capacity constraints and charging location optimisation are not part of the problem.

System Simulation Methods
In this section, existing methods for vehicle, fleet and depot simulation are compared.

Vehicle Modelling
Traction energy consumption is commonly determined by one of three approaches. Some works employ a longitudinal dynamics model comprising a detailed representation of the vehicle drivetrain [9,10,14,15,17,34,35]. A driving profile (see section 3.1) is required as an input to the model. Others use empirical correlations describing traction consumption as a function of, for example, average velocity, eliminating the need for driving profiles [5,8]. The most simple approach to traction modelling is to assume constant specific consumption (e. g., in kWh/km) irrespective of the actual driving profile [6,13,16].
The heating, ventilation and air-conditioning (HVAC) system is the most energy-consuming auxiliary device in an electric bus, its consumption potentially exceeding that of the drivetrain depending on weather conditions [7]. Despite this, most works related to electric bus system analysis and design do not model the HVAC system explicitly. Sebastiani et al. [15] do not consider the HVAC system at all. Hegazy et al. [35] perform vehicle simulations for various auxiliary powers, but they are not linked to a specific choice of HVAC system or specific weather conditions. Several authors use average overall vehicle consumption values, but do not state whether they include auxiliary consumption [8,13,16]. Lajunen [9] employs HVAC consumption data from Lajunen and Kalttonen [36], but it is unclear how the values were determined. Rogge et al. [17] employ a vehicle model from Sinhuber et al. [34] which uses measured values for auxiliary consumption (including the HVAC system). A detailed standalone HVAC system model was developed by the authors of this work [37,38], however its complexity impedes application within a fleet model. Kunith [5] uses this model to compute HVAC consumption for selected ambient temperatures prior to fleet simulation.
Explicit modeling of other auxiliaries in electric buses, such as air compressor, steering pump and battery heating/cooling, is -to the best of our knowledge -not encountered in the literature within the context of electric bus system analysis and design.

Fleet Modelling
We distinguish between two approaches to fleet simulation. Object-oriented or agent-based models using a discrete-event framework were popularised in autonomous taxi fleet and general logistics simulation [39][40][41][42], but are also applied to bus fleets [14,15,43,44]. All objects in the simulationvehicles, charging stations, depots, etc. -are simulated simultaneously in a shared environment with a central simulation clock, each object having its own individual state. Events change the system state at discrete time steps and allow for communication between objects. The second approach is sequential models in which vehicles do not share an environment and each vehicle's state is evaluated separately [10,16,17]. Some models assume that all vehicles have a uniform operation profile [5,8,9,13], hence only one vehicle is evaluated and its energy consumption is multiplied by the fleet size.

Depot Modelling
Especially in the case of depot charging, the charging process at the bus depot can be a bottleneck with major influence on the e-bus fleet size (and therefore on TCO), as we will show in Section 5.4. Several TCO studies, however, do not consider depot operations at all [8,9,13]. Some works approximate the additional vehicle demand arising from exchanging buses with depleted battery capacity and recharging them at the depot [5,45], but this specific approach is only applicable when using simplified timetable and route data (assuming constant travel duration and headway all day).
Rogge et al. [17] already consider the depot charging process at the scheduling stage (see Section 3.2), hence its influence on fleet size is accounted for. However, as mentioned above, the methodology cannot handle opportunity charging.
A comprehensive electric bus depot model applicable to real-world bus schedules and any charging strategy is presented by Lauth et al. [46]. It is based on discrete-event simulation and considers all relevant processes at the depot, including cleaning, maintenance, parking, charging and dispatch.

TCO Calculation Methods
TCO calculation may be carried out on the basis of a static [8,16,17] or dynamic [5,9,13] costing model. Static models assume a constant value of money over time, while dynamic models operate in terms of net present value (NPV). Usually, dynamic models also feature cost projections for future expenditures. Timetables are resampled to 5-minute intervals, but it may be assumed that the model can also operate with higher resolution data. i

Simplified scheduling without deadheading
Aside from the type of costing model, the existing TCO studies also vary in the selection of cost components. While all studies include vehicle and infrastructure investment cost and energy cost, the following cost components are not always accounted for: Financing, driver wages, grid connection, vehicle and infrastructure maintenance, carbon emissions, salvage values.

Comparison of Electric Bus TCO Studies
Following our survey of individual methodological contributions to electric bus system design, simulation and TCO calculation, we will now analyse existing TCO studies that compare electric bus systems in their entirety. Table 2 lists some features of electric bus TCO studies: • The charging strategies considered, • whether exact timetable data is used as input, • whether delays are considered during system design, • whether bus scheduling is performed for fleet size calculation and in what manner, • whether charging at the depot is considered for fleet size calculation, • how the location and/or number of required charging points is determined, • whether staff (i. e., driver) demand is part of the calculation.
The majority of the works uses simplified scheduling or no scheduling at all. As a consequence, application of these methods is limited to theoretical cases where the existing schedules do not have to be changed for electrification (see Section 3.2). Also, most works cannot operate on real-world timetable data, do not consider operational delays, and do not consider the charging process at the depot for fleet size calculation. The only work to feature an exact approach to scheduling and depot operations (Rogge et al. [17]) can treat depot charging only. Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 For a bus operator facing a procurement decision between various electric bus system alternatives, it is desirable to determine the TCO of each electric bus system for the local operating conditions, i. e. the exact local routes and timetables, rather than for generalised or simplified cases that may not adequately reflect local conditions. We must conclude, however, that none of the methods discussed in this section can deliver this.

Electric Bus System Simulation and Planning Tool
To be able to perform a TCO comparison of electric bus systems for a real-world, metropolitan bus network, we developed eFLIPS 4 , a simulation and planning tool first presented in [6]. Development took place in multiple projects, not only in the context of electric buses, but also battery-electric trains and electric sanitation vehicles.
eFLIPS was implemented in Python [47] using strict object orientation. A discrete-event simulation framework was built using SimPy [48], a package providing a simulation clock, an event and process system, and capacity-constrained resources. Figure 3 gives an overview of the tool's main features, the workflow involved in performing a TCO study as well as the inputs and outputs of each step. Each of the features will be explained in the following.

Bus Scheduling Algorithm
Our scheduling algorithm can plan schedules for depot charging (DC) and opportunity charging at terminal stops (OC-T). It follows a greedy approach similar to Paul and Yamada [27], but provides more flexibility: It can handle multiple vehicle types; it is possible to plan schedules for depot charging or refueling; in the case of opportunity charging, charging is not assumed at every terminus, but only at those stops defined as charging points. Like the algorithm by Paul and Yamada [27], it is limited to a single depot.
The main input to the algorithm is a timetable, i. e. a list of passenger trips sorted by departure time. A trip has the following attributes: Trip type (passenger or deadhead trip); vehicle type (e. g., standard or articulated bus); departure time; trip duration; delay; dwell time succeeding the trip 5 . Also, a list of charging locations and a set of vehicle parameters must be provided. The output is a list of schedules, which, essentially, are also lists of trips, except they include deadhead trips and must only consist of trips of identical vehicle type.
The algorithm operates in two stages: First, schedules are built from successive trips without deadheading (other than the depot trips at the start and end of the schedule), i. e., the next trip must always begin at the destination of the previous. If the destination is a charging point, sufficient dwell time is provided to fully recharge the energy storage before the next trip commences. A global minimum dwell time can be specified. Optionally, delays can be added to the dwell time to ensure sufficient charging time and punctuality. After the addition of each trip, the vehicle SOC is evaluated. A schedule is terminated if one of the following is true: There are no more serviceable trips from the current destination (either no trips with a matching vehicle type are left at all, or those that are left exceed the maximum permitted dwell time); or, a critical state of charge is reached. In the latter case, trips are subsequently removed from the end of the schedule until the state of charge is valid. Figure A1 in Appendix A shows a flowchart of this stage of the algorithm.
In the second stage, depicted as a flowchart in Figure A2 (Appendix A), it is attempted to concatenate the schedules created in stage I in order to maximise schedule length and to avoid unnecessary trips to the depot. The algorithm tries to join each schedule with the earliest reachable follow-up schedule through a deadhead trip until no more reachable schedules exist or a critical SOC

Schedule simulation results
Annual energy demand Annual driver hours Annual fleet mileage  The distance of deadhead trips -i. e., depot trips and trips connecting different schedules -is determined through the openrouteservice car routing API [49]. A constant average speed is assumed to determine the duration of deadhead trips. For each of the two scheduling stages, it is possible to allow or disallow line changes.

Schedule Simulation
The schedule simulation forms the main component of eFLIPS. It enables simulation of any kind of predefined schedules using one of the four charging regimes introduced in Section 1.
As pointed out above, the implementation follows an object-oriented approach. Thus, a schedule simulation replicates the physical objects encountered in the real world as depicted in Figure 4: • A list of schedules to be served is provided, as well as the geographical grid comprising grid points and connecting arcs. Typically, the schedules cover a single operational day, but any time window up to a week is possible. • The ambient (omitted in Figure 4) provides ambient temperature and insolation. • The charging network consists of charging points for stationary charging and charging arcs where vehicles can charge while in motion. Points and arcs each correspond to a point or arc in the grid, respectively. Charging facilities have a specific charging interface through which they can transfer energy to a vehicle. They are implemented as a SimPy resource with a defined capacity (i. e., the number of charging slots available). If a vehicle issues a charging request and all slots are occupied, it must queue for a free slot in order to charge. • One or more depots exist where vehicles start and end their respective schedules. • A central dispatcher reads the list of schedules and, when a schedule is about to commence, requests a vehicle of the required type from the depot specified in the schedule. It also assigns a driver to the vehicle. • Each vehicle provides various actions: Switching the ignition and air-conditioning on and off, driving along a specified leg of a schedule, driving along a specified velocity profile, modifying the payload (through boarding and alighting of passengers), etc. It has several sub-components, mainly the traction device, auxiliary devices and energy storage, as well as one or more charging interfaces. The vehicle model is explained in detail in Section 4.2.2.

•
The driver executes vehicle actions according to the schedule. It also keeps track of the time spent driving and idling.
A formal listing of all inputs to the schedule simulation is given in Appendix B.  The discrete-event system allows for communication between objects. For example, if a vehicle's traction power changes, the traction device triggers a state change event. The vehicle's charge controller listens for state change events and, upon receiving such an event, updates the energy flow to or from the energy storage. Similarly, charging facilities keep track of the total energy flow and the number of vehicles present. State change events also control when an object's state is logged by the data logging system: The state of any object is only evaluated when it changes, saving computing time and memory.

Vehicle Model
A vehicle comprises a primary and, optionally, a secondary energy subsystem, each consisting of an energy storage, any number of connected devices (loads) -including traction, HVAC and other auxiliary devices -and any number of charging or refueling interfaces. A charge controller routes the energy flow between loads, storage and interfaces. Upon each state change event, the energy storage integrates the net energy flow to determine the amount of energy charged or discharged. The structure of the vehicle and energy subsystem models is shown in Figure 5. The primary subsystem always includes the traction motor; a secondary subsystem may be present, for example, if the heating system uses a different fuel than the traction motor, as is the case in electric buses with diesel-fueled heating.
Two traction models are available for simulation (cf. Section 3.3.1): A constant specific consumption model that determines energy consumption on a per-arc basis, and a longitudinal dynamics model requiring a driving profile. The latter currently cannot be used for schedule simulation, however it is used to determine typical mean consumption values for standard driving cycles that can later be used in a schedule simulation.
Several HVAC component models were implemented using parameters from manufacturers' data: Electric heat pump, electric air conditioning, electric resistance heater and diesel heater can be combined to several HVAC system configurations. Auxiliaries other than the HVAC system are modelled as one device with constant power.
A charging logic checks for the availability of suitable charging facilities at the current location during every time interval and controls the vehicle's behaviour accordingly. The actions invoked by  Figure 6. Queuing and manoeuvring are generally only applicable to stationary charging points. Various queuing strategies can be defined: Vehicles can queue for a free charging slot or skip charging if all slots are occupied; also, vehicles can release the charging slot once they are fully charged, or remain at the charging point until departure. These features were implemented to be able to evaluate the impact of different driver break regulations on charging infrastructure demand. It is also possible to force vehicles to always wait until fully charged (even if this causes a delay), or to depart as punctually as possible (even if this leaves no time to charge). Furthermore, several energy storage (battery, diesel tank) and charging interface models (stationary pantograph, trolleybus pantograph, CCS plug, diesel nozzle, train pantograph) were implemented. When connected to a charging interface, a constant charging power is assumed.
A full documentation of the model equations is given in Appendix C.

Depot Model
Vehicles start and end their schedules at a depot. Any number of depots can be defined in the simulation. Each depot keeps track of the number of vehicles currently in service and the number of vehicles present at the depot for charging and parking. All depots are empty at the start of the simulation. If a vehicle is requested for line service from a depot by the dispatcher, the first available vehicle currently parked at the depot is chosen; if no vehicle is available, a new vehicle is generated and added to the depot. Thus, the required fleet size can be determined by counting the number of vehicles generated in total by the end of the simulation, as illustrated schematically in Figure 7.
When a vehicle arrives at the depot and a charging slot is available, charging commences immediately after a defined dead time for manoeuvring has passed. Vehicles are charged at full power. After charging, vehicles are again blocked for a certain dead time before being able to return to service.

Year Simulation and TCO Calculation
To determine the fleet's annual energy demand required for TCO calculation, it is important to consider the seasonal variation of HVAC system consumption. Thus, a batch simulation module was developed allowing simulation of any number of parameter sets. We use the batch simulation module to determine annual simulation results on the basis of a year's temperature and insolation function. Both functions are discretised into n intervals such that a list T of temperature and insolation values and the respective number of days (i. e., the width of the interval) is produced: T = (N days,1 , T 1 ,q sol,1 ), . . . , (N days,n , T n ,q sol,n ) .
For each quantity Q obtained from a schedule simulation for one single day, the annual quantity Q a is obtained through where Q may be the fleet energy consumption E fleet , fleet mileage M fleet or driver hours ∆t driver . Vehicle and infrastructure demand are not determined from the year simulation, but from a separate schedule simulation using a critical consumption case (usually a very cold winter day).
Once the vehicle demand, infrastructure demand, annual fleet mileage, annual energy demand and annual driver hours have been determined, they are passed to a dynamic TCO model. We assume loan capital is acquired for capital expenditures and repayed in the form of an annuity over the lifetime of the respective component (vehicles, batteries, charging infrastructure). The unit cost of all capital and operational expenses is determined for all relevant years using cost escalation factors that may be individually defined for each year. It is assumed payments take place at the beginning of the year. Salvage values are not considered. Once the annual cash flows for all types of expenses have been calculated, they are discounted to a base year to compensate for general inflation. Figure 8 gives an overview of the calculation method.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 The overall system TCO is obtained by summing up all discounted cash flows. A full description of the calculation can be found in Appendix D.

Genetic Algorithm for Charging Infrastructure Optimisation
The functions of eFLIPS presented thus far -electric bus scheduling, schedule simulation, year simulation and TCO calculation -require the specification of charging infrastructure locations as an input parameter. In the case of depot charging, this is trivial. When dealing with opportunity charging, however, deciding upon the location of charging points can become a complex task: As any combination of charging points poses a separate scheduling problem, the effect of charging point positions on overall system cost is difficult if not impossible to predict by intuition. Also, real-world bus networks produce solution spaces of considerable magnitude, as our case study presented in Section 5 will illustrate. It therefore seems purposeful to develop an optimisation method to determine a cost-optimised set of charging locations for opportunity charging.
To enable this, the entire process shown in Figure 3 was wrapped into a single function that returns the TCO of an electric bus system, using timetable data and charging point locations as the main inputs. A binary genetic algorithm (GA) was implemented that uses this aggregated TCO function as a fitness function.
A list of possible locations for OC charging infrastructure L = (l 1 , . . . , l i , . . . , l N loc ) defines the length N loc of each chromosome c = (b 1 , . . . , b i , . . . , b N loc ). The position i of each allele maps to location l i and the value of the allele indicates whether a charging station is present at this location (b i = 1) or not (b i = 0). A population size N pop is defined and an initial population is generated randomly. For each new generation, the best N keep = x select N pop chromosomes are kept, x select being the selection share, and the rest is discarded. Chromosome pairs (parents) are randomly selected to produce offspring through single-point crossover until the original population size is reached. The offspring is then mutated using the mutation rate µ. We define µ as the share of alleles that is randomly modified, i. e., N mut = (N chrom − 1) N loc µ alleles at random positions are switched, N chrom being the number of chromosomes in the population subset that mutation is applied to.
The number of charging slots is set to an arbitrary, high value for all stations in the schedule simulation so that, effectively, no capacity constraints exist. This is because the scheduling algorithm currently does not support charging station capacity constraints.
To reduce computation time, a simplified TCO calculation method was adopted for the GA fitness function: Instead of performing a year simulation using a temperature distribution, annual energy consumption is obtained by simply multiplying energy consumption for the critical consumption case by 365. Also, a static costing model is used.
Further reduction in computation time is obtained by skipping the fitness evaluation of infeasible solutions: Solutions not including at least one charging location per bus line are penalised by being assigned a very low fitness (i. e. high cost) value. Their actual TCO is not evaluated. Also, the algorithm caches all chromosomes and their respective fitness values such that no chromosome is evaluated twice. Parallel processing support was realised using Python's multiprocessing package.

Case Study: Electrification Scenarios for an Urban Bus Network
To illustrate the application of our methodology, we conducted a case study for a real-world bus network consisting of 39 lines, of which 28 operate at daytime, 2 provide 24-hour service and 9 are night lines. For these lines, the current diesel bus schedules -from which the timetables can be generated by discarding the empty trips -and delay data were made available by the bus operator.

Vehicle Specifications and Energy Consumption
For the schedule simulation and TCO calculation, it is paramount to obtain representative vehicle parameters and consumption values. Our approach outlined in the following is to define a set of vehicle parameters based on market data, and to determine specific consumption for standard driving Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 Detailed SORT [50] test data was available from a bus manufacturer for an 18 m articulated electric bus. The test yields specific vehicle consumption in kWh/km for a SORT 1, 2 and 3 cycle using a fixed payload. These experimentally determined consumption values were used to parameterise and validate the vehicle model presented in Appendix C.
The parameters f r , c w , A front and λ used in Eqs. (A25) and (A26) were obtained from literature ( Table 3). The HVAC system power P HVAC is zero because the HVAC system was switched off during the SORT test. This leaves the total drivetrain efficiency η total in Eq. (A23) and the power of the remaining auxiliaries P aux,other in Eq. (A2) unknown. They were determined by least-squares approximation such that where i = 1 . . . 3 corresponds to the respective SORT profile, e SORT,i,sim is the specific consumption obtained from longitudinal dynamics simulation and e SORT,i,exp is the experimentally determined specific consumption. The least-squares approximation yielded η total = 0.86 and P aux,other = 5.40 kW, both of which are plausible (e. g., by comparison with Sinhuber et al. [34]). Using these parameters, the SORT cycle energy consumption obtained through simulation was within 2% of the experimentally determined consumption, as Table 4 indicates. The parameters will thus be used henceforth.

Defining Vehicle Types for the Simulation
We defined five base types of electric buses: Three depot charging types with low (120 km), medium (200 km) and high (300 km) range, and two opportunity charging types with a range of 60 km and different charging powers (300 kW and 450 kW). For each base type, parameters for a standard 12 m bus and an articulated 18 m bus were defined, yielding 10 electric bus configurations in total.
For each vehicle configuration, the battery capacity was set such that the desired range can be fulfilled on a SORT 2 cycle with 50% occupation on a very cold winter day (−10°C) with the HVAC system enabled. Cabin temperature was set to 17°C in accordance with the VDV guidelines on passenger cabin air-conditioning [59]. To ascertain that the range requirement can be satisfied even at the end of the battery lifetime, a battery state of health (SOH) of 80% was assumed. A root finder was used to obtain the matching battery capacity because the discrete-event simulation model does not Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 permit solving for the battery capacity explicitly. The resulting battery weight was determined using energy density values taken from current manufacturer datasheets; for the high-range depot chargers, a 20% increase in energy density was assumed. Lithium-ion NMC batteries were assumed for the depot chargers and LTO batteries for the opportunity chargers. Vehicle base weights (without battery) were obtained as mean values from the literature. The full set of vehicle parameters used henceforth is listed in Table 5.

Simulation of Existing Schedules With Electric Buses
To assess the operability of the existing diesel bus schedules with electric buses, we performed simulations of the 317 unchanged schedules that cover the 39 lines on a weekday. Five scenarios, each corresponding to one of the vehicle types in Table 5, were simulated. Critical consumption parameters (SORT 2, 50% occupation, −10°C outside, 17°C inside) were assumed as outlined in the previous section.
For the opportunity charging scenarios, the location of charging stations 6 has to be defined. The charging optimisation algorithm introduced in Section 4.4 cannot be applied in this case because it enforces rescheduling of the vehicles. To avoid subjective decisions, a simple heuristic was chosen: A charging point was assumed at every terminus, even at termini that are only seldom visited. This yielded a total of 128 OC charging stations (more than 3 stations per line). It must be noted that this approach does not in any way reflect operational practice; it simply constitutes the upper boundary in terms of available energy supply and thus can be considered a theoretical best-case scenario for OC.
For the simulation of existing schedules, the question of interest is whether vehicles can sustain a valid state of charge during schedule operation. Depot operations are irrelevant at this stage. Thus, no depot simulation was carried out; a new, fully charged vehicle was generated for each schedule. If vehicles arrived at a terminus delayed, the dwell time (and, therefore, the charging time in the OC cases) was shortened to permit a punctual departure whenever possible.
Simulation was carried out for punctual and delayed operation. For the latter case, historical delay data was available from the bus operator; the delay assigned to each trip was obtained as the 90th percentile of all delays observed on similar trips within the same hour of the day 7 .
The simulation results are shown in Figure 9. It is observed that delays exert only a minor influence in the depot charging scenarios; in the opportunity charging scenarios, however, the results change considerably when delays are taken into account. As expected, the higher the DC vehicles' range and the higher the OC vehicles' charging power, the more schedules can be served. There is, however, no scenario that permits electric bus operation with completely unchanged schedules. Also, it must be emphasized that the OC results for a more realistic charging infrastructure setup would be considerably worse. These results reinforce our point that the transition to electric buses in a metropolitan bus network requires a re-scheduling of vehicle operations [6].

Fully Electrified Scenarios: Scheduling and Charging Infrastructure Optimisation
We will now proceed to construct scenarios for fully electric bus operation. Six scenarios were generated: Five electric bus scenarios corresponding to the vehicle types in Table 5 and a diesel reference scenario for comparison. Diesel vehicles were modelled using a specific average consumption of 44.4 litres/100 km for standard buses and 59.4 litres/100 km for articulated buses (values from a bus operator's fleet consumption evaluation over an entire year). HVAC system and other auxiliaries were not modelled for diesel buses, they were included in the average consumption.
For each of the scenarios, a new set of schedules has to be generated. In order to invoke the scheduling algorithm presented in Section 4.1, we first have to define a timetable. This is achieved 6 The word charging station is used synonymously with charging point. A station has several charging slots.  OK critical invalid Figure 9. Results from the simulation of existing diesel bus schedules with electric buses. The pie charts indicate the number of schedules for which the following applies: Green -schedules can be served within the SOC limits of the battery and also leave an operational safety margin of 10 km; yellow -schedules can technically be operated, but violate the 10 km safety margin; red -schedules are inoperable because they violate the SOC limits of the battery.
by filtering the existing schedules for passenger trips on the specified lines. For the daytime lines, all trips during a weekday were chosen (this typically includes all trips between 4:00 AM and 1:00 AM of the following day). For the night lines, all trips departing on the evening of the same weekday and during the following night were considered. For the 24-hour lines, a time window must be chosen. We considered all trips departing between 03:00 AM and 02:59 AM on the following day, in accordance with the bus operator's definition of an operational day. The resulting timetable consists of 4748 trips. All trips shall be served by a single depot. For scheduling, the minimum dwell time was set to zero as some lines currently operate with zero dwell time at certain termini. Maximum dwell time and maximum deadheading time were set to 45 minutes. The average velocity used to compute the duration of deadhead trips was defined as 25 km/h. Line changes were only permitted during the second stage of scheduling (cf. Section 4.1). A reserve range of 10 km was assumed for all vehicle types and the effective battery capacity available for scheduling was reduced accordingly.
Delays were taken into account in all scenarios during scheduling: The minimum dwell time at every terminus was increased by the delay upon arrival such that a punctual departure for the succeeding trip is always possible. Technically, it would also be conceivable to consider delays only in the case of OC, since only OC requires "guaranteed" dwell times for recharging even in the presence of delays. However, this would imply the OC systems can maintain a higher level of punctuality than the DC and diesel systems. To ensure a consistent quality of service for the passenger in all scenarios, it is thus appropriate to always consider delays.
A cost-optimised charging station layout was determined for each of the OC scenarios using the genetic algorithm presented in Section 4.4. The parameters were: Population size N pop = 120, selection share x select = 0.5 and mutation rate µ = 0.2. Infeasible solutions not including at least one charging station per bus line were assigned a TCO of 10 €/km. All of the 93 terminal stops were provided as charging location candidates, enabling 2 93 ≈ 10 28   Xeon E5-2640 machine with 64 GB RAM was used. Figure 10 shows the TCO of the best solution per generation over the course of the iteration 8 . The genetic iteration yielded a set of 42 charging locations for the 300 kW scenario and 44 charging locations for the 450 kW scenario. These configurations were subsequently used for schedule generation and system simulation. Further discussion of the charging network optimisation results is found in Section 6.
The results of the scheduling process are listed in Table 6. The scheduling efficiency was determined for each schedule as the ratio where t productive is the time spent during revenue service, i. e. on passenger trips excluding pauses, and t total is the total operation time. Computing time for schedule generation was 333 seconds, or ≈56 seconds per scenario, on an Intel Core i5-6200U using a single core. As would be expected, in the case of DC, the lower the vehicle range, the more schedules were generated and the lower is the resulting schedule efficiency. This is because more depot trips are required for the same number of passenger trips. The OC schedules provide higher efficiency than the DC schedules, indicating that the unproductive time for recharging OC vehicles is lower than the unproductive time for additional depot trips in the DC case. Diesel schedules have the highest mean efficiency and distance. 8 Note that because of the simplified TCO model implemented within the GA, the TCO obtained by the GA does not match the TCO calculated in Section 5.5 using the full model.

Fully Electrified Scenarios: System Simulation
The schedules generated for each technology in the previous section serve as the main input for the system simulation. The goal of the system simulation is to obtain the number of vehicles and charging points required to operate the schedules under critical conditions (a cold winter day as outlined in Section 5.2). Each individual vehicle is simulated; example SOC plots from a single-day simulation are given in Figure 11.
Schedules were generated for five electric bus scenarios (scenarios 1-5) and a diesel reference scenario (scenario 8) as illustrated in the previous section. Two additional electric bus scenarios (scenarios 6 and 7) not requiring additional scheduling were simulated to observe the impact of reducing the charging power at the depot: The medium range DC scenario and the low power OC scenario are replicated with a depot charging power of 60 kW instead of 150 kW.
To correctly simulate depot operations, the schedules have to be repeated twice such that a period of three consecutive days is simulated as illustrated in Figure 12: Only on the second day will there exist an equilibrium state that reflects actual weekday depot operation. This is because at the beginning of the simulation, the depot starts empty and it takes some time until all vehicle objects have been generated; at the end of the simulation, all schedules have ended and all vehicles are returned to the depot. In reality, this never happens because a certain number of vehicles is always in service at any time of day.
The number of required fast charging slots was obtained as the sum of the maximum occupation of each charging station; an example is provided in Figure 13. The number of available slots per station was set to a high value in the simulation so that, effectively, charging station capacity was unconstrained. Vehicles were configured to occupy their charging slot until departure 9 . The required number of depot charging slots was determined from the maximum depot occupation as illustrated in Figure 12. One depot charging slot per vehicle was assumed.
The simulation results are presented in Table 7. We observe the following: • Generally, the electric bus scenarios require at least 20 more vehicles (+12%) compared to the 234 vehicles in the diesel reference scenario. The only exception is the long-range DC scenario (scenario 3) that requires only 3 more vehicles (+1.3%). • Reducing the charging power at the depot from 150 kW to 60 kW incurs a significantly larger fleet in the case of depot charging (+14 vehicles or 4%). In the case of opportunity charging, the increase in fleet size is less pronounced (+2 vehicles or 0.8%). • Increasing the DC vehicles' range from 120 to 200 km increases the required fleet size substantially by 32 vehicles or 10%. This is because in the 200 km case, many vehicles run out of energy during the afternoon when vehicle demand is at its peak and, thus, many new vehicles have to be generated. In the 120 km case, however, most vehicles return to the depot for charging before the afternoon peak and can then cover the entire afternoon shift uninterrupted. This surprising result illustrates the limits of the greedy scheduling algorithm: The objective pursued by the algorithm to maximise schedule length does not necessarily lead to a minimum fleet size.

Fully Electrified Scenarios: TCO Comparison
For the final step of our analysis, the TCO comparison, a year simulation was carried out for each of the scenarios to obtain annual energy demand and driver hours (see Section 4.3). A temperature function for Germany [60] was used and discretised into monthly intervals. Vehicle and infrastructure demand was taken from the simulation of the critical consumption case in the previous section. The cost parameters used in the TCO calculation are presented in Table 8. To obtain the driver hours, it was assumed that drivers are paid an additional 20 minutes per schedule for vehicle preparation and       parking. Dwell times were only deducted from the paid labour hours if they have a certain minimum duration; short dwell times were assumed to be fully paid. This reflects the labour agreement of a bus operator, the details of which we cannot disclose. The cost for depot construction and depot grid connection was not considered. Identical unit cost was assumed for 150 kW and 60 kW depot charging points due to a lack of data. The construction and grid connection cost for fast charging stations was assumed equal for all stations, regardless of charging power and number of slots.
The eight scenarios were evaluated in two variants: One assuming a battery change after half of the bus lifetime, and the other without battery change. The results for both variants are shown in Figure 14. Vehicles and batteries are always treated as separate cost entities in the figures.
The key findings in the TCO comparison are: • In the calculation with battery renewal, the lowest-cost DC electric bus scenario has a TCO 4-6% higher than the OC scenarios. Without battery renewal, this gap reduces to 1-2%.
• Reducing the depot charging power from 150 kW to 60 kW has a more pronounced impact on the TCO of the DC scenario (+2%) than on the TCO of the OC scenario (+0.2%), as would be expected from the vehicle demand presented in the previous section. • If no battery renewal is necessary, system cost is reduced by 2% to 4%. • The short-range and long-range DC scenarios have equal TCO if battery renewal is considered; in this case, the reduced vehicle demand in the long-range scenario is countered by higher battery replacement cost. The calculation without battery renewal, however, favours the long-range scenario, albeit by a narrow margin (−2.5% compared to the short-range scenario). • The 450 kW OC scenario is slightly more competitive than the 300 kW scenario by a very small margin (−1%). • Charging infrastructure has little influence on TCO: Its contribution ranges from 0.6% to 1.0% for DC and from 3.0% to 3.4% for OC. The electric bus scenarios incur an overall TCO 15-31% higher than the diesel scenario if battery renewal is considered, and 13-25% without battery renewal.

Discussion
In this section, we will address the limitations of our methodology and critically evaluate our results.

OC Infrastructure Optimisation
The result obtained by the charging infrastructure optimisation -42 stations in the 300 kW scenario and 44 in the 450 kW scenario -appears counterintuitive at first. It would be expected that the lower the charging power, the more charging stations have to be deployed. However, our result can be explained by the behaviour of the scheduling algorithm: Dwell times are determined such that the battery can be fully charged at every terminus with a charging facility. Due to this strict condition, a lower charging power increases the chance of the algorithm skipping the next departure at a terminus, as illustrated schematically in Figure 15. If departures are skipped, however, the dwell time increases by a multiple of the headway -creating additional time available for charging. This can eliminate the need for additional charging stations on the same line. A high charging power, on the other hand, increases the chance of obtaining a full charge without skipping departures, thus requiring more charging stations, but reducing vehicle demand. In practice, it would be conceivable to adjust timetables in order to better accomodate opportunity charging and further reduce charging infrastructure demand. For example, departure times could be modified such that the resulting dwell times are shifted toward one terminus, thus allowing operation of the respective line with only one charging station. However, this was outside of the scope of this study.

Scheduling
As illustrated in Section 5.4, the greedy scheduling algorithm does not construct schedules with minimum vehicle demand, which can lead to unexpected results especially in the case of DC. The algorithm is therefore of limited use for schedule planning in practical applications. Optimisation-based approaches as introduced in Section 3.2 are better suited, but issues regarding the implementation and the ability to solve large problem instances have to be considered. In the case of OC, the algorithm cannot consider charging station capacity constraints. This also is an obstacle to practical application as the physical space available at potential charging locations is usually limited from the outset.

Vehicle and Infrastructure Demand (System Simulation)
The OC charging infrastructure demand determined in the simulation is comparatively high in relation to the fleet size: In both OC scenarios (4 and 5), it amounts to one charging slot for every two vehicles. This figure could be lowered significantly in two ways. Firstly, charging slots that are only seldom occupied could be dispensed of. Figure 13 provides an example: The peak demand of 8 slots only occurs three times a day for short intervals. Because vehicles generally have an ample SOC reserve in the simulation, eliminating the 8th charging slot should have no adverse effects (but this would have to be confirmed by a separate simulation). Secondly, changing the queuing strategy at charging stations could enable a major reduction in charging points: In an unpublished study we conducted for a bus operator, enabling vehicles to release charging points once fully charged reduced the number of required charging points by 17%. However, this may incur additional staff cost, depending on the labour regulations. Generally, the effect of reducing the number of charging slots on overall TCO is expected to be marginal as charging infrastructure contributes no more than 3.4% to the TCO.

TCO calculation
Our TCO results presented in Section 5.5 are not directly comparable to values from the literature because the majority of works does not consider staff cost (as outlined in Section 3.5). For better comparability, Figure 16 shows the results including only the additional staff cost incurred by electric bus operation compared to the diesel scenario (i. e., the staff cost in the diesel scenario is set to zero). Because of the infeasible scheduling results, the medium-range DC scenarios were omitted. Table 9 shows the relative TCO differences between individual technologies (diesel, OC, DC) determined from the literature as well as our results from Figure 16. There are considerable discrepancies between the values. Some studies claim a cost advantage of electric over diesel buses at recent prices 10 ; our findings disagree with this. Furthermore, some studies estimate a high cost difference between DC and OC of up to 55% which we also cannot confirm. This is due to the fact that none of the studies consider the additional staff cost incurred by OC and that some studies assume charging at intermediate stops (as outlined in Section 3.5), reducing the cost of the OC system. The results by Lajunen and Lipman [11] are closest to ours, but even here, considerable deviations remain due to methodological differences.
The cost for modifications to the bus depot was not considered in our study. It is expected to be higher for DC than for OC because of the larger fleet size and more powerful grid connection required. Thus, the cost gap between the two technologies could widen when considering depot construction. On the other hand, the planning and operation of OC charging infrastructure on public roads may also incur additional cost not considered in our model.
In light of the narrow cost difference observed between some scenarios, it must be noted that cost parameters may be subject to high uncertainties. In particular, the cost of vehicles and  [21] −6% n/a n/a No staff cost Ke et al. [16] n/a n/a   [52,62,66,67] charging infrastructure is difficult to determine due to the scarcity of public data and the highly individualised nature of bus procurements. Also, there seem to be large cost differences between various manufacturers as vehicle prices determined from the literature show ( Figure 17): Cost differences of up to one-third are observed despite similar battery capacity.

Conclusion and Outlook
We developed a planning and simulation methodology for electric bus networks comprising an object-oriented, discrete-event based simulation tool, a greedy bus scheduling algorithm, and a genetic algorithm for charging infrastructure positioning wrapped around the scheduling algorithm and simulation. The methodology was applied to assess the electrification of a real-world, metropolitan bus network with 39 bus lines using depot charging (DC) and opportunity charging at terminal stops (OC-T).
We first investigated the feasibility of operating existing diesel bus schedules with electric buses. Five electric bus scenarios were evaluated: 3 DC scenarios with varying range (120, 200 and 300 km) and 2 OC scenarios with varying charging power (300 and 450 kW). The analysis shows that none of the scenarios permit the operation of unchanged schedules, owing to the limited range of DC buses and the limited charging time available for OC. Delays exert a significant influence in the OC case and must therefore be taken into account to obtain valid results.
In the second stage, a TCO evaluation was carried out for fully electrified scenarios and a diesel reference scenario. New schedules were planned for each scenario using our scheduling algorithm. For OC, TCO-optimised charging locations were obtained using the genetic algorithm. We found that the smallest electric bus fleet size could be achieved by DC buses with a range of 300 km; otherwise, the OC scenarios yielded smaller fleet sizes than DC. The charging process at the depot was identified as a bottleneck for DC, but not for OC buses.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 The TCO calculation reveals that OC has a slight cost advantage over DC in all scenarios, the TCO of DC being 1-6% higher than OC. As depot construction cost was not considered, the cost gap between DC and OC may turn out higher in practice. Compared to diesel systems, the TCO of OC was at least 13% higher and the TCO of DC was at least 15% higher. Contrary to other studies, these figures include the full driver cost, allowing an assessment of the true additional cost of electric bus operation on a system level.
Our analysis of a complete bus network confirms our previous finding for a single bus line in [6]: On a system level, the cost difference between OC and DC can turn out very small. Given the uncertainties of the inputs, it can be argued that de facto cost parity exists between the two systems under some circumstances. Thus, no general recommendation for either of the technologies can be given solely on a cost basis. In cases where the results of the TCO analysis are inconclusive, other criteria must be defined to decide upon one of the two technologies.
Our methodology provides a framework for the planning and evaluation of electric bus systems with a higher level of detail and less reliance on simplifying assumptions than approaches found in the existing literature. Nonetheless, several aspects could be improved in further research: • The strict condition to fully charge at every charging station enforced by the scheduling algorithm reduces the efficiency of the OC schedules. • The objective of the scheduling algorithm -maximising the schedule length -does not concur with the objective of minimum fleet size or minimum cost, leading to partly unexpected results especially in the case of DC. • The scheduling algorithm currently does not support charging station capacity constraints. • In this study, we limited the duration of an operational day to 24 hours. However, with OC, vehicles could remain in service for several consecutive days without returning to the depot, reducing the number of depot trips and, therefore, the TCO. This should be examined in future works. • We did not evaluate a mixed scenario of OC and DC lines, even though it is a likely option for real-world application. Determining the best choice of technology on a per-line basis is, however, an optimisation problem in itself, requiring the development of additional methodology.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix C. Equations for Vehicle Model
In the following, the model equations related to energy flow and energy consumption of the vehicle are reproduced.

Appendix C.1. Energy Flow and Energy Storage Model
The total power of all loads is evaluated for each energy subsystem whenever a state change occurs: For the primary subsystem of an electric bus, this equation typically evaluates to P loads (t) = P traction (t) + P HVAC (t) + P aux,other (t).
If P loads > 0, energy is consumed by the loads; if P loads < 0, energy is recuperated. In the following, only the primary energy subsystem is considered, and the time argument f (t) is dropped for the sake of readability. Generally, all variables in the model are time-dependent except for static parameters.
The following equations describe the energy routing logic applied by the charge controller, using the terminology defined in Figure A3. Let P charge,max and P discharge,max be the current charge/discharge limits of the energy storage. Also, let P supply,max and P feed-in,max be the current limits for drawing power from and feeding power back to a charging interface 11 , respectively; if no interface is connected, both are zero.
If energy is consumed (P loads ≥ 0), Equations (A3) through (A8) apply. In this case, there is no flow from the loads: If power is available from the interface, it is preferentially routed to the loads: P interface,loads = P loads , P loads ≤ P supply,max P supply,max , P loads > P supply,max . (A5) 11 Feeding energy back to the grid can be of relevance in trolleybus and train operations for which our model was also designed.  If the interface cannot supply all the power required, the remaining power must come from the energy storage: P storage,loads = P loads − P interface,loads . (A6) If P storage,loads exceeds the discharge limit P discharge,max , a warning is issued but simulation continues. If the power available from the interface is greater than the load, the excess power can be used to charge the energy storage. The maximum power available from the interface for charging is P interface,storage,max = P supply,max − P interface,loads . (A7) To determine the actual flow from interface to storage, the charge limit must be observed (note that if the storage is fully charged, P charge,max = 0): P interface,storage = P interface,storage,max , P interface,storage,max ≤ P charge,max P charge,max , P interface,storage,max > P charge,max .
If energy is recuperated (P loads < 0), energy flow is governed by Equations (A9) through (A15). There is no flow to the loads: Recuperation power is first routed to the energy storage: If there is still excess recuperation power that cannot be fed into the storage, the charge controller attempts to route it to the interface. The maximum power available is: P loads,interface,max = |P loads | − P loads,storage .
The actual flow to the interface is then given by P loads,interface = P loads,interface,max , P loads,interface,max ≤ P feed-in,max P feed-in,max , P loads,interface,max > P feed-in,max .
Any power remaining in excess of P feed-in,max must be dissipated through a braking resistance which is not modelled. If the recuperation power does not exceed the charge limit of the energy storage and an interface is connected, there is power available to charge the storage from the interface. At most, P interface,storage,max = P charge,max − P loads,storage (A14) can be transferred to the storage. Observing the power limit of the interface, the actual power transfer is: P interface,storage = P interface,storage,max , P interface,storage,max ≤ P supply,max P supply,max , P interface,storage,max > P supply,max .
The net flows to the interface and storage are, respectively: P interface = P interface,loads + P interface,storage − P loads,interface , Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 where P interface > 0 indicates power flowing from and P interface < 0 indicates power flowing into the interface, and P storage = P storage,load − P load,storage − P interface,storage , with P storage > 0 indicating discharging and P storage < 0 indicating charging of the storage. The energy flow entering or leaving the storage is now known at every time t. Let t 0 be the last point in time at which the state was updated by the storage. The energy content of the storage at time t is then The energy storage has a nominal capacity E nom . In the case of a simple tank, the state of charge is determined relative to this nominal capacity: A battery has an additional attribute SOH defining its state of health, i. e. the fraction of the nominal capacity still usable. The state of charge of a battery is determined relative to the real, usable capacity which in turn is defined by Furthermore, the battery's operational SOC range is defined by the values SOC min and SOC max . Charge and discharge limits were already introduced above.

Appendix C.2. Traction Model
The constant consumption traction model determines the mean traction power for each interval based on a specific consumption e traction (in kWh/km, L/km etc.): where L is the distance of the arc, t 0 the departure time and ∆t the travel duration. The longitudinal dynamics model currently assumes a constant total drivetrain efficiency η total , however the model architecture also permits implementation of a motor efficiency map. Traction power is obtained from the mechanical power at the wheels, P wheels , , P wheels (t) ≥ 0 P wheels (t) η total P wheels (t) < 0, which itself is determined from the driving resistance consisting of rolling, climbing, air and acceleration resistances: Herein, F roll (t) = f r m total (t) g cos (α(t)) F climb (t) = m total (t) g sin (α(t)) (A25) F air (t) = ρ air 2 c w A front (v(t)) 2 F acc (t) = λ m kerb + m payload (t) a(t) with rolling resistance coefficient f r , total vehicle mass m total = m kerb + m payload , constant of gravitation g, vehicle slope α, density of air ρ air , drag coefficient c w , vehicle frontal projection area A front , vehicle velocity v, rotational mass factor λ, vehicle kerb weight m kerb , payload m payload and vehicle acceleration a.

Appendix C.3. HVAC Model
The steady state heating load -negative values indicating heat loss (heating case) and positive values indicating heat gain (cooling case) -is given bẏ Q HVAC (t) =Q conv (t) +Q sol (t) +Q passengers (t). (A27) Once again, we will henceforth drop the time argument f (t) for readability. The convective heat loss is determined from the heat transfer equation using the heat transmittance U A, the ambient temperature T ambient and the cabin temperature T cabin : The solar gainQ sol results from the insolationq sol and a surface area A sol : Heat release by passengers is determined using correlations from [68] (activity level II): (A33) The HVAC system consists of a cooling system with a maximum cooling capacityQ cooling,max , a heating system with a maximum heating capacityQ heating,max , and a backup heater with a maximum capacitẏ Q backup,max . In heating mode (Q HVAC ≤ 0), the thermal power supplied by the heating unit (usually, a heat pump) isQ heating = In the latter case, a warning is issued because the available heating capacity is not sufficient to keep the desired cabin temperature. Cooling power isQ cooling = 0 in heating mode.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 In cooling mode (Q HVAC > 0), Q cooling = Q HVAC ,Q HVAC ≤Q cooling,maẋ Q cooling,max ,Q HVAC >Q cooling,max , where, in the latter case, a warning is generated because cooling load exceeds cooling system capacity. Q heating = 0 andQ backup = 0 apply in cooling mode. The electric power of the HVAC system 12 is determined through the coefficient of performance (COP) of each component: The COPs of all components are currently assumed constant: COP heating = 2, COP cooling = 2, COP backup = 0.9. (A40)

Appendix D. Equations for TCO Model
From the simulation, the following quantities are determined: Number of vehicles of type v, N vehicles,v , number of charging facilities of type c, N stations,c , number of charging slots of type c, N slots,c , annual fleet mileage per vehicle type v, M fleet,v,a , annual fleet energy demand per medium m, E fleet,m,a (possible media being electricity, diesel etc.) and annual driver hours t driver,a .
Let t base be the base year for which all currency shall be adjusted, t start the start year of the project, ∆t project the project duration and t end = t start + ∆t project the end year of the project. In the following, all cost elements are assigned a category c, e. g., vehicle investment for each vehicle type, charging infrastructure investment for each charging station type, vehicle maintenance, charging station maintenance, energy for each medium, staff hours.
Each investment object of category c has a usage period ∆t dp,c after which a new procurement is due. The number of procurements for objects of category c is: N proc,c = ∆t project ∆t dp,c .
(A41) 12 Equations for a diesel heater are not reproduced here.
Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 29 July 2020 doi:10.20944/preprints202007.0691.v1 the end of the project, or scale down the sum of cash flows. We chose the latter, such that the TCO contribution of capital expenditures for component c is: C TCO,CAPEX,c = CF CAPEX,NPV,sum,c ∆t project ∆t dp,c . (A51) The TCO contribution of operational expenditures is: