Spine models in AMMRV1.2 and 1.3

Hi Damon,

Leg vs LegTD - the former one is an old version of the leg model, the latter is newer. They should be mutually exclusive - I think there will be an error message if you try to include both. Now we mostly use LegTD - there might be a few applications that still use the older.

Simple vs 3E muscles - Please check the tutorial on “muscle modelling: lesson 5 - muscle models”. You can choose to use either the simple model or the 3-element model, which needs calibration. They are also mutually exclusive.

Trunk-neck - is a section for the cervical spine, yes, you need to keep it.

Regards,
Pavel

Pavel
For this… “Trunk-neck - is a section for the cervical spine, yes, you need to keep it.”

1- Are you saying that for a lifting activity where I’m measureing the L5/S1 the Trunk-neck needs to be ON, and why?

2-And to do this I should change the code like below to incude the neck?

// Trunk: 1 included, 0 not included
// *********************************
#define TRUNK 0
// This is just the bones,
// Choose one of the following options to add muscles
#define TRUNK_SIMPLE_MUSCLES 0
// Additional stiffness in the lumbar joints can be added.
#define TRUNK_DISC_STIFFNESS_NORMAL 0

// Trunk with neck: 1 included, 0 not included
// *********************************
#define TRUNK_NECK 1
// This is just the bones,
// Choose one of the following options to add muscles
#define TRUNK_NECK_SIMPLE_MUSCLES 1
#define TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
// Additional stiffness in the lumbar joints can be added.
#define TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

Sincerely thanks
Damon

Hi Damon,

Trunk_Neck is just the neck (bones/muscles).

Trunk is everything else.

Include both, but for the latter one include the muscles too.
#define TRUNK_NECK 1
#define TRUNK 1
#define TRUNK_SIMPLE_MUSCLES 1

Pavel

Hi Pavel

[SIZE=3]

[SIZE=3]In BodyPartsSetup I did this.

[SIZE=3][SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 1
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 0
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

In BodyPartsSetup2 the Trunk-Neck is off as below. If i try to turn it ON the program does not load. So I left it OFF and loaded the program and ran the bones. Then I tried to load for inversedynamics… but that wouldn’t load.

If I try turning OFF the muscles in BodyPartsSetup and running inversedynamics it doesn’t load as well, and the program crashed,

I’ll try a few more times, but just wanted to run this by you now. Cause maybe I’m doing something wrong?

[SIZE=3][SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 0
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 0
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0
[/SIZE][/SIZE][/SIZE][/SIZE]

Hi Damon,

Yes, that’s not supposed to work. Sorry about that (Mondays). They are mutually exclusive. TRUNK_NECK actually includes a detailed cervical spine as well as the everything else.

When you say you ran the bones - does that mean you successfully solved kinematic optimization task? And what exactly is the problem now with running/loading the inverse dynamics task?

Pavel

Hi Pavel

Here is info.

ERROR(OBJ1) : 'ObjectName' : 'Error message'

Explanation:
This message is a general "object error" in which the full message text is varying from case to case and no further explanation is available here. Some of these messages are actually messages that has not yet been converted to AnyBody's new message format with their own message ID and with additional explanations. We appologize for these cases.

[SIZE=2]Associated code

[SIZE=3]AnyFolder[/SIZE] BodyModel = {

[SIZE=3]// The folder containing the selected human model output.
[/SIZE][SIZE=3]AnyFolder[/SIZE] SelectedOutput = {
[SIZE=3]AnyFolder[/SIZE] Trunk = {};
};

Steps

Loading Settings Script from : 'C:\Users\eng_d.stambolian.IEPRO.089\AppData\Local\AnyBody Technology\AnyBody.5.x.x\Settings.anyst
ERROR(SCR.SCN1) : Cannot open file : C:\Users\eng_d.stambolian.IEPRO.089\AppData\Local\AnyBody Technology\AnyBody.5.x.x\Settings.anyst
Settings file invalid and will be recreated. Using default settings.
Loading Main : "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting - Copy2\GaitFullBody.main.any"
Scanning...
Parsing...
Constructing model tree...
Linking identifiers...
Evaluating constants...
Configuring model...
Evaluating model...
Loaded successfully.
Elapsed Time : 13.360000
Closing model...
Saving modified values...
Deleting last loaded model...
...Model deleted.
Loading Main : "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting - Copy2\GaitFullBody.main.any"
Scanning...
Parsing...
Constructing model tree...
Linking identifiers...
Evaluating constants...
Configuring model...
Evaluating model...
Loaded successfully.
Elapsed Time : 12.571000


  1. InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions):
  2. ...Design variables have been updated.
  3. ...Load time positions have been re-established.
  4. ...Kinematic analysis completed. The kinematic constraints have been resolved.
  5. ...Initial conditions are fully updated.
    Total simulation time: 1.429

Macro command > runmacro "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting - Copy2\Sequence1.anymcr"

Macro command > operation Main.Studies.ParameterIdentification.ParameterOptimization

Macro command > run

  1. Operation Sequence: (Operation: Main.Studies.ParameterIdentification.Analysis):
    0.0) Kinematics (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
    0.0.0) PreOperation (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics.PreOperation):
    0.0.0) InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions):
    0.0.0) ...Design variables have been updated.
    0.0.1) ...Load time positions have been re-established.
    0.0.2) ...Kinematic analysis completed. The kinematic constraints have been resolved.
    0.0.3) ...Initial conditions are fully updated.
    0.0) Kinematic analysis...
    0.2) ...Kinematic analysis completed

