amep.thermo.kintemp#

amep.thermo.kintemp(v: ndarray, mass: float | ndarray | None = None) ndarray#

Calculates the kinetic temperature per particle.

Notes

The kinetic temperature is defined as the kinetic energy. In the overdamped regime (i.e. mass=0), it is simply \(\langle v^2\rangle\) (see Ref. [1]).

References

Parameters:
  • v (np.ndarray) – Velocity array of shape (N,3).

  • mass (float or np.ndarray or None, optional) – Particle mass(es). The default is None.

Returns:

temp – Kinetic temperature of each particle. Same length as v.

Return type:

np.ndarray

Examples

>>> import amep
>>> traj = amep.load.traj("../examples/data/lammps.h5amep")
>>> frame = traj[-1]
>>> tkin = amep.thermo.kintemp(
...     frame.velocities(), mass=frame.mass()
... )
>>> fig, axs = amep.plot.new(figsize=(3.6,3))
>>> mp = amep.plot.particles(
...     axs, frame.coords(), frame.box, frame.radius(),
...     values=tkin, cscale="log"
... )
>>> axs.set_xlabel(r'$x$')
>>> axs.set_ylabel(r'$y$')
>>> cax = amep.plot.add_colorbar(
...     fig, axs, mp, label=r"$T_{\rm kin}$"
... )
>>> fig.savefig('./figures/thermo/thermo-kintemp.png')
>>>
../_images/thermo-kintemp.png