# NPT monte carlo simulation pressure calculation

1. Jul 6, 2014

### pyscho

Hello all,

I have been working on an NPT monte carlo simulation. I would like to know how I can measure the instantaneous pressure of the system at each monte carlo step?

2. Jul 6, 2014

3. Jul 6, 2014

### pyscho

I am applying periodic boundary conditions, and my atoms are sitting on their lattice sites (pretty much). I am trying to figure out the optimum lattice constant for a given pressure and temperature. However, I would like to "monitor" the pressure of the system as a function of monte carlo steps. In NVT monte carlo simulations, even the system reaches a thermal equilibrium with the heat bath, there is still fluctuations in temperature in the system (not the heat bath) besides energy fluctuations. Similar thing is also true for NPT, but I don't exactly know how to measure those fluctuations in NPT monte carlo simulation. I am digging something that has to do with virial, but not sure how to use it at the moment.

4. Jul 8, 2014

### Useful nucleus

Last edited: Jul 8, 2014