Need to send in two sections, so I'll send a second reply because there is more than 10,00 characters[/SIZE]

[quote=dstambolian;15199]

Hi Pavel

Here is the rest of the info.


1.0) Optimization (Operation: Main.Studies.ParameterIdentification.ParameterOptimization):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Calculating a new search direction (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Calculating a new search direction (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
Optimization converged


Macro command > runmacro “SaveMacroOperation-Save.anymcr”

Macro command > classoperation Main.ModelSetup.SaveMacroOperation “Save AnyString to file” --file=“RunMacroOperation-Save.anymcr”

Macro command > runmacro “RunMacroOperation-Save.anymcr”

Macro command > classoperation Main.Studies.ParameterIdentification “Save design” --file=“1+ShortCaptureforTesting-OptimizedParameters.txt”

Main.Studies.ParameterIdentification : Saving design…

Macro command > operation Main.Studies.MotionOptimization.Kinematics

Macro command > run


5.0) Kinematics (Operation: Main.Studies.MotionOptimization.Kinematics):
0) PreOperation (Operation: Main.Studies.MotionOptimization.Kinematics.PreOperation):
.0) InitialConditions (Operation: Main.Studies.MotionOptimization.InitialConditions):
.0) …Design variables have been updated.
.1) …Load time positions have been re-established.
.2) …Kinematic analysis completed. The kinematic constraints have been resolved.
.3) …Initial conditions are fully updated.
5.0) Kinematic analysis…
5.19) …Kinematic analysis completed
Total simulation time: 8.93


Closing model…
Saving modified values…
Deleting last loaded model…
…Model deleted.
Loading Main : “\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting - Copy2\GaitFullBody.main.any”
Scanning…
Parsing…
Constructing model tree…
[SIZE=1]ERROR(OBJ1)[/SIZE] : [SIZE=1]//data/rf/E…n/D…s/1…n/A…3/Body/A…n/B…s/G…l/BodyModel.any[/SIZE] : [SIZE=1]BodyModel.UnhallowedCombination[/SIZE] : Combination is not allowed: Two trunks are being included.
Closing model…
Deleting last loaded model…
…Model deleted.
Model loading skipped

Hi Damon,

I thought we discussed that in the previous post. You included 2 trunks - TRUNK and TRUNK_NECK. Exclude the TRUNK_NECK from you inverse dynamics model.

I think most of the messages are self-explainable - just pay attention.

Pavel

Hi Pavel
I’m still having problems, since its not just one item to turn on and off. For trunk and trunk_neck there are muscles. Even if I could get it running, id feel uncomfortable that I may be missing something, and would want to verify with you. So could you please look at below (default AMMRV 1.3) code and recommend the correct settings for:

1- The normal case, when the muscles on back are pulling on the L5/S1 joint

2- And for the other case, to get the L5/S1 kinetics without the trunk muscles pulling on the joints.

[LEFT]//MotionAndParameterOptimiztionSequence:

// This seqeunce is used for determining the model parameters such as segment lenghts, marker positions

//

//

//InverseDynamicAnalysisSequence:

// This study sequence is used for calibrating the model and running the inverse dynamic analysis [/LEFT]

