GaitFullBody Load Optimized parameters

Hi all,

I am using a modified version of the GaitFullBody model and am looking for some help on the following:
How can I load optimized parameters from a previous trial before analyzing the kinematics? Basically I don’t want to optimize parameters for the same subject seperately for 16 different c3d files. The marker positions and segment lengths are the same for each c3d file and I am looking for an easier way to load the same optimized parameters for each trial. That way only the kinematics are analyzed separately for each trial.

In other words:
Right now for the RunMotionAndParameterOptimizationSequence, the model first optimizes segment lengths and marker positions, and then determines motions from these. After switching to the InverseDynamicAnalysisSequence, it loads these parameters (and opt motion) and runs inverse dynamics.
I want the first sequence to load the already determined optimized parameters, and then run only the kinematics determination.

Thanks for the help!
John O’

Hi John,

there are a couple of things that can be done, however, there is no guarantee that this will work.

  1. I suggest that you use the optimized values from the text file xyz-processed-OptimizedParameters.txt. and use them as initial guesses for segment lengths (in TrialSpecificData.any) and even marker positions (in ModelSetup.any). This will make your initial guess much better and will lead to a faster MotionAndParameterOptimisation!

  2. You could also swith off the individual optimisations of segments and marker positions, but there is a high chance, that the model will not solve kinematically due to small in-accuracies:

a. in the model setup you can define which segments you want to optimize:
OptimizeAnthropometricsOnOff OptimizeOnOff (
PelvisWidthOnOff =“On”,
ThighLengthOnOff=“On”,
ShankLengthOnOff=“On”,
FootLengthOnOff=“On”,
HeadHeightOnOff=“Off”,
TrunkHeightOnOff=“On”,
UpperArmLengthOnOff=“On”,
LowerArmLengthOnOff=“On”,
You could swith them to off after you entered the segment lengths from the first trial.

b. the same could be done to the marker positions take the optimized values from the text file and enter them in the ModelSetup.any
You could switch them also to off, but I do not think that the model will be able to solve kinematics.


Hi John,

What you want to do, I have done in a couple of models and the solution is not too difficult. What you need to do is to create a new operation sequence that loads the optimized parameters from your calibration trial (<trialname>-OptimizedParameters.txt), and then executes the initial conditions first and then the kinematic analysis of the MotionOptimization study, which then saves the joint angles to the appropriate files. Also, you need to create a similar macro sequence in the inverse dynamic analysis model that loads the optimized parameters and then executes the inverse dynamic analysis.

If you are having trouble, please feel free to send me an email (msa at m-tech.aau.dk) and I will dig out the appropriate code for you.

Best regards
Michael Skipper Andersen
Associate Professor
The AnyBody Research Group