Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Post by Mohammadreza Rezaie » Mon Apr 01, 2024 3:12 am

Hi Nick,

You are right, my model had locked joints (mtp). Replacing them with weld joint by ModelFactory::replaceJointWithWeldJoint fixed the issue, as you suggested. Now I'm getting reasonable joint reaction (I think) without any error related to DeGrooteFregly2016Muscle.

Thanks a lot for your help.
Try .add() if .append() didn't work.
StdVectorString doesn't have add method in Python, and append method doesn't work as expected (analyze() cannot realize StdVectorString collated by append).

Currently, push_back('.*reaction_on_child') is the only way that works.
note that activations are states, not controls. Muscle excitations are controls.
The formulations of activation dynamics in OpenSim (first-order) and De Groote et al. (2016) are different. Do you have any suggestion how I can handle that?

Since I'm only interested in joint contact forces here, can I disable muscles activation dynamics? Then the muscle excitation would be identical to muscle activation I think.

Thanks for your help.

Tags:

User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Post by Mohammadreza Rezaie » Thu Apr 11, 2024 12:04 am

StdVectorString doesn't have add method in Python, and append method doesn't work as expected (analyze() cannot realize StdVectorString collated by append). Currently, push_back('.*reaction_on_child') is the only way that works.
Hi, Any idea/solution for this issue? Why doesn't opensim::analyze work with StdVectorString collated by append? I'm referring to this code:

Code: Select all

outputVariables = osim.StdVectorString()
for joint in model.getJointSet():
    outputVariables.append(joint.getAbsolutePathString()+'|reaction_on_child')
outputTable = osim.analyzeSpatialVec(model, stateVariables, controlVariables, outputVariables)
The output table has no column. Only this method works:

Code: Select all

outputVariables = osim.StdVectorString()
outputVariables.push_back('.*reaction_on_child')
Thanks for your help.

User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Post by Mohammadreza Rezaie » Tue Apr 23, 2024 2:03 pm

Any help is greatly appreciated.

User avatar
Mohammadreza Rezaie
Posts: 377
Joined: Fri Nov 24, 2017 12:48 am

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Post by Mohammadreza Rezaie » Tue Jun 11, 2024 3:11 pm

Hi, one workaround I found was to replace the Muscles with Path Actuators (ModelFactory::replaceMusclesWithPathActuators), followed by the JR tool with the force file from Muscle Redundancy Solver. It works without any error/warning. Do you think this method is safe?

The former issue regarding analyzeSpatialVec with the outputVariables collected by append() and absolute paths still exists. This is the only working way: outputVariables.push_back('.*reaction_on_child')

-Mohammadreza

POST REPLY