Stiffness interpolation

Hi Zeinab,

Welcome to the AnyScript forum and apologies for the delayed response. This period has been a little bit busy.
You can use AnyFunInterpol to consider the changes in the length of the elastic band and apply the resulting force. You are on the right track, you have defined an AnyKinPLine that will give you a measure of the length of the elastic band.
The interpolation can be a little bit tricky to implement, especially when you are new to Anybody. But here is a piece of code that should help you get going:

AnyFunInterpol Int = {
      Type = PiecewiseLinear; // there are different types of interpolation functions, see reference manual
      T = L0*{0.25,0.5,0.75}; // replace L0 with your L0 value.
      Data = {{100, 150, 200}}; // Force data corresponding to band length
    };

AnyForce ElasticForce = {
      AnyKinMeasure &Line = .left; // path to your elastic band
      F = {.Int(Line.Pos[0])[0]};
    };

Please note that if your elastic band length goes out of range, i.e. it goes beyond 25 to 75% L0 during the simulation, the interpolation function will throw an error.

Hope this helps!

Best regards,
Dave