[lammps-users] damp factor in NVT fix

Hi everybody,

What exactly does the damp factor in the NVT fix do? When choosing its value do I have to take into account the size of my time step or other parameters?

greets Lukas

If you mean Tdamp (not the drag factor), then it is
in units of time, not timesteps. If you started at T1
and your target was T2, it determines how long it
takes (roughly) to re-equilibrate to T2.

Steve

Sorry for my imprecise question. What I'm actually trying to do is to heat my system (thiols on gold) from 0 K to 300 K using the NVT fix. Doing so the following problem occurs:
It takes considerable timesteps until the system starts to heat up, or when choosing the Tdamp parameter too large nothing happens at all.

Thanks in advance for any advice

Lukas

Steve Plimpton wrote

Sorry for my imprecise question. What I'm actually trying to do is to
heat my system (thiols on gold) from 0 K to 300 K using the NVT fix.
Doing so the following problem occurs:
It takes considerable timesteps until the system starts to heat up, or
when choosing the Tdamp parameter too large nothing happens at all.

lukas,

nose-hoover thermostats are good to keep an equilibrated system
in an NVT ensemble, they are not overly good for adding or
removing kinetic energy. The behavior you describe is in keeping
with that. you'd be much better off using fix nve and fix berendsen
for example for thermalizing your system. another alternative would
be using fix langevin ensemble. with a proper choice of randomization
and friction terms, it may help considerably to bring your system
to equilibrium (if you are after packing of the thiols, you don't
care about the fast movements of the chains but rather the slow
ones, right?).

cheers,
   axel.

Hi all,

I have similar questions. When I run, say, npt simulations, the
temperature and pressure don't remain constant. The documentation says
that it is a known problem with simulation of solids and that the 'drag'
parameter should be used to stabilize this. On using 'drag', the
temperature fluctuations diminish and I get roughly the specified
temperature. However, the pressure fluctuations still persist, even when
I use drag factor greater than the maximum of specified range (0.2 -
2.0). What else can I do to reduce the pressure fluctuations for
simulation of a metal?

However, even with the temperature, it takes quite a few time steps
before the fluctuations stabilize. So, how do we relate the computations
to properties on a short time scale, or say, high strain rate type case?

Further, with the fix command as follows:
fix 1 all npt 300.0 500.0 100.0 xyz 1.0 2.0 100.0 drag 2.0

That is, when I try to increase the 'tdamp' and 'pdamp' so as to
increase both temperature and pressure from a lower to a higher value
over a large number of time steps (100.0/0.001 = 100,000), I start
getting problems in both temperature and pressure. Temperature becomes
(144-148) and pressure fluctuates from -7000 to +9000.

With damp parameters reduced to 0.1
fix 1 all npt 300.0 500.0 0.1 xyz 1.0 2.0 0.1 drag 2.0

Here again, the temperature dips and then starts rising. What could be
the cause of this dip in temperature usually just after the simulation
starts?

After that the temperature starts rising from 300 to 500 in 100000 steps
as opposed to 100 (=0.1/0.001, 0.001 is the default time step in metals
units) steps expected from the fix command. But the pressure still has
large fluctuations. Is the large pressure fluctuation because of small
number of atoms (4000)?

The input file is as follows:

# Embedded atom method for Aluminum

units metal
atom_style atomic

lattice fcc 3.986
region box block 0 10 0 10 0 10
create_box 1 box
create_atoms 1 box
mass 1 27.0

velocity all create 300.0 87287

pair_style eam
pair_coeff 1 1 Al_jnp.eam

neighbor 2.0 bin
neigh_modify every 20 delay 0 check no

fix 1 all npt 300.0 500.0 0.1 xyz 1.0 2.0 0.1 drag 2.0

dump id all xyz 50 dump.metal

thermo 500
run 100000

write_restart restart

Thanks a lot

Rohit Rai

Hi all,

I have similar questions. When I run, say, npt simulations, the
temperature and pressure don't remain constant. The documentation says

rohit,

they are not even _supposed_ to be _constant_ for a finite system.
all fix nvt/npt do is to help generate an _ensemble_ that is equivalent
to an _average_ temperature/pressure of the specified values.

this is all standard textbook stuff on statistical mechanics.

that it is a known problem with simulation of solids and that the 'drag'
parameter should be used to stabilize this. On using 'drag', the

drag is an "unphysical" trick. particularly for dense system, you
can have some sort of "feedback" with a N-H thermostat. the drag
flag puts a damping on this. in general, drag should be chosen
as small as possible.

temperature fluctuations diminish and I get roughly the specified
temperature. However, the pressure fluctuations still persist, even when
I use drag factor greater than the maximum of specified range (0.2 -
2.0). What else can I do to reduce the pressure fluctuations for
simulation of a metal?

