Page 1 of 1

Using External Muscle Model

Posted: Wed May 24, 2017 3:02 pm
by djr294
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!

Re: Using External Muscle Model

Posted: Wed May 24, 2017 5:39 pm
by tkuchida
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

Re: Using External Muscle Model

Posted: Thu May 25, 2017 12:09 pm
by djr294
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!

Re: Using External Muscle Model

Posted: Thu May 25, 2017 1:28 pm
by tkuchida
would the idea be to replace muscles with path actuators and let the external model control their tension?
Yes.
would this method prohibit the use of the analyze tool for a given motion file, (i.e. a ForceReporter)
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.

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.