[MMTK] Units of measurement

Konrad Hinsen hinsen@cnrs-orleans.fr
Tue, 11 Sep 2001 11:15:59 +0200


> 		Here is a trivial question regarding work with structures. If I
> measure the distance between two atoms by getting the length of the difference
> of two vectors, do I get a value in Angstrom? 

No, the internal unit system is the following:

  length:  nm
  time:    ps
  mass:    g/mol (amu)
  charge:  elementary charge

All other units are derived from these by composition, just like in
the SI system, and using the same relations. For example, the energy
unit is kJ/mol.

Sometimes MMTK users ask why MMTK doesn't use this or that unit "as
everybody does". First, preferred units vary from one domain to the
other. More importantly, a library like MMTK with many functions
returning various quantities would be very difficult to use if the
unit system were not consistent. You, the user, would have to
remember where to put the conversion factors in all calculations.

The module MMTK.Units provides conversion factors for traditional
units such as Angstrom. To get the distance between two atoms in
Angstrom, write

      universe.distance(atom1, atom2)/Units.Ang

>From your question I suppose you were doing someting like

      (atom1.position()-atom2.position()).length()

to get the distance. This is fine for non-periodic universes, but the
form given above has the advantage of automatically giving the
minimum-image distance in periodic systems.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------