How to input a vector of values into AnyForce?

Basically, what I intend to do is to create a moment in the ankle joint with the following code:

AnyForce AnkleStiffness = {
 AnyKinMeasure &lin = Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Ankle;
 AnyInputFile Data_file = {FileName = "Moments.txt";};
 AnyVector M = Data_file.T;
  F = M;

// F = {-2*lin.Pos[0]};
};

Basically, I have created a vector of moments M that needs to be applied to the ankle joint. When I run the code, I get this error:

AnkleStiffness.F : Size of F does not match the number of force components in this AnyForce objects

I have already ensured that the number of values in the vector M is the same as the number of values in, for example, vector Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Pos[0]. I did this by displaying a chart of the vector Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Pos[0], obtaining the values of the chart in text form, and counting how many values are in the vector. I am pretty sure that the reason for this error is that I am not supposed be assigning F as a whole vector of values, but as a single value at each frame. For example, writing F = 2*t works.

Any help would be appreciated,
Háski.

Dear Háski,

It seems that you try to apply the moment profile on the Ankle joint (1DOF).

Then it means that your ‘Moments.txt’ file should contain only one column for the moment.

If your ‘Moments.txt’ file contains two columns, for instance, one for time and the other for the moment, then you can define your own AnyInterpol object and use it inside your AnyForce object.

If you can’t solve your problem then please upload your model in our debug section:
http://forum.anyscript.org/forumdisplay.php?f=21

Best regards,
Moonki