CMC error in relation to fiber length

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ryan Kim
Posts: 3
Joined: Wed Jan 26, 2011 10:09 pm

CMC error in relation to fiber length

Post by Ryan Kim » Mon Apr 19, 2021 2:33 pm

Dear OpenSim experts,

I'm working on CMC for my project.
I'm using Dr. Catelli's full-body model for squat movements.
  • Danilo S. Catelli, Mariska Wesseling, Ilse Jonkers & Mario Lamontagne (2019): A musculoskeletal model customized for squatting task, Computer Methods in Biomechanics and Biomedical Engineering, 22(1):21-24.
    DOI: 10.1080/10255842.2018.1523396
I am getting an error message below.
Exception caught in Millard2012EquilibriumMuscle::calcMuscleDynamicsInfo from addlong_r
Exception caught in Millard2012EquilibriumMuscle::calcFiberVelocityInfo from addlong_r
SimTK Exception thrown at MuscleFixedWidthPennationModel.cpp:169:
Error detected by Simbody method MuscleFixedWidthPennationModel::calcPennationAngularVelocity: Fiber length cannot be zero.
(Required condition 'fiberLength > 0' was not met.)
This error occurs literally at a very early stage of squat motion, so I don't think that the fiber length can be zero with the standing position.
[Edit: Muscle analysis also performed to check fiber length, and it turned out that it's not zero].

Although the error doesn't occur for all the squat trials, it is somewhat consistent.
I suspect it is a muscle model issue potentially, but I am not sure what causes this error and how to fix it.
I was able to complete CMC after that specific time frame when the error occurred.

I also found a similar post from another user, but it has not been answered yet.
Here is the link for the issue.
viewtopicPhpbb.php?f=91&t=10676&p=29637&start=0&view=

Does anyone have any suggestions to fix that issue?
Any input would be greatly appreciated!

Sincerely,

Tags:

User avatar
Thomas Uchida
Posts: 1794
Joined: Wed May 16, 2012 11:40 am

Re: CMC error in relation to fiber length

Post by Thomas Uchida » Tue Apr 20, 2021 2:04 pm

The error is thrown by this line: https://github.com/opensim-org/opensim- ... l.cpp#L167. The fiber length of the muscle must be reaching zero. There are many things you could try---for example, you could make the tendon rigid to prevent the error, plot the results, and then refine the muscle model parameters.

User avatar
Matthew Millard
Posts: 25
Joined: Fri Aug 01, 2008 7:17 am

Re: CMC error in relation to fiber length

Post by Matthew Millard » Thu Apr 22, 2021 11:51 pm

Dear Namwoong,

I've taken a quick look at the exception that is being thrown, at Catelli et al., and at Catelli-V4.0_Nu.osim for a hint of what might be causing the problem. There are two things you can try modifying in the muscle model settings that may stop the exception from being thrown:

1. The exception you're getting only gets called if the muscle model is pennated. The pennation angle of addlong is pretty small, which means you can neglect it without incurring a big loss in accuracy. To do this you can

a. Open Catelli-V4.0_Nu.osim in a text editor (NotePad++ is a favourite if you're using Windows)
b. Search for "addlong_r" and then scroll to the pennation angle and set it to zero. On the version of osim file that I have this means:

change: <pennation_angle_at_optimal> 0.13777038999999999 </pennation_angle_at_optimal>
to : <pennation_angle_at_optimal> 0.0 </pennation_angle_at_optimal>

On the file I have these entries appear at lines 5596 for addlong_r, and 9798 for addlong_l. This still may not fix the problem: if the fiberLength goes below zero then there is an exception that is thrown Millard2012EquilibriumMuscle::calcMuscleDynamics on line 800 of Millard2012EquilbriumMuscle.cc.

2. As Tom Uchida mentioned, you can also make the tendon rigid. Since addlong has a tendon-slack-length--to--fiber-length ratio of nearly 1:1, making this modification will have little impact on the accuracy of the model's calculations. This will, however, mean that fiber cannot shorten as much, and this may allow your simulations to proceed. As before, to make this change open the osim file in a text editor and search for "addrlong_r" and then

change: <ignore_tendon_compliance>false</ignore_tendon_compliance>
to : <ignore_tendon_compliance>true</ignore_tendon_compliance>

and repeat this process for addlong_l.


Whether or not these suggestions allow the model to run, it is important that you try to understand why the problem is happening in the first place. If possible, take a look at a complete record of the fiber lengths of the problem muscles to understand why you are seeing this problem. I don't believe that addlong sees very short fiber lengths during a squat in reality, which means there's either a problem with the model's geometry, or perhaps with the kinematic data the CMC is attempting to track.

For example, if you look at Figure 9 of Arnold et al. 2010 you can see that the hip adductors of both the models and the experimental data of Cahalan et al. 1989 are able to generate large moments from hip angles of -40 degrees adduction to +10. If you assume that the passive forces are small, then this means that the 'average' fiber length must be between 0.5 normalized fiber lengths (shorter than this the fiber cannot generate active force as the force-length curve goes to zero) to about 1.2 normalized fiber lengths (longer than this and you'll start to see significant passive forces). We can tentatively conclude that a real adductor longus should not be reaching short fiber lengths in the ranges that you look at. I'll use the word tentative only here because there are clearly other muscles contributing to the adduction moment.

Why then, are you seeing such short fiber lengths in your simulations? I can think of two reasons that you would have to follow up on:

1. Maybe the model's geometry needs to be improved: this problem could be caused by having an adductor longus tendon that is longer than it should be, given its points of origin and attachment. The peak adduction moment should occur with a hip adduction angle of about -20 degrees of hip angle adduction (looking at Figure 9 of Arnold et al. 2010). This means that when your model is put in that pose, and the adductor longus is maximally activated, the final normalized fiber length of addlong should be nearly 1.0. This is something that you can simulate and check. Alternatively you can just pose the hips at -20 degrees of hip adduction, calculate the path of the addlong. This should be equal to the sum of the tendon slack length (scaled by 1.049 if you're including tendon compliance) plus the optimal fiber length scaled by the cosine of the pennation angle: if you find that the length of the MTU is very different than the path length then this is a geometry problem. The fix in this case would be to scale the tendon slack length and fiber length such that the length of the MTU at its peak tension production is equal to the path length of addlong with a hip adduction angle of about -20 degrees.

I have a strong suspicion that this is the problem. OpenSim is in need of a fitting routine to adjust the lengths of the MTU's such that the model is able to reproduce known dynamometry results. This is a non-trivial amount of work, but it would go a long way in reducing these kinds of problems which are currently resolved by hand-tuning.

2. The other reason is that perhaps the model is in good shape, but CMC is doing something odd, and somehow managing to put the model in an unrealistic pose. If this is the case I have fewer suggestions I can make. However, at this point you can then go and look at your data in detail to make sure that there is not an error in the kinematic data that you're trying to get CMC to track.

Hope this helps,

Matt

References

Arnold EM, Ward SR, Lieber RL, Delp SL. A model of the lower limb for analysis of human movement. Annals of biomedical engineering. 2010 Feb 1;38(2):269-79.

Cahalan, T. D., M. E. Johnson, S. Liu, and E. Y. Chao. Quantitative measurements of hip strength in different age groups. Clin. Orthop. Relat. Res. 246:136-145, 1989.

POST REPLY