[LEFT]AnyFolder Studies ={[/LEFT]

[LEFT]#if MotionAndParameterOptimizationModel[/LEFT]

[LEFT]AnyBodyStudy KinematicStudyForParameterIdentification = {

AnyFolder &C3DData=…ModelSetup.C3DFileData ;[/LEFT]

[LEFT]AnyFolder &ref=HumanModel;

ref={

AnyFolder &Mannequin=.Mannequin;

#include “BodyPartsSetup2.any”

};[/LEFT]

HERE IS THE BODYPARTSSETUP2 CODE

[LEFT]// Trunk: 1 included, 0 not included

// *********************************

#define TRUNK 1

// This is just the bones,

// Choose one of the following options to add muscles

#define TRUNK_SIMPLE_MUSCLES 0

// Additional stiffness in the lumbar joints can be added.

#define TRUNK_DISC_STIFFNESS_NORMAL 0[/LEFT]

[LEFT]// Trunk with neck: 1 included, 0 not included

// *********************************

#define TRUNK_NECK 0

// This is just the bones,

// Choose one of the following options to add muscles

#define TRUNK_NECK_SIMPLE_MUSCLES 0

#define TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0

// Additional stiffness in the lumbar joints can be added.

#define TRUNK_NECK_DISC_STIFFNESS_NORMAL 0[/LEFT]

Inverse Dynamic Analysis

[LEFT]//This study is used for running the inverse dynamic analysis of the optimized motion

//***********************************************************************************

HumanModel={

AnyFolder &Mannequin=.InverseDynamicStudy.Mannequin;

#include “BodyPartsSetup.any”

};[/LEFT]

HERE IS THE BODYPARTSSETUP CODE

[LEFT]// Trunk: 1 included, 0 not included

// *********************************

#define TRUNK 1

// This is just the bones,

// Choose one of the following options to add muscles[/LEFT]

[LEFT]#define TRUNK_SIMPLE_MUSCLES 1

// Additional stiffness in the lumbar joints can be added.

#define TRUNK_DISC_STIFFNESS_NORMAL 0[/LEFT]

[LEFT]// Trunk with neck: 1 included, 0 not included

// *********************************

#define TRUNK_NECK 0

// This is just the bones,

// Choose one of the following options to add muscles

#define TRUNK_NECK_SIMPLE_MUSCLES 0

#define TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0

// Additional stiffness in the lumbar joints can be added.[/LEFT]

#define TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

Sincerely thanks
Damon

Hi Damon,

Yes, that seems to be ok.

But I would also recommend to try to run the inverse dynamics with the (TRUNK_NECK 1, TRUNK_NECK_SIMPLE_MUSCLES 1, TRUNK 0). Just to check that the neck muscles do not contribute.

So run the kinematic + inverse dynamics as you wrote, check the forces + re-run just the inverse dynamics analysis with another trunk configuration.

Best regards,
Pavel

Hi Pavel

Sorry for the delay, was in Boston for HFEA conference this week, kinda busy.

Below, the differences weren’t exaclty zero but were extremely small. So looks like the L5/S1 values are not affected by including the neck. So do you think it is better to use the default settings (no neck muscles) to save processing time?

Also, I tried (TRUNK_NECK 0, TRUNK_NECK_SIMPLE_MUSCLES 0, TRUNK 0). to get the joint forces without muscles, but didn’t see any changes when i compared with (TRUNK_NECK 1, TRUNK_NECK_SIMPLE_MUSCLES 1, TRUNK 0). What do you think?

L5SacrumMedioLateralForce / L5SacrumProximoDistalForce/ L5SacrumAnteroPosteriorForce
7.99E-14 / 0.00E+00 / -1.02E-12
3.20E-14 / 0.00E+00 / 1.02E-12
-2.10E-14 / 0.00E+00 / 0.00E+00
0.00E+00 /0.00E+00 /0.00E+00
-1.10E-14 /0.00E+00 /-1.02E-12
0.00E+00 0.00E+00 0.00E+00
-1.12E-13/ 0.00E+00 /-1.02E-12
3.20E-14 /1.00E-11 /0.00E+00
-6.20E-14 /0.00E+00 /1.02E-12
-1.21E-13/ 0.00E+00 /0.00E+00
-7.99E-14 /0.00E+00/ 0.00E+00
-4.50E-14 /0.00E+00 /0.00E+00
2.20E-13 /0.00E+00 /0.00E+00
-6.99E-14 /0.00E+00 /9.66E-13
9.99E-14 /0.00E+00/ 9.66E-13
1.10E-13 /0.00E+00 /0.00E+00
1.80E-13 /0.00E+00 /0.00E+00
-4.97E-14 /0.00E+00 /9.66E-13
0.00E+00/ 0.00E+00/ 0.00E+00
3.02E-14 /0.00E+00 /-9.66E-13

Hi Damon,

Yes, that would be my suggestion.

Pavel

Pavel
When I use the default code, and turn of TRUNK_SIMPLE_MUSCLES, the Model loading skipped.

Below is the code I used for Dynamic Processing to try to get L5/S1 joint reaction forces without muscles pulling on the this joint. But it didn’t work, what do you think I should do to make this work?

[SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 0
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 0
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

Hi Damon,

It did not become clear :slight_smile: What error do you get?

Pavel
I discovered why it was skipping, was because there was some ouput code for the trunk muscles. So when the trunk muscles are off then the ouput code was lost. So I fixed this and below is the L5/S1 output with muscles on and with the muscles off, and the average of the difference of those values. looks much less without muscles, so appears we are on the right track. How does this look to you?

The average of the difference between muscles on and muscles off is:

L5SacrumMedioLateralForce = 3.50
L5SacrumProximoDistalForce = 781.52
L5SacrumAnteroPosteriorForce = 337.12

Trunk Muscles on:

[FONT=Times New Roman]L5SacrumMedioLateralForce L5SacrumProximoDistalForce L5SacrumAnteroPosteriorForce
3.32 1362.97 307.48
0.15 1340.26 303.94
-0.15 1340.75 304.32
-0.77 1338.95 304.47
-0.26 1346.91 306.17
-0.06 1351.25 307.17
0.12 1355.30 308.12
0.30 1359.29 309.05
0.49 1363.20 309.92
0.68 1367.00 310.77
0.85 1370.48 311.56
1.00 1373.64 312.29
1.15 1376.72 313.01
1.30 1379.73 313.71
1.45 1382.89 314.44
1.61 1386.22 315.19
1.76 1389.21 315.86
2.43 1390.19 315.49
2.76 1391.39 315.61
4.30 1385.31 312.98

[/FONT]

Trunk Muscles Off:

L5SacrumMedioLateralForce L5SacrumProximoDistalForce L5SacrumAnteroPosteriorForce
15.54 587.66 -27.31
-4.15 596.70 -20.42
-6.25 598.42 -19.52
-10.89 603.55 -16.86
-8.15 596.96 -20.00
-7.36 593.82 -21.34
-6.97 591.99 -22.55
-6.57 590.14 -23.76
-6.18 588.26 -24.96
-5.78 586.37 -26.16
-5.40 584.65 -27.25
-5.02 583.09 -28.23
-4.65 581.53 -29.20
-4.27 579.94 -30.17
-3.89 578.34 -31.13
-3.51 576.73 -32.09
-3.13 575.26 -32.95
3.39 575.73 -32.48
5.90 575.69 -32.45
19.82 576.48 -31.93

Sincerely thanks
Damon

Hi,

Yes, that seems to be ok.

Pavel.

Hi Pavel

I think I should go ahead and have the neck muscles on too. I tried the code below and the program worked for the bones, but not for the muscles. I sent you some other messages about this. What do you think is causing it not to work?

BONES:

[SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 0
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 0
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

MUSCLES:

[SIZE=3][SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 0
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 1
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0
[/SIZE]

Hi Damon,

Please be more specific on what it is that does not work when the muscles in the neck are included, i did not get this.

Best regards
Søren

Hi Søren

When I tried to load the below code for InverseDynamicModel, (for neck and trunk muscles on)... the model loading skipped. What do you think needs to be done to fix this. Sincerely thanks, Damon

This is the code for InverseDynamicModel:

[SIZE=3]// Trunk: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK 0
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_SIMPLE_MUSCLES 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_DISC_STIFFNESS_NORMAL 0

[SIZE=3]// Trunk with neck: 1 included, 0 not included
// *********************************
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK 1
[SIZE=3]// This is just the bones,
// Choose one of the following options to add muscles
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES 1
[SIZE=3]#define[/SIZE] TRUNK_NECK_SIMPLE_MUSCLES_ONLY_ON_NECK 0
[SIZE=3]// Additional stiffness in the lumbar joints can be added.
[/SIZE][SIZE=3]#define[/SIZE] TRUNK_NECK_DISC_STIFFNESS_NORMAL 0

The is the responses to the program:

[SIZE=1]Loading Main : "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting_Arm Muscles_on - Neck on\GaitFullBody.main.any"
Scanning...
Parsing...
Constructing model tree...
Linking identifiers...
Evaluating constants...
Configuring model...
Evaluating model...
Loaded successfully.
Elapsed Time : 19.038000


  1. InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions):
  2. ...Design variables have been updated.
  3. ...Load time positions have been re-established.
  4. ...Kinematic analysis completed. The kinematic constraints have been resolved.
  5. ...Initial conditions are fully updated.
    Total simulation time: 3.484

Macro command > runmacro "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting_Arm Muscles_on - Neck on\Sequence1.anymcr"

Macro command > operation Main.Studies.ParameterIdentification.ParameterOptimization

Macro command > run

  1. Operation Sequence: (Operation: Main.Studies.ParameterIdentification.Analysis):
    0.0) Kinematics (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
    0.0.0) PreOperation (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics.PreOperation):
    0.0.0) InitialConditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.InitialConditions):
    0.0.0) ...Design variables have been updated.
    0.0.1) ...Load time positions have been re-established.
    0.0.2) ...Kinematic analysis completed. The kinematic constraints have been resolved.
    0.0.3) ...Initial conditions are fully updated.
    0.0) Kinematic analysis...
    0.2) ...Kinematic analysis completed

