Download this file
AnyVar l0 = lr/(er+1); AnyVar eps0 = 0.03; AnyVar eps = (meas.Pos[0]-l0)/l0; AnyVar Stiffness = k*l0; AnyFloat Val = {iffun(gteqfun(eps,0.0),iffun(gtfun(eps,2*eps0),-Stiffness*(eps-eps0),-Stiffness*1/4*(eps^2/eps0)),0.0)};