Spine models in AMMRV1.2 and 1.3

[quote=aalmunajjed;13677]2:
AnyBody has multiple options and per default uses a polynomial solver with power 3. It is possible to have both linear, polynomial and min/max objective functions, and also all possible linear combinations of these.


[quote=dstambolian]
Hi Amir
Thanks for you help.

#2, How would I change the objective function in the software to be like the one used in the spine model, min/max by Rasmussen, et. al. ?


Also, did you find out anything for #1? How to graph the L5/S1 forces/moments without the muscles forces included.

Very much thanks.
Damon

for 1, How to graph the L5/S1 forces/moments without the muscles forces included:

Here we are trying to setup a knee joint with only having Quadriceps muscles included. You would have to setup something similar using the AnyForceMomentMeasure2 for L5S without any muscles:
http://forum.anyscript.org/showthread.php?t=2894

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

AnyReacForce &jnt=…Jnt.PatellaMovement.Reaction;

#include “LegMuscleNamesQuadriceps.any”
AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};

For 2, How to change the muscle recruitment solver:

This is described in the Tutorial: Inverse Dynamics of Muscle Recruitement.


[quote=aalmunajjed;13708]for 1, How to graph the L5/S1 forces/moments without the muscles forces included:

Here we are trying to setup a knee joint with only having Quadriceps muscles included. You would have to setup something similar using the AnyForceMomentMeasure2 for L5S without any muscles:
http://forum.anyscript.org/showthread.php?t=2894

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

AnyReacForce &jnt=…Jnt.PatellaMovement.Reaction;

#include “LegMuscleNamesQuadriceps.any”
AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};

For 2, How to change the muscle recruitment solver:

This is described in the Tutorial: Inverse Dynamics of Muscle Recruitement.


////////////////////////////////////////////////////////////////////////////////////

[quote=dstambolian]

Amir

Q1- Which file would i create the code for AnyForceMomentMeasure2?

Q1.1 - Will there be other code needed to get the graph, or is that taken care of within AnyForceMomentMeasure2?

********

Q2.1- Which file and where in the file should i change the optimization code?

Q2.2I - Is this the correct code? I found this in the turtorial.

