The work and energetic cost of locomotion