Using metabolics probe with DeGrooteFregly2016Muscle

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Using metabolics probe with DeGrooteFregly2016Muscle

Post by Karthick Ganesan » Wed Feb 19, 2020 9:27 am

Dear Chris Dembia,
Is it possible to use metabolics probe with DeGrooteFregly2016 Muscle?
Thanks,
Karthick

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

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Christopher Dembia » Wed Feb 19, 2020 10:05 am

I think so! We haven't tried it yet, but I can't think of a reason why it wouldn't work. If it works, please let us know!

User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Karthick Ganesan » Thu Feb 27, 2020 1:06 pm

It seems to work. I have not yet validated the results.
When using the analysis tool to compute metabolic cost with metabolics probe, the inputs are the states and controls. When muscle activation and fiber length are the state variables, I believe that the probe reporter calculates the fiber velocity by numerical differentiation. Am I right?
In DGF muscle, normalized tendon force is a state variable. How does the probe reporter/ analysis tool compute the fiber length and fiber velocity required for the metabolic cost computation? It could be computed from the DGF muscle model. But is the probe reporter/analysis tool programmed to do so?
Or is it that for each time step the corresponding model's state is realized and as a result the probe reporter has access to the variables like fiber length and fiber velocity?

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

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Christopher Dembia » Thu Feb 27, 2020 3:25 pm

Fiber velocity is computed by solving the fiber-tendon force equilibrium for fiber velocity, and is done for a given state, not on a series of states (through numerical differentiation).

To see how we compute fiber velocity and other varaibles for the DGF muscle when using tendon force as a state variable, see the appendix of De Groote et al., 2016: https://www.ncbi.nlm.nih.gov/pubmed/27001399 and Moco's source code:https://github.com/opensim-org/opensim- ... #L285-L317
But is the probe reporter/analysis tool programmed to do so?
Yes

If you want to gain confidence about this, you could also add a MuscleAnalysis to see the reported fiber velocity.

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

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Christopher Dembia » Thu Feb 27, 2020 3:27 pm

Make sure to use a PrescribedController to enforce the correct muscle excitations, which are required by the metabolics probes. The PrescribedController requires a STO file for controls, which you can create via methods on MocoTrajectory or MocoSolution.

I bet other users would be very grateful if you share your code for running a metabolics probe analysis from a MocoSolution.

User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Karthick Ganesan » Mon Mar 02, 2020 9:45 am

Thanks Chris. Got it.
I am using the analyze tool with xml setup file. I specified the controls.sto file under controller set in setup file. Included the states file as well. I created these files manually. I could have used the methods on MocoSolution though. I will try to do it and share.
It requires the muscles to be included in forceset. But in the original 2D_gait model, muscles are in components. Is there any specific reason why muscles are put under components?
When I used the 2D_gait model with compliant tendon, instantaneous metabolic cost values are even in the order of 1e10. This seems to be contributed by gastroc and sol muscles.When I used the Gait10dof18muscle model after replacing muscles with DGF muscle model and with same states, controls and setup files I got reasonable values. I don't know what is going wrong.

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

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Christopher Dembia » Mon Mar 02, 2020 4:00 pm

Is there any specific reason why muscles are put under components?
No, you can move the muscles into the force set.
When I used the 2D_gait model with compliant tendon, instantaneous metabolic cost values are even in the order of 1e10. This seems to be contributed by gastroc and sol muscles.
Can you use a Muscle Analysis to get a better sense of what's causing these large values? Such an analysis could pinpoint which muscle quantities are so large.

User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Karthick Ganesan » Sun Mar 15, 2020 8:25 am

Hi Chris,
How to create states and controls.sto files from a moco solution? I tried using exportToStatesTrajectory. But I could not find any method on StatesTrajectory to write a sto file. Any suggestions would be helpful.
Thanks,
Karthick

User avatar
Iris Magnusdottir
Posts: 19
Joined: Thu Nov 01, 2018 2:04 am

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Iris Magnusdottir » Wed Mar 25, 2020 2:38 am

Hi Karthick,

I am interested in knowing if you managed to create states and controls.sto files from a MocoSolution.

Also, which files did you use as input files for the Analyze tool? I got state tracking solution and tracked states (.sto) as a result of my MocoTrack setup.
I'm getting low values (and strange curves) for the metabolic cost which I think might be related to negative muscle force values.

It would be great if you can share your approach.
Thanks!

User avatar
Karthick Ganesan
Posts: 119
Joined: Thu Oct 10, 2013 12:11 am

Re: Using metabolics probe with DeGrooteFregly2016Muscle

Post by Karthick Ganesan » Sun Apr 05, 2020 9:36 am

Hi Iris,
I have not yet figured it out. Manually I created states.sto and controls.sto files from the tracking/prediction solution. When using analysis tool specify these files for states_file and controls_file. Hope this helps. If you have figured out a better way of doing please let me know.
Regards,
Karthick.

POST REPLY