Change spring constant during running

Hi,

I’m using “fix spring/self” and I’m wondering if there is anyway to change the spring constant during running.

Thanks,
Yang

Hi,

I’m using “fix spring/self” and I’m wondering if there is anyway to change the spring constant during running.

not directly.

you could modify the source code, to allow the force constant to be an
equal style variable.

or you could try to emulate fix spring/self with a combination of "fix
store/state", "fix addforce" and an atom-style variable.
i.e. store the initial (unwrapped) positions with fix store/state,
then define an atom style variable, that computes the distance of the
current unwrapped positions to the stored ones and compute the
restoring force and then apply it via fix addforce. in this variable,
you can make the force constant a function of the time step number.

axel.