New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Sliding Origin for MSD Computation #3796
Comments
Hi @GenieTim,
|
Thanks for your insights, @Bibobu. Two more references:
|
After close to a year, I had to revisit this, and might have found how to do it without any additional implementation required (i.e., using the existing fix ave/correlate/long):
the rest (the formula shown above) can be done in post-processing. |
@GenieTim your script seems to be calculating |
Hm... @S-Lykles I would argue my script computes:
But I am thankful for any issues you see. |
Ah my bad, I thought that |
Yes, you are right, the "*10" limits to 10, as this is the number of atoms in the centralBeads group in my case. For some reason, Yes, absolutely, the conversion between atom- and global vectors like this feels very smelly and is a waste of resources, but there does not seem to be another way, yet, as far as I know. |
I was working on a custom fix to calculate MSD and some other properties, but this post made me realize that writing a |
Could you kindly reference me or this issue, @S-Lykles, please, when you have a working implementation? Thanks. |
While my code works, comparing it to results from outputting the coordinates and computing the MSD externally indicates some considerable issues with the multiple-tau method; not sure if it actually is an issue of mulitple-tau or my post-processing, but so far, I have not found an issue for the relatively simple script, yet there seems to exist some considerable strangeness: |
@GenieTim In the paper about the multiple tau correlator they mention: "F. Nonaveraged algorithm I have a fork where I added a an option to ave/correlate/long to use the nonaveraged algorithm. I havent gotten around to testing it yet but I plan to make a pull request once I have. |
You can find it here, if you like you can help test it for me :) https://github.com/S-Lykles/lammps/tree/nonaveraged_correlate_long |
Ah, you are right, that slipped my mind, thanks for pointing it out. I will gladly have a try at your implementation early next week. |
Ok, so, I have given your implementation a try. It seems to work just fine. However, I have realised, that there is another caveat and corresponding trick to improve the accuracy of the multiple-tau method: rather than doing the whole (in this figure, only N = 80 got the non-averaged treatment, all other systems are the same as in the plot above, except for what I used as baseline) |
Summary
The
compute msd
command currently only takes one origin into account.One must call this command multiple times to achieve multiple origins, while in theory, it would be possible to compute the MSD using "all" origins to get very smooth results.
Detailed Description
I imagine one path to a sensible implementation to be this:
Using the following relation from Wikipedia:
, I would imagine an extension to
fix ave/correlate/long
to be a suitable way. Say, a parameter "msd", which, when used, additionally computes the two quantities<r^2(t)>
and<r^2(0)>
(it might be that I misunderstand the correlation computation a bit, but if I am not mistaken,<r^2(0)>
is the first entry in the autocorrelation computation anyway) and automatically applies the formula above before outputing.To me, this felt like it could be easy to implement; however, the code of
fix ave/correlate/long
is still not particularly easy to understand. Additionally, I feel like I am missing some understanding about the autocorrelation, that's why I hope you could give me a hint if I am missing an obvious way how this could be achieved in LAMMPS now already.Further Information, Files, and Links
The Wikipedia I meantioned above: MSD on Wikipedia
Other random MSD implementation using multiple-tau autocorrelation: jkriege2/StatisticsTools
The text was updated successfully, but these errors were encountered: