How to create a Chart with MoCap Frame Nos in the abscissa

Hi,

I would like to plot variables (e.g. Fm) with the MoCap frame numbers as the abscissa instead of time.

I have created a AnyVector with the same number of frames as my C3D file.

In order to plot this as the abscissa, should this appear in the Model Tree of the Chart? Currently, this vector appears in the Studies section of the Model Tree but not in the Studies section of the Model Tree of the Chart. If a vector of frame numbers need to be in the Studies section of the Chart, please tell me how to do this.

Thanks for your help.

Paul

Hi Paul

Welcome to the AnyScript forum!

You can generate a new abscissa that represents the frame number like this:

Main = {
  Main.Studies.InverseDynamicStudy = {
    AnyInt FrameN = iStep + Main.ModelSetup.TrialSpecificData.FirstFrame +3;
  };
};

Please note that the inverse dynamics study excludes the first 3 and last 3 frames to avoid artefacts due to interpolation functions at the edge of the study.

I hope this helps.

Best regards,
Dave

Hi Dave,

Thanks for your quick reply.

I found it works if you use AnyFloat instead of AnyInt. With AnyFloat you get the frame numbers in the tree in the Chart View, which can then be used for the abscissa.

Regards,
Paul

Hi Paul,

That sounds a little bit strange to me. Changing the variable type should not have a consequence on whether it shows in the ChartView model tree. That depends on if the variable is actually updated in the study or not. So, any kind of constant value should not show up in the ChartView, independent of whether it is AnyInt or AnyFloat.

Normally, a hack that you can use to show a constant value in the chart view is by adding 0*Main.Study.t to the value. This forces the value to be evaluated at each time step and then it will show on the Chart View.

Best regards,
Dave