Page 2 of 2

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Posted: Mon Apr 01, 2024 3:12 am
by kernalnet
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.

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Posted: Thu Apr 11, 2024 12:04 am
by kernalnet
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.

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Posted: Tue Apr 23, 2024 2:03 pm
by kernalnet
Any help is greatly appreciated.

Re: Issue related to DeGrooteFregly2016Muscle computeEquilibrium

Posted: Tue Jun 11, 2024 3:11 pm
by kernalnet
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