Page 1 of 1

Obtaining muscle fiber accelerations during integration

Posted: Tue Apr 19, 2016 1:34 am
by subquantic
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?

Re: Obtaining muscle fiber accelerations during integration

Posted: Thu Apr 21, 2016 6:21 pm
by rosshm
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

Re: Obtaining muscle fiber accelerations during integration

Posted: Thu Apr 21, 2016 7:55 pm
by chrisdembia
Ross Miller is correct.

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

Re: Obtaining muscle fiber accelerations during integration

Posted: Sun Apr 24, 2016 6:10 pm
by subquantic
Thank you for your input Ross and Chris.

Re: Obtaining muscle fiber accelerations during integration

Posted: Wed Apr 27, 2016 11:43 am
by rosshm
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

Re: Obtaining muscle fiber accelerations during integration

Posted: Tue May 10, 2016 11:26 pm
by subquantic
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.