InverseDynamics.Criterion = {
Type = MR_MinMaxStrict;

Q2.3 - I found the below existing code in the main file in GaitFullBody. Is this where I put in what i found in the turtorial?

[SIZE=3]//This study is only used for loading the optimized parameters
[/SIZE][SIZE=3]AnyOptKinStudy[/SIZE] LoadParametersOptimizationResults = {
[SIZE=3]AnyFolder[/SIZE] &Study = .InverseDynamicStudy;
ParameterOptimization.ConvergenceTol=1e-3;
Analysis = {
[SIZE=3]AnyOperation[/SIZE] &ref = .Study.Kinematics;

Sincerely Thanks
Damon

For Your questions 2:

There is no need for a change of the muscle recruitment in the Motion and Parameter Optimization! During the Optimization, you don’t even need to have muscles included.
If you run the Inverse Dynamics, you can change the muscle recruitment solver!
Please make Tutorial “Inverse dynamics of Muscle Systems, Lesson 1-6”, as it described exactly how to change the muscle recruitment solver:

http://www.anybodytech.com/fileadmin/AnyBody/Docs/Tutorials/chapX_MuscleRecruitment/Inverse_dynamics.html

On questions 1:

Net moment measures about joints
AnyForceMomentMeasure2 is a new class for measuring forces. Compared to the existing AnyForceMomentMeasure the new class works more like a free body diagram setup where the contribution of selected forces acting on a segment or a collection of segments are summed up to a resulting force and moment. This new class makes net-moment measures about musculoskeletal joints easy even when the model contains muscles and closed loops.

Here is an example for the knee, where only the loads from the patella are included. You have to setup something for L5S1 now and include only the external loads:
AnyForceMomentMeasure2 KneeNetMomentMuscleHamstrings = {
AnyRefNode &ref = …Seg.Shank.KneeJoint; // this is the joint of interest!
AnySeg &seg1=…Seg.Shank; // include the segments of interest here!
AnySeg &seg2=…Seg.Foot;
AnySeg &seg3=…Seg.Talus;

AnyReacForce &jnt=…Jnt.PatellaMovement.Reaction // include the external load her!

  AnyVec3 Mlocal=M*ref.Axes;                    //Moments created through the external load
  AnyVec3 Flocal=F*ref.Axes;                     //Loads created through the external load
  };

[quote=aalmunajjed;13719]For Your questions 2:

There is no need for a change of the muscle recruitment in the Motion and Parameter Optimization! During the Optimization, you don’t even need to have muscles included.
If you run the Inverse Dynamics, you can change the muscle recruitment solver!
Please make Tutorial “Inverse dynamics of Muscle Systems, Lesson 1-6”, as it described exactly how to change the muscle recruitment solver:

http://www.anybodytech.com/fileadmin/AnyBody/Docs/Tutorials/chapX_MuscleRecruitment/Inverse_dynamics.html

[/quote=dstambolian]

Hi Amir

In the turtorial there this webcast is referenced, http://www.anybodytech.com/webcast.html?wid=webcast250609wrf&t=1&tt=wc, that explains how to change the optimization criteria.

When I look for the code in the webcast (frame ~32) it is not the same as in my GaitFullModel.

Here is what i can find that looks close to the webcast code. Can you please take a look at it and advise what I should change in the code to get the min/max optimization?

[SIZE=3]//This study is only used for loading the optimized parameters
[/SIZE][SIZE=3]AnyOptKinStudy[/SIZE] LoadParametersOptimizationResults = {
[SIZE=3]AnyFolder[/SIZE] &Study = .InverseDynamicStudy;
ParameterOptimization.ConvergenceTol=1e-3;
Analysis = {
[SIZE=3]AnyOperation[/SIZE] &ref = .Study.Kinematics;
};
};

[SIZE=3]#endif
[/SIZE]};

Also, in the webcast John Rasmussen recommends to use the third order polynomial, but in Mark de Zee’s paper recommends to use the min/max. Can you explain, if it is best to use the min/max for the spine muscles activation as Mark used?

Sincerely Thanks
Damon

[quote=aalmunajjed;13720]On questions 1:

Net moment measures about joints
AnyForceMomentMeasure2 is a new class for measuring forces. Compared to the existing AnyForceMomentMeasure the new class works more like a free body diagram setup where the contribution of selected forces acting on a segment or a collection of segments are summed up to a resulting force and moment. This new class makes net-moment measures about musculoskeletal joints easy even when the model contains muscles and closed loops.

Here is an example for the knee, where only the loads from the patella are included. You have to setup something for L5S1 now and include only the external loads:
AnyForceMomentMeasure2 KneeNetMomentMuscleHamstrings = {
AnyRefNode &ref = …Seg.Shank.KneeJoint; // this is the joint of interest!
AnySeg &seg1=…Seg.Shank; // include the segments of interest here!
AnySeg &seg2=…Seg.Foot;
AnySeg &seg3=…Seg.Talus;

AnyReacForce &jnt=…Jnt.PatellaMovement.Reaction // include the external load her!

AnyVec3 Mlocal=Mref.Axes; //Moments created through the external load
AnyVec3 Flocal=F
ref.Axes; //Loads created through the external load
};

[/quote=dstambolian]

Hi Amir

How does this code look below?

AnyForceMomentMeasure2 L5Sacrum = {
AnyRefNode &ref = …Seg.L5Sacrum;
AnySeg &seg1=…Seg.L5;
AnySeg &seg2=…Seg.Sacrum;

AnyReacForce &jnt=…Jnt.L5SacrumMovement.Reaction

AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};

If this is good, which file should I add this code, and where in the file do I add this?

Sincerely Thanks
Damon

Hi Damon,

Problem1, about the min/max or polynomial muscle recruitment:
The webcast from John and the Tutorial lessons change the muscle recruitment to polynomail, or min/max in the inverse dynamics study. This has nothing to do with the initial motion and parameter optimization study.

The place where you have to change the muscle recruitment solver is in the study. A good way to find it is to look for the gravity!

Problem2, L5S loads without muscles:
try that in the HumanModel folder:

AnyForceMomentMeasure2 L5Sacrum = {
AnyRefNode &ref = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;
AnySeg &seg1=Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.L5Seg;
AnySeg &seg2= Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;

AnyReacForce &jnt= Main.Studies.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt;

AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};
This will give you the L5S reaction without any muscle forces.


[quote=aalmunajjed;13737]Hi Damon,

Problem1, about the min/max or polynomial muscle recruitment:
The webcast from John and the Tutorial lessons change the muscle recruitment to polynomail, or min/max in the inverse dynamics study. This has nothing to do with the initial motion and parameter optimization study.

The place where you have to change the muscle recruitment solver is in the study. A good way to find it is to look for the gravity!

Problem2, L5S loads without muscles:
try that in the HumanModel folder:

AnyForceMomentMeasure2 L5Sacrum = {
AnyRefNode &ref = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;
AnySeg &seg1=Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.L5Seg;
AnySeg &seg2= Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;

AnyReacForce &jnt= Main.Studies.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt;

AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};
This will give you the L5S reaction without any muscle forces.


[/quote=dstambolian]

Amir

I think i found it under:

[SIZE=3]#if[/SIZE] InverseDynamicModel

[SIZE=3]//This study is used for running the inverse dynamic analysis of the optimized motion
[/SIZE]
I found this section including the gravity.

InverseDynamics.Criterion.UpperBoundOnOff=Off;
nStep=Main.ModelSetup.nStep;
Gravity ={0,0,-9.81};
tStart = Main.TrialSpecificData.tStart+2Kinematics.ApproxVelAccPerturb;
tEnd = Main.TrialSpecificData.tEnd-2
Kinematics.ApproxVelAccPerturb;
[SIZE=3][I_think_this_is_where_I_add_in_the_code_for_min/max_etc.,_damon]

Is this correct?

[COLOR=black]Thanks again[/COLOR]

[/SIZE]

Hi Damon,

Yes this is the right place to set the recruitment solver. It is polynomial degree 3 by default.

Best regards, Sylvain.

[quote=sylvaincarbes;13743]Hi Damon,

Yes this is the right place to set the recruitment solver. It is polynomial degree 3 by default.

Best regards, Sylvain.

[/quote-dstambolian]

Hi Sylvain or Amir
I tried adding in the code and when I tried to upload it I got this message “Model loading skipped”

Here below is the code from the study section in GaitFullBody found in AMMRV1.3.

In red is the code or comments I added. What do you think I need to do to correct this code to get min/max to work?

Sincerely
Damon

[SIZE=3][SIZE=3]//This study is used for running the inverse dynamic analysis of the optimized motion
[/SIZE][SIZE=3]//***********************************************************************************
[/SIZE]HumanModel={
[SIZE=3]AnyFolder[/SIZE] &Mannequin=.InverseDynamicStudy.Mannequin;
[SIZE=3]#include[/SIZE] “BodyPartsSetup.any”
};
[SIZE=3]#include[/SIZE] “HumanModel.any”

[SIZE=3]AnyBodyStudy[/SIZE] InverseDynamicStudy = {
[SIZE=3]AnyFolder[/SIZE] &C3DData=…ModelSetup.C3DFileData ;
[SIZE=3]AnyFolder[/SIZE] &HumanModel=.HumanModel.BodyModel;
[SIZE=3]#include[/SIZE] “Mannequin.any”

[SIZE=3]//Environment around the human
[/SIZE][SIZE=3]AnyFolder[/SIZE] EnvironmentModel ={

[SIZE=3]AnyFolder[/SIZE] DrawC3DMarkers = {};
[SIZE=3]//Model of the floor and force plates this is where the force plates are defined
[/SIZE][SIZE=3]AnyFolder[/SIZE] &HumanModelRef=…HumanModel.BodyModel;
[SIZE=3]//This environment file makes use of automatic detecteion of which foot are incontact with which plate
[/SIZE][SIZE=3]#include[/SIZE] “EnvironmentAutoDetection.any”
[SIZE=3]//This environment file has no automatic detecteion of which foot are incontact with which plate it has to be set manually
[/SIZE][SIZE=3]//#include “Environment.any”
[/SIZE]};

[SIZE=3]//Connection between environment and the human
[/SIZE][SIZE=3]AnyFolder[/SIZE] ModelEnvironmentConnection = {
[SIZE=3]//Drivers for the model
[/SIZE][SIZE=3]#include[/SIZE] “JointsAndDriversOptimized.any”
};

[SIZE=3][/SIZE]
[SIZE=3][COLOR=seagreen]//This is where to change the Optimization to min/max. It is polynomial degree 3 by default… I added this note
[/COLOR][/SIZE]
InverseDynamics.Criterion.UpperBoundOnOff=Off;
[SIZE=3][/SIZE]nStep=Main.ModelSetup.nStep;
[SIZE=3][/SIZE]Gravity[SIZE=3] [/SIZE]={0,0,-9.81};
[SIZE=3][/SIZE]tStart[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]Main.TrialSpecificData.tStart+2Kinematics.ApproxVelAccPerturb;[SIZE=3]
[/SIZE]tEnd[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]Main.TrialSpecificData.tEnd-2
Kinematics.ApproxVelAccPerturb;
[SIZE=3][/SIZE]Main.Studies.MotionOptimization.InverseDynamics.Criterion.Type[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]MR_MinMaxStrict;
[SIZE=3]

[/SIZE][SIZE=3]//#include “GCDOutput.any”
[/SIZE][SIZE=3][/SIZE]};
[SIZE=3]

[/SIZE][SIZE=3]//This study is only used for loading the optimized parameters
[/SIZE][SIZE=3][/SIZE][SIZE=3]AnyOptKinStudy[/SIZE][SIZE=3] [/SIZE]LoadParametersOptimizationResults[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]{
[SIZE=3][/SIZE][SIZE=3]AnyFolder[/SIZE][SIZE=3] [/SIZE]&Study[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE].InverseDynamicStudy;
[SIZE=3][/SIZE]ParameterOptimization.ConvergenceTol=1e-3;
[SIZE=3][/SIZE]Analysis[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]{
[SIZE=3][/SIZE][SIZE=3]AnyOperation[/SIZE][SIZE=3] [/SIZE]&ref[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE].Study.Kinematics;
[SIZE=3][/SIZE]};
[SIZE=3][/SIZE]};
[SIZE=3]
[/SIZE][SIZE=3]#endif
[/SIZE][SIZE=3][/SIZE]};
[SIZE=3]
[/SIZE]};[SIZE=3] [/SIZE][SIZE=3]//Main
[/SIZE][/SIZE][SIZE=3][/SIZE]

[quote=aalmunajjed;13737]Hi Damon,

Problem1, about the min/max or polynomial muscle recruitment:
The webcast from John and the Tutorial lessons change the muscle recruitment to polynomail, or min/max in the inverse dynamics study. This has nothing to do with the initial motion and parameter optimization study.

The place where you have to change the muscle recruitment solver is in the study. A good way to find it is to look for the gravity!

Problem2, L5S loads without muscles:
try that in the HumanModel folder:

AnyForceMomentMeasure2 L5Sacrum = {
AnyRefNode &ref = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;
AnySeg &seg1=Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.L5Seg;
AnySeg &seg2= Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;

AnyReacForce &jnt= Main.Studies.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt;

AnyVec3 Mlocal=Mref.Axes;
AnyVec3 Flocal=F
ref.Axes;
};
This will give you the L5S reaction without any muscle forces.


[/quote=dstambolian]

Amir

Where do I find the output graphs for these forces and moments? I went to this location below in ChartFX 1, but did not see any graphs.

Main.Studies.InverseDynamicStudy.Output.HumanModel.SelectedOutput.Trunk.JointReactionForce

Sincerely
Damon

Damon,

1: the error message is longer then just “Model loading skipped”. In the lines before, you get exactly told why the Model wasn’t loaded and what the error is.
It looks like you included the InverseDynamicsStudy form the Motion Optimization. You have to include the real inverseDynamics Study. Something like:
Main.Studies.InverseDynamicStudy.InverseDynamics.Criterion.Type

