pybilt.diffusion package

Submodules

pybilt.diffusion.diffusion_coefficients module

Estimate self diffusion coefficients from MSD(t) data.

This module provides a set of functions to estimate self diffusion coefficients from mean squared displacement (MSD) time trajectories.

pybilt.diffusion.diffusion_coefficients.diffusion_coefficient_Einstein(times, msd_vals, dim=2, time_range=None)[source]

Estimate diffusion coefficient from MSD(t) via Einstein relation.

A function to estimate the diffusion constant from a mean squared displacement time series. This function uses the long time mean squared displacement approximation (Einstein relation):

MSD = lim_(t->inf) <||r_i(t) - r_i(0)||**2>_(nsels) = 2*dim*D*t

where D is the diffusion coefficient.

Parameters
  • times (numpy.array) – Array of the simulation times of each MSD point.

  • msd_vals (numpy.array) – Array of the MSD values.

  • dim (Optional[int]) – Set the dimension of the data and fit function: 1 for 1-dimensional , 2 for 2-dimensional, or 3 for 3-dimensional. Defaults to 2.

  • time_range (Optional[list]) – Specify a time range via a list with format [time_start, time_end]; the range should be given in the same units as the time data in the Arg times. Defaults to None, which uses the whole time range in Args times.

Returns

The value of the diffusion coefficient.

Return type

float

References

  1. Preston B. Moore, Carlos F. Lopez, Michael L. Klein, Dynamical

    Properties of a Hydrated Lipid Bilayer from a Multinanosecond Molecular Dynamics Simulation, Biophysical Journal, Volume 81, Issue 5, 2001, Pages 2484-2494, ISSN 0006-3495, http://dx.doi.org/10.1016/S0006-3495(01)75894-8. (http://www.sciencedirect.com/science/article/pii/S0006349501758948)

  2. Section 8.7,

    http://manual.gromacs.org/documentation/5.1.4/manual-5.1.4.pdf

pybilt.diffusion.diffusion_coefficients.diffusion_coefficient_anomalous_fit(times, msd_vals, dim=2, time_range=None)[source]

Fit MSD time series data to an anomalous diffusion model.

The anomalous diffusion function has the form:

MSD(t) = 2 * dim * D_alpha * t**alpha

For alpha values 0 < alpha < 1 corresponds to subdiffusion, while 1 < alpha < 2 corresponds to superdiffusion.

Parameters
  • times (numpy.array) – Array of the simulation times of each MSD point.

  • msd_vals (numpy.array) – Array of the MSD values.

  • dim (Optional[int]) – Set the dimension of the data and fit function: 1 for 1-dimensional , 2 for 2-dimensional, or 3 for 3-dimensional. Defaults to 2.

  • time_range (Optional[list]) – Specify a time range via a list with format [time_start, time_end]; the range should be given in the same units as the time data in the Arg times. Defaults to None, which uses the whole time range in Args times.

Returns

The return is a tuple with values (D_alpha, alpha) where D_alpha is the anomalous diffusion coefficent and alpha is the anomalous diffusion power.

Return type

tuple

References

  1. Gerald R. Kneller, Krzysztof Baczynski, and Marta

    Pasenkiewicz-Gierula, Consistent picture of lateral subdiffusion in lipid bilayers: Molecular dynamics simulation and exact results, The Journal of Chemical Physics 135, 141105 (2011); doi: http://dx.doi.org/10.1063/1.3651800

pybilt.diffusion.diffusion_coefficients.diffusion_coefficient_linear_fit(times, msd_vals, dim=2, time_range=None)[source]

Estimate the diffusion coefficent via linear least squares fit of MSD(t) data.

Assumes the MSD data has the linear form,

MSD(t) = 2*dim*D*t ,

and uses a linear least squares fit to estimate the diffusion coefficent D.

Parameters
  • times (numpy.array) – Array of the simulation times of each MSD point.

  • msd_vals (numpy.array) – Array of the MSD values.

  • dim (Optional[int]) – Set the dimension of the data and fit function: 1 for 1-dimensional , 2 for 2-dimensional, or 3 for 3-dimensional. Defaults to 2.

  • time_range (Optional[list]) – Specify a time range via a list with format [time_start, time_end]; the range should be given in the same units as the time data in the Arg times. Defaults to None, which uses the whole time range in Args times.

Returns

Returns a tuple with format (D, Error_D), where D is the estimated diffusion coefficent and Error_D is the estimated error for D.

Return type

tuple

References

  1. Preston B. Moore, Carlos F. Lopez, Michael L. Klein, Dynamical

    Properties of a Hydrated Lipid Bilayer from a Multinanosecond Molecular Dynamics Simulation, Biophysical Journal, Volume 81, Issue 5, 2001, Pages 2484-2494, ISSN 0006-3495; http://dx.doi.org/10.1016/S0006-3495(01)75894-8 (http://www.sciencedirect.com/science/article/pii/S0006349501758948)

Module contents