## 5 Case Study
### One Intermediate Timing Point  
The case studied is the same journey presented in the previous subsection and defined by the timing points collected in Table 3. Taking into account these restrictions, the algorithms are executed to obtain the speed profile of minimum consumption that fulfils the timing points. Three values for the tolerance have been used to study the influence of the constraint relaxation. These values are 1 s, 5 s, and 10 s.  
Figure 5 depicts the evolution of the average value of the 20 tests performed of the fitness of the best solution found by the GA throughout the iterations. In this figure, the three cases of tolerance values are represented. Furthermore, the area of this figure is divided into two areas by a horizontal line with value located in the position Fitness = 1.52. As explained in Section 4.2, the fitness value of infeasible solutions is the energy consumption of the flat-out driving plus the constrain violation. In this case, the energy consumption of the flat-out driving is equal to 1.52 MWh. Therefore, if the fitness is greater than 1.52, i.e., it is located in the red area, the best solution found by the algorithm at that iteration is infeasible. Contrary, if the fitness is lower than 1.52, i.e., it is located in the green area, the best solution found by the algorithm at that iteration fulfils the timing points restrictions. As can be observed, the GA is not capable of finding a feasible solution in 24 iterations. The evolution of the algorithm improves the fitness value of the best solution. In other words, the solutions found are closer to the feasible region. However, the fitness improvement between two iterations is too small to find a feasible solution in the iterations given. Comparing the results for the different values of tolerance, it can be seen that solutions found are closer to the feasible region as the tolerance is bigger. Increasing the tolerance gives more flexibility to fulfil the timing points. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Passing Speed (km/h)** & **Passing Time** & **Arrival Time** & \
\begin{tabular}{c} **Energy Consumption** \\ **(MWh)** \\ \end{tabular} &
\begin{tabular}{c} **Difference with Minimum** \\ **Consumption** \\ \end{tabular} \\ \hline
300 & 00:12:03 & 00:26:00 & 0.955 & 0.13 \% \\
235 & 00:12:03 & 00:26:00 & 0.954 & 0.00 \% \\
200 & 00:12:03 & 00:26:00 & 0.959 & 0.54 \% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of the speed profiles obtained for different values of passing speed at 264 km. Figure 5: Evolution of the mean value of the fitness of the best solution found by the Genetic Algorithm (GA) for the case of one intermediate timing point. On the other hand, the results provided by the DE algorithm present a better performance. Figure 6 shows the evolution of the average value of the 20 tests performed of fitness of the best solution found by the DE at each iteration. The figure is divided into the infeasible red area and the feasible green area as in the previous case. The results provided by the algorithm has shown its capability to find feasible solutions. In all the 20 tests the algorithm was capable to find a speed profile that meets the target times. As in the case of the GA, the bigger the tolerance, the easier for the algorithm to find a feasible solution. As can be seen in Figure 6, with a tolerance of 1 s the algorithm found a feasible solution at iteration 8, with a tolerance of 5 s the feasible solution is found in iteration 5 and with a tolerance of 10 s the feasible solution is found at iteration 3. The DE algorithm is capable not only of finding a feasible solution but also of finding an energy efficient solution. Figure 7 shows the same results as in Figure 3, but zooming in the feasible region. This figure shows how the energy consumption of the best solution found by the algorithm is improved during the iterations. Furthermore, these improvements are stabilised at around 15 iterations.