## 4 Algorithm for Energy and Fuel Consumption Minimization
### Fuel Consumption Model  
To generate the previous look-up table, a mathematical vehicle model is used. Depending on the dynamics and detail level of the simulated variables, the models can be classified into quasi-static models and dynamic models. Energy, consumption, performance and emissions studies can be simulated by means of quasi-static models [46; 47; 48]. A quasi-static fuel consumption modelling can follow either a forward-looking or a backward-facing approach. The backward-facing approach assumes the vehicle exactly describes a speed profile to calculate the fuel consumption [49]. The forward-looking approach needs a driver model to follow the target duty cycle [50]. This driver model is usually implemented as a PID controller to generate acceleration and brake commands [51; 52].  
Quasi-static models have a shorter simulation time than dynamic models but their exactitude is lower. Simulation differences between these two kinds of models are smaller than 5% and the simulation time proportion is close to two orders of magnitude [53]. The quasi-static models include fuel consumption and power train efficiency as static maps by means of look-up tables [46; 54].  
Examples of quasi-static vehicle simulators are QSS-Toolbox [55; 56] and ADVISOR [57; 58]. In contrast, PSAT [59], CARSIM [60; 61] and V-ELPH [62] use dynamic models to perform their simulations.  
In this paper, a quasi-static vehicle model was chosen because it provides a low computational time and, according to [63], its accuracy varies approximately around 4% from fuel mass estimations based on dynamic methods.  
Our energy and fuel consumption model takes the mathematical methodology from QSS-Toolbox [55] but the implementation is different. QSS-Toolbox contains the equations necessary to perform a longitudinal dynamics simulation [64] and calculates the fuel consumption for a determined duty cycle and provides fuel consumption, accelerations, car speed, aerodynamic forces, and other variables _versus_ time. Contrary to QSS-Toolbox, our fuel consumption model accepts as input a speed cycle that varies in the distance domain. Fuel consumption expressed as a function of distance is a requirement because the optimization process takes into account the legal and safe speed constraints and these limits are defined in the space domain. The model implementation allows a flexible scheme to vary input parameters of the simulation such as initial speed, final speed, slope, gear and simulated distance. This flexibility is useful when spent fuel and elapsed time calculation is performed for each speed transition.  
Table 1 shows the main model parameters. Furthermore, the fuel consumption model contains global operational limits for vehicle operation, e.g., maximum engine torque and minimal speed according to the gear engaged. Other more specific limits can be adjusted such as the maximum engine speed and user-defined acceleration/deceleration ranges. Vehicle parameters can be configured, so atomic cases contained in the look-up table depend on the vehicle type and they are calculated once at the beginning of the algorithm execution.