I would put a linked between the elongation of the ligament and the force that this last could bear. Thus I would use a viscoelastic model for the behavior of the ligaments like the follow one:
It is generally a good idea to start with the Tutorials.
If you want to construct a complex force function you can do so. For example, in THA-KneeBendDemo example of the AnyBody Managed Model Repository an artificial stiffness (can be considered a ligament) with linear elastic properties is defined as:
The ligament curves are ok, but when the ligaments begin smaller I could have some negative values in the forces, how I can eliminate or set them to 0?
I´m a new user of AnyBody and I´ll show you all my problems:
I have chose the “kneeload.any” from the anybody model repository AMMRV 1.4 as initial model of the knee. I have anybody 5.1.0 version so I think that I can´t use the TKA-KneeBendDemo from the AMMRV 1.5 model repository. these are my big two problems:
[SIZE=2]When I have negative Dl the Force has negative value, but a ligament couldn´t have negative force, How I can eliminate negative value?
2- When I give a varus-valgus angle of 20 degree there is a penetration between shank and femur segment. How I can eliminate this unreal penetration?
[/SIZE]
AnyFloat a = -1;
//AnyFloat a = -1;
AnyFloat Dl = iffun(gteqfun(a, 0.0), a, 0.0);
Penetration is not taken into account in the analysis - it is just for the visualization. To avoid penetration you would need either relocate the bone surfaces or adjust joint axes or define kinematics differently (I replied in another thread where you may find an example of using articular surfaces for changing kinematics).
First parameter - true or false value (1/0 can be used).
Second - value to be returned in case of true.
Third - value to be returned otherwise.
gteqfun - GreaTer or EQual FUNction.
See my message above: first parameter is logical/integer (it has to be the result of other functions such as gteqfun, lseqfun, etc.), second parameter is the value to be in case of ‘true’, third in case of ‘false’.
I have also given you an example: AnyFloat Dl = iffun(gteqfun(a, 0.0), a, 0.0);
Try it and see what value of Dl you get if you change a.
Literally this function means:
if (a>0) use a, otherwise 0.
Is there the possibility during the simulation to save the initial position of the ligament, thus Lin.Pos[0] at t = 0 sec, and to use this variable in other part of the program?
But you can output this value and start a new analysis using this value. And the output will be for all the timesteps (so if you have a static analysis - you will get a single value).
I would give an hysteretic behavior to my ligaments, to do this I should have the possibility to select the components of the elongation vector, because I should consider the velocity of the ligaments deformation, So for example I have just implemented the model in matlab, and this should be in the following way: