Output Formatting

Hi Pavel

Going to the formatting of the output. Below is the text from the output file that has the initial conditions for the joint angles. My question before was how to format this output file information into columns so I can easily get just the numerical values. The reason for this is…

---- AnyBody Output File ---------------------------------
Study: Main.Studies.ParameterIdentification
Operation: Main.Studies.ParameterIdentification.ParameterOpti mization

Constants (Name = Value):
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.FileName = “1_INITIALCONDITIONS_v1.txt”
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.NumberFormat.Digits = 15
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.NumberFormat.Width = 22
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.NumberFormat.Style = ScientificNumber
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.NumberFormat.FormatStr = “%22.15e”
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Search =
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.SepSign = “,”
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.LineSepSign = “”
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Header.TitleSectionOnOff = On
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Header.ConstSectionOnOff = On
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Header.VarSectionOnOff = On
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Header.ColumnNamesOnOff = On
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.Header.LinePrefix = “”
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.PelvisRotZ = {-2.860987123693359e-002}
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.PelvisRotY = {-3.329400399204128e+000}
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.PelvisRotX = {-1.451082411952960e+000}
Main.Studies.KinematicStudyForParameterIdentificat ion.OutputFile.R_GlenohumeralFlexion = {8.492907734462563e-001}
ETC…

I’ve been transferring these above values to the below code in he model, to get a more accurate initial condition. Doing this is reducing the time it takes to process the bones.

But transferring these values also takes some time, and mistakes can be made. So do you have any suggestions how this can be done with the programming?

THIS IS THE CODE IN THE Model, I’ve been replacing the values below with the values from the output file.

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

[SIZE=3]AnyVar[/SIZE] PelvisRotZ = 180;
[SIZE=3]AnyVar[/SIZE] PelvisRotY = -15;
[SIZE=3]AnyVar[/SIZE] PelvisRotX = 95;

[SIZE=3]AnyFolder[/SIZE] Right={
[SIZE=3]AnyVar[/SIZE] GlenohumeralFlexion =-10;
ETC…
[/COLOR][/SIZE][/COLOR][/SIZE]

from another thread.

Sorry I answered in the other thread. So this below is more information from that string.

/*
AnyValue is an abstract (programming term) class, meaning that you can not use it directly, but only to create reference for other basic object types. You can keep using AnyFloat or AnyFloatVar.
*/

Hi

The output values are now in scientific, so I then need to convert these with this equation “output*180/PI()”, to convert from radians to get the correct format to update the TrailSpecificData in the GaitFullModel.

So what can I do to improve the code so the values come out in the correct format. So I don’t have to make these conversion from scientific radians to… angles.

Sincerely thanks
Damon [SIZE=3]

[/SIZE]

Damon,

Scientific or other formats have nothing to do with the unit conversion. It is just the way the numbers appear in your output:

DecimalNumber Fixed decimal point.
ScientificNumber Scientific notation using 'e' to seperate the decimal and the exponential part.
CompactNumber Automatic selection depending on which format is more compact.

You would still need to do the unit conversion yourserlf - it is not much work and you have posted the formula.

Regards,
Pavel

Hello AnyBody Team,

I am using AnyOutputFile to collect float datas in order to use them later. I am getting each segments mass, center of mass, inertia matrix, and each joints position.

By switching flags in the header section, I am able to get only float numbers seperated by white spaces for CoM and joints positions (see attached file)

However, when it comes to segment masses and inertia matrix, I can’t get only the numerical values at the bottom of the text file (see attached file 2).

Is there any way I could do this ?

Thank you very much in advance.

Uranon