Hi there,
I am trying to simulate a 2D system of N particles in p-T ensemble.
I am measuring kinetic energy (K) and temperature (T) and printing them through the following rows:
compute 3 all ke
compute 4 all temp
variable N equal atoms
variable kin equal c_3
variable tem equal c_4
fix PRINT all print 1000 “{N} {kin} ${tem}” append xcm.dat
Problem is: plotting the ratio K/T i find N-1 instead of N.
On the instructions I find instead [http://lammps.sandia.gov/doc/compute_temp.html]
«The temperature is calculated by the formula KE = dim/2 N k T, where KE = total kinetic energy of the group of atoms (sum of 1/2 m v^2), dim = 2 or 3 = dimensionality of the simulation, N = number of atoms in the group, k = Boltzmann constant, and T = temperature.»
I guess that, since units are lj , k_B=1, yet I cannot understand why K/T=N-1 rather than N.
Regards
Mario
ps I attach the code to reproduce what I am saying. In xcm.dat you will find K as the second column, T as the third one.
in.pour (1.28 KB)