3D predictive simulations of walking
This repository contains code and data to generate predictive simulations of human walking as described in Falisse A, Afschrift M, De Groote F (2022) Modeling toes contributes to realistic stance knee mechanics in three-dimensional predictive simulations of walking. PLoS ONE 17(1): e0256311.
Here is an example of a predictive simulation of walking, based on a complex musculoskeletal model (31 degrees of freedom, 92 muscles, 6 compliant foot-ground contacts per foot), generated with our framework.
The main script is main.py
and the easiest is to start exploring the code from there. The code is for use on Windows, but please post an issue if you want support for other platforms as changes are minimal.
conda create -n 3dpredsim pip spyder
activate 3dpredsim
cd Documents
git clone https://github.com/antoinefalisse/predictsim_mtp.git
cd predictsim_mtp
python -m pip install -r requirements.txt
main.py
: basically everything from loading data, formulating the problem, solving it, and processing the results. Yes I know, it is not fantastic pratice to have everything in one place. Case 42 (default) converges in 772 iterations on my windows machine.plotResults.py
: plots of simulation results against reference data (eg, joint angles and torques, ground reaction forces, and muscle activations).Figure<>.py
: scripts to reproduce figures of the publication.analyzeResults<>.py
: scripts to get key numbers reported in the publication.main.py
.To keep this repository small in size, we do not include raw data and results. Instead we provide .npy
files with processed data and results. Please find raw data and results on our SimTK project page:
OpenSimModel/new_model/experimentalData.npy
contains all processed experimental data and was generated from running extractExperimentalData.py
.Results/optimaltrajectories.npy
contains all processed results.Results/Case_42
, which is the default case.OpenSimModel/new_model/Model/new_model_scaled_FK_contacts.osim
Results/Case_42/motion.mot
Results/Case_42/GRF.mot
Please cite this paper: