colvars
colvars copied to clipboard
More practical smoothing of changing force constant in restraint
Right now targetForceExponent in restraints smoothes the lambda dependence of the force constant according to: kλ=k0+λ^α(k1−k0) , where k0, kλ, and k1 are the initial, current, and final values of the force constant.
This is ideal when the force constant starts from 0, that is for the coupling transformation. However when doing the uncoupling transformation it would be more convenient to start from λ=1 and decrease it. This can be done explicitly by providing lambdaSchedule, but could be done automatically with a "decreasingLambda" flag. And that would allow for single-stage uncoupling, if anyone ever uses that.
Essentially, the current convention is very convenient in the situation that is not often used in practice.
Ideas to improve this:
- add a "decoupling" keyword that makes lambda go from 1 to 0. Problem: then the role of forceConstant and targetForceConstant is not very clear.
- decide that in the expression kλ=k0+λ^α(k1−k0), k0 is always the smaller value of forceConstant and targetForceConstant, and k1 the larger one.
- detect if one of the end points is k=0, because that's what the real use case is, and set that as k0.
In progress with #485