An optimal control solution to the predictive dynamics of cycling