**3. Mixed Fleet vehicle scheduling and charging optimization**

Vehicle scheduling problems in public transportation have been approached as part of the "full operational planning process" [29]. From a modeling perspective, these problems are usually formulated as Mixed-Integer Linear Programs (MILP), under the name of Single/Multi-Depot Vehicle Scheduling Problem (SDVSP/ MDVSP) [30]. The impact of electrification on bus scheduling problems has been recently taken into consideration by researchers, e.g. [31, 32], in preparation and support towards widespread Public Transport electrification. In this Section we

**Figure 2.**

*The eCoBus integrated management ecosystem.*

present results stemming from our own recent research efforts [33–35] concerning the development of mixed-fleet vehicle scheduling models and algorithms tailored to the ongoing electrification of the bus fleet in the City of Luxembourg.

Compared to combustion, a fleet of electric or partially electric busses brings novel challenges to transit planning. Within the four decisional stages as discussed in [29] (line planning, timetabling, vehicle scheduling and crew rostering), electrification especially influences scheduling. The problem faces an increase in complexity, as recharging operations must be included without introducing disturbances in the existing schedule, to both ensure that busses have sufficient charge to perform trips and to avoid conflicts at the charging infrastructure. When handling a mixed fleet, optimal scheduling policies should therefore seek to take as much advantage as possible from both coexisting technologies.

In this Section we introduce mathematical models and methodologies to address the problem of scheduling a mixed fleet of conventional and electric busses. We begin by introducing the offline, planning stage optimization problem related to both single and multi-terminal instances. Subsequently we discuss a potential extension towards online, reactive rescheduling in the presence of disturbances, such as delays. Finally, we present a multi-terminal case study based on the city of Luxembourg, in the eponymous country.

#### **3.1 Offline optimization: The SDEVSP and MDEVSP optimization problems**

We formulate the problem of assigning a mixed fleet of *I* ¼ f g 1, … , *i* electric busses and *H* ¼ f g 1, … , *h* hybrid busses to a set of scheduled trips *J* ¼ f g 1, … , *j* , each characterized by desired departure time *D <sup>j</sup>* ¼ 1, … , *d <sup>j</sup>* � � [time steps], duration *T <sup>j</sup>* ¼ 1, … , *tj* � � [time steps] and total energy required *<sup>U</sup> <sup>j</sup>* <sup>¼</sup> f g 1, … , *<sup>u</sup>* [kWh]. Time is subdivided in consecutive steps *τ* ¼ f g 0, 1, … , *N* , with a discretization step *Ts*. For each trip, decision variables *y<sup>t</sup> <sup>i</sup>*,*<sup>j</sup>* and *zt h*,*j* describe respectively whether trip *j* is initiated at time step *t* by electric bus *i* or hybrid bus *h*, while variable *x<sup>t</sup> <sup>i</sup>*,*<sup>m</sup>* represents whether e-bus *i* is recharging at charging station *m* at time step *t*.

Throughout this Section we adopt the assumption that full charging of e-busses happens within a single time step, as will be detailed later. **Table 1** introduces the meaning of each variable and parameter, as well as their domain.

The formulation's objective function, in Eq. (1), is that of minimizing the total operational cost:

$$\begin{split} \min & \sum\_{t} \sum\_{i} \sum\_{j} \left( p\_{ij}^{t} \cdot \left( c + r \cdot \left( t - d\_{j} \right) \right) \right) + \sum\_{t} \sum\_{h} \sum\_{j} \left( \mathbf{z}\_{hj}^{t} \cdot \left( \hat{c} + r \cdot \left( t - d\_{j} \right) \right) \right) \\ & + \sum\_{m} \sum\_{i} \sum\_{t} q\_{i}^{t} \cdot \mathbf{x}\_{i,m}^{t} \end{split} \tag{1}$$

Trip costs *c* and ^*c* are determined following Eq. (2), adopting average cost rates per kWh of energy components *η*<sup>1</sup> and *η*<sup>2</sup> for e-busses and h-busses respectively:

$$\begin{aligned} \mathcal{c} &= \eta\_1 \cdot u\_j \\ \hat{\mathcal{c}} &= \eta\_2 \cdot u\_j \end{aligned} \tag{2}$$

selected terminals, and take into account the time dependent cost *qt*

X *j zt*

> X *j zt h*,*j*

X *i yt <sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup><sup>X</sup> *h zt h*,*j*

X *i yt <sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup><sup>X</sup> *h zt h*,*j*

*t*

X *i xt*

*ε*0

*<sup>i</sup>*,*<sup>j</sup>* � *<sup>u</sup> <sup>j</sup>* <sup>þ</sup> *<sup>ε</sup><sup>t</sup>*

*<sup>i</sup>* � *s t <sup>i</sup>* <sup>¼</sup> *<sup>ε</sup><sup>t</sup>*þ<sup>1</sup>

X *j yt <sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup><sup>X</sup> *m xt*

*<sup>i</sup>*,*<sup>j</sup>* f g 0, 1 1 if trip *j* is initiated by e-bus *i* at time *t*, 0 otherwise

*<sup>h</sup>*,*<sup>j</sup>* f g 0, 1 1 if trip *j* is initiated by h-bus *h* at time *t*, 0 otherwise

*<sup>i</sup>* ≤*E*, ∈ ℜ<sup>þ</sup> Total energy in kWh that e-bus *i* has at time *t*

*Optimal Management of Electrified and Cooperative Bus Systems*

*E* ℜ<sup>þ</sup> Total battery capacity in kWh for all electric busses

*μ* ≤1, ∈ ℜ<sup>þ</sup> Minimum battery charge in percentage for each electric bus

transport

*t <sup>j</sup>* **ℤ**<sup>þ</sup> Duration of trip *j* in time steps

of *ε<sup>t</sup> i*

*d <sup>j</sup>* **ℤ**<sup>þ</sup> Preferred departure time step for trip *j*

*<sup>i</sup>*,*<sup>m</sup>* f g 0, 1 1 if e-bus *i* is being recharged at charging station *m* at time t, 0 otherwise

*u <sup>j</sup>* ℜ<sup>þ</sup> Total energy in kWh required to perform trip *j*, considering e-bus as a means of

*<sup>i</sup>* ≤*E*, ∈ ℜ<sup>þ</sup> Slack variable, necessary to ensure that constraint (12) does not violate the domain

*<sup>i</sup>* f g 0, 1 1 if e-bus *i* is not available to perform any trip nor recharge at time *t*, 0 otherwise

X *j yt <sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup><sup>X</sup> *m xt i*,*m*

0 @

1 *tj* � 1 *t*þ X*<sup>t</sup> <sup>j</sup>*�<sup>1</sup>

X *t*

X *t*<*d <sup>j</sup>*

*yt <sup>i</sup>*,*<sup>j</sup>* � *<sup>ε</sup><sup>i</sup>*

*E* � X *m xt <sup>i</sup>*,*<sup>m</sup>* �<sup>X</sup> *j yt*

*t*¼*t*þ1

*yt <sup>i</sup>*,*<sup>j</sup>* þ

1 *tj* � 1

*Problem variables and parameters.*

**Var. Domain Explanation**

*DOI: http://dx.doi.org/10.5772/intechopen.93892*

*yt*

*zt*

*xt*

*εt*

*s t*

*At*

*Ht*

**Table 1.**

**101**

*zt <sup>h</sup>*,*<sup>j</sup>* þ

*t*þ X*<sup>t</sup> <sup>j</sup>*�<sup>1</sup>

*t*¼*t*þ1

bus *i* at time *t*. System dynamics are captured by constraints (3)–(14):

*<sup>h</sup>* f g 0, 1 1 if h-bus *h* is not available to perform any trip at time, 0 otherwise

*<sup>i</sup>*,*<sup>m</sup>* <sup>≤</sup> <sup>1</sup> � *At*

1

*<sup>h</sup>*,*<sup>j</sup>* <sup>≤</sup><sup>1</sup> � *<sup>H</sup><sup>t</sup>*

!

!

*i*

*<sup>i</sup>* of recharging

∀*i*, *t* (3)

A ≤1∀*i*, ∀*j* : *tj* > 1, ∀*t* : *t*≥*d <sup>j</sup>* (4)

≤1∀*h*, ∀*j* : *tj* >1, ∀*t* : *t*≥*d <sup>j</sup>* (6)

*<sup>u</sup> <sup>j</sup>* <sup>þ</sup> *<sup>μ</sup><sup>E</sup>* <sup>≤</sup>0∀*i*, *<sup>j</sup>*, <sup>∀</sup>*<sup>t</sup>* : *<sup>t</sup>*≥*<sup>d</sup> <sup>j</sup>* (9)

*<sup>i</sup>*,*<sup>m</sup>* ≤ 1∀*m*, *t* (10)

*<sup>i</sup>* ¼ *εi*∀*i* (11)

*<sup>h</sup>*∀*h*, *t* (5)

¼ 1∀*j* (7)

¼ 0 ∀*j* (8)

*<sup>i</sup>* ∀*i*, *t* (12)

Energy component *η*<sup>2</sup> includes a coefficient to represent the difference in consumption rates between electric and conventional combustion (hybrid) busses. The penalty term *r* [EUR] is applied to trips being performed later than their preferred departure time, to allow, at a cost, trade-offs between schedule adherence and operational performance. We consider *M* ¼ f g 1, … , *m* charging stations available at *Optimal Management of Electrified and Cooperative Bus Systems DOI: http://dx.doi.org/10.5772/intechopen.93892*


#### **Table 1.** *Problem variables and parameters.*

selected terminals, and take into account the time dependent cost *qt <sup>i</sup>* of recharging bus *i* at time *t*. System dynamics are captured by constraints (3)–(14):

$$\sum\_{j} y\_{i,j}^{t} + \sum\_{m} \mathbf{x}\_{i,m}^{t} \le \mathbf{1} - A\_i^t \forall i, t \tag{3}$$

