FW: Problem with pressure input/output in NPT

Dear users,

I would like to ask you the following: I run my simulations in NPT ensemble. My system is in 2-dimensions and it consists of 100 atoms with triangular shape (ring) and chains attached each atom on the corners. Each ring consist of 48 beads. For the rings I use fix rigid/npt and for the chains I use fix npt (non-rigid bodies). I have FENE potential to connect each ring with chains. You can find the data file (data.spm) and input file (in.spm) attached. You can see that my pressure is 0.05 in LJ units but in output file (see attached files - log.lammps) the average pressure is far away than that value. I know that the barostat I used help to maintained the average pressure constant, but I do not understand why this value is so far away than the value in input file (0.05 in LJ units). I tried to fix it, I changed the time step, I changed the damping parameters, but nothing know. The problem remains.

I appreciate any help! Thank you very much!

Regards,

Nikoletta

Neighbor list info …
1 neighbor list requests
update every 1 steps, delay 10 steps, check yes
master list distance cutoff = 2.8
Memory usage per processor = 7.80776 Mbytes
Step Temp PotEng E_bond KinEng TotEng Volume Press Density
0 1.3882529 11988.034 11988.113 0.3900123 11988.424 1308090.5 0.013985158 0.0036694708
10000 1.4684553 11966.877 11966.955 0.41254416 11967.29 1303136.8 0.022028536 0.0036834199
20000 1.4435041 11966.902 11966.979 0.40553442 11967.308 1303299 0.020429611 0.0036829614
30000 1.3838952 11966.946 11967.023 0.38878805 11967.334 1302129.9 0.020165392 0.0036862683
40000 1.4176457 11966.911 11966.984 0.39826983 11967.309 1299454.4 0.020881707 0.0036938581
50000 1.4834446 11966.926 11967.005 0.41675521 11967.342 1300598.5 0.018657056 0.0036906086
60000 1.4439543 11966.947 11967.02 0.4056609 11967.353 1298687.5 0.01779849 0.0036960392
70000 1.4148898 11967.071 11967.147 0.39749561 11967.469 1296899.9 0.018785089 0.0037011338
80000 1.4375612 11966.942 11967.013 0.40386486 11967.346 1297080.9 0.019258395 0.0037006172
90000 1.4322728 11967.016 11967.089 0.40237914 11967.419 1294985.8 0.018711749 0.0037066044
100000 1.4687217 11967.051 11967.126 0.41261901 11967.463 1294192.9 0.018744119 0.0037088753
110000 1.4122405 11966.972 11967.047 0.39675132 11967.369 1292862.1 0.020337221 0.003712693
120000 1.4143504 11967.001 11967.066 0.39734406 11967.398 1291582.6 0.020537383 0.0037163709
130000 1.4222799 11967.05 11967.114 0.39957175 11967.449 1291248.2 0.020487205 0.0037173333
140000 1.4217638 11967.151 11967.226 0.39942676 11967.55 1291482 0.018547292 0.0037166604
150000 1.4373325 11967.018 11967.091 0.40380061 11967.422 1290136.6 0.020992194 0.0037205363
160000 1.441027 11967.011 11967.085 0.40483853 11967.416 1287675.3 0.01995542 0.0037276477
170000 1.4106329 11967.058 11967.136 0.39629967 11967.454 1285779.2 0.021229056 0.0037331448
180000 1.4701518 11967.151 11967.228 0.41302078 11967.564 1286125.7 0.019763448 0.0037321392
190000 1.4099572 11967.135 11967.21 0.39610985 11967.531 1285926 0.018048433 0.0037327188
200000 1.4040099 11967.085 11967.159 0.39443903 11967.479 1283503.7 0.019111078 0.0037397634
210000 1.4204192 11967.078 11967.15 0.39904901 11967.477 1282083.4 0.017518041 0.0037439062
220000 1.4455052 11967.084 11967.158 0.40609661 11967.49 1280964.2 0.020508494 0.0037471773
230000 1.4382855 11967.178 11967.254 0.40406834 11967.582 1281428.3 0.021371316 0.0037458201
240000 1.4109532 11967.127 11967.201 0.39638967 11967.523 1280443.2 0.020059525 0.003748702
250000 1.3977696 11967.126 11967.194 0.39268589 11967.519 1279708.3 0.019488007 0.0037508547
260000 1.4568479 11967.194 11967.269 0.4092832 11967.603 1278363.3 0.019834653 0.0037548012
270000 1.4336037 11967.29 11967.366 0.40275303 11967.693 1275210.3 0.019765222 0.0037640849
280000 1.4496045 11967.169 11967.243 0.40724825 11967.576 1278402.6 0.019842549 0.0037546858
290000 1.4052963 11967.242 11967.316 0.39480044 11967.637 1273794.5 0.020544339 0.0037682686
300000 1.4146228 11967.128 11967.202 0.39742059 11967.525 1274629 0.019919752 0.0037658017
310000 1.4397921 11967.151 11967.22 0.4044916 11967.556 1275107.2 0.021305508 0.0037643894
320000 1.407828 11967.278 11967.354 0.39551168 11967.673 1270207.1 0.020183532 0.0037789112
330000 1.4293389 11967.26 11967.333 0.4015549 11967.662 1270155.9 0.018637366 0.0037790636
340000 1.4221336 11967.246 11967.314 0.39953066 11967.645 1270091 0.021058521 0.0037792567
350000 1.4203498 11967.212 11967.277 0.39902952 11967.611 1270869.7 0.018803253 0.0037769412
360000 1.4594634 11967.193 11967.269 0.410018 11967.603 1270067.4 0.018570373 0.0037793271
370000 1.4621953 11967.204 11967.276 0.4107855 11967.615 1267238.1 0.019809506 0.0037877649
380000 1.4362394 11967.255 11967.326 0.40349349 11967.658 1265744.3 0.021063134 0.0037922351
390000 1.4105247 11967.299 11967.366 0.39626929 11967.696 1266405.6 0.021108738 0.0037902549
400000 1.3906129 11967.339 11967.406 0.39067532 11967.73 1264177.3 0.019243244 0.0037969358
410000 1.4150246 11967.329 11967.399 0.39753347 11967.726 1264738.2 0.019913894 0.0037952519
420000 1.4545877 11967.327 11967.398 0.40864824 11967.735 1261764 0.020881227 0.0038041979
430000 1.3887296 11967.344 11967.414 0.39014621 11967.735 1263866.6 0.018997035 0.0037978693
440000 1.453729 11967.222 11967.293 0.40840698 11967.631 1262056.8 0.023050528 0.0038033153
450000 1.4410089 11967.301 11967.369 0.40483344 11967.705 1260301.9 0.020207303 0.0038086113
460000 1.4668265 11967.337 11967.409 0.41208657 11967.749 1258893.8 0.020615381 0.0038128714
470000 1.4739648 11967.459 11967.529 0.414092 11967.873 1260774.2 0.021009183 0.0038071845
480000 1.4610418 11967.384 11967.456 0.41046143 11967.794 1256277.7 0.019832959 0.0038208112
490000 1.4248566 11967.551 11967.617 0.40029565 11967.951 1257138.8 0.019898582 0.003818194
500000 1.4472015 11967.435 11967.507 0.40657318 11967.842 1256611.8 0.018312841 0.0038197953
Loop time of 261.241 on 6 procs for 500000 steps with 4800 atoms