And then you have to run the InverseDynamics study, switch 1 and 0 at the beginning of the GaitFulBody file.

2: where did you include the AnyForceMomentMeasure2? You will find the data for the graph in the folder, where you included the script, e.g. if you have it in the InverseDynamicsStudy you will find it in Main.Study.InverseDynamicsStudy!


[quote=aalmunajjed;13746]Damon,

1: the error message is longer then just “Model loading skipped”. In the lines before, you get exactly told why the Model wasn’t loaded and what the error is.
It looks like you included the InverseDynamicsStudy form the Motion Optimization. You have to include the real inverseDynamics Study. Something like:
Main.Studies.InverseDynamicStudy.InverseDynamics.Criterion.Type

And then you have to run the InverseDynamics study, switch 1 and 0 at the beginning of the GaitFulBody file.

2: where did you include the AnyForceMomentMeasure2? You will find the data for the graph in the folder, where you included the script, e.g. if you have it in the InverseDynamicsStudy you will find it in Main.Study.InverseDynamicsStudy!


[/quote=dstambolian]

Hi Amir

1: Is seems to be working now, thanks. I did get an error after completing the AnyOperation selected from Marco: InverseDynamics(64:64): Step Started. Here is the error message.

[SIZE=1]
7.0) Inverse dynamic analysis…
[SIZE=1][COLOR=#0000ff]ERROR(OBJ.MCH.MUS4)[/SIZE] : [SIZE=1]C:/U…s/DB/D…s/A…s/A…3/A…n/A…n/G…1/GaitFullBody.main.any[/SIZE] : [SIZE=1]InverseDynamicStudy.InverseDynamics[/SIZE] : Muscle recruitment solver : maximum number of setbacks occured
[/SIZE]
When I click on the GaitFullBocy.main.any error link the cursor goes to the beginning of this code. What does this error mean?

[SIZE=3]AnyBodyStudy[/SIZE] InverseDynamicStudy = {
[SIZE=3]AnyFolder[/SIZE] &C3DData=…ModelSetup.C3DFileData ;
[SIZE=3]AnyFolder[/SIZE] &HumanModel=.HumanModel.BodyModel;
[SIZE=3]#include[/SIZE] “Mannequin.any”

[SIZE=3]//Environment around the human
[/SIZE][SIZE=3]AnyFolder[/SIZE] EnvironmentModel ={

[SIZE=3]AnyFolder[/SIZE] DrawC3DMarkers = {};
[SIZE=3]//Model of the floor and force plates this is where the force plates are defined
[/SIZE][SIZE=3]AnyFolder[/SIZE] &HumanModelRef=…HumanModel.BodyModel;
[SIZE=3]//This environment file makes use of automatic detecteion of which foot are incontact with which plate
[/SIZE][SIZE=3]#include[/SIZE] “EnvironmentAutoDetection.any”
[SIZE=3]//This environment file has no automatic detecteion of which foot are incontact with which plate it has to be set manually
[/SIZE][SIZE=3]//#include “Environment.any”
[/SIZE]};

[SIZE=3]//Connection between environment and the human
[/SIZE][SIZE=3]AnyFolder[/SIZE] ModelEnvironmentConnection = {
[SIZE=3]//Drivers for the model
[/SIZE][SIZE=3]#include[/SIZE] “JointsAndDriversOptimized.any”
};

[SIZE=3]//This is where to change the Optimization to min/max. It is polynomial degree 3 by default
[/SIZE]
InverseDynamics.Criterion.UpperBoundOnOff=Off;
nStep=Main.ModelSetup.nStep;
Gravity ={0,0,-9.81};
tStart = Main.TrialSpecificData.tStart+2Kinematics.ApproxVelAccPerturb;
tEnd = Main.TrialSpecificData.tEnd-2
Kinematics.ApproxVelAccPerturb;
Main.Studies.InverseDynamicStudy.InverseDynamics.Criterion.Type = MR_MinMaxStrict;

[SIZE=3]//This will give you the L5S reaction without any muscle forces.
[/SIZE]
[SIZE=3]AnyForceMomentMeasure2[/SIZE] L5Sacrum = {
[SIZE=3]AnyRefNode[/SIZE] &ref = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;
[SIZE=3]AnySeg[/SIZE] &seg1=Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.L5Seg;
[SIZE=3]AnySeg[/SIZE] &seg2= Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.SacrumSeg;
[SIZE=3]AnyReacForce[/SIZE] &jnt= Main.Studies.HumanModel.BodyModel.Trunk.JointsLumbar.L5SacrumJnt;
[SIZE=3]AnyVec3[/SIZE] Mlocal=Mref.Axes;
[SIZE=3]AnyVec3[/SIZE] Flocal=F
ref.Axes;
};

[SIZE=3]//#include “GCDOutput.any”
[/SIZE]};

[SIZE=3]//This study is only used for loading the optimized parameters
[/SIZE][SIZE=3]AnyOptKinStudy[/SIZE] LoadParametersOptimizationResults = {
[SIZE=3]AnyFolder[/SIZE] &Study = .InverseDynamicStudy;
ParameterOptimization.ConvergenceTol=1e-3;
Analysis = {
[SIZE=3]AnyOperation[/SIZE] &ref = .Study.Kinematics;

};
};

[SIZE=3]#endif
[/SIZE]};

