How to set the minimum activation of muscles in Hyfydy

SCONE is a software tool for predictive simulations of biomechanical movement. It uses OpenSim for modeling and simulation, and performs optimization using various control strategies, including feed-forward control, proprioceptic feedback control, and bal
POST REPLY
User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

How to set the minimum activation of muscles in Hyfydy

Post by Yuichiro Omura » Sun Jul 24, 2022 11:23 pm

I want to set the minimum activation of muscles in Hyfydy model.
Default value is 0.01, but I want to set lower value.
Are there any parameters that can achieve this in hyfydy?

User avatar
Thomas Geijtenbeek
Posts: 445
Joined: Wed Mar 12, 2014 8:08 am

Re: How to set the minimum activation of muscles in Hyfydy

Post by Thomas Geijtenbeek » Mon Jul 25, 2022 2:30 am

You can set the minimum activation for all muscles:

Code: Select all

ModelHfd {
	...
	min_muscle_activation = 0
}
Documentation of this and other ModelHfd features has now also been added here:

https://scone.software/doku.php?id=ref:model_hfd

User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

Re: How to set the minimum activation of muscles in Hyfydy

Post by Yuichiro Omura » Tue Jul 26, 2022 1:50 am

I could set the minimum activation using this parameters. Thank you for the reply!

User avatar
Yuichiro Omura
Posts: 44
Joined: Thu Apr 04, 2019 10:03 pm

Re: How to set the minimum activation of muscles in Hyfydy

Post by Yuichiro Omura » Tue Sep 06, 2022 12:04 am

I found that changing the minimum muscle activity changed the initial muscle length depending on the value.
The length changes between the initial value of 0.01 and 0.001, as shown in the figure.
It appears (at least in visualize) that the length does not change any more when the value is set above 0.01 or below 0.001.
At 0.001, the length of the muscle fibers shrinks significantly at the beginning of the simulation.
Is there any way to prevent this?
If not, I will run the simulation at 0.01.
Attachments
min_act=0.001.png
min_act=0.001.png (127.18 KiB) Viewed 199 times
min_act=0.01.png
min_act=0.01.png (123.12 KiB) Viewed 199 times

User avatar
Thomas Geijtenbeek
Posts: 445
Joined: Wed Mar 12, 2014 8:08 am

Re: How to set the minimum activation of muscles in Hyfydy

Post by Thomas Geijtenbeek » Tue Sep 06, 2022 1:45 am

The initial fiber length of all muscles is based on the initial muscle activations, through equilibration. The initial muscle activations, in turn, are based on the muscle excitations set by your controller during the first time your script's update() function is called. If a muscle excitation set in your initial update() is zero (or a small value), it will be corrected to min_muscle_activation, and this will affect the initial fiber length for that muscle.

If this is undesirable, you have the following options:
  • You can add "initialize_activations_from_controller = 0" to the Model section of your scenario; this will prevent the initial activations being taken from the controller and always use the same constant (determined by initial_equilibration_activation).
  • You can make sure the muscle excitation computed in your controller's initial update() function is higher (i.e. > 0.01). You can check if it is the first call via model:time() == 0.
  • You can increase min_muscle_activation (as you suggest).
Please let me know if this makes sense!

POST REPLY