RE: Problems with temperature control.

From: Vermaas, Joshua (
Date: Tue Jul 31 2018 - 14:18:35 CDT

Just an interested observer here... If you change langevinTemp alone, why would there be a kinetic energy jump? Your random forces would start getting larger/smaller, and the damping would bring the system up to the new temperature.

I think the history of where these ramping profiles came from is informative. CHARMM and AMBER used to recommend velocity quenching minimization when their minimizers weren't all that great. The temperature ramps were just a way of letting the system settle itself down before production, as jumping directly to large temperature could blow up your system. There isn't much point to temperature ramping nowadays, except perhaps to seed temperature replica exchange simulations.


On 2018-07-31 12:02:12-06:00 wrote:

This isn't stupidity, just a really tricky usage of the code. I think
you're making this harder than it needs to be - aren't you just trying to
enhance relaxation to a thermodynamically reasonable state?

The "reassign" keywords are very old and kind of unnecessary IMO. Were I to
implement a heating protocol I might do it as follows (this is completely
untested and I can't guarantee that it will work, let alone apply to your
given system/problem):

set rampInterval 5000
set T1 600
set TN 300
set dT -10

reinitvels $T1
set oldTemp $T1
for {set temp $T1} {$temp >= $TN} {incr temp $dT} {
  langevinTemp $temp
  rescalevels [expr {sqrt($temp/$oldTemp)}] ;# this effectively "pre-heats"
the system so that you don't get sudden changes in kinetic energy
  run $rampInterval
  set oldTemp $temp

Note that "rampInterval" and "dT" are fairly critical values in order for
this to work. The former needs to be suitably long so that the system can
actually respond to the thermostat, while the latter needs to be suitably
small so that heating is not too strong, but also large enough that you
don't waste all of your time at intermediate temperatures.


On Tue, Jul 31, 2018 at 11:54 AM, Josep Ivan Balaguer Molins <> wrote:

> Hi Brian, sorry for my stupidity and thank you very much for being so
> helpful. This is how I've implemented the rescalevels, the same error of
> unestable system appears. I don't understand why...
> Is it correct? Or is it wrong?
> Thank you very much.
> binvelocities testD2.vel
> run 100
> for { set TEMP 600 } { $TEMP >= 300 } { incr TEMP -1 } {
> reassignTemp $TEMP
> rescalevels sqrt($TEMP+300)
> run 10
> }
> reassignFreq 40
> # Constant Temperature Control
> langevin off ;# do langevin dynamics
&gt; Quoting Brian Radak <>:
&gt; You should only need to adjust langevinTemp in order to accomplish
&gt;&gt; temperature control. I might also recommend rescaling the velocities
&gt;&gt; (rescalevels <scale factor="">) at each interval by the sqrt ratio of the old
&gt;&gt; and new temperatures as is done for simulated tempering, but this is
&gt;&gt; probably overkill for a simple annealing run.
&gt;&gt; Again, pressure control is not your friend when the temperature changes
&gt;&gt; quickly. The exclusion errors you are seeing almost always come up when
&gt;&gt; the
&gt;&gt; simulation cell changes rapidly for any reason.
&gt;&gt; On Tue, Jul 31, 2018, 7:37 AM Josep Ivan Balaguer Molins &lt;
&gt;&gt;; wrote:
&gt;&gt; Hell again Brian, I think the problem is using the reassign
&gt;&gt;&gt; temperature control. I would like to try doing the same with Langvine
&gt;&gt;&gt; if posible:
&gt;&gt;&gt; for { set TEMP 600 } { $TEMP &gt;= 300 } { incr TEMP -10 } {
&gt;&gt;&gt; langevin on ;# do langevin dynamics
&gt;&gt;&gt; langevinDamping 2 ;# damping coefficient (gamma) of 1/ps
&gt;&gt;&gt; langevinTemp TEMP
&gt;&gt;&gt; langevinHydrogen no ;# don't couple langevin bath to hydrogens
&gt;&gt;&gt; langevinPiston on
&gt;&gt;&gt; langevinPistonTarget 1.01325 ;# in bar -&gt; 1 atm
&gt;&gt;&gt; langevinPistonPeriod 200
&gt;&gt;&gt; langevinPistonDecay 150
&gt;&gt;&gt; langevinPistonTemp TEMP
&gt;&gt;&gt; }
&gt;&gt;&gt; This doesn't work, how should I code it? I don't see any example on
&gt;&gt;&gt; internet nor in the manual.
&gt;&gt;&gt; Best regards,
&gt;&gt;&gt; Ivan
&gt;&gt;&gt; Quoting Josep Ivan Balaguer Molins <>:
&gt;&gt;&gt; &gt; Thank you very much Brian. I've turned off the pressure control. And
&gt;&gt;&gt; &gt; I've changed the temperature increment from -10 to -0.1 and even to
&gt;&gt;&gt; &gt; -0.001:
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; run 1000
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; for { set TEMP 600 } { $TEMP &gt;= 300 } { incr TEMP -0.1 } {
&gt;&gt;&gt; &gt; reassignTemp $TEMP
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; run 1000
&gt;&gt;&gt; &gt; }
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; reassignFreq 100
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; In any case I get the warning "low global exclusion count" as you
&gt;&gt;&gt; &gt; expected before. And the simulation stops:
&gt;&gt;&gt; &gt;
&gt;&gt;&gt; &gt; ERROR: Constraint failure in RATTLE algorithm for atom 1347!
&gt;&gt;&gt; &gt; ERROR: Constraint failure; simulation has become unstable--_000_BYAPR09MB2584D20DF9D58818238328D2E42E0BYAPR09MB2584namp_--

This archive was generated by hypermail 2.1.6 : Tue Dec 31 2019 - 23:20:09 CST