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

Create a new function for diffusivity #28

Closed
phydev opened this issue Jun 12, 2020 · 2 comments · Fixed by #89
Closed

Create a new function for diffusivity #28

phydev opened this issue Jun 12, 2020 · 2 comments · Fixed by #89
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@phydev
Copy link
Member

phydev commented Jun 12, 2020

The calculation of the diffusion coefficient should be moved to a new @staticmethod (see bellow).
https://github.com/phydev/trajpy/blob/562415b0f35976c726df7fc8daa773dacca7fb2c/trajpy/trajpy.py#L74

@staticmethod
def diffusivity_(msd, timelag, ndim):
    """"
        :param msd: ensemble averaged mean squared displacement
        :param timelag: time-lag
        :param ndim: number of dimensions
        :return diffusivity: short-time diffusion coefficient D 
    """"
    diffusivity = Trajectory.anomalous_exponent_(msd[:10], timelag[:10]) / (2*n)
    return diffusivity
@phydev phydev added enhancement New feature or request good first issue Good for newcomers labels Jun 12, 2020
@phydev phydev self-assigned this Jun 12, 2020
@phydev
Copy link
Member Author

phydev commented Jun 17, 2020

Diffusivity should be generalized with Green-Kubo relation.

phydev pushed a commit that referenced this issue Dec 16, 2020
phydev pushed a commit that referenced this issue Dec 16, 2020
@phydev
Copy link
Member Author

phydev commented Dec 16, 2020

Commit 4e620cb: added three new functions to the class Trajectory in order to compute the Green-Kubo relation:

  • velocity: computes the instantaneous velocity along the trajectory
  • _stationary_velocity_correlation: estimate the stationary velocity correlation
  • green_kubo_: calculates the diffusivity by integrating the stationary velocity correlation

A new test covering the new functions was added to tests/computing_features.py

@phydev phydev closed this as completed Dec 16, 2020
@phydev phydev linked a pull request Jun 3, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant