# MoCapModel of legpress on a flywheel device

Hi,

I am working with the MoCapModel (AMMR version 1.6.3) and I have a problem with an external force I want to add. The force is a traction force working from the sternum and I have estimated it by inverting the reaction forces I got from used force plates. I have the force data in a space separated .txt file (YOYOERIKA_TractionForce_ss) with the values in columns of t, x, y and z. However I find a few problems. The illustration of the force is constant through the whole simulation, I guess it just takes the first value in the text file. How can I get it to pick all values, values corresponding to the right time?
Here comes next problem. In my trial specific data I have stated a Front- and LastFrameOffset. When I run my model the force is still the one representing the first frame. How will I get the force vector F to pick the right time?

I am not really completely understanding what t in force(t) stands for. Is that an internal character for the time collected from the first column in the text file?

I have implemented the external force in the Environment.any file with the following code:

AnyForce3D InterpForce = {
AnyFunInterpol force = {
Type = PiecewiseLinear;
FileName = “YOYOERIKA_TractionForce_ss.txt”;
};
AnyRefNode &SternumNode = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsTh orax.ThoraxSeg.RACP_CO6Node;
F = {force(t)[0],force(t)[1],force(t)[2]};
AnyDrawVector DrawForce = {
AnyRefFrame &ref = .SternumNode;
Vec = .F*1/1000;
Line = {
Style = Line3DStyleFull;
Thickness = 0.01;
RGB = {0,1,0};
End = {
Style = Line3DCapStyleArrow;
RGB = {1,0,0};
Thickness = 0.02;
Length = 0.04;
};
};
};
};
};

You can find the necessary and changed files of the MoCapModel repository in the attached zip-folder.

Kind regards,
Maria

Hi Maria,

I’ve tried to run your model.

1. First, I would change your code as follows:
``````  AnyFolder Loads = {
AnyForce3D InterpForce = {
AnyFunInterpol force = {
Type = PiecewiseLinear;
FileName = "YOYOERIKA_TractionForce_ss.txt";
};
AnyRefNode &SternumNode = Main.Studies.HumanModel.BodyModel.Trunk.SegmentsThorax.ThoraxSeg.RACP_CO6Node;
F = {force(Main.Studies.InverseDynamicStudy.t)[0],force(Main.Studies.InverseDynamicStudy.t)[1],force(Main.Studies.InverseDynamicStudy.t)[2]};
AnyDrawVector DrawForce = {
AnyRefFrame &ref = .SternumNode;
Vec = .F*1/1000;
Line = {
Style = Line3DStyleFull;
Thickness = 0.01;
RGB = {0,1,0};
End = {
Style = Line3DCapStyleArrow;
RGB = {1,0,0};
Thickness = 0.02;
Length = 0.04;
};
};
};
};
};
``````
1. When I look your ‘YOYOERIKA_TractionForce_ss.txt’ file, the left column(time column) looks strange.
It should replicate the real time vector which can be compatible with the time of AnyBodyStudy class object.
But the values in your file are too big.
I would suggest you to modify those values.

Best regards,
Moonki

Thanks a lot Moonki, that solved my problem perfectly

Kind regards,
Maria