Softball Model

Hi, AnyBody Supports,

I’m now try modeling a sport’s pitching, called Softball.
Attached is the two different pitcher’s pitching(different c3d file), in there, the “Softball_BestPitcherFP_3” file is well done, then I try modeling another pitcher in “Softball_SlowPitcherFP_2” file, there’s some problems.
The kinematic analysis is no problem, but when I run the inverse dynamic analysis, following error message appears.
Study.InverseDynamics : Muscle recruitment solver : solver aborted after maximum number of iterations.
But I use the same methods to built two models.

Before the error message appears, I had try once that there’s no error without Trunk muscles, in other words, if I just use the two legs muscles, there won’t have errors by running inverse dynamic analysis, so I think the problem is on the Trunk muscles.
I had research the related issues in this Forums, so I had try using the AnyGeneralMuscle and try to turn the Reaction.Type off which is in the JointsAndDriversOptimized. JntDriverTrunk, and something else.
But it still doesn’t work, so I’m here to ask for some help with my original model.

My AMS is ver 5.0 and AMMR is ver 1.3

Thanks first :slight_smile:
Best regards,
Yeh

Hi Yeh,

I have tested the model a little bit.

You are right the model can not solve at some point, i made some tests and if you add a reaction to this dof
PelvisThoraxRotation = …HumanModel.Interface.Trunk.PelvisThoraxRotation;

it will run through.

When it fails there is quite a lot of thoraxpelvis twist and i suspect that some of the muscles loose their moment arms at this point.

Obviously it is not nice to add a reaction force there so you could also add a AnyGeneral muscle there with limited strength for this trial, this would make this model run through and you could afterwards check if the size of the applied moment you will be adding to the model, would be acceptable.

Best regards
Søren

Hi, Søren

Thanks for the help :slight_smile:
I had add a reaction to PelvisThoraxRotation like this first :

AnyKinEqInterPolDriver JntDriverTrunk = {
    FileErrorContinueOnOff = On;
    Type = Bspline;
    BsplineOrder = 4;
    FileName = Main.ModelSetup.C3DFileData.NameOfFile+"-output-euler-trunk.txt";
    AnyKinMeasureOrg &PelvisPosX = ...HumanModel.Interface.Trunk.PelvisPosX;
    AnyKinMeasureOrg &PelvisPosY = ...HumanModel.Interface.Trunk.PelvisPosY;
    AnyKinMeasureOrg &PelvisPosZ = ...HumanModel.Interface.Trunk.PelvisPosZ;
    AnyKinMeasureOrg &PelvisRotX = ...HumanModel.Interface.Trunk.PelvisRotX;
    AnyKinMeasureOrg &PelvisRotY = ...HumanModel.Interface.Trunk.PelvisRotY;
    AnyKinMeasureOrg &PelvisRotZ = ...HumanModel.Interface.Trunk.PelvisRotZ;
    AnyKinMeasureOrg &PelvisThoraxExtension = ...HumanModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasureOrg &PelvisThoraxLateralBending = ...HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasureOrg &PelvisThoraxRotation = ...HumanModel.Interface.Trunk.PelvisThoraxRotation;
    AnyKinMeasureOrg &NeckJoint = ...HumanModel.Interface.Trunk.NeckJoint;
    Reaction.Type={On,On,On,On,On,On,Off,Off,On,Off};
  };

Then, I add a AnyGeneral muscle there :

