Diffusion Analysis in MD Simulations

Author: Tyler Reddy

The purpose of this Python module is to provide utility functions for analyzing the diffusion of particles in molecular dynamics simulation trajectories using either linear or anomalous diffusion models.

diffusion_analysis.fit_anomalous_diffusion_data(time_data_array, MSD_data_array, degrees_of_freedom=2)

This function should fit anomalous diffusion data to Equation 1 in Kneller et al. (2011) J Chem Phys 135: 141105. It will assign an appropriate coefficient based on the specified degrees_of_freedom. The latter value defaults to 2 (i.e., a planar phospholipid bilayer). Input data should include arrays of MSD (in Angstroms) and time values (in ns). The results are returned in a tuple.

Parameters:

time_data_array : array_like

Input array of time window sizes (nanosecond units)

MSD_data_array : array_like

Input array of MSD values (Angstrom units; order matched to time_data_array)

degrees_of_freedom : int

The degrees of freedom for the diffusional process (1, 2 or 3; default 2)

Returns:

fractional_diffusion_coefficient

The fractional diffusion coefficient (units of Angstrom ** 2 / ns ** alpha)

standard_deviation_fractional_diffusion_coefficient

The standard deviation of the fractional diffusion coefficent (units of Angstrom ** 2 / ns ** alpha)

alpha

The scaling exponent (no dimensions) of the non-linear fit

standard_deviation_alpha

The standard deviation of the scaling exponent (no dimensions)

sample_fitting_data_X_values_nanoseconds

An array of time window sizes (x values) that may be used to plot the non-linear fit curve

sample_fitting_data_Y_values_Angstroms

An array of MSD values (y values) that may be used to plot the non-linear fit curve

Raises:

ValueError

If the time window and MSD arrays do not have the same shape

diffusion_analysis.fit_linear_diffusion_data(time_data_array, MSD_data_array, degrees_of_freedom=2)

The linear (i.e., normal, random-walk) MSD vs. time diffusion constant calculation.

The results are returned in a tuple.

Parameters:

time_data_array : array_like

Input array of time window sizes (nanosecond units)

MSD_data_array : array_like

Input array of MSD values (Angstrom units; order matched to time_data_array)

degrees_of_freedom : int

The degrees of freedom for the diffusional process (1, 2 or 3; default 2)

Returns:

diffusion_constant

The linear (or normal, random-walk) diffusion coefficient (units of Angstrom ** 2 / ns ** alpha)

diffusion_constant_error_estimate

The estimated uncertainty in the diffusion constant (units of Angstrom ** 2 / ns ** alpha), calculated as the difference in the slopes of the two halves of the data. A similar approach is used by GROMACS g_msd.

Raises:

ValueError

If the time window and MSD arrays do not have the same shape

Previous topic

Welcome to diffusion_analysis_MD_simulations’s documentation!

This Page