Page 1 of 1

Problem with Barostat in MLFF

Posted: Tue Mar 26, 2024 12:54 am
by burakgurlek
Hi,

I am trying to understand the parameters of barostat in NPT simulation. For this, I tried to replicate the example given in the end of best practices MLFF website (https://www.vasp.at/wiki/index.php/Best ... rce_fields). I did learn the dynamics in 5000 steps and reproduction run with 10000 steps with the given files. I plot the distribution of pressure via py4vasp (np.trace(Stress_Data['stress'], axis1=1,axis2=2)/3), but the mean is quite different than the pressure 0.001kB. I only did not include any KPOINTS file as this was not provided in the example. Do you have any idea why the barostat does not work properly? or Am I doing something wrong?

mean pressure = -5.7
std pressure = 8.0

Here is the distribution and the files

Regards,
Burak

Re: Problem with Barostat in MLFF

Posted: Tue Mar 26, 2024 10:18 am
by martin.schlipf
Did you monitor the pressure over time? Perhaps your system has not equilibrated yet?

Re: Problem with Barostat in MLFF

Posted: Tue Mar 26, 2024 11:01 am
by burakgurlek
Hi,

Thanks, I do observe the pressure overtime. It may not be equilibrated, but that was the point that I wanted to use the example. I used the same number of steps indicated in the example. I assume, it would produce the result well and equilubrated. Otherwise, there should be already a potential learned which does not seems to be the case according to the website.

Regards,
Burak

Re: Problem with Barostat in MLFF

Posted: Wed Mar 27, 2024 3:06 pm
by andreas.singraber
Hello!

In order to get meaningful ensemble averages from MD simulations the system must be in equilibrium. However, if you used the INCAR file you attached to your initial post, then the system cannot be in equilibrium because you ramp up the temperature:

Code: Select all

TEBEG            = 200
TEEND            = 500
With this setting you are continuously pumping energy into the system, hence, time averages will not be meaningful. Although the barostat will try to adjust the lattice to achieve the desired pressure it will not succeed because at the same time the thermostat heats up the system.

In order to perform a meaningful averaging of pressure you will need to turn off temperature ramping and set a fixed thermostat temperature. Properly equilibrate the system (e.g. monitor energy, temperature, lattice parameters until there is no more drifts) and only afterwards start to average pressure. Unfortunately, getting a good pressure average with low error bars is known to be notoriously time-consuming, in particular for small systems (tens to hundreds of atoms). The pressure usually fluctuates wildly into positive and negative values and long simulation times are necessary to get a decent time average. The situation improves if one scales up to (ten-)thousands of atoms but this of course is also computationally expensive.

If you find that even after proper equilibration pressure averages do not match with the input pressure within error bars then please post all relevant input and output files so we can have a closer look.

All the best,
Andreas Singraber