Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] for reducing the time of computation #22

Open
mrrezaie opened this issue Apr 2, 2023 · 2 comments
Open

[Suggestion] for reducing the time of computation #22

mrrezaie opened this issue Apr 2, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mrrezaie
Copy link
Contributor

mrrezaie commented Apr 2, 2023

Hi,

Thanks for providing this great toolbox. Given that this may take ~3 hours for every subject, I have a suggestion to reduce this time by 50%. I see that this function, sampleMuscleQuantities.m is the most time consuming one. Lots of users may use generic models as reference, e.g. modified Rajagopal model in my case. My suggestion is to store the sample muscle quantities of the reference model once forever and use it for each subject.
First, collate the sample quantities of all muscles into one struct using Mus_ref_all.(curr_mus_name) = sampleMuscleQuantities(osimModel_ref,curr_mus,'all',N_eval); instaed of the following line of code and save the Mus_ref_all variable as a MAT file. Then, load the file before the loop and use Mus_ref = Mus_ref_all.(curr_mus_name); instead of:

Mus_ref = sampleMuscleQuantities(osimModel_ref,curr_mus,'all',N_eval);

The good point is that this file is readable in Python as well. Here is an example (N_eval=5):
Rajagopal2015_passiveCal_hipAbdMoved.zip

Best - Mohammadreza

@modenaxe modenaxe added the enhancement New feature or request label Apr 12, 2023
@modenaxe
Copy link
Owner

that's actually a very good idea, thank you @mrrezaie I'll see if I can implement it in the next update of the scripts.

@mrrezaie
Copy link
Contributor Author

Thank you. Another suggestion in this regard would be to add an option to optimize the muscles of only one leg, in case of using identical scaled factors for both legs. This will reduce additional 50%!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants