opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
783 stars 316 forks source link

RigidTendonMuscle fibervelocity computation lacks pennation angle effect #3672

Open pepbos opened 8 months ago

pepbos commented 8 months ago

The fiberVelocity computation in RigidTendonMuscle does not take the pennation angular velocity into account. It appears to be correct only if the pennation angle is zero, which is not generally the case.

The fibervelocity computed by the RigidTendonMuscle is set to equal the muscle lengtheningspeed: https://github.com/opensim-org/opensim-core/blob/20752f3a7852854a3e95a0bf52832bc8ec788163/OpenSim/Actuators/RigidTendonMuscle.cpp#L164

This would be correct if the pennation angle is zero. But the pennation angle is generally not zero: https://github.com/opensim-org/opensim-core/blob/20752f3a7852854a3e95a0bf52832bc8ec788163/OpenSim/Actuators/RigidTendonMuscle.cpp#L138

It looks like the correct fibervelocity calculation can be found in Millard2012EquilibriumMuscle, with the ignore_tendon_compliance set to true: https://github.com/opensim-org/opensim-core/blob/20752f3a7852854a3e95a0bf52832bc8ec788163/OpenSim/Actuators/Millard2012EquilibriumMuscle.cpp#L996C32-L996C32