# Theory used to calculate temperature in Lammps

Dear All,

I am trying to understand the theory used to calculate temperature in Lammps. Statistical mechanics relates ‘the mean kinetic energy of the molecules or atoms to the temperature of the system’.

My question is that in Lammps how to consider the velocity (or kinetic energy) of the molecules or atoms within the simulation box if we move the whole box with some translational or rotational accelerations. what velocities should be used to calculate the kinetic energy and temperature: the velocity relative to the box or the velocities relative to some fixed reference frame? since these two are not the same any more.

The system’s temperature is not supposed to change due to only the whole box 's motion. ?

Thank you for your time and help!

Lili Zhang

Dear All,

I am trying to understand the theory used to calculate temperature in
Lammps. Statistical mechanics relates 'the mean kinetic energy of the
molecules or atoms to the temperature of the system'.

My question is that in Lammps how to consider the velocity (or kinetic
energy) of the molecules or atoms within the simulation box if we move the
whole box with some translational or rotational accelerations. what
velocities should be used to calculate the kinetic energy and temperature:
the velocity relative to the box or the velocities relative to some fixed
reference frame? since these two are not the same any more.

The system's temperature is not supposed to change due to only the whole box
's motion. ?

the total kinetic energy in lammps is the collected kinetic energy of all atoms.
in lammps it is assumed that the box in itself doesn't move or rotate. you can
have objects inside your system that do, but then the computed "temperature"
is still based on the total kinetic energy of its atoms. any setup
that would not
conform to this, would be in error. there are several discussions in the mailing
list archives on the "flying icecube syndrom".

axel.

Many of the temperature computes, e.g. compute temp.com,
perform their calculation of T after removing a "bias" from
the atom velocities, e.g. the velocity of the center of mass.
Thus various kinds of collective motion can be subtracted
from the atoms, before the thermal KE is used to calc a T.

See section 6.16 of the manual for a discussion.

Steve