Skip to content
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

Improve MSD calculation #248

Merged
merged 4 commits into from
Jan 25, 2024
Merged

Improve MSD calculation #248

merged 4 commits into from
Jan 25, 2024

Conversation

SCiarella
Copy link
Contributor

This branch improves the statistics of the MSD calculation, expanding on the idea of the multiple starting points, discussed in #237.

In the limit of infinitely many starting-points, the MSD algorithm can consider all the non-overlapping continuous subtrajectories of length $t_i$ in order to compute all the corresponding $MSD(t_i)$.
Numerically this can be efficiently implemented following the algorithm introduced in this paper, which is well explained in this stackoverflow thread.

This new MDS-algorithm uses Fast Fourier Transform, and produces estimation which are significantly less sensitive to noise.
These are some plot to showcase the improved performance:
li

It can also be used for multiple species at the same time:
many

And also using plotly:
newplot

Use MSD method in plots

Add MSD test
@SCiarella SCiarella linked an issue Jan 25, 2024 that may be closed by this pull request
@SCiarella SCiarella requested a review from stefsmeets January 25, 2024 15:11
Copy link
Contributor

@stefsmeets stefsmeets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I don't entirely understand how the the new msd works, but the plots look nice 😅

A few minor nitpicks from my side.

src/gemdat/trajectory.py Outdated Show resolved Hide resolved
src/gemdat/plots/matplotlib/_displacements.py Outdated Show resolved Hide resolved
src/gemdat/plots/plotly/_displacements.py Outdated Show resolved Hide resolved
@SCiarella SCiarella marked this pull request as draft January 25, 2024 15:36
SCiarella and others added 3 commits January 25, 2024 16:36
MSD into a function

Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Simplify traj filtering

Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
@SCiarella SCiarella marked this pull request as ready for review January 25, 2024 15:48
@SCiarella SCiarella requested a review from stefsmeets January 25, 2024 15:55
@stefsmeets stefsmeets merged commit 72d9bb6 into main Jan 25, 2024
5 checks passed
@stefsmeets stefsmeets deleted the multiple_msd_starts branch January 25, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use multiple starting point to compute the MSD
2 participants