[/COLOR]
2: I put the [SIZE=3][COLOR=#0000ff]AnyForceMomentMeasure2 [/SIZE]code in the same inverse dynamics study just under where I added in the min/max criterion, (see above code). So just as you said the folders are in… Main.InverseDynamicsStudy.Output.L5Sacrum… awsome![/COLOR]

Under L5Sacrum folder is: F(graph), M(graph), ref(folder), seg1(folder), seg2(folder), jnt(folder), Mlocal(graph), and Flocal(graph). The graphs are empty in F, M, Llocal, and Flocal; and i didn’t see anything that looked like a force/moment graph in the folders.

Why would these graphs be empty?, And which one of these sub folders or graphs should show the forces/moments?

Thank you very much,

for 1: do you get this message also when you outcomment the MinMax criteria?

for 2: F is the Force, M the Moments; FLocal the Force in the Local RefFrame and MLocal the Moments in the Local RefFrame.
This shows now the Forces and Moments without any Muscle loads, nor other loads!


[quote=aalmunajjed;13750]for 1: do you get this message also when you outcomment the MinMax criteria?

for 2: F is the Force, M the Moments; FLocal the Force in the Local RefFrame and MLocal the Moments in the Local RefFrame.
This shows now the Forces and Moments without any Muscle loads, nor other loads!


[/quote=dstambolian]

Hi Amir

  1. I was wondering it this had something to do with it so I ran this last night. I tried the default P=3 optimization and didn’t get the error. What do you think?

  2. The F, M, graphs do not show any curves. Would it help if I send you the C3D of this?

Since the subject is holding a box, should I referece F,M, graphs instead of FLocal and MLocal?

Since I’m adding in the code the subjects correct body weight, and the subject is on force plates won’t the AB model figure the correct loads at the joints even if the subject is holding a box? This is what I need to do.

Sincerely Thanks
Damon

Hi Damon,

Some solvers are more robust than others, and simply give slightly differents results. So it happens that one of them fails but not the others. Nothing strange here.

Yes you can send your model if you want, and we’ll try to have a look at it.

I don’t think the choice of F,M or Flocal,Mlocal has anything to do with the box. It just depends on you in which reference frame you want to visualize the output…

If the force plate data has been recorded while the subject is holding the box then it is all fine. If the box was not there during the experiment then it won’t fit. Basically you have to reproduce in the model the same situation as during the experiment.

Best regards, Sylvain.

[quote=sylvaincarbes;13760]Hi Damon,

Some solvers are more robust than others, and simply give slightly differents results. So it happens that one of them fails but not the others. Nothing strange here.

Yes you can send your model if you want, and we’ll try to have a look at it.

I don’t think the choice of F,M or Flocal,Mlocal has anything to do with the box. It just depends on you in which reference frame you want to visualize the output…

If the force plate data has been recorded while the subject is holding the box then it is all fine. If the box was not there during the experiment then it won’t fit. Basically you have to reproduce in the model the same situation as during the experiment.

Best regards, Sylvain.

[/quote=dstambolian]

Hi Sylvain, or Amir

Your group should already have the code for the rest of the model since we were previously trouple shooting the force plates.

Attached is the C3d file, I hope your experts can get the force graphs working.

Also attached is the main file with the code I added to the main file to generate the kinetics for L5/S1 without muscles included.

Please let me know if you got the files, I’m not sure if I uploaded them properly on this forum.

Sincerely thanks
Damon

Amir
I’m trying a different C3D file and am getting a different kind of error. Can you please help me with solving this error I’m getting about 1/4 way through inverse dynamics analysis.

Here is the error, and below that is where the link points too.

7.0) Inverse dynamic analysis…
[SIZE=1]WARNING(OBJ.MCH.KIN6)[/SIZE] : [SIZE=1]C:/U…s/DB/D…s/A…s/A…3/Body/A…n/Arm/Jnt.any[/SIZE] : [SIZE=1]GHRot[/SIZE] : Close to singular position : Orientation close to Gimbal Lock, i.e., first and third axis of rotation being parallel
[SIZE=1]ERROR(OBJ.LIB.OOS1)[/SIZE] : [SIZE=1]C:/U…s/DB/D…s/A…s/A…3/Body/A…n/Arm/Muscle.any[/SIZE] : [SIZE=1]subscapularis_3.SPLine[/SIZE] : Unexpected exception in the library OOSol :
OOSol exception : MISSING MESSAGE.

