choderalab / openmmtools

A batteries-included toolkit for the GPU-accelerated OpenMM molecular simulation engine.
http://openmmtools.readthedocs.io
MIT License
252 stars 81 forks source link

Hard-code some parameters in Custom*Force terms for alchemical factory #492

Open jchodera opened 4 years ago

jchodera commented 4 years ago

From @peastman:

Rather than using global parameters for the constants, I suggest hardcoding them in the expression. That is, add softcore_alpha=0.5; softcore_a=1; softcore_b=1; softcore_c=6 to your expression. That will let it optimize much more effectively. For example, it will do the optimization ((1)-(lambda))^(-1+(softcore_b)) = (1-lambda)^(-1+1) = (1-lambda)^0 = 1. With that change, the nans go away.

cc https://github.com/openmm/openmm/issues/2914#issuecomment-724182279

adw62 commented 4 years ago

I have made the changes to address this here #493 . Please use this code if it is helpful.

Cheers, Alex