Open wjq1228 opened 1 week ago
If the coordinate transformation is indeed incorrect, you can manually calculate the coordinates using the correct formula as a workaround until an update is available. mdsimulation.txt
i have attached the file here see if it works
Very thanks! Looking forward to updates soon!
appreciate it !
@wjq1228 do you have a reference (eg from the LAMMPS docs) that defines the scaled coordinate transformation?
We will look into this, concerning if correct.
Expected behavior
The coordinate transform of "scaled" LAMMPS trajectory should be imported correctly.
Actual behavior
The MDAnalysis calculated incorrectly coordinates from scaled to unscaled. Calculation method of “scaled” is xs = (x-xlo)/(xhi-xlo). So, when coordinate transform, the coordinate can be calculated by x = (xhi-xlo)*xs + xlo. However, the LAMMPS DumpReader returns incorrect coordinate transform. For example, the scaled coordinate in my dump is
The real coordinate of atom 2608 is [2.58086, 12.9388, 6.15641]. However, the coordinate calculated by DumpReader is [2.513854, 13.992818, 36.15641]. Calculation method of DumpReader seem to be x = (xhi-xlo)*xs - xlo. Other atoms are tested and the same error happened.
Code to reproduce the behavior