I need more information about the AnyForceMomentMeasure2. It is a complicated function and we can think that our measure is correct while it is not. Seeing this function as a free body diagram (FBD) helps to understand it, but only partially from my point of view.

Take one of the gait models for example. I want to find the contribution of the vastus lateralis to the knee forces and moments around the knee joint, taking the shank KneeJoint reference node as the point of interest. Does the following measure is correct :

AnyRefFrame &ThighRef = .Side.Leg.Seg.Thigh.KneeJoint;
AnyRefFrame &ShankRef = .Side.Leg.Seg.Shank.KneeJoint;

AnyForceMomentMeasure2 VastusLateralis = {
AnyRefFrame &ref = .ShankRef;
AnyForceBase &mus1 = …Side.Leg.Mus.VastusLateralisInferior1;
AnyForceBase &mus2 = …Side.Leg.Mus.VastusLateralisInferior2;
AnyForceBase &mus3 = …Side.Leg.Mus.VastusLateralisInferior3;
AnyForceBase &mus4 = …Side.Leg.Mus.VastusLateralisInferior4;
AnyForceBase &mus5 = …Side.Leg.Mus.VastusLateralisInferior5;
AnyForceBase &mus6 = …Side.Leg.Mus.VastusLateralisInferior6;
AnyForceBase &mus7 = …Side.Leg.Mus.VastusLateralisSuperior1;
AnyForceBase &mus8 = …Side.Leg.Mus.VastusLateralisSuperior2;

AnySeg &seg1=..Side.Leg.Seg.Patella; // Segment on which the muscles of interest have their common insertion

AnyVec3 FLocal = F*.ShankRef.Axes;
AnyVec3 MLocal = M*.ShankRef.Axes;


Here, I did not included the thigh segment, because I assume that the segment from where the muscle comes from is not needed in the FBD.

Regardless of the point of interest, does the FBD has to include all the segments between the origin and insertion of the muscle(s) of interest, excluding the origin segment if it is not the point of interest ?

Thank you.


Hi Pierre,

I think your code looks correct and your guess is right.

As you guessed, when you use AnyForceMomentMeasure2 class you should consider only one side (either origin or insertion) from the point of interest.

You can see how we could define several moment measures here:

Let’s see the code for KneeNetMomentMuscle:

AnyForceMomentMeasure2 KneeNetMomentMuscle = 
  AnyRefNode &ref = ..Seg.Thigh.KneeJoint.RotNode;
  AnySeg &seg1=..Seg.Shank;      
  AnySeg &seg2=..Seg.Foot;  
  AnySeg &seg3=..Seg.Talus;

  AnyReacForce &jnt=..Jnt.PatellaMovement.Reaction;

  #include  "LegMuscleNames.any"

   AnyVec3 Mlocal=M*ref.Axes;
   AnyVar MKneeFlexion=Mlocal[2];  

As we can see here, to calculate the knee net moment by only muscles, this code only considers the downward directions from the knee joint( shank, foot, talus) so this code does not consider thigh.

I hope this may be helpful to you.

Best regards,

1 Like

Hi Moonki,

I understand but I’m still unsure about the correct way to use that kind of measure. Is there another way to measure the contribution of a muscle to the knee joint moments ?

Thank you.


Hi Moonki,

I did a really simple model to understand how to apply a AnyForceMomentMeasure2. This simple model (attached file) is based on your 2D shoulder model. However, the rotation is kept to 0 degree and the segment is at equilibrium in the vertical direction.

The active forces in that model are the mass of the segment and an external force applied at the elbow node {0,0,-0.4}m of 10 N.

Now if you run the model and look at the reaction forces and moments at the joint, you will find :

Fx = 0 N
Fy = 10 N
Fz = 19.62 N (ie. 2 kg segment mass * 9.81 m/s^2)

There are two other measures. I guess that these measures are respectively the moment in the X and Z direction, because the Y rotation is the only DOF.

The moment around the X-axis should be 4 Nm (0.4m10N) and the moment around the Z axis should be null. However, this is not what I obtain (Mx = Mz = 5.66 N*m).

I think I’m missing something here…



Hi Pierre,

  1. I think you could use AnyForceMomentMeasure2 well.
    When we see the Mlocal value which you defined, then it gives the same value which you could guess.

  2. The reason why the reaction moments in the AnyRevoluteJoint are different from the value from AnyForceMomentMeasure2 is that the AnyKinRotational object type in an AnyRevoluteJoint is ‘PlanarAngles’.
    As we know, the value of reactions will depends on which type of kinematics measures were used with those reactions.
    So in this case it is natural to see the difference.
    And I would say that you can believe the values from AnyForceMomentMeasure2 class.
    If the AnyKinRotational object in the AnyRevoluteJoint was in type of RotAxesAngles, then the reaction moment values from the AnyRevolueJoint would have been as same as the values from the AnyForceMomentMeasure2.

  3. From the AnyBody version 6, each joint has an folder which is called ‘RefFrameOutput’ inside. In that folder you can see the F and M values in the global coordinate systems. This may be helpful to you.

Best regards,