An inverse dynamics model for the analysis, reconstruction and prediction of bipedal walking