the questions is rather, are the fluctuations physical or not.
this is also impacted by the choice of time step, temperature
and interaction potentials. there are typically three phases in
regular (equilibrium) MD simulations:

  - bringing the system into equilibrium.
    this can include minimization to remove unphysically high
    potential energies from constructing the initial coordinates
    and temperature rescaling (or berendsen or langevin) to bring
    your system close to the desired temperature and then wait
    until the potential energy is equilibrated

  - testing for energy conservation and stability.
    restart from the equilibrated structure using nve integration.
    at this stage choice of cutoffs, time step, etc. have to be
    optimized to minimize any drifts in total energy. there always
    will be some small residual drift
   
    this step is frequently skipped by experienced users,
    that know their systems very well.

  - running production with nvt/npt. you generally want a "weak"
    thermalization, i.e. manipulate the system as little as possible
    to just maintain the desired ensemble.
    particularly with npt less experienced people are always confused
    by the large pressure fluctuation, but those have to be large,
    since dense liquids are not very compressible. you have to monitor
    a running average of the pressure to see whether you actually have
    a drift there or not, same goes for temperature or rather kinetic
    energy, but the fluctuations there is often much smaller.
    in my personal experience, i found that a larger drag factor may
    only be needed at the beginning of a simulation and then can be
    reduced. also a more aggressive choice for time step, can be offset
    to some degree by this, but then you have to keep in mind that
    you are no longer is a properly defined statistical mechanical
    ensemble and properties derived from your simulation may be tainted.

in general, always keep in mind the fundamental rule of compute
simulations: garbage in, garbage out. i.e. make sure that all
parameters you choose are proper and adjusted for your system.
there is not one set that always works and not one truth.

[...]

Here again, the temperature dips and then starts rising. What could be
the cause of this dip in temperature usually just after the simulation
starts?

a small "dip" is quite typical when initializing a nose-hoover
thermostat. nothing to worry about, if the average is still ok.

After that the temperature starts rising from 300 to 500 in 100000 steps
as opposed to 100 (=0.1/0.001, 0.001 is the default time step in metals
units) steps expected from the fix command. But the pressure still has
large fluctuations. Is the large pressure fluctuation because of small
number of atoms (4000)?

_and_ the high temperature. yes. you can check this
by simply comparing to a large system.

cheers,
   axel.

Well, the damp parameter is in time units, not timesteps.
So it will take about that long in time to get to the new
temperature, then it may oscillate a bit with that period.

Steve

Hi,
I am struggling with the following problems:

With the following command,

fix 1 all npt 300.0 500.0 0.1 xyz 1.0 1.0 0.1 drag 2.0

Since, dt = 0.001 in metal units, it should take 0.1/0.001 = 100 steps for the temperature to rise from 300 to 500. Instead, it takes 100,000 steps when I run the simulation with:

run 100000

If I run it for 200000 steps, it takes 200000 steps for the same temperature rise. Why is it so?

If I increase tdamp to 10.0, the temperature just keeps fluctuating about 150 instead of rising to 500 in 10,000 steps. It seems to me that Tdamp or Pdamp are not doing what, as I understand, they are supposed to do.

Also, even with drag = 2.0, large pressure fluctuations persist. How can I correct that?

The simulation is for solid Aluminum with 4000 atoms with periodic boundaries.

Your help is deeply appreciated.

Thanks a lot

Rohit

Hi Rohit,

You didn't read the documentation carefully enough. The
temperatures given are for the beginning and the end of the
run. Moving the end of the run farther out results in a slower
temperature ramp. The 0.1 time indicates fluctuations about
the current temperature target, which is moving when you ramp.
The target isn't 500 until the end of the run. If you want the
temperature to ramp up from 300 to 500 in 100 steps, only run
100 steps.

Joanne Budzien

Thanks Joanne for your response. That is what's happening with my runs. However, a couple of related questions:

1. Steve's earlier responses to the query by Lukas seemed to indicate otherwise. Steve, could you please clarify?

2. If Joanne's explanation is right, under what conditions would one want to have large temperature fluctuations by specifying large Tdamp? Wouldn't one, then, ideally want to have the least value of Tdamp? For my runs (metal units), if I go to tdamp <= 0.01, I start getting Pressure =1.#QNB.

3. Even though the initial velocities are created for T=300, temperature always dips just after the simulation starts. Why is that so?

velocity all create 300.0 87287

4. Any solutions to pressure fluctuations?

Thanks a lot Joanne, Steve, and all of you.

Rohit

2. If Joanne's explanation is right, under what conditions
would one want to have large temperature fluctuations by
specifying large Tdamp? Wouldn't one, then, ideally want to
have the least value of Tdamp? For my runs (metal units), if I
go to tdamp <= 0.01, I start getting Pressure =1.#QNB.

You appear to be conflating three separate issues: ramping
rate, thermostat relaxation time (Tdamp), and friction
coefficient (drag). If you want a system to have exactly T=500
in the shortest possible time, do a temperature rescale or
velocity create to that temperature. But that's a pretty harsh
way to set the temperature if what you want is a relaxed system
that started from room temperature coordinates.

You can ramp the temperature more gently over the course of
time by letting the system adjust to the new temperature by
giving it a long run time. However, Tdamp has to be set
according to the relaxation time of your system. Too short a
time can do bad things to the system due to the mismatch
between system's ability to respond to the driving by the
thermostat and barostat.

Even a good thermostat setting on a solid initially coming up
to temperature may cause feedback oscillations, which is where
the friction coefficient (drag) helps, if everything is
basically ok and just needs a minor nudge.

But nothing can help you if you are wildly twiddling the wrong
knobs all the way to their limits.

Joanne Budzien

Bingo - Joanne identified your problem. What I was describing earlier was
what would occur if you had a system at time 0, equilibrated at 300K.
If you then ran fix nvt or fix npt like fix nvt 500 500 0.1, then you
are telling it to instantly change to 500K. But it will take 0.1 time
(100 steps in this case) to get there.

Steve