Differentiable Lap Time Simulation with Optimal Control