Obtaining muscle fiber accelerations during integration

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Obtaining muscle fiber accelerations during integration

Post by Sergio Verduzco-Flores » Tue Apr 19, 2016 1:34 am

I am currently implementing a model of spindle afferents, using an object derived from ModelComponent. The model I use calculates the tension in the spindle's fibers, and to do so it calculates the second derivative of the tension in the computeStateVariableDerivatives method. The equation for the second derivative of the tension, however, requires the acceleration of the muscle fiber length from the muscle containing the spindle.

I don't know how to control the stage at which computeStateVariableDerivatives is called, or how to access the acceleration. I tried something like:

Code: Select all

double Lpp = dynamic_cast<const AfferentMuscle*>(musclePtr)->getStateVariableDeriv(s,"fiber_velocity");
where AfferentMuscle is my muscle class (derived from Millard2012EquilibriumMuscle), and musclePtr is a pointer to the muscle containing the spindle afferent object. This resulted in some runtime error.

Is there some way to access the length acceleration from computeStateVariableDerivatives?

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Obtaining muscle fiber accelerations during integration

Post by Ross Miller » Thu Apr 21, 2016 6:21 pm

Hi Sergio,

As far as I know, none of the muscle models in OpenSim have the fiber velocity as a state variable, so I think computeStateVariableDerivatives will not return the fiber acceleration regardless of when it's called.

If your controller can access multiple timepoints, you could try estimating fiber acceleration with a finite difference.

Hope this helps,
Ross

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Obtaining muscle fiber accelerations during integration

Post by Christopher Dembia » Thu Apr 21, 2016 7:55 pm

Ross Miller is correct.

You can also use Simbody's "Differentiate" Measure.
https://simtk.org/api_docs/simbody/3.5/ ... tiate.html

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Obtaining muscle fiber accelerations during integration

Post by Sergio Verduzco-Flores » Sun Apr 24, 2016 6:10 pm

Thank you for your input Ross and Chris.

User avatar
Ross Miller
Posts: 375
Joined: Tue Sep 22, 2009 2:02 pm

Re: Obtaining muscle fiber accelerations during integration

Post by Ross Miller » Wed Apr 27, 2016 11:43 am

Sergio, if you're using the API, could you use the "Millard2012AccelerationMuscle"? I've never heard of anyone using it in OpenSim (didn't even know about it until a few minutes ago) but it sounds like it will do what you're looking for:

https://simtk.org/api_docs/opensim/api_ ... uscle.html

Some more details on the model are in Matt Millard's ASME proceeding here:

https://www.researchgate.net/profile/Ma ... 725704.pdf

Ross

User avatar
Sergio Verduzco-Flores
Posts: 9
Joined: Wed May 23, 2012 3:55 pm

Re: Obtaining muscle fiber accelerations during integration

Post by Sergio Verduzco-Flores » Tue May 10, 2016 11:26 pm

Thank you Ross. For some reason I failed to see your reply until now.

The Millard2012AccelerationMuscle is a good option, but in the end I implemented a spindle afferent object that obtains its own estimate of the fiber's acceleration, so it could be used with any of the muscle models.

POST REPLY