1. Introduction
In the global effort to reduce greenhouse gas emissions, the transportation sector is undergoing a transformative shift towards cleaner and more sustainable technologies. Electric bus fleets have emerged as a key component of this shift and are widely recognised as a promising alternative to traditional diesel-powered public transport [
1,
2]. Electric buses are three to four times more energy efficient than their diesel counterparts and produce no tailpipe emissions, making them a lower-emission alternative for public transport systems [
1,
3].
Public transportation plays a pivotal role in reducing global emissions by offering high passenger capacity with low per-capita carbon output [
4]. Urban areas, which account for more than 60% of global energy use and 70% of carbon emissions, make the decarbonisation of urban regions critical [
5]. In South Africa, public transportation is essential, with around 35% of the working population relying on buses, minibus taxis, or trains for their daily commute [
6].
Air quality is an equally pressing concern alongside carbon reduction. This is particularly true in African cities, where a combination of rapid urbanisation, high reliance on diesel vehicles, and weak emissions regulation creates hazardous levels of pollution. According to the World Health Organization, ambient (outdoor) air pollution caused approximately 4.2 million premature deaths globally in 2019. When combined with indoor air pollution the total rises to about 6.7 million annually [
7]. In Africa specifically, the State of Global Air report estimates that around 1.1 million premature deaths in 2019 were attributable to air pollution-related diseases, with ambient PM
2.5 alone accounting for nearly 400,000 of these deaths [
8]. In cities such as Lagos, Nairobi, and Johannesburg, air pollution levels frequently exceed WHO guidelines by factors of two to five, exposing millions of residents to elevated risks of respiratory and cardiovascular disease. The electrification of public transport fleets, therefore, offers not only climate benefits but also the potential to deliver immediate public health gains by improving air quality and reducing the disease burden attributable to fossil fuel combustion.
From a sub-Saharan Africa perspective, the continent is particularly well positioned to benefit from the electric vehicle transition [
9]. The region’s abundant sunshine means that, despite an existing dependence on fossil fuels for electricity generation, electricity is expected to become cleaner over time. Moreover, Africa holds approximately 30% of the world’s key minerals used in battery manufacturing, including cobalt, lithium, and manganese, offering both an environmental and economic opportunity if harnessed effectively [
10,
11].
At the same time, integrating large fleets of electric buses into the existing power grid infrastructure presents substantial operational challenges, particularly in developing countries with constrained electricity networks. South Africa’s electricity grid is both capacity-constrained and structurally fragile, posing significant risks for large-scale electrification of bus fleets. The national utility Eskom’s nominal installed generation capacity of around 48 GW is frequently reduced to about 24 GW due to unplanned breakdowns and routine maintenance, which has entrenched load shedding as a daily reality. Beyond generation shortfalls, the distribution infrastructure is ageing and increasingly prone to faults, with many substations and feeder lines operating near or beyond their design life. This dual challenge of insufficient generation and deteriorating transmission and distribution assets undermines confidence in the grid’s ability to accommodate new, high-intensity loads such as electric bus charging depots. Without targeted reinforcement and modernisation of both supply capacity and local grid infrastructure, attempts to electrify public transport risk exacerbating existing instability and further entrenching supply insecurity [
12].
While the technical and infrastructural challenges outlined above are particularly acute in South Africa, they resonate with broader concerns faced by cities worldwide. Bus depots are increasingly recognised as critical nodes in the transition to electrified public transport: they represent both a logistical bottleneck and a concentrated electrical load that can rival medium-sized industrial facilities. Insights from the South African context are therefore globally significant for two reasons. First, they provide a stress test scenario: if electrification strategies can be shown to work within a fragile, capacity-constrained grid, they can inform solutions in other emerging economies with similar vulnerabilities. Second, they add empirical evidence from a region that is underrepresented in the global literature on electric bus deployment, thereby complementing the more extensively studied cases in Europe, China, and North America. By situating depot-level charging challenges within this dual local and global frame, the study makes two contributions. It aids South Africa’s decarbonisation goals and also expands to the international knowledge base on how to scale electric bus fleets in diverse and resource-constrained contexts.
The challenge of integrating electric bus fleets is a global one, prompting a significant body of research into optimal fleet scheduling and depot charging, particularly in North America, Europe, and Asia. In Europe, for instance, exact mathematical models have been developed to tackle the electric bus scheduling problem, incorporating real-world constraints such as limited driving range and the availability of both depot and opportunity charging stations [
13]. Research from advanced markets like South Korea has moved towards robust optimisation, using MILP to manage the uncertainties of energy consumption and grid-load requests, even incorporating Vehicle-to-Grid (V2G) capabilities to enhance depot profitability and grid stability [
14]. While much of the literature focuses on buses in developed economies, related challenges are being studied across different vehicle classes in emerging contexts. For example, the grid impact of electrifying motorcycle taxis in Kenya highlights the critical trade-offs between environmental benefits and infrastructure requirements, showing how charging strategies like battery swapping can mitigate peak demand [
15]. Despite this progress, most studies assume a relatively stable and reliable power supply. This leaves a critical gap in understanding depot optimisation within severely capacity-constrained and fragile grid environments, such as the one in South Africa, which this paper aims to address.
To ensure operational efficiency and sustainability, the development of effective charging strategies is not only beneficial but essential. This study focuses on the development of an optimised bus charging strategy in an electric energy-constrained and frugal environment. By leveraging off-peak grid electricity, the proposed approach aims to reduce peak demand and electricity cost while alleviating stress on the grid. A Mixed-Integer Linear Programming (MILP) model is developed to schedule the charging of buses to minimise demand charges while ensuring that all buses are fully charged and ready for deployment at the start of their daily operations.
Contribution
Amidst South Africa’s ongoing electricity crisis and the relatively slow uptake of electric vehicles, this study provides one of the first detailed assessments of the grid impact of an electric bus fleet in the country. Focusing on Cape Town’s pioneering deployment of electric buses and their associated charging infrastructure, the work develops and validates a dedicated simulator to capture the interaction between bus operations and the local power grid.
The simulation framework accounts for key determinants of charging demand, including the distributions of bus arrival times at depots and the states of charge of their batteries upon arrival. Using these inputs, the study evaluates the comparative impacts of unmanaged versus managed charging under different charging rates and within the constraints of a time-of-use tariff structure.
Finally, a Mixed-Integer Linear Programming (MILP) model is employed to determine the optimal charging schedules that flatten the load profile while ensuring that all buses are sufficiently charged for deployment. This integrated approach demonstrates how advanced optimisation can reduce grid stress, lower operational costs, and maintain reliable mobility. Beyond its immediate relevance to South Africa, the study offers a transferable framework for electric bus integration in other contexts. The framework applies both to resource-constrained grids in developing economies and to mature power systems that must manage new peak loads. In doing so, it expands the global evidence base on how depot-level charging strategies can be designed to support the dual objectives of operational efficiency and sustainable electrification of public transport.
Recent work on AI-based, grid-integrated PV operation shows that reinforcement learning and hybrid meta-heuristics can improve operational efficiency and sustainability by shaping plant output to grid conditions. These approaches mirror the depot problem: coordinating flexible electrical assets to reduce peak demands and align with ToU windows. Depot charging is therefore situated within a broader class of grid-aware optimisation problems, drawing on insights from AI-based PV scheduling to motivate the MILP control of depot demand [
16]. In parallel, recent studies on depot charging optimisation report peak mitigation and tariff-aligned charging using MILP and related methods.
The specific novelty of this work lies in its methodological focus, which diverges from standard time-of-use (ToU) energy optimisation ([
17,
18]). Our MILP formulation is explicitly designed to minimise the peak depot load (kW) [
19], a primary objective that directly addresses the severe financial and grid-stability penalties of a Notified Maximum Demand (NMD) tariff. This model is one of the first to be empirically calibrated with operational data from a large-scale bus deployment in sub-Saharan Africa, contrasting with many simulation-based approaches [
3]. Demonstrating a viable strategy within South Africa’s uniquely fragile power system provides a crucial “stress test” for electrification, offering a validated framework for other capacity-constrained regions.
2. Methodology
This section describes the methodology used to simulate, validate, and optimise electric bus charging at the Golden Arrow Bus Services (GABS) Arrow Gate depot in Cape Town. The approach integrates empirical operational data, statistical modelling, and a Mixed-Integer Linear Programming (MILP) optimisation framework.
Within the first eight months of 2025, GABS expanded its electric fleet from two to 60 buses, each a BYD B12 model fitted with a 230 kWh lithium iron phosphate (LFP) battery rated for up to 100 kW DC charging. At the depot, 30 chargers with two 60 kW dispensers each were installed. To mitigate the City of Cape Town’s high demand surcharges, an effective cap of 30 kW per bus was imposed once the fleet reached 30 buses. This constraint meant charging typically remained in the constant-current region, requiring just over six hours to reach full charge from 20% to 100% SOC, which aligns with the City of Cape Town’s off-peak tariff window (22:00–04:00) [
20].
Daily electricity usage at the depot increased sharply with the fleet’s growth, rising from 30 MWh per week with 20 buses to over 60 MWh per week with 50 buses, as shown in
Figure 1. Over the same period, the distance travelled with the electric fleet increased to 44,000 km per week. These operational realities highlight both the opportunities of time-of-use optimisation and the risks of unmanaged charging, which can drive excessive peak demand penalties and exacerbate stress on South Africa’s already fragile grid.
Fundamentally, the bus battery determines the grid load through three main factors: the timing of charging, the charging power (kW), and the energy required to recharge (SOC).
In this paper, the following charging scenarios are assessed:
Unmanaged charging at the nominal 60 kW and reduced 30 kW;
Managed charging at 30 kW, restricted to avoid peak tariff periods;
Optimised charging using MILP, incorporating the impact of SOC on the optimal charging rate.
For the first two scenarios, charging power is fixed, leaving timing and SOC as the main determinants. In the unmanaged cases, buses begin charging as soon as they arrive. In the managed scenario, charging is delayed to avoid high-tariff periods.
Arrival times and SOC on arrival were monitored at the depot, and the resulting statistical distributions were used to parameterise a probabilistic model. This model, simulated using validated battery and charger representations, provided estimates of depot load profiles under different scenarios.
The unmanaged 60 kW case is compared to a more conservative unmanaged 30 kW case. The managed 30 kW scenario is then evaluated and benchmarked against observed depot load data, which validates the simulation framework. Finally, the MILP optimisation model is introduced to capture charging under realistic operational constraints.
The overall methodology, therefore, consists of three main features:
An overview of the current charging strategy at the GABS depot;
Formulation of the MILP optimisation model;
A simulation framework to assess performance improvements.
2.1. Existing Charging Infrastructure and Operating Conditions
Each GABS electric bus is equipped with an onboard telematics unit that records real-time data on vehicle speed, braking, and driver behaviour. While primarily intended for fleet management, this system demonstrates the depot’s readiness for digital integration with advanced energy management in the future.
Operationally, buses typically return to the depot from 17:00 onwards and are connected to a charging dispenser upon arrival. Actual charging, however, is delayed until 22:00 to align with the City of Cape Town’s off-peak tariff window [
20]. This delay is enforced through the dispenser’s time-of-use (ToU) logic. Each dispenser applies a maximum charging rate that keeps the bus in the constant-current stage until the battery reaches the constant-voltage phase, when power draw naturally tapers. In handling the input/output voltage, each charger uses an active front-end (PFC) to regulate the DC-link and track a constant-power command via an inner current loop. For voltage sags/swells within tolerance, the input/output current is adjusted to hold the scheduled power; the DC/DC stage maintains the CC–CV profile. If the AC voltage exceeds tolerance, the dispenser derates to a lower power setpoint.
The existing charging strategy reduces some cost by aligning with ToU windows, but it does not fully minimise demand charges. This creates an opportunity to optimise both demand charges and use of the full off-peak window while still ensuring all buses are ready for deployment the next morning.
To evaluate this opportunity, a simulation framework was developed. The evaluation consisted of two phases: (i) analysis of the current charging strategy and (ii) implementation of an improved model that incorporates a two-stage battery charging profile and optimises demand charge within the available window.
2.2. Modelling Bus Charging: Arrival Times and Depths of Discharge
The grid impact of bus charging was simulated and validated using measured depot data. Charging dispenser records were analysed to establish arrival times and initial SOC distributions. The maximum simultaneous charging reached ≈65% of the fleet (median 15%, IQR 7–26%). The derivation of parameters was a deterministic process using the entire measured depot grid load dataset and charging dispenser records from 20 June to 18 September 2025, when charging was capped at 30 kW. The depot grid load dataset, therefore, includes 90 days, with 15 min updates equating to approximately 8640 observations. The charging dispenser records include 7621 charging events over the 90-day period (approximately 85 per day).
Using the derived inputs, the simulation reproduced charging demand as buses arrived with specific SOCs and were connected to chargers, whilst capping the maximum simultaneous charging events in the system. The resulting grid load was driven primarily by the distributions of arrival times and SOC, as well as the charger power profile. Arrival times were split into daytime (08:00–16:00) and evening (16:00–24:00) categories.
Figure 2 and
Table 1 present the fitted distributions that parametrised the simulation model. The source code can be found on GitHub and the results from this research were generated using v1. [
21].
2.3. MILP Model Formulation
To minimise depot costs while ensuring full fleet readiness, a MILP optimisation model was developed. The objective is to reduce the maximum total demand (kW) during the off-peak charging window (22:00–04:00), thereby lowering demand charges, while ensuring all buses are fully charged by dispatch.
The MILP model incorporates the following inputs and constraints:
Arrival State of Charge (SOC): Each bus arrives with SOC between 20% and 40%.
Energy requirement: Based on battery capacity and SOC, the required energy to reach full charge is calculated.
Charger assignment: Buses are assigned to charging dispensers to allow staggered load distribution.
Maximum charging rate: Each bus is limited to a fixed upper charging rate.
Time-of-use structure: Charging is restricted to the off-peak period under the City of Cape Town’s tariff framework.
The constraint set reflects both the City of Cape Town’s tariff structure and the physical limitations of the depot. In particular, the maximum rate corresponds to the 30 kW cap imposed at the depot to reduce demand charges while enabling overnight charging.
The optimisation problem is formulated as follows:
where (symbols and SI units):
Binary charging decision for bus i in slot t (1 if charging, else 0).
Charging rate assigned to the charger group of bus
i [kW].
Energy required for bus i to reach its target state of charge [kWh].
Duration of each time slot (e.g., ) [h].
Maximum allowable charging rate per bus [kW].
Earliest slot at which group g is permitted to start charging.
Bus index; B is the set of buses ().
Time-slot index; T is the set of discrete slots.
Charger-group index; G is the set of charger groups.
Input-voltage robustness: Within the charger’s allowable AC-voltage tolerance, the commanded charging rate is maintained by the AFE/PFC and DC/DC control. If the input voltage leaves this band, the dispenser derates; in the model, this is represented as a reduced available setpoint for the affected slots, which the MILP reallocates under the NMD constraint.
Standing/leakage losses: A small fixed overhead per active charger is included to capture auxiliary/idle and cable losses with a sensitivity of .
With kWh and arrival SOC , the required energy is kWh. With kW and h, the minimum slots to full charge is .
This MILP formulation (binary , fixed ) is a deliberate simplification. As described in the Methodology section, the depot’s 30 kW cap is chosen to keep buses in the Constant Current (CC) phase for the vast majority of the 6-h off-peak window. The Constant Voltage (CV) taper is therefore negligible, making a fixed-rate a high-fidelity approximation for this operational context. The “optimum per-bus demand” reported in the Results section is not a direct variable, but rather the minimum feasible fixed rate () found by the solver that satisfies all energy constraints under the NMD limit.
Simulation Constraints and Setup
The simulation framework integrates realistic operational parameters and depot-level constraints derived directly from GABS operational data. This ensures that modelled behaviour closely reflects real-world operations.
All buses are assumed to arrive at the depot with SOCs between 20% and 40%, based on telematics records. Each bus has a fixed battery capacity of 230 kWh, which determines the individual charging requirement. The available charging period is 22:00–04:00, divided into twelve 30 min slots, consistent with the City of Cape Town’s off-peak tariff period. While the arrival data shows a small portion of the fleet arriving after 22:00, the current optimisation assumes all buses are available at the start of the window. Modelling the impact of these stochastic late arrivals on feasibility is noted as an area for future work. Completion of charging by 04:00 ensures that all buses are fully prepared for morning dispatch.
The simulation enforces the depot’s Notified Maximum Demand (NMD) [
20], which places a cap on allowable peak demand and therefore on associated demand charges. This directly shapes the distribution of charging across the fleet. In the GABS case study, the depot’s Notified Maximum Demand (NMD) is set to 1000 kW in line with the applicable tariff. The schedule enforces a hard cap so that the total depot demand charge never exceeds this value in any time slot.
Charging behaviour follows a two-stage lithium-ion profile [
22]. Initially, charging is constant-current (CC) at the fixed limit, followed by a constant-voltage (CV) stage in which current tapers as the battery approaches full capacity. The simulation was implemented with both 30-min slot-based and 1-min resolution to capture detailed dynamics.
After each time slot, charging rates are recalculated based on updated SOC and remaining energy requirements, ensuring consistent compliance with demand limits while protecting battery health and readiness.
These assumptions are consistent with measured depot data, which showed daily electricity consumption rising from 2–3 MWh with two buses to more than 14 MWh with 60 buses, with weekly distances exceeding 40,000 km. Such proportionality between fleet size, kilometres driven, and depot energy demand confirms the need for an optimised charging strategy.
Although calibrated using South African depot data, the methodology is designed to be transferable. It can be adapted to different fleet sizes, battery chemistries, and tariff structures, making it relevant for both resource-constrained and advanced grid contexts.
4. Conclusions
This study applied a Mixed-Integer Linear Programming (MILP) model to optimise depot charging for an electric bus fleet. The baseline analysis showed that uncontrolled, simultaneous charging created excessive demand that risked exceeding the demand charge limit. In contrast, the optimised staged strategy distributed charging across the off-peak window, maintained demand charges within acceptable limits, and ensured full readiness before dispatch. The controlled strategy achieved a 17% reduction in demand charge relative to the unmanaged baseline.
The results highlight three key implications for operators and utilities. First, controlled charging reduces exposure to peak tariffs and aligns load with off-peak windows, thereby lowering operational costs. Second, arrival state-of-charge (SOC) policies strongly influence charging requirements. Avoiding very low arrival SOC and limiting SOC spread make capacity needs more predictable and reduce the optimum demand requirement. Third, depot planning must integrate charger sizing, assignment, and Notified Maximum Demand (NMD) constraints, since coordination at the depot level is essential for stable grid integration.
Although the analysis is calibrated to South African conditions, the lessons are globally relevant. Many regions face tariff-based demand charges, limited substation capacity, or rapid fleet growth. The proposed framework can be readily adapted to different battery chemistries, charger ratings, and tariff structures without loss of generality. The MILP framework is inherently scalable; for larger fleets, the model size increases linearly with the number of buses (B) and time slots (T), remaining computationally tractable for typical depot sizes. For multi-depot operations, the model can be extended to a coordinated system or applied independently at each site. It adapts to local grid constraints (e.g., different NMD limits) and regional ToU tariffs simply by updating the model’s constraint parameters.
Future work should extend the model in three directions: (i) integrating on-site solar photovoltaics and stationary battery storage to reduce grid imports during sensitive hours; (ii) incorporating uncertainty explicitly (e.g., stochastic arrivals and SOCs) to ensure schedules remain feasible under variability; (iii) including battery ageing modelling in the optimisation objective to balance short-term tariff savings with long-term asset health; (iv) performing a full out-of-sample predictive validation with additional error metrics (such as NMBE or MAPE) to assess its forecasting capabilities; and (v) Policy Implementation: these extensions would enhance operational resilience and provide scalable pathways for electrification of bus fleets in both constrained and mature power systems.
By showing feasibility under South Africa’s severe grid constraints, the study provides confidence that similar optimisation frameworks can be applied internationally.