Energy optimal control for Formula One race car