Problem with pressure fluctuations

Dear All user

When I represent pressure vs time in npt ensemble( Pstop=1 bar and nose-hoover)

My pressure fluctuate too much and, In my fluctuations, I have periodically negative numbers,

Why Is there negative numbers in fluctuations?

Hi Ali,

During my time of trying to get acquainted with MD and LAMMPS in particular I’ve seen this question repeatedly.

However, I’m still far from an expert and my attempt/guess at this question is just for my own education. Assuming you’re using periodic boundary conditions, and the npt by default is implemented using a feedback mechanism with variable simulation volume changes to regulate pressure, the fluctuations might be due to the value used in the artificial “external piston”. Also the “pressure waves” from the wildly varying “piston” may also be interacting with its original point of origin after traversing the periodic image cells, causing the wild pressure fluctuations.

Again, this is just guesses/assumptions of a beginner, trying to increase his experience.

Hopefully, someone more knowledgeable may be able to assist you.

v/r,

dc

Dear Daniel

Thank you for your reply very much,

But, I really have a problem here, I can not find any tutorials about liquids and related calculations,

I think it can be really useful for new comers like me,

Greetings guys,

I am also not an expert on these types of simulations(I typically do
NVE), but intuitively I can tell you what to look out for. If you
look at the documentation you'll find that "pdamp" controls the
time-scale at which pressure is relaxed, and that if you make it too
short the pressure can fluctuate rapidly. The same applies for
dilation and contraction of the box, where "drag" can damp the
response of the domain size.

In either case, it should be obvious that if your "control system"
responds "too rapidly/large in magnitude," you can overshoot
equilibrium and you essentially construct an unstable controller.
(on the other hand if the controller is too weak you can't effectively
control the system) To this end you're likely going to have to make
educated selections of simulation parameters involved in your
thermostats and barostats, that will be specific to your macroscopic
parameters and microscopic interactions. All I can suggest is that
you find test cases similar to your system with which you can compare,
and as always running convergence studies.

Greetings guys,

I am also not an expert on these types of simulations(I typically do
NVE), but intuitively I can tell you what to look out for. If you
look at the documentation you'll find that "pdamp" controls the
time-scale at which pressure is relaxed, and that if you make it too
short the pressure can fluctuate rapidly. The same applies for
dilation and contraction of the box, where "drag" can damp the
response of the domain size.

In either case, it should be obvious that if your "control system"
responds "too rapidly/large in magnitude," you can overshoot
equilibrium and you essentially construct an unstable controller. (on
the other hand if the controller is too weak you can't effectively
control the system) To this end you're likely going to have to make
educated selections of simulation parameters involved in your
thermostats and barostats, that will be specific to your macroscopic
parameters and microscopic interactions. All I can suggest is that
you find test cases similar to your system with which you can compare,
and as always running convergence studies.

Small system have huge pressure fluctuations, it is OK. It’s just an effect of the finite size of your system.

Barostats are not made to keep pressure constant, neither thermostats are made to keep the temperature constant. They are made to keep the AVERAGE value of temperature and/or pressure constant and also to reproduce the correct fluctuations from the average value. If you wanna check that, perform a long simulation with constant pressure and compute the mean value, it is going to be the one you specified in your thermostat/barostat.

Rodrigo

Ali,
You need to learn first how to crawl before you attempt to walk. You
don't really have a Lammps Q but one on SM and MD. Do some browsing on
the Lammps archives and you'll find similar Qs and Anws. 1bar is
actually quite a small pressure at the atomic level. No surprise if
you see negative values of the pressure then (assuming you know what
your are doing with your barostat). Your simulation box can
compress/expand you know? You can reduce the amplitude of the
fluctuations by increasing your system size.
Be very careful if you are running NPT on a reactive system because
the box rescaling algorithm could artificially break your molecules
apart. Anyways, messages are flowing in thus I'm sure people have
given you a ton of advice. Mine, do your learning on easier systems a
solid for example. And go to the library and read about MD and SM.
Carlos

Ali,
You need to learn first how to crawl before you attempt to walk. You
don't really have a Lammps Q but one on SM and MD. Do some browsing on
the Lammps archives and you'll find similar Qs and Anws. 1bar is
actually quite a small pressure at the atomic level. No surprise if
you see negative values of the pressure then (assuming you know what
your are doing with your barostat). Your simulation box can
compress/expand you know?

well put. let me add a few more comments to this.

when looking at fluctuations (temperature or pressure) people tend to
forget a few key concepts that are implied in what we do and often not
expressed perfectly accurately.

1) you always have to differentiate between equilibration and
"production" simulation. during equilibration things can go wild,
sometimes you may even do this on purpose. all that matters is that
you *get* to equilibrium. you can expect only a representation of an
NVT or an NPT ensemble when your system is *in* equilibrium. neither
the nvt nor the npt integrator are good at going to equilibrium
quickly and don't work so well, if you are far away.

2) when looking at fluctuations, you always have to look at how much
is too much. liquids and solids are not very compressible, so small
changes in volume by the npt integrator can result in large changes in
pressure. when you think you have too large fluctuations it is of the
utmost importance to *understand why* you have those fluctuations and
not look for a method to make them go away. you want to cure the
problem, not hide it. if you hide it, it will come back and bite you.
usually at the worst of times.

3) it is important to understand the difference between a macroscopic
sample and a microscopic representation. we typically assume
*equipartitioning*, i.e. that there are *no* fluctuations. this
assumption breaks down the smaller the sample. the most extreme
example is the harmonic oscillator which goes from 0K to 2x the
average temperature depending on where in the cycle you are.

4) we also typically assume that we reach ergodicity (sufficient
statistical sampling) by sampling the same system over some time
rather than increasing the system. however, that has two consequences:
a) the system has to be in equilibrium and b) temperature and pressure
make the most sense when averaged over a sufficiently large amount of
time.

5) the final comment is to dig out some proper books and read and
study them. there is no quick-n-dirty, you cannot find a "this is how
you do it in 5 mins" tutorial, because you cannot understand this in
5mins. the two books i usually recommend are the "statistical
mechanics" textbook by mcquarrie and "theory of simple liquids" by
hansen and mcdonald. particularly the latter was what got me properly
clued in when i was a grad student.

axel

Dear All users

Thank you very much,

Yes there are a handful information on the web.

  1. information for beginners

LAMMPS folks are generous enough to upload the workshop powerpoints here. There are sections for beginners as well.

http://lammps.sandia.gov/workshops.html

  1. Please do a keyword search on the mailing list archive before throwing a question to the list:

http://lammps.sandia.gov/threads/threads.html

  1. MD related course materials

http://people.virginia.edu/~lz2n/mse627/

http://molsim.chem.uva.nl/molsim2012/index.html

http://web.mse.uiuc.edu/courses/mse485/