Pair time () = 8.58921 (3.28785)* *Bond time () = 24.937 (9.54559)
Neigh time () = 12.6994 (4.86119)* *Comm time () = 17.4716 (6.68792)
Outpt time () = 0.107458 (0.0411337)* *Other time () = 197.436 (75.5763)

Nlocal: 800 ave 1269 max 528 min
Histogram: 2 1 1 0 0 0 1 0 0 1
Nghost: 22 ave 42 max 0 min
Histogram: 1 1 0 0 1 1 0 0 0 2
Neighs: 367.667 ave 569 max 233 min
Histogram: 1 1 0 2 0 0 1 0 0 1

Total # of neighbors = 2206
Ave neighs/atom = 0.459583
Ave special neighs/atom = 2
Neighbor list builds = 22058
Dangerous builds = 0

write_restart restart1.spm
write_data dataNew.spm

data.spm (757 KB)

in.spm (1.21 KB)

Dear users,

I would like to ask you the following: I run my simulations in NPT
ensemble. My system is in 2-dimensions and it consists of 100 atoms with
triangular shape (ring) and chains attached each atom on the corners. Each
ring consist of 48 beads. For the rings I use fix rigid/npt and for the
chains I use fix npt (non-rigid bodies). I have FENE potential to connect
each ring with chains. You can find the data file (data.spm) and input file
(in.spm) attached. You can see that my pressure is 0.05 in LJ units but in
output file (see attached files - log.lammps) the average pressure is far
away than that value. I know that the barostat I used help to maintained
the average pressure constant, but I do not understand why this value is so
far away than the value in input file (0.05 in LJ units). I tried to fix
it, I changed the time step, I changed the damping parameters, but nothing
know. The problem remains.

I appreciate any help! Thank you very much!

