Unit conversion in Dynasor

Hi!

I am reading into dynasor a trajectory file from a LAMMPS simulation of polymers that uses Lennard-Jones units for time and length. The units for time and length are thus not femtoseconds (fs) and Ångströms (Å) that dynasor assumes as default. Are there a simple way to tell dynasor what the units are (expressed in Å and fs) or should I convert to Å and fs before importing the trajectory into dynasor.

Jens


                    
 

Hi Jens,

Yes, you can tell the dynasor trajectory reader which units are used in your trajectory. This is done by specifying the keywords `length_unit` and `time_unit` when setting up your Trajectory. See this documentation page and, for example, the part about setting up the trajectory in this tutorial for more information.

Please don’t hesitate to ask in case you have more questions.

Esmée

OK! :slight_smile: So you can provide a LAMMPS dump file with e.g. lengths in 1 Å, 1 nm, 1 pm etc and just add the additional argument “ length_unit=‘nm’ “ etc when calling Trajectory(..), but if you happen to use a unit of length equal to say 0.79 nm in LAMMPS are there still a way to tell dynasor this value of unit?

       ./Jens

Exactly, that’s how it works!

As the conversions are tabulated, this is not possible in the current implementation. If you have used such a length unit, I advise you to convert first, like you wrote in your initial question, before plugging your trajectory into dynasor.

Are units like 0.79 nm common in your field? If this becomes a common issue, we could perhaps consider extending the interface to also allow for numerical scaling factors instead of only the standard named units.

Are units like 0.79 nm common in our field? Good question. I guess not, but I made the “mistake” to use LAMMPS with Lennard-Jones units and then it happened that a polymer bead had this diameter which I used as base unit for length. I guess next time I will consider normalizing all lengths to 1 nm instead! :grinning_face_with_smiling_eyes: Thanks for the help.

1 Like