Page 1 of 1

Forward Dynamics Tool Does Not Converge

Posted: Thu Jan 21, 2021 12:00 am
by weaqa12
Hello,

I am having trouble using getting the forward dynamics tool to converge and run the entire length it is supposed to. I am using the Rajagopal2015.osim with meshes for contact geometries and an ElasticFoundation force. The idea is to use the forward dynamics to see how the model falls due to gravity (if someone loses consciousness for example) with no controls or states files. I tried multiple combinations of minimum timesteps and error tolerances but changing them yields the same error(time steps: 1e-4 to 1e-8 and error: 1e-4 to 1e-8). The model only has this problem if it is set to fall forwards, the tool runs fine when the model falls backwards. I copy-pasted the error message below, the muscle the comes up in the error does change depending on the starting position. I have tried removing them to see if that fixes the problem with no success. I would greatly appreciate any help I can get.

Exception caught in Millard2012EquilibriumMuscle::calcMuscleDynamicsInfo from bflh_r
Exception caught in Millard2012EquilibriumMuscle::calcFiberVelocityInfo from bflh_r
bflh_r Fiber velocity Newton method did not converge
Exception caught in Millard2012EquilibriumMuscle::calcMuscleDynamicsInfo from bflh_r
Exception caught in Millard2012EquilibriumMuscle::calcFiberVelocityInfo from bflh_r
bflh_r Fiber velocity Newton method did not converge
ForwardTool::run() caught exception

Thank you very much for reading and for your time.

Re: Forward Dynamics Tool Does Not Converge

Posted: Thu Jan 21, 2021 5:54 am
by tkuchida
The "Fiber velocity Newton method did not converge" error is thrown at line 844 of Millard2012EquilibriumMuscle::calcFiberVelocityInfo() (https://github.com/opensim-org/opensim- ... e.cpp#L844) because calcDampedNormFiberVelocity() was unable to calculate a muscle fiber velocity that satisfies the equilibrium equation for the given fiber length. You may be trying to operate the model beyond the range of motion for which it has been validated. If you are allowing the model to flop over in a forward dynamic simulation, you may want to introduce CoordinateLimitForces to prevent the joints from exceeding reasonable ranges (and, thus, to prevent the muscles from reaching unreasonable lengths). More information about the muscle model can be found on the "Millard 2012 Muscle Models" page in the documentation (https://simtk-confluence.stanford.edu/d ... cle+Models), and in the references listed there.

Re: Forward Dynamics Tool Does Not Converge

Posted: Thu Jan 21, 2021 9:49 am
by weaqa12
Thank you very much for your reply. I actually have coordinatelimitforces in place for all the joints in the model while getting this error. I have also tried removing all muscles from the model to see if that makes a difference. However, that also ends up crashing with the error ForwardTool::run() caught exception without any mention of muscles. This is what made me unsure of how to proceed.

Again, thank you for your time.