Ligament's Model

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:

F= k*elongation[mm]

where:

  • k is the stiffness of ligament [N/mm]

Is this possible???

Hi,

Please take a look at the tutorial for ligaments: Tutorials: Muscle modelling->Ligaments

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:

AnyForce ArtificialStiffness = 
{
  AnyFloat Stiffness = 5e4; // N/m
  AnyKinLinear lin = 
  {
    //Ref = -1;
    AnyRefFrame &r1= Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.HipJoint.PelvisImplantNode;
    AnyRefFrame &r2 = Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJointAnatomicalFrame.FemImplantNode;
  };
  F = - Stiffness * lin.Pos;
};

But you can also define Stiffness as a nonlinear function of lin.Pos. For example:


AnyFloat A=-1;
AnyFloat B=0;
AnyFloat C=1;
AnyFloat D=0;
AnyFloat E=0.001;
AnyVar Val = A*lin.Pos*lin.Pos*lin.Pos+B*lin.Pos*lin.Pos+C*lin.Pos+D+E*sqrt(lin.Pos);
  F = Val;

Regards,
Pavel

Thanks a lot for your answer, in this way I could put a Stifness-dumper ligaments model and this is perfect for my work!!!

Friendly
Giovanni

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?

Please describe in more detail what you are doing. I am not sure which scenario you have chosen.

Pavel

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:

1- I have done these ligament model:

[SIZE=3]AnyForce[/SIZE] PATELLA3 =
{
[SIZE=3]AnyFloat[/SIZE] Stiffness = 1e5; [SIZE=3]// [N/m]
[/SIZE][SIZE=3]AnyFloat[/SIZE] Dumper = 3e4; [SIZE=3]// [N/m*s]
[/SIZE][SIZE=3]AnyKinPLine[/SIZE] lin =
{
[SIZE=3]AnyRefNode[/SIZE] &Ori = Main.HumanModel.BodyModel.Right.Leg.Seg.Patella.Origin_patella_tendon3;
[SIZE=3]AnyRefNode[/SIZE] &Ins = Main.HumanModel.BodyModel.Right.Leg.Seg.Shank.Insertion_patella_tendon3;
[SIZE=3]AnyDrawPLine[/SIZE] drw =
{
Thickness = 0.004;
RGB = {1,0,0};
};
};
[SIZE=3]AnyVar[/SIZE] L0 = 0.058558;
[SIZE=3]AnyFloat[/SIZE] Dl = lin.Pos - L0;
[SIZE=3]AnyFloat[/SIZE] Dt = 0.204; [SIZE=3]//valore da cambiare in base ai casi
[/SIZE]F = Stiffness * (Dl) + Dumper * (Dl/Dt);
};

[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]

You can check for the sign using something like:

AnyFloat a = -1;
//AnyFloat a = -1;
AnyFloat Dl = iffun(gteqfun(a, 0.0), a, 0.0);

  1. 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).

Regards,
Pavel

For the first answer: what is the meaning of each value to put in “iffun”?

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.

P.

I work with float values (Dl is a float variable) and the “iffun” function could have as input only Int variable, so how could I solve my problem?

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.

Pavel

Ok, perfect I have done this and I have a Dl AnyFloat variable,

But the force F in AnyForce model wants an AnyFloat[1] as input,
so If I put this function:

F= Stiffness * Dl + Dumper * Dl/Dt;

The system gives me this error:

[u][SIZE=1]
ERROR(SCR.EXP1)[/u][/SIZE] : [u][SIZE=1]C:/U..s/g..a/D..p/m..i/A..y/Body/A..n/L..D/Seg.any[/u][/SIZE] : '=' : Illegal operation for given argument types : 'AnyFloat[ ]' '=' 'AnyFloat'
Model loading skipped

Could I transform an AnyFloat variable in a AnyFloat [1] variable?

AnyFloat a = 1.0;
AnyVec3 v = {a, a+1.0, a*1.0};

Pavel

Thanks a lot Pavel, I´m successful with your information!!!

Now the ligaments model are done.

Thanks,
Giovanni

Hi Pavel,

My professor has asked me to use a Force for the ligament defined for step in this way:

F = a; if 0 < x < x1
F = b; if x1 < x < x2
.
.
.

Is there a function similar “itfun” or “gtfun” that takes in input three values and answer if the middle one is into the x1-x2 value?

Thanks,
Best regards,
Giovanni

Hi Giovanni,


  AnyFloat x1 = 10;
  AnyFloat x2 = 20;
  AnyFloat x_ = 15;
  AnyFloat a = 0.01;
  AnyFloat b = 0.02;
  
  AnyFloat value = iffun(gtfun(x_,0)*ltfun(x_,x1),a,0.0)
  +iffun(gtfun(x_,x1)*ltfun(x_,x2),b,0.0);

You can use boolean logic to construct something complex.

Pavel

Hi pavel,

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?

something like:

AnyFloat a = Lin.Pos[] (t=0);

thanks,
Giovanni

Hi Giovanni,

not dynamically, not within one simulation.

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).

Regards,
Pavel

Good morning,

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:

velocity = [Lin.Pos(temporal instant i)-Lin.Pos (temporal instant i-1)]/Dt

How I could implement something like this with Anybody with Inverse Dynamics approach? Is it possible?

Thanks,
Best regards,
Giovanni