## 2 Case Study and HEV Model  
The case study is a hybrid electric bus covering the route 2 (\"Universitats-Hosp. Dr.Peset\") from the public transport service in the city of Valencia (EMT-Valencia). The route consists of a loop of 15.1 km which is repeated by the bus between 9 and 10 times a day with an average duration of 5100 s and a standard deviation of 320 s. The vehicle position and speed of the bus in the considered route was registered during two consecutive working days, covering 287 km in total. A GPS in the vehicle outputs the vehicle position, while the vehicle speed is obtained from the vehicle measurements through the OBD port. To divide the total distance covered daily by the bus between the different loops, the starting and ending point of every loop is determined from the GPS signal. In particular, the starting point of the route is associated to the measurement sample with minimum Euclidean distance between its GPS coordinates (in UTM) and those of the theoretical starting location (\(7.275\times 10^{5}\) UTM Easting, 4,373,741 UTM Northing). The ending point of a given loop is associated to the starting point of the next loop. When the initial and final points of a given loop are determined, the distance covered is computed by integrating the vehicle-speed signal obtained from the ECU. Figure 1 shows the vehicle-speed traces in time (left plot) and space (right plot) bases along the 19 repetitions of the loop. While it is difficult to observe any clear correlation between the speed profiles shown in Figure 1, not in time (left plot) nor in distance domain (right plot), it is intuitive that most of the vehicle speed disturbances, e.g., traffic lights or bus stops, and even the trip duration, are defined in a space basis. It is intuitive that the loop duration is defined in terms of distance instead of time, for this reason, important deviations in the time duration of the different loops can be observed in Figure 1 (left), while they show similar distances covered around the theoretical value of 15.1 km (right). Despite the route being the same in all the loops, some discrepancies with the exact distance covered appear due to differences in the driving trajectory, e.g., due to sporadic line changes to avoid obstacles and due to measuring uncertainties. In any case, Figure 1 shows a better correlation between the  
Figure 1: Recorded vehicle-speed traces in time (**left plot**) and distance (**right plot**) bases along the 19 loops covered by a bus of route 2 (“Universitats-Hosp. Dr.Peset”) during two consecutive days. driving cycles in the distance domain and even some strips of high and low velocity can be observed in the space basis (right plot). This correlation is exploited by the proposed control strategy of the HEV bus, whose architecture follows the P2 scheme shown in Figure 2.  
According to the previous paragraph, the objective of the energy management strategy can be formally defined as finding the control law \(u(t)\) that minimizes the following cost:  
\[J=\int_{t_{0}}^{t_{f}}P_{f}(u(t),t)\mathrm{dt}+(E_{b}(t_{f})-E_{b}(t_{0}))^{2} \tag{1}\]  
where \(P_{f}\) is the power of the fuel consumed by the ICE, \(t_{0}\) and \(t_{f}\) are the starting and ending time of the trip, \(u\) is the control action, i.e., the power split between ICE and motor and \(E_{b}\) is the energy stored in the battery. Note that the last term in Equation (1) is needed to ensure the battery charges sustainability. The key variables to determine the value of \(J\) are the energy stored in the battery at the end of the trip and the fuel consumption, so a powertrain model able to estimate the system evolution and the impact of control decisions on \(J\) is needed.