*3.4. Building and Solving the Model*

For the model with a two-speed gearbox, the gear ratios were determined. The optimization objective was to minimize the energy consumption of the vehicle. This process was executed for different cycles separately because the optimal gear ratios and shifting policy vary between cycles.

The gear ratio search range of the two-speed gearbox was split at the single speed differential gear ratio of the reference model in order to retain the vehicle acceleration and top speed performance. The reference single speed ratio was 7.0 and, therefore, the first gear ratio in the two-speed gearbox was set to be larger than 7.1 and the second gear smaller than 7.0. In the gear ratio optimization process, ratios from 2.0 to 7.0 and from 7.1 to 20.0 were covered, for the low and high gear, respectively. Increment for the iteration was set to 0.1.

The simulations were carried out for five driving cycles: The standardized city bus cycle Braunschweig, and three measured cycles from Espoo bus line 11. In addition to the measured cycles E11-LT, E11-MT, and E11-HT, the combined cycle E11-C was used.

The vehicle dynamics, powertrain and gear ratio optimization models were formulated with the Python programming language. The integer programming model was formulated algebraically using Gurobi Python interface functions, and solved with Gurobi 8.1 solver with the default settings. The used solver is based on the branch-and-bound algorithm and comes with additional acceleration techniques, such as cutting planes and preprocessing.
