A theory of energy cost and speed of climbing