*5.1. General Description*

A generic framework for virtual simulation of an e-bus fleet over the recorded driving cycles is represented by the flowchart shown in Figure 13. The model of city bus of any type (Section 4) is initialised based on the data stored in DMM and virtually run over the recorded driving cycles for the specified period of time, thus resulting in fuel and/or electricity consumption output data. In the case of a PHEV- or BEV-type bus the user needs to specify locations and types of charging stations, the nominal vehicle battery capacity and grid power constraints to execute the simulation. The simulation is repeatedly run for a peak day or peak week for different charging infrastructure and battery capacity specifications, in order to find a nearly-optimal configuration, which would be finally re-run for a given, longer period of time to calculate the fuel/electricity consumption and charging station utilisation statistics. In the case of BEV-type bus, the COM automatically adds reserve bus(es) if needed, and calculate their final number and related statistics. The bus intervening algorithm monitors each BEV's battery SoC, and when it drops below a predefined minimum value (0.3, herein), the immediate replacement with reserve e-bus is conducted. At the same time, it is taken into account that the depleted bus needs some constant time to reach the nearest charging station, where it is to be charged (as any other bus), and once it is fully charged, it will be waiting for the next replacement/intervention.

#### *5.2. Charging Management Algorithm*

Charging management is described by the flowchart shown in Figure 14. First, it is checked if a PHEV- or BEV-type bus has arrived to an end station/depot and if that station has a charger installed. If the charger is not occupied or if the bus has a lower battery SoC of any of the buses already being charged, the bus is put on charge; otherwise, it remains in the charging queue. Note that each station can be set to have an arbitrary number of chargers, as described with Figure 13.

**Figure 13.** Flowchart of Charging Optimisation Module (COM) with embedded EBSM functionality.

**Figure 14.** Flowchart of rule-based charging management algorithm (applied to PHEV- and BEV-type buses).

The charging process is managed by taking into account the requirements on satisfying the departure schedule, minimising battery power loss and respecting the grid power constraints. According to [26,27], the battery energy loss is minimised by demanding a linear change of SoC all over the remaining charging interval Δ*Tch* = *tf* − *tk*. Therefore, the SoC rate is updated in each sampling instant *k* according to:

$$\frac{d\text{SoC}}{dt} = \frac{\text{SoC}\_f - \text{SoC}\_k}{t\_f - t\_k} \,, \tag{12}$$

where *SoCk* is the current SoC and *SoCf* is the target SoC at departure. Inserting Equation (12) into the battery state Equation (1) yields the charging power *Pbatt* < *0* to be applied in the *k*th sampling instant:

$$P\_{hatt} = \frac{lI\_{\text{CC}}^2(\text{SoC}\_k) - \left[2Q\_{\text{max}}R\_{\text{int}}(\text{SoC}\_k)\frac{\text{SoC}\_f - \text{SoC}\_k}{t\_f - t\_k} + lI\_{\text{CC}}(\text{SoC}\_k)\right]^2}{4R\_{\text{int}}(\text{SoC}\_k)}\tag{13}$$

If the charging power −*Pbatt* calculated from Equation (13) is greater/less than the maximum/minimum allowable power (defined by the charger selected), the charging power is limited to themaximum/minimum power, respectively. Note that Δ*Tch* = *tf* − *tk* is saturated in Equation (13) to its lower limit of 30 s to avoid division by zero.

Once the charging power profile is obtained for each sampling step *k* and for *i* th vehicle from the total number of *Nv* vehicles connected to chargers at the same grid sections (e.g., depot), it is checked if the total charging power is greater than the maximum grid power *Pgrid*,*max*. If this applies, the charging power is scaled down to satisfy the grid power constraint:

$$P\_{\text{but},k,i,corr} = \frac{P\_{\text{grid, max}}}{\sum\_{i=1}^{N\_v} P\_{\text{but},k,i}} P\_{\text{but},k,i} \text{ if } \sum\_{i=1}^{N\_v} P\_{\text{but},k,i} > P\_{\text{grid, max}} \text{ }. \tag{14}$$

#### *5.3. Obtaining of Near-Optimal Charging System Configurations*

According to the city bus transport characterisation results from Figure 7, there is a number of end stations with relatively long bus resting durations and potentially high utilization of charger units. Additionally, the end station resting time share approaches that of depot (Figure 5), and there are no other emphasised stop locations. Therefore, fast charging stations and belonging transformer substations can be installed at end stations to provide bus recharging, while otherwise the available power can be utilised to supply city e-mobility hubs built around the end stations. High-power off-board chargers with built-in pantograph are considered (150 or 300 kW, see Table 2) [19]. In addition, the slow-to-modestly fast plug-in charging solutions can be considered for a depot, where the charging time can be long in night (Figure 6).

#### 5.3.1. PHEV Fleet Case

Figure 15 shows the PHEV fleet simulation results for different number of end stations equipped with a single fast charger per station (150 kW) and a five work day period. Charging in depot was not considered because the small-capacity PHEV battery (Table 2) can quickly be recharged at the end stations, where the buses rest for a relatively long time (Figures 6 and 7). The results shown in Figure 15 point out that the fuel consumption saving converges to −41% as the number of end station charging spots approaches six. Of course, as the fuel consumption reduces, the electricity consumption grows, but the overall energy cost is reduced by 17% due to cheaper electricity. By conducting PHEV fleet simulations over the five-month period, it has been found that the optimal number of charging stations should be incremented to seven.

**Figure 15.** Pareto frontier-like plot showing PHEV bus fleet electricity vs. fuel consumption costs for different number of end stations equipped with a fast charger per station.

#### 5.3.2. Case of BEV Fleet

The BEV fleet simulation results are shown in Table 4. The full five-month period is considered to cover a larger number of "critical" days when reserve buses may be needed. Only scenarios with the number of end-station charging spots being in the vicinity of the optimal one found for the PHEV fleet is examined (around six stations plus depot, each considering a single fast charger). The maximum charging power is set to the levels of 150 kW or 300 kW. Finally, various battery capacities are considered (76, 150 and 250 kWh, as the capacities available for the considered bus [19]).


**Table 4.** BEV fleet simulation results for different number of charging spots (located at end stations and depot) and reserve buses, and different battery capacities (full five-month period).

The results shown in Table 4 point out that by increasing the number of charging stations, the percentage of total electricity consumed by reserve buses drops from 9.2% (case BEV 1) to 1.8% (case BEV 2). Likewise, the number of bus swaps (concerning reserve bus) drops from 558 in 106 (out of 152) days (BEV 1) to 94 in 54 days (BEV 2). Figure 16 indicates that in the case BEV 2 notable bus swaps occurs only in several days, which are characterised by peak traffic load (typically due to specific needs such as moving tourists from cruising ships to the old city). Similar trends apply to the case of increasing the battery capacity from 76 kWh to 150 kWh and further to 250 kWh (cases BEV 4 and BEV 5, respectively), where the reserve buses are marginally needed in the former case, and not needed in the latter case.

**Figure 16.** Number of daily bus swaps with reserve buses for BEV 2 case.

Based on the above results, the case BEV 5 might be considered as optimal. However, since increasing of the battery capacity of each bus in a fleet is rather expensive and the need for reserve buses in case BEV 2 is minor (only 1.8%), the case BEV 2 has been adopted as an optimal for final simulations discussed in Section 5.4.
