Mean Square Displacement

Hello everyone.

My lammps data file has 12 molecules that are compressed under npt ensemble to generate densities and energies at room temperature and pressure. Since its a mixture of different kinds of molecules interacting to form a material property, I am a little bit confused about the mean square displacement values that I am getting. I am using the script below.

Are the values of MSD an average for all molecules or if the values are averages of different molecules at a particular instant?

Also, as per the lammps guide, if " If the average option is set to yes. It only makes sense to use this option if the atoms are not diffusing, so that their average positions relative to the centre of mass of the system are stationary. The most common case is crystalline solids undergoing thermal motion."

How can I make the mixture of molecule diffuse altogether like a single material.
I totally understand that my question can be confusing, but supportive answers will be very much appreciated.

compute msd all msd
reset_timestep 0
fix 5 all vector 1 c_msd[1] c_msd[2] c_msd[3] c_msd[4]

thermo_style custom step temp c_msd[1] c_msd[2] c_msd[3] c_msd[4]

only need to run for 10K steps to make a good 100-frame movie

dump 1 all xyz 100
thermo 1000
run 10000000

The compute msd command knows nothing about molecules. It operates on the atoms in the compute group and the result is the MSD averaged over all atoms.

What has this to do with the “average” option? How atoms (or molecules) move depends on the forces they experience. The MSD value is simply a diagnostic.

It is not just confusing, but lacking a lot of information. mixing up unrelated issues, and contradicting what is written in the documentation.

Thank you for your response @akohlmey
Inconvenience regretted. I am a novice and trying to learn lammps on my own.

The reason I put a comment on the average option is that I do not see the group of atoms displace from one position to other in the XYZ file but are only vibrating at a fixed position which actually happens in crystals. But my system is a representation of liquid and I want to see diffusive action of group of atoms.

Most likely you are simulating ice instead of a liquid. This sometimes occur due to bad thermostating.

Please see the following two recent comments about the feasibility of learning MD and LAMMPS on your own.

Well, if your system is not behaving like a liquid on visualization, it is not likely going to have a diffusivity of a liquid, and changing a flag in an analysis tool does not change the trajectory.
The fact that you have this line of thought underlines that you need to find a sufficiently experienced tutor.


I totally agree with you. I am going through the same situation of being unsupervised. I appreciate that you reminded me that its not something that we can do on our own.