AnyKinEqInterPolDriver JntDriverTrunk = {
    FileErrorContinueOnOff = On;
    Type = Bspline;
    BsplineOrder = 4;
    FileName = Main.ModelSetup.C3DFileData.NameOfFile+"-output-euler-trunk.txt";
    AnyKinMeasureOrg &PelvisPosX = ...HumanModel.Interface.Trunk.PelvisPosX;
    AnyKinMeasureOrg &PelvisPosY = ...HumanModel.Interface.Trunk.PelvisPosY;
    AnyKinMeasureOrg &PelvisPosZ = ...HumanModel.Interface.Trunk.PelvisPosZ;
    AnyKinMeasureOrg &PelvisRotX = ...HumanModel.Interface.Trunk.PelvisRotX;
    AnyKinMeasureOrg &PelvisRotY = ...HumanModel.Interface.Trunk.PelvisRotY;
    AnyKinMeasureOrg &PelvisRotZ = ...HumanModel.Interface.Trunk.PelvisRotZ;
    AnyKinMeasureOrg &PelvisThoraxExtension = ...HumanModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasureOrg &PelvisThoraxLateralBending = ...HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasureOrg &PelvisThoraxRotation = ...HumanModel.Interface.Trunk.PelvisThoraxRotation;
    AnyKinMeasureOrg &NeckJoint = ...HumanModel.Interface.Trunk.NeckJoint;
    Reaction.Type={Off,Off,Off,Off,Off,Off,Off,Off,On,Off};
  };
  
  
  
  AnyFolder Pelvis_Residual = 
  {
      AnyMuscleModel mus = 
      {
          F0 = 50;
      };
      
      AnyGeneralMuscle PosX_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosX;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle PosX_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosX;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };      
      AnyGeneralMuscle PosY_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosY;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle PosY_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosY;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };
      AnyGeneralMuscle PosZ_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosZ;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle PosZ_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisPosZ;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };
      AnyGeneralMuscle RotX_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotX;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle RotX_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotX;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };      
      AnyGeneralMuscle RotY_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotY;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle RotY_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotY;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };
      AnyGeneralMuscle RotZ_Pos = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotZ;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle RotZ_Neg = 
      {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisRotZ;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
      };
      
      AnyVar PosX_Force = PosX_Pos.Fout[0] + PosX_Neg.Fout[0];
      AnyVar PosY_Force = PosY_Pos.Fout[0] + PosY_Neg.Fout[0];
      AnyVar PosZ_Force = PosZ_Pos.Fout[0] + PosZ_Neg.Fout[0];
      AnyVar RotX_Moment = RotX_Pos.Fout[0] + RotX_Neg.Fout[0];
      AnyVar RotY_Moment = RotY_Pos.Fout[0] + RotY_Neg.Fout[0];
      AnyVar RotZ_Moment = RotZ_Pos.Fout[0] + RotZ_Neg.Fout[0];      
  };

And it both could run through, but there still some questions I can not understand.

  1. Why it is not nice to add a reaction force, and what’s the advantage adding a AnyGeneral muscle there with limited strength.
  2. What are your meaning “the size of the applied moment you will be adding to the model”.

Thanks for helping
Best regards,
Yeh

Hi Yeh,

I would keep the reaction on the pelvis active so not having these done by muscles, only the pelvisthroaxrotation.

If you add a reaction force to the DOF it will be infinitely strong, adding a muscle instead with limited strength it will have a cost in the objective function, so it will not use it unless that it needs to.

So it is not nice just to add an reaction because it will make this dof inifinitely strong which is not correct. In principle this should not be needed but it seems that the posture requires this, so this is a quick “hack” to add some artificial muscle to correct for missing momentsarms.

If you look into the moments applied by the muscles afterwards you can see the amount of moment they apply and judge if this is ok.

Best regards
Søren

Hi, Søren

Thanks for the explanation, It’s really rewarding to me :slight_smile:
But I just wondering what you are meaning “keep the reaction on the pelvis active so not having these done by muscles, only the pelvisthroaxrotation”.
Is that mean I shouldn’t reaction “On” the pelvisthoraxrotation in the JointsAndDriversOptimized, I need to add a reaction at the other place? Or?
And I need to to turn off all the muscles when reaction on the pelvis active? But I finally needs to analyze the muscle activity. So what should I do and when can I turn on all the muscles?

Sorry I just can not really understand what you are meaning about the model operating.
Best regards,
Yeh

Hi Yeh,

