Abstract : We present new models, numerical simulations and rigorous analysis for the optimization of the velocity in a race. In a seminal paper, Keller (1973,1974) explained how a runner should determine his speed in order to run a given distance in the shortest time. We extend this analysis, based on the equation of motion and aerobic energy, to include a balance of anaerobic energy (or accumulated oxygen deficit) and an energy recreation term when the speed decreases. We also take into account that when the anaerobic energy gets too low, the oxygen uptake cannot be maintained to its maximal value. Using optimal control theory, we obtain a proof of Keller's optimal race, and relate the problem to a relaxed formulation, where the propulsive force represents a probability distribution rather than a value function of time. Our analysis leads us to introduce a bound on the variations of the propulsive force to obtain a more realistic model which displays oscillations of the velocity. Our numerical simulations qualitatively reproduce quite well physiological measurements on real runners. We show how, by optimizing over a period, we recover these oscillations of speed. We point out that our numerical simulations provide in particular the exact instantaneous anaerobic energy used in the exercise.