Get muscle properties independent to model coordinates

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Get muscle properties independent to model coordinates

Post by Mohammadreza Rezaie » Mon Jul 24, 2023 2:10 am

Hi, I'm trying to retrieve all possible values for some muscle properties, e.g., tendon length, fiber length, fiber pennation angle. My current approach is to update the coordinates in 1000 arbitrary poses and then, call the relevant methods. But this takes several minutes for each muscle. Is there any way to do this independent to the coordinates? i.e., is it possible to set the total length of the muscle and then get the other properties? I'm looking for something like
setFiberLength()

Any help is greatly appreciated.
Mohammadreza

Tags:

User avatar
Carmichael Ong
Posts: 378
Joined: Fri Feb 24, 2012 11:50 am

Re: Get muscle properties independent to model coordinates

Post by Carmichael Ong » Thu Aug 24, 2023 4:44 pm

If you want to do this independent to model coordinates, sounds like you might just want to make a new model that has one model and one block and attach the muscle to ground and the block. Then you can move the block to be the correct muscle-tendon length that you want.

If you still want to use arbitrary poses, there is one way to speed things up (depending on the details of your model). If you are using `Coordinate::setValue()` (documentation), by default every time the coordinate, the constraints of the model will be solved to be satisfied. So, you could make sure to pass in `enforceConstraints=false` and then call `Model::assemble(state)` at the end.

User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Get muscle properties independent to model coordinates

Post by Mohammadreza Rezaie » Wed Aug 30, 2023 11:13 pm

Thanks Dr. Ong for your response. Using enforceConstraints=false followed by assemble(state) speeded up the code.

What if I define a muscle alone using API without any attachments (no bodies and joints). Isn't it possible to set the muscle-tendon length as a value and ask the muscle class to calculate the pennation angle, tendon and fiber lengths?

Thanks for your help.

User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Get muscle properties independent to model coordinates

Post by Mohammadreza Rezaie » Fri Jan 12, 2024 8:43 pm

Hi, I think I found it: GeometryPath::setLength

Code: Select all

import opensim as osim

model = osim.Model(osimModel_fileName)
state = model.initSystem()

soleus = model.getMuscles().get('soleus_r')
soleus.setActivation(state, 1)
soleus.getGeometryPath().setLength(state, 0.4)
soleus.computeEquilibrium(state)
This could update the fiber and tendon properties according to the given muscle-tendon length. So, there is no need to update the model pose. Do you think this method is safe?

Thank you,
-Mohammadreza

POST REPLY