[SIZE=3]AnyShortestPathMuscle[/SIZE] subscapularis_4 = {
[SIZE=3]AnyMuscleModel[/SIZE] &MusMdl = …MusPar.subscapularis_4;
[SIZE=3]AnyRefNode[/SIZE] &Org = …Seg.Scapula.O_subscapularis_4;
[SIZE=3]AnyRefNode[/SIZE] &Ins = …Seg.Humerus.I_subscapularis_4;
[SIZE=3]AnyDrawMuscle[/SIZE] DrwMus = {[SIZE=3]#include[/SIZE] “…/drawSettings/MusDrawSettings.any”};
SPLine.StringMesh = 35;
[SIZE=3]AnySurfEllipsoid[/SIZE] &Surf1 =.art_gh_humRef;
[SIZE=3]AnySurfCylinder[/SIZE] &Surf2 =.coracoid_cyl;
[SIZE=3]AnySurfCylinder[/SIZE] &Surf3 =.subscapularis_cyl;
SPLine.InitWrapPosVectors = {
[SIZE=3]// {0,…Sign0.05,-0.05}, {…Sign-0.05,-0.05,0.0}
[/SIZE]{0,…Sign0.05,-0.05}, {…Sign-0.05,-0.05, …Mannequin.Posture.Right.GlenohumeralFlexion/1000 - …Mannequin.Posture.Right.GlenohumeralAbduction/1000}
};

Thank you very much

Damon

Damon,

this is a wrapping muscle problem. Here is a section from the Wiki on how to resolve this:

Resolve penetration errors

Many muscles in the body are wrapped over bones and slide on the bony surfaces when the body moves. This means that the contact forces between the bone and the muscle are always perpendicular to the bone surface, and the muscle may in fact release the contact with the bone and resume the contact later depending on the movement of the body. Via point muscles are not capable of modeling this type of situation, so the AnyBody Modeling System has a special muscle object for this purpose.
A wrapping muscle is presumed to have an origin and an insertion just like the via point muscle. However, instead of interior via points it passes a set of surfaces. If the surfaces are blocking the way then the muscle finds the shortest geodesic path around the surface. Hence the name of the class: AnyShortestPathMuscle. The fact that the muscle always uses the shortest path means that it slides effortlessly on the surfaces, and hence there is no friction between the muscle and the surface.
Sometimes one or some of the points defining a muscle turn out to be located inside one of the surfaces that the muscle can wrap on. In general this should be avoided because a part of the muscle path will be located inside the surface and this part of the path becomes unpredictable.
The penetration errors can occur at different times:

[ol]
[li] They may happen at load time when the model is in its initial position. If they only occur in this position they are not important. It just means the initial posture creates penetration.[/li][li] They may occur when running inverse analysis of the model. This can be important.[/li][/ol]
There can be different reasons for this, including:

[ol]
[li] If for example the arm is penetrating the thorax this may give a penetration warning. This is not an error related to the Body model but related to the way the model is being used. Here the remedy is to change the drivers of the model.[/li][li] In principle all surfaces in the model used for wrapping have been made in a way that makes them scale with the model. When defining a cylinder it is typically defined using three nodes. These nodes control the size and location of the cylinder. When the bone is scaled, these control nodes will also be scaled like any other node on the bone and consequently the cylinder will be scaled too. Ellipsoids are made in a similar way. This setup does not guarantee that penetration errors will never occur. If the via point and the surface are located on the same bone and are very close, different types of scaling and sizes could potentially create penetration errors.[/li][/ol]
In general the remedy is to

[ol]
[li] Exclude all muscles from the model except the one causing the problem.[/li][li] Insert an AnyDrawParamSurface in the surface being penetrated to visualize it you can do this directly in the muscle. Typically by writing Surf1={ AnyDrawParamSurf drw={}; }; //assuming a Surf1 reference is existing![/li][li] Insert an AnyDrawRefFrame in the node which is penetrating.[/li][li] Try to understand the root of the problem, whether it is related to scaling or motion.[/li][li] Do modifications on either model or motion to solve the problem[/li][/ol]