Page 1 of 1

Moment arm calculation of OpenSim

Posted: Sun Sep 01, 2024 8:17 am
by lijunnan
Hi community,

I am curious about how the OpenSim calculates the moment arm of muscles with wrapping surfaces. I somehow can not find the code or specific paper that mentioned a bit more details.
Could someone guide me to the code or paper that may help me find it out?

Thanks

Best regard,
Junnan Li

Re: Moment arm calculation of OpenSim

Posted: Tue Sep 03, 2024 5:18 am
by kernalnet
Hi, the following paper and the MATLAB example might help:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4404026/
https://github.com/opensim-org/opensim- ... FLCurves.m
You can also search for MomentArmSolver and the relevant methods in the source code (https://github.com/opensim-org/opensim-core).
Hope this helps.

Re: Moment arm calculation of OpenSim

Posted: Tue Sep 03, 2024 7:43 am
by bogert
The paper cited by Mohammadreza is very good, but there is one error in the paper that I would like to point out (in case it causes confusion). When a model has moving muscle points, the paper says that equation (1) should be used instead of equation (3). This is, however, not correct. Equation (3) is ALWAYS the correct moment arm: moment arm for degree of freedom k is the partial derivative of muscle path length L with respect to the generalized coordinate k: r = dL/dq_k.

This came to light after the paper was written, when someone compared quadriceps moment arm between two versions of the same leg model. One version had a patella that moved as a function of knee flexion (as in Delp's original leg model), and the other had no patella but a moving insertion point with exactly the same motion as a function of knee flexion. The moment arms should be the same, but they were not. I believe this was in OpenSim 3.2.

See viewtopicPhpbb.php?f=91&t=4479 for details.

In November 2013, I had a long email correspondence with Ajay Seth and Michael Sherman on this. They agreed, the moment arm calculation code was corrected and subsequent versions of OpenSim now have a correct moment arm calculation using equation (3) for all types of muscle path, including models with moving muscle points.

I attach my original email, in case anyone wants to read a more detailed explanation.
moment arms and moving muscle points.pdf
(143.86 KiB) Downloaded 23 times
.

Ton van den Bogert

Re: Moment arm calculation of OpenSim

Posted: Tue Sep 03, 2024 8:02 am
by kernalnet
Thanks a lot for the correction. I wonder why there is no corrigendum for that paper.

Re: Moment arm calculation of OpenSim

Posted: Thu Sep 05, 2024 1:37 am
by lijunnan
Hi Mohammadreza,

Thanks for the recommendation of the paper. I have also checked the paper, and I agree with Ton van den Bogert's point that according to the virtual work principle, equation 3 should be correct.

I also notice that they have mentioned the analytical expression of the dl/dq is hard to derive, therefore, they use generalized force method to calculate moment arm and stated that they can easily calculate T matrix (transferring muscle tension to spatial force).
As I understood, for a straight-line muscle path, it is easy to calculate the matrix T. When it comes to a geodesic path over the obstacle, I don't see the formulation or proof that the matrix T can be derived easily.

Please tell me if I miss something.

Junnan