Problems with External Force Not Effecting Model When Running


I am applying an external force to the shank and trying to see how much it displaces because of the applied force.

I have been able to run an inversedynamics analysis successfully in my model; however, when the model runs my external force does not seem to be doing anything. When I increase the load it reacts the same or doesn’t run at all. When I change the load to zero it gives me the same response as when the load is set to a 100 N. When I change the load to -100N it gives me the same response as the load with 100N. This makes me think that my external force is not working correctly.

*I was wondering if you could help me figure out why my external load/force does not seem to be causing any reaction/displacement in my model? It might be the way I created the external force in my code, so if you could look at my code and see if I did something wrong that would be great. The external force is located towards the end of my code.

*I was also wondering if you could help me figure out why my analysis fails when I increase the force above 200N?

My model is attached below. Any suggestions would be greatly appreciated.

I am using AnyBody 6.0.4.

Michael Stokes

Michael, please remember that, in inverse dynamics, movement is input and the forces are output. In the analysis you propose above, movement seems to be the output. That type of analysis requires forward dynamics, which AnyBody does not do.

When you add an external force to the model, it does not change the imposed motion. It only changes the muscle and reaction forces in the system such that the model can continue to perform the same motion despite the load you have Applied.

Best regards,

John, thank you for your reply. I believe AnyBody has the capabilities of performing Force Dependent Kinematics, is that correct? I know there is a tutorial on Force Dependent Kinematics. Would you consider my model a Force Dependent Kinematic model because I am applying an external force and then trying to determine the kinematics that results from that force?

You were correct when you mentioned that inverse dynamics takes motion as the input and outputs force. With that being said inverse dynamics is probably not the best analysis for me to run. What type of analysis would you suggest running in order to get Force Dependent Kinematics to work?

Michael Stokes

Force-Dependent Kinematics (FDK) is indeed a type of analysis where the displacements depend on the forces in the system. FDK is in essence a mix between forward and inverse dynamics. Its practical limitation is that the unknown displacements must be those that are balanced by (nonlinear) elastic structures, while the known displacements are large movements, primarily joint articulations.

In your case, if you want to figure out how the cartilage deforms in a joint as a result of the applied load to the shank, then you could use FDK. However, if the applied load to the shank changed the joint articulations, then you cannot.

We can understand the difficulty of simulating the latter case if we imagine what happens in practice: Let us assume a person is walking and encounters a sudden force at the shank. This will change the movement and the central nervous system will perform a series of very complex actions designed to maintain balance and restore a normal gait pattern. To my knowledge, no current technology can accurately predict how the central nervous system handles such a case.

John, thank you for your reply again.

I am not looking for the gait with an external force. I am trying to perform a knee laxity test. It is similar to when a doctor is trying to determine if somebody tore their ACL. A doctor holds the thigh in place and then applies a force on the shank from behind and notices how far anteriorly it displaces. This displacement tells the doctor weather the ACL is torn or not because the ACL prevents this dislocation from occurring to far. This is what I am trying to create so then I can measure that displacement.

Do you think this is possible using FDK? I am not creating a gait and the ligaments are the elastic structures you were talking about. The only thing is there is no joint articulation just a small displacement.


Okay, I think I may have misunderstood the title of your original post: “(…)Not Effecting Model When Running”. I thought you were developing a model of humans running and that the leg was hit by some sort of force during the running cycle. Sorry about that.

Knee laxity of precisely the kind of thing that FDK was developed for. You will need a detailed knee model with ligaments, condyle contacts, meniscus and such. It is no small task to gather all the necessary information for the model.

Best regards,

Sorry for the confusion John. I see now that I did not come up with the best title, that is my fault. By running I just meant running my simulation.

That is great news that knee laxity is possible using AnyBody. I believe I have created a pretty detailed model so far that should be able to perform knee laxity; however as I mentioned in my first post the knee is not displacing with my external force.

I have created an ACL and PCL using an AnyKinPLine. These ligaments are calibrated before my study runs, using RunApplication.

Condyle Contacts:
I believe I have created contact using AnyKinEqSimpleDriver as well as AnyForceSurfaceContact. Is this correct?

I do not have a meniscus because I have inserted implant parts for a TKR instead.

External Force:
I have also created an external force using AnyForce3D.

John if you or any user of AnyBody could take a look at my model and see if it is created correctly for knee laxity simulation, I would appreciate that. Also if you could try to determine why my external force does not seem to be working that would be great.

Any suggestions or advice from anybody for this knee laxity model would be greatly appreciated.