But I just wondering what you are meaning "keep the reaction on the pelvis active so not having these done by muscles, only the pelvisthroaxrotation".
Is that mean I shouldn't reaction "On" the pelvisthoraxrotation in the JointsAndDriversOptimized, I need to add a reaction at the other place? Or?

Yes exactly only have the Pelvis linear and rotational dof with reactions "On" , then you need to add an AnyGeneral muscle on the pelvisthroaxrotation dof and make one with both forcedirection=1 and -1 so that you cover both directions of the Dof.

And I need to to turn off all the muscles when reaction on the pelvis active? But I finally needs to analyze the muscle activity. So what should I do and when can I turn on all the muscles?

You should not change these settings having muscle in the model or not, even with no ordinary muscles in the model there are still moment generating muscles in the joints. The reactions on pelvis is neede to make balance in the model, there will always remain residual forces in such a model due to measurement errors, differences between model and human etc. so the six dof on pelvis can not be avoided.

Best regards
Søren

Hi, Søren

Now I keep the original reaction of the JntDriverTrunk :

AnyKinEqInterPolDriver JntDriverTrunk = {
    FileErrorContinueOnOff = On;
    Type = Bspline;
    BsplineOrder = 4;
    FileName = Main.ModelSetup.C3DFileData.NameOfFile+"-output-euler-trunk.txt";
    AnyKinMeasureOrg &PelvisPosX = ...HumanModel.Interface.Trunk.PelvisPosX;
    AnyKinMeasureOrg &PelvisPosY = ...HumanModel.Interface.Trunk.PelvisPosY;
    AnyKinMeasureOrg &PelvisPosZ = ...HumanModel.Interface.Trunk.PelvisPosZ;
    AnyKinMeasureOrg &PelvisRotX = ...HumanModel.Interface.Trunk.PelvisRotX;
    AnyKinMeasureOrg &PelvisRotY = ...HumanModel.Interface.Trunk.PelvisRotY;
    AnyKinMeasureOrg &PelvisRotZ = ...HumanModel.Interface.Trunk.PelvisRotZ;
    AnyKinMeasureOrg &PelvisThoraxExtension = ...HumanModel.Interface.Trunk.PelvisThoraxExtension;
    AnyKinMeasureOrg &PelvisThoraxLateralBending = ...HumanModel.Interface.Trunk.PelvisThoraxLateralBending;
    AnyKinMeasureOrg &PelvisThoraxRotation = ...HumanModel.Interface.Trunk.PelvisThoraxRotation;
    AnyKinMeasureOrg &NeckJoint = ...HumanModel.Interface.Trunk.NeckJoint;
    Reaction.Type={On,On,On,On,On,On,Off,Off,Off,Off};
  };

Below it, I add a reaction force to the DOF :

AnyReacForce &PelvisThoraxRotation = ...HumanModel.BodyModel.Interface.Trunk.PelvisThoraxRotation;

But so far as I know, AnyReacForce must used between two object, like the force from a “ReactionNode” to “Body”.
So I don’t know if I am doing the right thing, if not please correct me.
Then below the reactionForce, I add a AnyGeneral muscle there :

AnyFolder Pelvis_Residual = { 
      AnyMuscleModel mus = {
          F0 = 50;
      };
      
      
      AnyGeneralMuscle PelvisThoraxRotation_Pos = {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisThoraxRotation;
          AnyMuscleModel& mus = .mus;
          ForceDirection = 1;
      };
      AnyGeneralMuscle PelvisThoraxRotation_Neg = {
          AnyKinMeasure& org = ....HumanModel.Interface.Trunk.PelvisThoraxRotation;
          AnyMuscleModel& mus = .mus;
          ForceDirection = -1;
        };

Is that what you telling me to do?
Thanks again :slight_smile:

Best regards,
Yeh

Hi,

I’m sorry but can you correct me if I’m wrong.
I just can not sure if I had do what you want.

Thanks :slight_smile:
Best regards,
Yeh

Hi Yeh,

Sorry for late reply.

Yes you are right. It seems that what you did for PelvisThoraxRotation looks similar to what Søren mentioned.

Best regards,
Moonki