# AnyVar = f(t)

Hi,

i have got a question which is hopefully not too simple.

I would like to output a variable AnyVar, which is derived from two model coordinates and which changes during the analysis.

Unfortunately all i get is the final value from the end of the calculation. I thought AnyVar is a scalar with respect to one step but a vector (with nStep components) with respect to the complete analysis.

The variable is the horizontal distance of two coordinates. I calculate it by
AnyVar dist = (Main…r - Mai…Pos)[0];

How can i easily solve this problem?

Thanks,

Thomaz

Hi Thomaz,

I would recommend you to try to define an AnyOutputFun object in your AnyBodyStudy class object. Then you can use that function outside of that study.

To be honest, I’m not so sure about what the intention of your question is.

Best regards,
Moonki

Hi Moonki,

hope i do not bother you.

My code looks like this:

AnyBodyStudy Study = {
AnyFolder &Model = .Model;
tEnd = 3;
Gravity = {0.0, -9.81, 0.0};
nStep = 10;
AnyVar DesiredValue = Main.Model.something.r[0]-Main.Model.somethingelse.r[0]);
}; // End of study
}; //Main

DesiredValue is but one scalar number. I expected that it should have 10 numbers according to nStep (=10) because the two r[0] values change within the 3 seconds i analyse.

As far as i can see, AnyOutputFun is just for solving a symantic problem. Or does it help here?

Thanks,

Thomaz

Hi Thomaz,

I think you should clarify what you want to do with the full history of that value first.

1. If you only want to ‘extract’ the full history of that value, then you can open an AnyChart and pick your value and export it into some file formats such as text file.

2. If you want to use that value in other AnyBodyStudy object, then you should define your own AnyOutputFun function.
In the ‘\AMMR\Application\Validation’ folder there is an example called ‘GaitVaughan’ which used this AnyOutputFun function for post-processing.

Best regards,
Moonki

Hi Moonki,

0.) It is a lever arm which changes with time and which i want to evaluate externally from AB.

1.) Thanks, that works fine.

2.) No, i don’t not need the value somewhere else within AB.

To be honest, i am not so much (or not only) interested in the solution of my question but more in understanding why my variable is just a scalar while other time dependent values are provided nStep times (e. g. the joint reaction forces). I prefer to understand things more than having just a solution for a single question. Could i have found the answer to this somewhere systematically in the documentation?

Thanks,

Thomaz

Hi Thomaz,

It seems that your are looking the values in the different locations.

1. In your AnyBodyStudy class object, there is the folder ‘Output’ of which type is AnyOutputFolder class. You can see the description of this AnyOutputFolder class in the reference manual.

2. In this Output folder, the values which you can see are in type of ‘AnyOutputFloat’. Also you can find the description of this class.

3. If you try to see the value of a variable in the model tree instead of this Output folder, then you can see only single value.