Thank you so much for your reply. I get you and understand better about fix smd now.
Probably, I didn’t express my meaning exactly last time. Yes, you are right. The sign of the smd force depends on the displacement vector between the mass center of the tethered group and the reference point of the spring, i.e., dx, dy and dz.
Here I only talk about the “tether” type. In the code, it gives us
fx = k_spring * dr * dx/r
fy = k_spring * dr * dy/r
fz = k_spring * dr * dz/r
dr = r - r0 - r_old
At the most beginning, r = r_old, because no velocity to update r_old. Therefore, at that time, the smd force is decided by r0 and dx/r, dy/r and dz/r (k_spring is a constant). If for one-dimension case(say x direction), namely, the value of the initial force is depended on r0 and the sing of the force is depended on dx/r ( -1 or +1).
Yes, in most case, r0 =0 to give us a zero initial smd force. While I need a non-zero one, I could evaluate r0 and adjust the position of the tether point to change the sign of the initial force.
Is my understanding correct?
Any instruction would be most appreciated.