  This paper presents a bi-level optimization framework to compute the
maximum-distance race strategies for a fully electric endurance race car,
whilst accounting for the low-level vehicle dynamics and the thermal
limitations of the powertrain components. Thereby, the lower level computes the
minimum-stint-time for a given charge time and stint length, whilst the upper
level leverages that information to jointly optimize the stint length, charge
time and number of pit stops, in order to maximize the driven distance in the
course of a fixed-time endurance race. Specifically, we first extend a convex
lap time optimization framework to capture low-level vehicle dynamics and
thermal models, and use it to create a map linking the charge time and stint
length to the achievable stint time. Second, we leverage the map to frame the
maximum-race-distance problem as a mixed-integer second order conic program
that can be efficiently solved in a few seconds to the global optimum with
off-the-shelf optimization algorithms. Finally, we showcase our framework for a
simulated 6h race around the Zandvoort circuit. Our results show that the
optimal race strategy can involve partially charging the battery, and that,
compared to the case where the stints are optimized for a fixed number of pit
stops, jointly optimizing the stints and number of pit stops can significantly
increase the driven distance and hence race performance by several laps.
