Page 1 of 1

Setting muscle excitation problem in matlab

Posted: Sat Jun 27, 2020 6:47 pm
by sambhav.ratna
Hello all,
I have to set excitation and activation to muscles in every loop of integration in matlab.
This is done so that the metabolic probe attached to the model, can get this information from the muscles and calculate the metabolic cost.
Activation is easily set into the muscles.
But when I set excitation using the following command:
model.getMuscles().get(0).setExcitation(state, 0.3);
it is showing no error but it's not working, as when using the following command:
model.getMuscles().get(0).getExcitation(state) I try to get the value, it is returning just 0.
This is not the case with activation, but I don't know what's the problem with excitation.

What should I do? Can I use the internal Activation Dynamics which can do this operation of getting the excitation from the activation value itself. How can I set the excitation to muscle for the metabolic cost to give correct output?

Thanks,
Ratna

Re: Setting muscle excitation problem in matlab

Posted: Fri Jul 03, 2020 2:56 pm
by mjasmuss
Hi Ratna,

I have not worked with changing the excitation of a muscle, but I have been able to do this effectively for muscle activation (as you also mentioned).

Is your main issue that you cannot get the metabolics from a muscle? If so, I recall that the metabolic probe would not work unless I implemented realizeDynamics(state) for the model and then updated the probe set. Maybe the same is true for your issue.

I don't know if this will work for your example, but it might be worth a try.

All the best and let me know if it works,

Mike

Re: Setting muscle excitation problem in matlab

Posted: Wed Aug 12, 2020 1:03 am
by sambhav.ratna
Thankyou Mike for your kind attention.
Yeah I have realized the stage to the dynamics and I am able to obtain the metabolic cost, but the metabolic cost I am getting seems to be containing only two components of it. I mean, out of the Mechanical work rate, Shortening heat rate, Activation and maintenance heat rate and Basal heat rate, I am only able to get Mechanical work rate and shortening heat rate, and not the activation and maintenance heat rate, Basal is not an issue.
This thing, I am guessing is happening because of the fact that I am only able to give activation not excitation to the muscle. The two components I am getting as the result, are actually functions of activation of the muscle.
What I did was, from Umberger and Bhargava metabolic cost models, I brought a mathematical equation for calculating the activation and maintenance part of the metabolic cost. I am able to get a similar curve now, of the total metabolics, but still since I don't know the exact value of the some of the constants used by OpenSIm GUI in calculating the metabolic cost, my results are not exactly matching with that of OpenSim GUI.
If anyhow, I get to know how to use OpenSim metabolic cost calculation API, so that I get all the components of metabolic cost, that would be great. For that, setting excitation level to the muscle, I think, is posing an issue.

--Ratna

Re: Setting muscle excitation problem in matlab

Posted: Wed Nov 18, 2020 2:00 am
by akoussou
Hi Ratna,

Sorry for reopening this topic, I won't be able to answer to your questions, but I'm facing a problem that it seems you were able to suceed.
Indeed, I would like to set the activation of my muscles to 0.

As you, I'm using :
model.getMuscles().get(i).setActivation(state,0);

But, when I'm using :
model.getMuscles().get(i).getActivation(state); I got 0.1.

Finally, it's the same problem as you for the excitation. Apparently, you got no problem with setActivation. So, I was wondering if you have any idea of what I'm doing wrong.

Is it because activation can't be inferior to 0.1? Or finally, have you suceed to set your excitation? Maybe, it will give a lead to me.

PS : I'm using Rajagopal's Model desgined for gait.

Thanks in advance,

Regards

Re: Setting muscle excitation problem in matlab

Posted: Mon Dec 28, 2020 10:59 pm
by sambhav.ratna
Hi Axel,

My main objective was to see metabolic cost, so muscle activation being 0 or 0.01 was not going to have much effect on my results (in the range of 3-5 units may be). I can suggest you to check Millard2012AccelerationMuscle, as in its description I found that "it is possible to simulate 0 activation". https://simtk.org/api_docs/opensim/api_ ... uscle.html
In Rajagopal2015 model, Millard2012EquilibriumMuscle is used, where I think it is in the property of muscle itself that it's activation cannot be 0.

I hope this helps.

Re: Setting muscle excitation problem in matlab

Posted: Fri Apr 02, 2021 6:38 pm
by sambhav.ratna
I think, I have understood what is required to be done for my problem.

If the muscle excitations are set using any prescibedController, Metabolic probe works correctly and give right numbers for metabolic cost and the obtained plot is very similar to that obtained from GUI.