1.0) Optimization (Operation: Main.Studies.ParameterIdentification.ParameterOptimization):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Calculating a new search direction (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Calculating a new search direction (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Calculating a new search direction (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating KKT conditions (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
0) Evaluating the objective function (Operation: Main.Studies.KinematicStudyForParameterIdentification.Kinematics):
Optimization converged


Macro command > runmacro "SaveMacroOperation-Save.anymcr"

Macro command > classoperation Main.ModelSetup.SaveMacroOperation "Save AnyString to file" --file="RunMacroOperation-Save.anymcr"

Macro command > runmacro "RunMacroOperation-Save.anymcr"

Macro command > classoperation Main.Studies.ParameterIdentification "Save design" --file="1+ShortCaptureforTesting-OptimizedParameters.txt"

Main.Studies.ParameterIdentification : Saving design...

Macro command > operation Main.Studies.MotionOptimization.Kinematics

Macro command > run


5.0) Kinematics (Operation: Main.Studies.MotionOptimization.Kinematics):
0) PreOperation (Operation: Main.Studies.MotionOptimization.Kinematics.PreOperation):
.0) InitialConditions (Operation: Main.Studies.MotionOptimization.InitialConditions):
.0) ...Design variables have been updated.
.1) ...Load time positions have been re-established.
.2) ...Kinematic analysis completed. The kinematic constraints have been resolved.
.3) ...Initial conditions are fully updated.
5.0) Kinematic analysis...
5.19) ...Kinematic analysis completed
Total simulation time: 12.226


Closing model...
Saving modified values...
Deleting last loaded model...
...Model deleted.
Loading Main : "\data\rf\ENG_d.stambolian\Documents\1-AnyScripts_Damon\AMMRV1.3\Application\1+ShortCaptureforTesting\1+ShortCaptureforTesting_Arm Muscles_on - Neck on\GaitFullBody.main.any"
Scanning...
Parsing...
Constructing model tree...
Linking identifiers...
Evaluating constants...
Configuring model...
[SIZE=1]ERROR(OBJ1)[/SIZE] : [SIZE=1]//data/rf/E..n/D..s/1..n/A..3/A..n/1..g/1..n/JointsAndDriversOptimized.any[/SIZE] : [SIZE=1]NeckDrv.Reaction.Type[/SIZE] : Number of elements in type specification must match number of elements in force vector (num. elem = 3)
Closing model...
Deleting last loaded model...
...Model deleted.
Model loading skipped

This is what the link pointed to for the above error(OBJ1)

[SIZE=3]

[SIZE=3][COLOR=#0000ff][SIZE=3][COLOR=#0000ff]AnyFolder[/SIZE] JointsAndDrivers = {

[SIZE=3]// Aliases for convenient referencing
[/SIZE][SIZE=3]AnyFolder[/SIZE] &JntPos=..Mannequin.Posture;
[SIZE=3]AnyFolder[/SIZE] &JntVel=..Mannequin.PostureVel;

[SIZE=3]AnyKinEqSimpleDriver[/SIZE] NeckDrv={
[SIZE=3]AnyKinMeasureOrg[/SIZE] &ref1= ...HumanModel.Interface.Trunk.NeckJoint;
DriverPos={0};
DriverVel={0};
Reaction.Type={Off};
};

[/COLOR][/SIZE][/COLOR][/SIZE][/SIZE]

Hi Damon,

You have optimized the motion using the neck model as far as i can see.

Then when you are trying to run inverse model the number of dof in the measure for the neck do not macth the driver.

The measure you are using in the driver has three dof as the error says:
Number of elements in type specification must match number of elements in force vector (num. elem = 3)

And the driver only drives one dof.

So you have to look for the definition of the neck joint you are using…

i looked it up, this is the def.

[SIZE=3]AnyJoint[/SIZE] &NeckJoint = …Trunk.JointsCervicalSpine.T1C7Jnt;

This is a spherical joint so you need to drive three rotations.

Please make sure that you output all joint angles for the neck when you run the kinematic analysis and then make sure that you are using them again for the inverse dynamic analysis.

Best regards
Søren