Michael, I am sorry but I do not have time to debug your model. But I can give you some advice.
1, Are you sure that you are actually executing an FDK analysis? The analysis should take somewhat longer time than a normal inverse dynamics solution.
2. If you are executing FDK and get no displacement, then you may have overconstrained the model. If you run a normal inverse dynamics analysis and it Works, then the model is overconstrained for FDK.

Best regards,

John, I completely understand. I appreciate all the advice you can provide me.

  1. How do I know if I am actually executing an FDK analysis? I am pretty sure I am because I have the settings InverseDynamics.ForceDepKinOnOff set to ON. When I run the FDK analysis it only takes 5 seconds which is not very long.

  2. When I was trouble shooting my model I realized that my model doesn’t work when I turn the FDK OFF and just run a normal InverseDynamic analysis. When it fails it gives me the error “Muscle recruitment: singular KKT matrix.” What could be the reason that my model works when FDK is ON but fails when it is OFF?



I loaded the model and expanded the tree structure in the GUI till I got to “Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints”. It seems like your constraint type (CType) for all the remaining 5 DOFs that are constrained in a revolute joint (where only 1 DOF is free to rotate), are set to ‘Hard’.

You would have to change these to ‘ForceDep’ for the FDK analysis to treat them as DOFs which can vary during the analysis. Hopefully, this should fix your problem!

AnyBody Support

Ananth, thank you for your reply. I cannot find the CType that you are talking about where 4 out of 5 DOF are set to Hard. The only can find one CType in my code and it only had one hard in it.

I have attached my most updated code. The only CType I can find is in the Drivers Folder. All 5 DOF are set to ForceDep but my model is still not working correctly.

I think you might be onto something though. If you have found a section in my code that is set to Hard instead of ForceDep then that might be my problem. I just can’t figure out where you are talking about. If you could find it in this updated code, and let me know, I would really appreciate that.


Hi Michael,

I went through your latest code and think the issue might be related to you redefining a second, redundant knee driver in your main file.

If you use the folder path I gave you yesterday (Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints) and browse the model tree using the ‘Model’ tab on the left of the AnyBody GUI, you will notice that the default knee driver has been left untouched.

In addition to this, you define a second knee driver in your main file (Main.Study.Drivers.KneeForceDep) where you have enforced the ForceDep CType, but not on the original knee. This is also why your Object Description might be showing 5 excess constraints, compared to your rigid body degrees of freedom.

I’d recommend deleting the knee driver in your main file, and instead modifying the CType for the default knee driver to ForceDep.

P.S: I understand from a previous post that you only have the ACL and PCL, and so you might have to later look into the feasibility of performing FDK with 5 variable DOFs, once you have FDK running.

AnyBody Support

Hi Ananth,

Thank you for taking a look at my code. I have looked at your path and all throughout my code and files that are referenced but I cannot find the default knee driver. When I follow your path it takes me to code that says this:

[SIZE=3] [SIZE=2]AnyRevoluteJoint[/SIZE][/SIZE] Knee = {
Axis = z;
AnyRefNode &ThighNode = …Seg.Thigh.KneeJoint;
AnyRefNode &ShankNode = …Seg.Shank.KneeJoint;
//AnyDrawStdJoint Knee = { };
}; // End of knee

Is viewing a code through GUI different then viewing it just normally in AnyBody?

Could you tell me the file name at the top of the file for the default driver? Maybe this will help me find the file that the default driver is in, or if you have another way for me to find it, I will try that too.

In my code I have a section that is suppose to exclude the default knee joint and its drivers so then I can define my own knee.

AnyObjectPtrArray l1 = ObjSearch(“Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint”,“AnyMechObject”);
AnyObjectPtrArray l2 = ObjSearchRecursive(“Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee”,"",“AnyMechObject”);
AnyObjectPtrArray l3 = ObjSearchRecursive(“Main.Model.ModelEnvironmentConnection.Drivers.KneeDriverRight.Knee”,"Knee

AnyObjectPtrArray KneeExcludeList = arrcat(arrcat(l1,l2), l3);

AnyObjectPtrArray[SIZE=2] excludelist = KneeExcludeList ;
MechObjectExclude = excludelist;
Will this not work? When I suppress this code then I get the over constrained by 5, but with this code it is not over constrained so it seems to be excluding something. But like you said if I can just find this driver and manually change it, then that would be the easiest thing.

Thanks for your help, I really appreciate it.

Best Regards,


Hi Ananth,

I finally found where you are talking about. I see where it says all 5 DOF are Hard. I am currently working on changing this. I just wanted to update you and let you know. Hopefully this will work.