$$\left(\mathbf{y}\_{ij}^{\mathbf{f}} + \frac{\mathbf{1}}{t\_j - \mathbf{1}} \sum\_{\tilde{t} = t+1}^{t+t\_j - 1} \left(\sum\_{\tilde{j}} \mathbf{y}\_{i\tilde{j}}^{\tilde{t}} + \sum\_m \mathbf{x}\_{i,m}^{\tilde{t}}\right) \le \mathbf{1} \forall i, \forall j: t\_j > \mathbf{1}, \forall t: t \ge d\_j \tag{4}$$

$$\sum\_{j} z\_{h,j}^{t} \le 1 - H\_h^t \forall h, t \tag{5}$$

$$z\_{hj}^{t} + \frac{1}{t\_j - 1} \sum\_{\tilde{t} = t+1}^{t+t\_j - 1} \sum\_{\tilde{j}} z\_{h\tilde{j}}^{\tilde{t}} \le 1 \forall h, \forall j: t\_j > 1, \forall t: t \ge d\_j \tag{6}$$

$$\sum\_{t} \left( \sum\_{i} \mathbf{y}\_{i,j}^{t} + \sum\_{h} \mathbf{z}\_{h,j}^{t} \right) = \mathbf{1} \forall j \tag{7}$$

$$\sum\_{t$$

$$
\lambda y\_{i,j}^t - \frac{e\_i^t}{u\_j + \mu E} \le 0 \forall i, j, \forall t: t \ge d\_j \tag{9}
$$

$$\sum\_{i} \boldsymbol{\pi}\_{i,m}^{t} \le \mathbf{1} \forall m, t \tag{10}$$

$$
\varepsilon\_i^0 = \overline{\varepsilon}\_i \forall i \tag{11}
$$

$$E \cdot \sum\_{m} \mathbf{x}\_{i,m}^t - \sum\_{j} \mathbf{y}\_{i,j}^t \cdot \mathbf{u}\_j + \mathbf{e}\_i^t - \mathbf{s}\_i^t = \mathbf{e}\_i^{t+1} \forall i, t \tag{12}$$

$$\sum\_{m} \mathbf{x}\_{im}^{t} - \frac{s\_i^t}{E} \ge \mathbf{0} \forall i, t \tag{13}$$

amount of *m* chargers. Deadheading trips are possible between any combination of

*<sup>i</sup>*,*<sup>j</sup>* and *z<sup>t</sup>*

^*c* � 1 þ *r* � *t* � *d <sup>j</sup>* � � � � � *<sup>z</sup><sup>t</sup>*

*<sup>i</sup>*,*b*,*<sup>m</sup>* (15)

*<sup>h</sup>*,*<sup>j</sup>* describe respec-

*<sup>i</sup>*,*b*,*<sup>m</sup>* captures

*h*,*j*

(16)

*<sup>i</sup>* of

(18)

(19)

*<sup>i</sup>* <sup>∀</sup>*i*, *<sup>t</sup>* (17)

1 A

> 1 A

We discretize time in consecutive time steps *τ* ¼ f g 0, 1, … , *N* , with a

tively whether trip *j* is initiated at time step *t* by electric bus *i* or hybrid bus *h*,

*<sup>i</sup>*,*<sup>b</sup>* controls execution of deadheading trips, and variable *xt*

recharging decisions. We adopt the assumption that full charging of e-busses happens within a single time step. Locations of the electric and hybrid busses are

*<sup>h</sup>*,*<sup>b</sup>* respectively. In this work, we allow deadheading trips for electric busses only. Deadheading is, in fact, critical to optimize usage of electric busses, which have cheaper operational costs, and to optimize their charging dynamics, allowing them to move to terminals equipped with charging stations when needed, while it is not strictly necessary for optimal dispatching of hybrid/conventional combustion busses. The model could anyway be easily extended to consider deadheading for hybrid busses.

> *<sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup><sup>X</sup> *t*

> > X *m qt <sup>i</sup>* � *<sup>x</sup><sup>t</sup>*

Cost vectors *c*, ^*c* and *c* are computed as shown in Eq. (16), considering average cost rates per kWh of energy components *η*1, *η*<sup>2</sup> and *η*<sup>3</sup> for e-busses, h-busses and

Energy component *η*<sup>2</sup> includes an adaptation coefficient to consider the difference in consumption rates between e-busses and h-busses. A penalty term *r* [EUR] is applied to trips being performed later than their preferred departure time, to evaluate trade-offs between schedule adherence and operational performance. Regarding the cost of recharging, we take into account the time dependent cost *q<sup>t</sup>*

recharging bus *i* at time *t* as part of the operational cost needing minimization. Updated system dynamics are captured by constraints (17)–(41) as follows:

*<sup>i</sup>*,*b*1,*b*<sup>2</sup> <sup>þ</sup><sup>X</sup>

*<sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup>XX *b*1, *b*<sup>2</sup> ∈*B*

≤1∀*i*, ∀*j* : *tj* >1, ∀*t* : *d <sup>j</sup>* ≤ *t*≤*d <sup>j</sup>* þ *θ*

*<sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup>XX *b*1, *b*<sup>2</sup>

≤ 1∀*i*, ∀*b*<sup>1</sup> ∈*B*, ∀*b*<sup>2</sup> ∈*B*, ∀*t* : ^*tb* >1

*b*

X *m xt*

*ωt*

*ωt i*,*b*1,*b*<sup>2</sup>

*<sup>i</sup>*,*b*1,*b*<sup>2</sup> <sup>þ</sup> <sup>X</sup>

*<sup>i</sup>*,*b*,*<sup>m</sup>* <sup>≤</sup><sup>1</sup> � *At*

*b*∈*B*

<sup>þ</sup> <sup>X</sup> *b*∈*B*

X *m xt i*,*b*,*m*

X *m xt i*,*b*,*m*

*c* ¼ *η*<sup>1</sup> � *u <sup>j</sup>* ^*c* ¼ *η*<sup>2</sup> � *u <sup>j</sup> c* ¼ *η*<sup>3</sup> � *u*^*<sup>b</sup>*1,*b*<sup>2</sup>

X *b*

X *h*

X *j*

terminals, with required total energy *u*^*<sup>b</sup>*1,*b*<sup>2</sup> and duration ^*tb*1,*<sup>b</sup>*2.

discretization step *Ts*. For each trip, decision variables *y<sup>t</sup>*

*Optimal Management of Electrified and Cooperative Bus Systems*

*DOI: http://dx.doi.org/10.5772/intechopen.93892*

*<sup>i</sup>*,*b*1,*b*<sup>2</sup> and *p<sup>t</sup>*

The updated formulation's objective function is as follows:

X *i*

*c* � 1 þ *r* � *t* � *d <sup>j</sup>* � � � � � *<sup>y</sup><sup>t</sup>*

> *<sup>i</sup>*,*b*1,*b*<sup>2</sup> <sup>þ</sup><sup>X</sup> *t*

*<sup>c</sup>* � *<sup>ω</sup><sup>t</sup>*

variable *g<sup>t</sup>*

minX *t*

> þ<sup>X</sup> *t*

X *i*

X *i*

X *j*

X *b*1

deadheading trips respectively:

X *j yt*

1 *tj* � 1

> 1 ^*tb* � <sup>1</sup>

*t*þ X*<sup>t</sup> <sup>j</sup>*�<sup>1</sup>

*t*¼*t*þ1

*t*þ X^*tb*�<sup>1</sup>

*t*¼*t*þ1

*yt <sup>i</sup>*,*<sup>j</sup>* þ

*ωt <sup>i</sup>*,*b*1,*b*<sup>2</sup> þ

**103**

*<sup>i</sup>*,*<sup>j</sup>* <sup>þ</sup>XX *b*1, *b*<sup>2</sup> ∈*B*

> 0 @

*ωt*

X *j yt*

> X *j yt*

0 @

X *b*2

captured by variables *ω<sup>t</sup>*

$$\frac{1}{E} \cdot s\_i^t - \frac{1}{E} e\_i^t \le 0 \forall i, t \tag{14}$$

Constraint (3) ensures that an e-bus can be assigned to at most one trip at a time, or recharge in at most one charger at a time, only in those time steps in which the bus is available. Constraint (4) implies that an e-bus which initiates a trip *j* whose duration in time steps is greater than one cannot be used to perform any other trip nor recharged throughout the entire duration of trip *j*. Constraints (5) and (6) enforce similar dynamics for trips being performed by hybrid busses. Note that matrices *Ai <sup>t</sup>* and *H<sup>t</sup> <sup>i</sup>* represent exogenous sources of unavailability (e.g., during a scheduled maintenance). Constraint (7) guarantees that each trip be performed exactly once, by either kind of bus, and constraint (8) implies that no trip *j* can be initiated before its preferred departure time. Constraint (9) guarantees that an e-bus will not perform a trip unless it has enough energy to do so. Constraint (10) implies that a charger can charge at most one e-bus at any given time. Constraint (11) controls the initial state of battery charge of each electric bus, which is set to the exogenously given input value *ε<sup>i</sup>* for all e-busses. Constraint (12) represents recharging and discharging dynamics of electric bus *i* at time *t*: if it is assigned to a trip *j* at time *t*, its available charge at time *t+1* will be reduced by the trip's required energy *u <sup>j</sup>*. Conversely, if the electric bus *i* is being recharged at time *t*, total battery capacity *E* is assumed to be restored at time *t+1*. We operate under the assumption that a single time step is sufficient to fully recharge an electric bus, although this condition can rather trivially be relaxed by altering this constraint, or by assuming a large enough time step. We consider the availability of charging stations at selected terminals, powerful enough to meet the required electricity demand. To ensure that the total battery capacity is not exceeded during charging, when the residual charge level *ε<sup>t</sup> <sup>i</sup>* is greater than zero, a "slack" variable *si* is introduced, with consideration of the domain feasibility for variables *ε<sup>t</sup> <sup>i</sup>* and *ε<sup>t</sup>*þ<sup>1</sup> *<sup>i</sup>* . When a bus is being recharged, the slack variable *si* must assume a value at least equal to *ε<sup>t</sup> i* , enforcing that *ε<sup>t</sup>*þ<sup>1</sup> *<sup>i</sup>* ≤ *E*. Constraint (13) implies that the slack variable *Si* can be non-zero only during recharging operations, and constraint (14) ensures that its maximum value can be *ε<sup>t</sup> i* . Therefore, the combination of constraints (12)–(14) governs the behavior of the slack variable *Si* such that the latter variable is either 0, if bus *i* is not recharging at time *t*, or exactly *ε<sup>t</sup> <sup>i</sup>* if the bus is recharging.

By supplying a set of lines with accompanying timetables, the model can be employed to determine the optimal scheduling for a mixed-fleet of e-busses and h-busses. Parameters such as fleet size, fleet composition (% of electrics, % of hybrids), charging stations' availability and capacity are supplied exogenously.

#### *3.1.1 MDEVSP: Multi-depot electric vehicle scheduling problem*

In order to correctly represent realistic Public Transport services, we improve and extend the model showcased in the previous section to appropriately represent multi-terminal schedules featuring deadheading trips.

For each trip *j* we therefore introduce a departure terminal *α <sup>j</sup>* and arrival terminal *β* both within a given set of bus terminals *B* ¼ f g 1, … , *b* . The set of bus terminals can also include any number of bus depot(s), where busses are stored when not in service. The subset *B* ⊆*B* of bus terminals is equipped with charging stations. We assume that each terminal of the *B* subset is equipped with the same

## *Optimal Management of Electrified and Cooperative Bus Systems DOI: http://dx.doi.org/10.5772/intechopen.93892*

amount of *m* chargers. Deadheading trips are possible between any combination of terminals, with required total energy *u*^*<sup>b</sup>*1,*b*<sup>2</sup> and duration ^*tb*1,*<sup>b</sup>*2.

We discretize time in consecutive time steps *τ* ¼ f g 0, 1, … , *N* , with a discretization step *Ts*. For each trip, decision variables *y<sup>t</sup> <sup>i</sup>*,*<sup>j</sup>* and *z<sup>t</sup> <sup>h</sup>*,*<sup>j</sup>* describe respectively whether trip *j* is initiated at time step *t* by electric bus *i* or hybrid bus *h*, variable *g<sup>t</sup> <sup>i</sup>*,*<sup>b</sup>* controls execution of deadheading trips, and variable *xt <sup>i</sup>*,*b*,*<sup>m</sup>* captures recharging decisions. We adopt the assumption that full charging of e-busses happens within a single time step. Locations of the electric and hybrid busses are captured by variables *ω<sup>t</sup> <sup>i</sup>*,*b*1,*b*<sup>2</sup> and *p<sup>t</sup> <sup>h</sup>*,*<sup>b</sup>* respectively.

In this work, we allow deadheading trips for electric busses only. Deadheading is, in fact, critical to optimize usage of electric busses, which have cheaper operational costs, and to optimize their charging dynamics, allowing them to move to terminals equipped with charging stations when needed, while it is not strictly necessary for optimal dispatching of hybrid/conventional combustion busses. The model could anyway be easily extended to consider deadheading for hybrid busses.

The updated formulation's objective function is as follows:

$$\begin{split} \min & \sum\_{t} \sum\_{i} \sum\_{j} \boldsymbol{\varepsilon} \cdot \left( \mathbf{1} + \boldsymbol{r} \cdot \left( \mathbf{t} - d\_{j} \right) \right) \cdot \boldsymbol{\chi}\_{ij}^{t} + \sum\_{t} \sum\_{h} \sum\_{j} \hat{\boldsymbol{\varepsilon}} \cdot \left( \mathbf{1} + \boldsymbol{r} \cdot \left( \mathbf{t} - d\_{j} \right) \right) \cdot \boldsymbol{\omega}\_{hj}^{t} \\ & + \sum\_{t} \sum\_{i} \sum\_{h\_{1}} \sum\_{b\_{2}} \overline{\boldsymbol{\varepsilon}} \cdot \boldsymbol{\alpha}\_{i,b\_{1},b\_{2}}^{t} + \sum\_{t} \sum\_{i} \sum\_{b} \sum\_{m} \mathbf{d}\_{i}^{t} \cdot \boldsymbol{\omega}\_{i,b,m}^{t} \end{split} \tag{15}$$

Cost vectors *c*, ^*c* and *c* are computed as shown in Eq. (16), considering average cost rates per kWh of energy components *η*1, *η*<sup>2</sup> and *η*<sup>3</sup> for e-busses, h-busses and deadheading trips respectively:

$$\begin{aligned} \mathcal{L} &= \eta\_1 \cdot \boldsymbol{u}\_j \\ \hat{\boldsymbol{c}} &= \eta\_2 \cdot \boldsymbol{u}\_j \\ \overline{\boldsymbol{c}} &= \eta\_3 \cdot \hat{\boldsymbol{u}}\_{b\_1, b\_2} \end{aligned} \tag{16}$$

Energy component *η*<sup>2</sup> includes an adaptation coefficient to consider the difference in consumption rates between e-busses and h-busses. A penalty term *r* [EUR] is applied to trips being performed later than their preferred departure time, to evaluate trade-offs between schedule adherence and operational performance. Regarding the cost of recharging, we take into account the time dependent cost *q<sup>t</sup> <sup>i</sup>* of recharging bus *i* at time *t* as part of the operational cost needing minimization. Updated system dynamics are captured by constraints (17)–(41) as follows:

$$\sum\_{j} \mathbf{y}\_{i,j}^{t} + \sum\_{b\_1, b\_2} \sum\_{i \in B} \alpha\_{i, b\_1, b\_2}^{t} + \sum\_{b} \sum\_{m} \mathbf{x}\_{i, b, m}^{t} \le \mathbf{1} - A\_i^t \quad \forall i, t \tag{17}$$

$$\begin{split} \mathbf{y}\_{i,j}^{t} + \frac{\mathbf{1}}{t\_{j} - \mathbf{1}} \sum\_{\tilde{t} = t+1}^{t+t\_{j}-1} \left( \sum\_{\tilde{j}} \mathbf{y}\_{i,\tilde{j}}^{\tilde{t}} + \sum\_{b\_{1}, b\_{2}} \sum\_{\mathbf{c} \in \mathcal{B}} a\_{i,b\_{1},b\_{1}}^{t} + \sum\_{b \in \overline{\mathcal{B}}} \sum\_{m}^{\tilde{t}} x\_{i,b,m}^{\tilde{t}} \right) \\ \leq \mathbf{1} \forall i, \forall j: t\_{j} > \mathbf{1}, \forall t: d\_{j} \leq t \leq d\_{j} + \theta \end{split} \tag{18}$$

$$\begin{split} \boldsymbol{\alpha}^{t}\_{i,b\_{1},b\_{1}} + \frac{\mathbf{1}}{\tilde{t}\_{b} - \mathbf{1}} \sum\_{t=t+1}^{t+\tilde{t}\_{b}-1} \left( \sum\_{j} \mathbf{y}^{\mathsf{f}}\_{i,j} + \sum\_{\overline{b}\_{1}, \overline{b}\_{2}} \sum\_{i,\overline{b}\_{1}} \boldsymbol{\alpha}^{\mathsf{f}}\_{i,\overline{b}\_{1},\overline{b}\_{2}} + \sum\_{\overline{b}\_{\overline{b}} \in \overline{B}} \sum\_{m}^{\mathsf{f}} \boldsymbol{\alpha}^{\mathsf{f}}\_{i,\overline{b},m} \right) \\ \leq \mathsf{M}\boldsymbol{\forall}, \forall b\_{1} \in B, \forall b\_{2} \in B, \forall t: \boldsymbol{\hat{t}}\_{b} > \mathbf{1} \end{split} \tag{19}$$

$$\sum\_{j} z\_{h,j}^{t} \le 1 - H\_h^t \forall h, t \tag{20}$$

X *j*:*β <sup>j</sup>*¼*b zt*

*Optimal Management of Electrified and Cooperative Bus Systems*

*DOI: http://dx.doi.org/10.5772/intechopen.93892*

*p*0

location dynamics of each bus.

congestion, … ).

*<sup>h</sup>*,*<sup>j</sup>* � *pt*þ<sup>1</sup>

X *b pt*

*<sup>h</sup>*,*<sup>b</sup>* � *pt h*,*b*

*<sup>h</sup>*,*<sup>b</sup>* <sup>¼</sup> <sup>1</sup> *if <sup>b</sup>* <sup>¼</sup> *Ph* <sup>0</sup> *otherwise* �

Constraints (17)–(21) avoid conflicts in the usage of resources. Constraints (22)–(23) model when the scheduled trips should be executed. Constraints (24)–(30) control the charging and discharging dynamics and ensure that the trip execution is consistent with battery status. Constraints (31)–(41) control the

**3.2 Online optimization: Decomposition scheme and model predictive control**

*3.2.1 Time-wise decomposition scheme for the SDEVSP/MDEVSP models*

in time where decomposition should happen. In order to ensure that the

*<sup>f</sup>* <sup>¼</sup> *At*þ*l*ð Þ *<sup>f</sup>*�<sup>1</sup> *i*

*<sup>f</sup>* <sup>¼</sup> *<sup>H</sup><sup>t</sup>*þ*l*ð Þ *<sup>f</sup>*�<sup>1</sup> *i*

*<sup>f</sup>* <sup>¼</sup> <sup>1</sup> <sup>∀</sup>*i*, *<sup>t</sup>* : <sup>∃</sup>*j*, *<sup>t</sup>* : *<sup>y</sup><sup>t</sup>*

0 *otherwise*

*<sup>f</sup>* <sup>¼</sup> <sup>1</sup> <sup>∀</sup>*i*, *<sup>t</sup>* : <sup>∃</sup>*j*, *<sup>t</sup>* : *zt*

0 *otherwise*

*εi*j

*εi*j *<sup>f</sup>* ¼ *ε<sup>i</sup>*

<sup>0</sup> ¼ *E*∀*i*

straints must be added to the formulation, as follows:

*At i* � �

> *Ht i* � �

8 < :

> 8 < :

*λt i* � �

> *ζt i* � �

**105**

The optimization model described in the previous section is aimed at determining full day bus schedules in the Public Transport planning stage, i.e. assuming a specific trip timetable and considering no deviations arising from operations. However, the model has been designed with the explicit objective of enabling the application of time-based decomposition schemes, for the sake of scalability in seeking solutions at the planning stage. In this Section we showcase how this decomposable nature can be further exploited, in combination with a Model Predictive Control scheme, to compute real-time rescheduling in case of major disruptions arising from operations (e.g. delays due to overcrowding, bunching,

The two models described earlier can be rather straightforwardly decomposed along the time variable *τ* ¼ f g 0, 1, … , *N* , arbitrarily choosing both the frequency of sub-problem (defined henceforth as time-lapse) definition and the effective points

decomposed time-lapses effectively capture the original formulation, coupling con-

� � � *f*�1 <sup>þ</sup> *<sup>λ</sup><sup>t</sup> i* � � *f*�1

> � � � *f*�1 <sup>þ</sup> *<sup>ζ</sup><sup>t</sup> i* � � *f*

*i*,*j* � � � *f*

*i*,*j* � � � *f*

*l <sup>f</sup>*�<sup>1</sup> � � *f*�1 ∀*i*, *f*

¼ 1∧ *l <sup>f</sup>* <*t* ≤*t* þ *tj* � �

¼ 1∧ *l <sup>f</sup>* <*t* ≤*t* þ *tj* � �

� �<sup>≥</sup> <sup>0</sup>∀*h*, *<sup>b</sup>*, *<sup>t</sup>* (39)

*<sup>h</sup>*,*<sup>b</sup>* ¼ 1∀*h*, *t* (40)

∀*h*, *b* (41)

∀*i*, *f*, *t* (42)

∀*i*, *f*, *t* (43)

(44)

(45)

(46)

$$z\_{hj}^{t} + \frac{1}{t\_j - 1} \sum\_{i=t+1}^{t+t\_j - 1} \sum\_{\vec{j}} z\_{h\vec{j}}^{\vec{i}} \le 1 \forall h, \forall j: t\_j > 1, \forall t: d\_j \le t \le d\_j + \theta \tag{21}$$

$$\sum\_{t} \left( \sum\_{i} y\_{i,j}^{t} + \sum\_{h} z\_{h,j}^{t} \right) = \mathbf{1} \forall j \tag{22}$$

$$\sum\_{td\_j+\theta} \left(\sum\_i \mathbf{y}\_{i,j}^t + \sum\_h \mathbf{z}\_{h,j}^t \right) = \mathbf{0} \quad \forall j \tag{23}$$

$$\sum\_{i} \mathbf{x}\_{i,b,m}^{t} \le \mathbf{1} \forall m, t, \forall b \in \overline{B} \tag{24}$$

$$y\_{i,j}^t - \frac{e\_i^t}{u\_j + \min\_{\beta\_j \notin \overline{B}, b\_1 \in \overline{B}} \left(\hat{u}\_{\beta\_j, b\_2}\right) + \mu E} \le \mathbf{0} \forall i, j, \forall t: d\_j \le t \le d\_j + \theta \tag{25}$$

$$
\alpha\_{i,b\_1,b\_2}^t - \frac{\varepsilon\_i^t}{\hat{u}\_{b\_1,b\_2} + \mu E} \le \mathbf{0} \forall i, \forall t, \forall b\_1, \forall b\_2 \tag{26}
$$

$$
\varepsilon\_i^0 = \overline{\varepsilon}\_i \forall i \tag{27}
$$

$$E \cdot \sum\_{b \in \overline{B}} \sum\_{m} \mathbf{x}\_{i,b,m}^{\ell} - \sum\_{j} \mathbf{y}\_{i,j}^{\ell} \cdot \mathbf{u}\_{j} - \sum\_{b\_{1},b\_{2}} \sum\_{\mathbf{c} \in \mathbf{B}} \mathbf{a}\_{i,b\_{1},b\_{2}}^{\ell} \cdot \hat{\mathbf{u}}\_{b\_{1},b\_{2}} + \mathbf{e}\_{i}^{\ell} - \mathbf{s}\_{i}^{\ell} = \mathbf{e}\_{i}^{\ell+1} \forall i, \mathbf{t} \tag{28}$$

$$\sum\_{b \in \overline{B}} \sum\_{m} \mathcal{X}\_{i,b,m}^{t} - \frac{s\_i^t}{E} \ge 0 \forall i, t \tag{29}$$

$$\frac{1}{E} \cdot s\_i^t - \frac{1}{E} e\_i^t \le 0 \forall i, t \tag{30}$$

$$\sum\_{m} \mathbf{x}\_{i,b,m}^{t} - \mathbf{g}\_{i,b}^{t} \le \mathbf{0} \forall t, i, \forall b \in \overline{B} \tag{31}$$

$$\sum\_{j:a\_j=b\_1} y\_{i,j}^t + \sum\_{b\_2} a\_{i,b\_1,b\_2}^t - \mathbf{g}\_{i,b\_1}^t \le \mathbf{0} \forall i, b\_1, t \tag{32}$$

$$\sum\_{j:\beta\_j=b\_2} y\_{ij}^t + \sum\_{b\_1} o\_{i,b\_1,b\_2}^t - g\_{i,b\_2}^{t+1} \le 0 \forall i, b\_2, t \tag{33}$$

$$\sum\_{j:\beta\_j=b\_2} y\_{i,j}^t + \sum\_{b\_1} a\_{i,b\_1,b\_2}^t - \left(g\_{i,b\_2}^{t+1} - g\_{i,b\_1}^t\right) \ge 0 \forall i, b\_2, t \tag{34}$$

$$\sum\_{b} \mathbf{g}\_{i,b}^{t} = \mathbf{1} \forall i, t \tag{35}$$

$$\mathbf{g}\_{i,b}^{0} = \begin{cases} \mathbf{1} & \text{if} \quad b = \mathbf{G}\_{i} \\ \mathbf{0} & \text{otherwise} \end{cases} \forall i, b \tag{36}$$

$$\sum\_{j:a\_j=b} z\_{h,j}^t - p\_{h,b}^t \le 0 \forall h, b, t \tag{37}$$

$$\sum\_{j:\beta \cdot j = b} z\_{h,j}^t - p\_{h,b}^{t+1} \le 0 \forall h, b, t \tag{38}$$

*Optimal Management of Electrified and Cooperative Bus Systems DOI: http://dx.doi.org/10.5772/intechopen.93892*

$$\sum\_{j:\beta\_j=b} z\_{h,j}^t - \left(p\_{h,b}^{t+1} - p\_{h,b}^t\right) \ge 0 \forall h, b, t \tag{39}$$

$$\sum\_{b} p\_{h,b}^{t} = \mathbf{1} \forall h, t \tag{40}$$

$$p\_{h,b}^{0} = \begin{cases} 1 & \text{if } b = P\_h \\ 0 & \text{otherwise} \end{cases} \forall h, b \tag{41}$$

Constraints (17)–(21) avoid conflicts in the usage of resources. Constraints (22)–(23) model when the scheduled trips should be executed. Constraints (24)–(30) control the charging and discharging dynamics and ensure that the trip execution is consistent with battery status. Constraints (31)–(41) control the location dynamics of each bus.

#### **3.2 Online optimization: Decomposition scheme and model predictive control**

The optimization model described in the previous section is aimed at determining full day bus schedules in the Public Transport planning stage, i.e. assuming a specific trip timetable and considering no deviations arising from operations. However, the model has been designed with the explicit objective of enabling the application of time-based decomposition schemes, for the sake of scalability in seeking solutions at the planning stage. In this Section we showcase how this decomposable nature can be further exploited, in combination with a Model Predictive Control scheme, to compute real-time rescheduling in case of major disruptions arising from operations (e.g. delays due to overcrowding, bunching, congestion, … ).

#### *3.2.1 Time-wise decomposition scheme for the SDEVSP/MDEVSP models*

The two models described earlier can be rather straightforwardly decomposed along the time variable *τ* ¼ f g 0, 1, … , *N* , arbitrarily choosing both the frequency of sub-problem (defined henceforth as time-lapse) definition and the effective points in time where decomposition should happen. In order to ensure that the decomposed time-lapses effectively capture the original formulation, coupling constraints must be added to the formulation, as follows:

$$\left. \mathbf{A}\_{i}^{t} \right|\_{f} = \left. \mathbf{A}\_{i}^{t+l\_{(\
f-1)}} \right|\_{f-1} + \left. \lambda\_{i}^{t} \right|\_{f-1} \forall i, f, t \tag{42}$$

$$\left.H\_i^t\right|\_f = H\_i^{t+l\_{(\
f\_i-1)}}\Big|\_{f=1} + \zeta\_i^t\big|\_f \forall i, f, t \tag{43}$$

$$\left. \lambda\_i^t \right|\_f = \begin{cases} \mathbf{1} & \forall i, t: \exists j, \overline{t}: \mathcal{Y}\_{i,j}^{\overline{t}} \Big|\_f = \mathbf{1} \land \left( l\_f < t \le \overline{t} + t\_j \right) \\\mathbf{0} & \text{otherwise} \end{cases} \tag{44}$$

$$\left. \zeta\_i^t \right|\_f = \begin{cases} \mathbf{1} \quad \forall i, t: \exists j, \overline{\mathbf{7}}: \mathbf{z}\_{i,j}^{\overline{t}} \Big|\_f = \mathbf{1} \land \left( l\_f < t \le \overline{\mathbf{7}} + t\_j \right) \\\mathbf{0} \quad otherwise \end{cases} \tag{45}$$

$$\begin{aligned} \left. \overline{\varepsilon\_{i}} \right|\_{f} &= \varepsilon\_{i}^{l \; \; f - 1} \left| \right|\_{f-1} \forall i, f\\ \left. \overline{\varepsilon\_{i}} \right|\_{0} &= E \forall i \end{aligned} \tag{46}$$

These constraints communicate the status of the fleet along different timelapses, informing the later time periods on both availability and battery status of the busses as a result of the scheduling decisions performed in the earlier time periods.

By correctly configuring the frequency of time decomposition (at each time step), the width of the time lapses (chosen equal to the desired prediction horizon) and the appropriate bus availability data (busses are marked available only after the effective trip completion, rather than following a pre-determined trip duration), a Model Predictive Control application can be devised, as shown in **Figure 3**.

#### **3.3 Multi-terminal mixed-fleet scheduling in the city of Luxembourg**

The proposed model and solution framework have been implemented in Matlab™, employing IBM's ILOG Cplex 12.7 as optimization software. We validated our multi-terminal model against a real-life instance arising in the city of Luxembourg, considering several urban bus lines, as shown in **Figure 4**. Four of the terminals are currently equipped with two opportunity charging stations each. We employ our model on two different sets of tests: one addressing a subset of bus lines (lines 1, 16, 9 and 14, comprising 536 daily trips across 5 bus terminals, 2 of which are equipped with chargers), and one representing the complete instance (10 bus lines, 1034 daily trips across 12 terminals, 4 of which are equipped with chargers).

The results shown in **Figures 5** and **6** show consistently that, as the fleet transitions towards full electrification, the overall operational cost decreases and the number of total recharges increases accordingly.

**Figure 4.**

**Figure 5.**

**Figure 6.**

**107**

*Case study: 10 bus lines in the City of Luxembourg.*

*Optimal Management of Electrified and Cooperative Bus Systems*

*DOI: http://dx.doi.org/10.5772/intechopen.93892*

*Bus lines, 536 trips – Total operational costs and recharge operations (left); distinct cost factors (right).*

*10 bus lines, 1034 trips – Total operational cost and recharge operations (left); distinct cost factors (right).*

It is interesting to note that the rate at which operational costs decrease and the total amount of recharging operations increase both exhibit an inflection point: in the set of tests addressing all the 10 lines, the gradient decreases at about 30% of electrified fleet, while in the reduced problem addressing 4 bus lines it becomes actually flat at about 70% of electrified fleet.

These results showcase that a diminishing returns effect might arise when approaching full electric operations. The effect is however less impactful in the fullscale scenario, implying that complex instances might lead to larger potential gains to be attained through electrification.

**Figure 3.** *MPC scheme.*

*Optimal Management of Electrified and Cooperative Bus Systems DOI: http://dx.doi.org/10.5772/intechopen.93892*

**Figure 4.** *Case study: 10 bus lines in the City of Luxembourg.*

**Figure 5.** *Bus lines, 536 trips – Total operational costs and recharge operations (left); distinct cost factors (right).*

**Figure 6.** *10 bus lines, 1034 trips – Total operational cost and recharge operations (left); distinct cost factors (right).*