​you have two fixes (rigid/npt and npt) that try to ​adjust the box
dimensions. this is incorrect. since pressure and box volume are global
properties for the entire system, there not be more than one fix at a time
trying to adjust them. this is discussed in the manual.
if you change fix npt to fix nvt, it should work as expected.

axel.

Hi Axel,

Thank you very much for your reply! I read that in the documentation, but I thought that I cannot use different ensemble in the same system. As my system consists of rings with chain (the rings are rigid and the chain are non-rigid bodies) I thought that there is a problem if I use both NPT and NVT, I mean by physical perspective. So, there is no problem to use both NPT and NVT ensemble in the same system.

Thank you for that! I will check it again. Thank you for your time and your help!

Regards,
Nikoletta

Hi Axel,

Thank you very much for your reply! I read that in the documentation, but
I thought that I cannot use different ensemble in the same system. As my
system consists of rings with chain (the rings are rigid and the chain are
non-rigid bodies) I thought that there is a problem if I use both NPT and
NVT, I mean by physical perspective. So, there is no problem to use both
NPT and NVT ensemble in the same system.

​you are making the mistake of assuming that using fix nve, nvt, npt or
similar will "imprint" a specific ensemble on a system.
this is not the case. you have to look at things the other way around, i.e.
what is necessary to have a specific ensemble.

take NVE as an example: it needs time integration (on all atoms), fully
periodic boundary conditions and nothing ​else manipulating the system. fix
nve only provides the first part. if you combine it with, say, fix
temp/csvr, then you will get an NVT ensemble *despite* using fix nve.

so NPT ensemble needs: time integration, temperature control that is
consistent with canonical sampling, volume control that allows for (local)
fluctuations consistent with a very large volume (and fully periodic
boundary conditions). fix npt provides all three. fix rigid/npt does the
same. thus if you combine both, you manipulate the volume twice. the tricky
thing is that you can assume equipartitioning for the kinetic energy and
thus compute a "temperature" for any subgroup of atoms based on that
assumption, yet for pressure this is not possible.

Thank you for that! I will check it again. Thank you for your time and
your help!

​well, if you find the time, have a look into a statistical mechanics text
book for additional enlightenment. it may hurt a bit right now, but trust
me that it will pay off in the long run. :wink:

axel.​

Hi Alex,

Thank you again for your time and help! I started to read the Statistical Mechanics and at the same time I test my system with fix npt/rigid for the rings and with fix nvt for chains (non-rigid bodies). Unfortunately, the problem remains.; the average pressure is different than the target pressure (I run the system several times in order to catch the target pressure, but nothing). I don’t know where is the problem. Is there any idea, please?

Thank you again!

Regards,
Nikoletta

Hi Axel (and not Alex),

Thank you again for your time and help! I started to read the Statistical Mechanics and at the same time I test my system with fix npt/rigid for the rings and with fix nvt for chains (non-rigid bodies). Unfortunately, the problem remains.; the average pressure is different than the target pressure (I run the system several times in order to catch the target pressure, but nothing). I don’t know where is the problem. Is there any idea, please?

Thank you again!

Regards,
Nikoletta

P.S. I’m sorry about the fault in your name

Hi Axel (and not Alex),

Thank you again for your time and help! I started to read the Statistical
Mechanics and at the same time I test my system with fix npt/rigid for the
rings and with fix nvt for chains (non-rigid bodies). Unfortunately, the
problem remains.; the average pressure is different than the target
pressure (I run the system several times in order to catch the target
pressure, but nothing). I don't know where is the problem. Is there any
idea, please?

​keep reading!

soon you should discover that certain properties, e.g. pressure, fluctuate
more than others. however, for a system in equilibrium, equipartitioning
does not exist only in space, but also in time, which means, that you can
average over time as well. ...and in the case of pressure that is almost
always required, since most condensed systems are not very compress​ible
and thus the pressure fluctuates a *lot*. if i add to your example input
(after switching fix npt to fix nvt) this line:

fix 4 all ave/time 1 1000 1000 v_press ave window 20

​and change the thermo output to this:​

thermo_style custom step temp pe ebond ke etotal vol press density f_4

​you'll see that when averaging over a window of 20000 time steps, you ​are
within 2% of your desired target pressure.

statistics at work. :wink:

axel.

i should probably add, that you can also see, that it takes almost half of your 50000 steps until the system reaches the equilibrium pressure. so if you average over the whole run, you’ll get useless information.

axel.

Hi Axel,

Thank you very much for all these informations! Yes, it’s real that pressure in my system fluctuates a lot and it needs a lot of steps in order to catch the target pressure. Thank you a lot. I will continue to study the statistical mechanics to understand the laws and the rules.

Regads,
Nikoletta