Hi all, I’m new to the dynasor package, and I would like to use it to calculate the self intermediate scattering function for a binary mixture of Kob-Andersen model simulated by lammps. I manged to get some outputs from it, but not sure what to think of the units, the manual says unit of time is “fs” and positions are in “Å”, for Kob-Andersen everything is in LJ units, and also the F(k) plot doesn’t seem decaying from 1, it starts about 2, so I think there is something up with the units. do you have any idea how should I set the parameters of Dynasor functions properly for my system?
Hi aminer,
I think your suspicion might be correct, one has to be careful with the units with these types of calculations.
When using dynasor, you need to specify the time difference dt
between two consecutive frames in your MD trajectory. This is the timestep that you specified for your MD simulation multiplied by the your dump frequency. If you, for example, have dumped every 5th frame and your time step is 2 fs, then you should specify dt=10
when using dynasor.
The specified dt
is by default assumed to be in fs, but time_unit='ps'
and time_unit='ns'
are also supported.
From your post, I gather that you have used LJ units when specifying the timestep in lammps, i.e. your timestep is given as some fraction of tau (timestep command — LAMMPS documentation), right? This means that you need to convert the timestep to the corresponding time in femtoseconds and multiply it with your dump frequency (dump command — LAMMPS documentation) to specify dt
for the dynasor calculation.
For the conversion from LJ timestep to fs, please consult the lammps documentation and forum (perhaps units command — LAMMPS documentation and this lammps forum post might be useful).
Regarding the length units, I assume the positions of the atoms are written in the trajectory file in units of sigma if you used LJ units, right? In dynasor, there is native support for Ångström, nm, pm and fm, with Ångström being the default. In order to get the correct units for dynasor, I think the easiest would be to scale all positions in the file such that they are given in Ångström, before feeding the trajectory to dynasor.
If possible, you could instead redo the lammps MD simulation and save the trajectory in real units immediately, in order to avoid having to perform the unit conversions specified above.
Feel free to reach out again if you have any further questions.