AnyOutputFile

Hi all,

I have a very simple question. How can I output variables which are not standard outputs, for example:

AnyVar OutputParameter = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Sha nk.Izz;

If I use the anyoutputfile, the value does not show up… And the AnyValue doesn’t work.

Thanks in advance :),

René Fluit

Hi René,
Just exchange the AnyValue with AnyFloat and it will work.
E.g.:
AnyOutputFile test =
{
FileName = “test_out.txt”;

  AnyFloat Iz = Main.ArmModel.Segs.UpperArm.Jii;
  };

Best regards,
Sebastian

Hi René,

The reason that Jii does not appear in the output as a function of time is that it is a constant and not dependent on time.

It will appear in the constant section of the output file, if the “ConstSectionOnOff” is on, it may look like this

---- AnyBody Output File ---------------------------------
Study: Main.MyStudy
Operation: Main.MyStudy.Kinematics

Constants (Name = Value):
Main.MyStudy.test.FileName = “test.txt”

Main.MyStudy.test.mass = 1.000000000000000e+000

If you prefer to have it as a constant for each time value you need to trick the system to think it has a time variation. This can be done by multiplying and dividing by the time like this.

  AnyVar mass= .Main.MyModel.Pendulum.Mass*.Main.MyStudy.t/.Main.MyStudy.t;

Then the mass will appear for each time step… this setup will cause division by zero problem if you start time is zero.

Best regards
Søren

Soren and Sebastian, thanks for the quick answer!

If I want to output both time-dependent and time-independent variables, the structure of the output file (*csv) messes up somehow.
So I now use two output files for both types of variables.

René