Code for applying external forces

Hello, I am a student working on a project analyzing the use of an exoskeleton in sit-to-stand motion. To do this, intend to add a time-dependent external forces from a force platform to represent a chair under the subject, as well as a point moment around the knee area.

Below is the code we have right now, but it doesn't seem to be affecting the data. I am not a professional/expert in the AnyBody software, so I don't completely understand it. If anyone can give me tips or help me debug the code, that would be greatly appreciated!

AnyRefNode Chair={
AnyDrawNode drw={

AnyFolder Loads = {
AnyForce3D InterpForce = {
AnyFunInterpol force = {
Type = PiecewiseLinear;
FileName = "test.txt";
AnyRefFrame &Point=Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Chair;
AnyVector Fz = force(t);
F= {0, Fz[0],0};


AnyForce KneeMoment={
AnyKinMeasure &Knee = Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur;

Hi @caratran

The code snippets you send seems to be doing what you intend them to do.
What you could check is whether or not you have any reaction forces on the pelvis that counteract the force you imply on the seat.

As for the knee moment you have applied it to the patella-femur joint and not the knee joint which might be why you see no effect.
Try to use AnyKinMeasure &Knee = Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee; instead.

Best regards,

Hello Bjørn,

Thank you for your response. I tried that edit, however it didn't seem to work. I'm wondering if this is because the forces/moments are being applied internally in which an equal reaction is implemented by AnyBody, preventing it from affecting the overall motion of the body model. Is there a specific method to applying forces/moments externally instead of internally?


Hi @caratran

You could be right that there is a AnyReacForce active on that degree of freedom.
You can inspect the mechanical system information window as described here.

It a little hard to pinpoint the exact problem as it is dependent on the settings you have.
If possible you can try to send me a working example of the model.

Best regards