Detailed description |
|
I have been looking at the OpenSim implementation of Thelen2003 muscle and found, I believe, a small bug in Thelen2003Muscle::printCurveToCSVFile.cpp.
Here are the problematic lines when computing the FiberForceVelocity in printCurveToCSVFile:
line 1484: fvInv = calcfvInv(a, a*1.0, dlceN, 1e-6,100);
line 1485: DdlceDaFalFv = calcDdlceDaFalFv(a,a*1.0,a*1.0*fvInv[1]);
the second argument of these call is multiplied by the activation (a) while it should be 1.0 (=fal).
In all other calls to calcfvInv, the second argument is fal. For example, the call is correct in Thelen2003Muscle::initMuscleState
line 1133 : fvInv = calcfvInv(ma,fal,dlceN,aSolTolerance, 100);
Note calcfvInv calls calcdlceN and calcDdlceDaFalFv
line 2001: dlceN1 = calcdlceN(aAct,aFal, aFalFv);
line 2003: dlceN1_d_Fm = calcDdlceDaFalFv(aAct,aFal,aFalFv);
where aFal is the second argument of calcfvInv
In the body of both functions, the second arguments is multiplied by the activation to compute afl, which is used to compute dlceN and dlcedFm. When calling calcfvInv with a*1.0 instead of 1.0 (or fal), the result is wrong.
The reason for the confusion is the name of the 2nd argument of calcfvInv and calcDdlceDaFalFv, which is named aFal, but should be fal. To what I could see, printCurveToCSVFile is the only place where this confusion leads to a wrong result but I don't have yet a global view of the code. |
|