Hi All!
I was curious if anyone has had experience applying an external (aka not native to opensim) muscle model for opensim simulations - or if such a task is possible. I'm trying to implement a muscle model that differs from the millard model in terms of model kinematics and kinetics. As of yet I've been unable to find literature pertaining to how opensim loops through its native muscle models for inverse/forward trials, or how to call a third party muscle model in a simulation.
Any input would be greatly appreciated!
Using External Muscle Model
- Thomas Uchida
- Posts: 1800
- Joined: Wed May 16, 2012 11:40 am
Re: Using External Muscle Model
Have you looked into using the scripting interface? For example, if you had your muscle model implemented in MATLAB, I think you could use a PathActuator (https://simtk.org/api_docs/opensim/api_ ... ml#details) to apply the computed force. The code would be structured as if you were designing a controller (because the PathActuator applies a tension equal to its control signal); the MATLAB version of the Dynamic Walker example does this:
- "Dynamic Walker Competition January 2014" page in the Confluence documentation: http://simtk-confluence.stanford.edu:80 ... nuary+2014
- Link to example files: https://simtk.org/frs/download.php?file_id=3862
- "Dynamic Walker Competition January 2014" page in the Confluence documentation: http://simtk-confluence.stanford.edu:80 ... nuary+2014
- Link to example files: https://simtk.org/frs/download.php?file_id=3862
- Daniel Rivera
- Posts: 2
- Joined: Mon Jan 30, 2017 10:30 am
Re: Using External Muscle Model
Thanks Tom! That is immensely helpful.
So - to make sure I'm understanding correctly - given an upper body model (for example), would the idea be to replace muscles with path actuators and let the external model control their tension?
Another question comes to mind - would this method prohibit the use of the analyze tool for a given motion file, (i.e. a ForceReporter), or would we get similar quantities by performing an actuation analyses?
Thanks a ton!
So - to make sure I'm understanding correctly - given an upper body model (for example), would the idea be to replace muscles with path actuators and let the external model control their tension?
Another question comes to mind - would this method prohibit the use of the analyze tool for a given motion file, (i.e. a ForceReporter), or would we get similar quantities by performing an actuation analyses?
Thanks a ton!
- Thomas Uchida
- Posts: 1800
- Joined: Wed May 16, 2012 11:40 am
Re: Using External Muscle Model
Yes.would the idea be to replace muscles with path actuators and let the external model control their tension?
I don't think so. You should be able to interact with the AnalyzeTool as usual. You could also run the analysis during a simulation to avoid using the AnalyzeTool altogether. You obviously won't be able to ask OpenSim for muscle-specific quantities like fiber lengths, but your muscles would still be actuators.would this method prohibit the use of the analyze tool for a given motion file, (i.e. a ForceReporter)
I suggest looking at the MATLAB version of the dynamic walker example (linked in my previous post) and try a simple version of this strategy to make sure it will meet your needs.