Direction of the model

Hi,
I loaded the C3D file to the gait model, and the file is captured by vicon. It can be seen from the picture that there is something wrong with the direction. How to modify the code to solve the problem, please?
Addationally, I removed the forceplate file in the model, as it dosen’t exist in the c3d files. Could the inverse dynamics calculation be run in this case?

Looking forward to your reply.Thank you very much.

Best wishes.
Jing

The first problem is solved by modify the PelvisPosX/Y/Z and Pelvis Pos in the mannequin.any!

But there is an error when run MotionAnd ParameterOptimizaiton Sequence:

ERROR(OBJ.MCH.KIN3) : C:/P…s/A…y/A…0/AMMR/A…n/E…s/M…y/M…l/Kinematics.any(23) : KinematicStudyForParameterIdentification.Kinematics : Kinematic analysis failed in time step 27
…(Many lines saying like this: Constraint no. 555 above error tolerance 0.000001, error = 0.000012.
)
ERROR(OBJ.MCH.KIN3) : C:/P…s/A…y/A…0/AMMR/A…n/E…s/M…y/M…l/Kinematics.any(74) : MotionOptimization.InitialConditions : Kinematic analysis failed in time step 0

Could you tell me how to solve the new problem?

Thank you!

Hi,

It is hard to say what the problem is exactly without looking into it. But on the screenshot I see that there might be an error in your ankle markers - they seem to be flipped. Unfortunately I cannot suggest more without having a better picture or the model itself.

Sometimes you could try to exclude some of the markers to see whether they cause problem or not.

Regards,
Pavel

Hi,

Thank you for your advice. Now the inverse dynamics analisis is achieved! It’s pretty a good idea to set the markers on precise location and delete a few unimportant markers.

In addition, could you give a brief explanation about how dose the "AnyOptKinStudy " run when it’s used in the MoCapModel, and what dose “ParameterOptimization.ConvergenceTol=1e-2” and " Kinematics.MaxIteration " refer to?

Kinematics.PosAnalysisOnlyOnOff=On; //only run the position analysis
InitialConditions.KinematicTol=1e-3;
Kinematics.KinematicTol=1e-3;
InitialConditions.SolverType = KinSolOverDeterminate;
Kinematics.SolverType = KinSolOverDeterminate;
InitialConditions.MaxIteration = 20000;
Kinematics.MaxIteration = 20000;
};
// Second Sub-Study to optimize the Parameters**// Usually no need to make changes
AnyOptKinStudy ParameterIdentification = {
AnyFolder &StudyRef = .KinematicStudyForParameterIdentification;
ParameterOptimization.ConvergenceTol=1e-2;
Analysis = {
AnyOperation &ref = .StudyRef.Kinematics;
};
};

Thank you so much!

Regards,
Jing

Hi Jing,

ParameterOptimization.ConvergenceTol as it is probably clear from the name is a tolerance factor, which specifies when parameter optimization is converged. You could think of it as a change of the objective function value between two consequent optimization iterations.

Kinematics.MaxIteration - Is a maximum allowed number of iterations when solving kinematic analysis.

This information is also available in the ref. manual, that can be found by pressing F1 on the object of interest :wink:

Regards,
Pavel

Hi Pavel,

Thank you so much for your reply.

I’ve found the description of AnyKinStudy in the ref.manual.It’s helpful!

I just wondering wether the users of AnyBody can see the algorithms and the nonlinear equations which are used during the calculation, or they’ve been packaged and are invisible. If they are invisible, on what basis the users to set the certain parameters, for example, whether the "Kinematics.MaxIteration = 20000 " or “=30000”, “Kinematics.KinematicTol=1e-3” or “=1e-2”?

Thank you. Looking forward to your reply.

Regards,
Jing

Hi Pavel,
I meet another problem and hope you can help me.
In my C3D data, only data captured by vicon are included, not force plat data.And the external forces impacted on the hip are recorded by another device, saved as notepad++ files.
My question is that, can we import the data in Text file format into AnyBody? and how to do it? By the way, I just want AnyBody to use certain data in the files, not all of them.
I’m thinking about changing the input of the ForcePlate( lineated in the following) to read the data from NotePad++ files. Do you think it is realizable?

ForcePlateType4AutoDetection Plate1 (
PlateName = Plate1,
Folder =Main.ModelSetup.C3DFileData,
Limb1= .BodyModelRef.Right.Leg.Seg.Foot,
Limb2= .BodyModelRef.Left.Leg.Seg.Foot,
No=0,
VerticalDirection =“Y”,
HeightTolerance=0.07,
VelThreshold=2.2,
Fx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fx1,
Fy=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fy1,
Fz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fz1,
Mx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Mx1,
My=Main.ModelSetup.C3DFileData.Analog.DataFiltered.My1,
Mz=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Mz1,

FootPresent=HumanModelPresent)
={
Cal=Main.ModelSetup.C3DFileData.Groups.FORCE_PLATFORM.CAL_MATRIX.Data[0];
Switch_DrawForceVectorFromCOP =On;
};

Thank you for your patient reply.

Best wishes.
Jing

Hi Jing,

Kinematic tolerance is an allowed kinematic error in other words. If you are ok with markers to be deviating by 1cm - then 1e-2 is ok. Please keep in mind that this tolerance can also be used for angular measures, e.g. 1e-2 radians. You don’t really need to know what kind of solvers are being used and what is happening inside.

MaxIteration - can somehow be dependent on the convergence rate of the solver, however, normally these large numbers should be sufficient for any problem.

For more information please read publication on our website, for example here a brief explanation of kinematic solver is given:

[read section 2.6](file:///C:/Users/peg/Downloads/rasmussen_2003a_designing%20a%20general%20software%20system%20for%20musculoskeletal%20analysis.pdf)

For the second message:

You can simply exclude those forceplates by commenting them out.

Please have a look at examples of AnyFunInterpol, AnyForce/AnyForce3D - you can apply an external force using objects of these classes.

Kind regards,
Pavel

Got it !
Thank you so much for your kind and patient reply, Pavel.

Best wishes.
Jing

Hi Pavel,

I found that load the force by AnyForce3D is a great idea to achive my goal!:slight_smile:

We can set the 3Dforce by filling in the big parantheses of F = {0.0, 0.0, 0.0};.

While, as my experiment data of a lot of subjects are saved in the form of NotePad++ files, seen the attachment.
I hope that my AnyBody model could read the force of Rest0, Fx=12.38N, Fz=-194.17N into AnyForce 3D function, instead of type into the data one by one.

Is there a solution to read the certain data of a NotePad++ file into AnyBody? Could you give me some advice to achive it?

Eagerly look forward to your reply. Thank you so much!!!

Sincerely,
Jing

Hi Jing,

First of all, i don’t see the attachment so can’t actually see the format of this data.

But if you mean that you have tables in that Notepad++ files - you can probably read them in. AnyFunInterpol can use a CSV file to construct Time and Data arrays with your experimental readings to construct an interpolation function that you can further connect with your AnyForce3D object.

Kind regards,
Pavel