kinisi.yeh_hummer#

Implementation of the Yeh-Hummer finite-size correction for diffusion coefficients from molecular dynamics simulations with periodic boundary conditions.

Based on: Yeh & Hummer, J. Phys. Chem. B 2004, 108, 15873-15879

class kinisi.yeh_hummer.YehHummer(diffusion, temperature, priors=None)#

Bases: FittingBase

Apply Yeh-Hummer finite-size corrections to diffusion coefficients from MD simulations with periodic boundary conditions.

The Yeh-Hummer correction formula is: D_PBC = D_0 - (k_B * T * xi) / (6 * pi * eta * L)

Internally, fitting is performed in (D_0, slope) space where the model is linear, then slope is converted to viscosity for output.

Parameters:
  • diffusion – sc.DataArray with diffusion coefficients and box_length coordinate

  • temperature (Variable) – Temperature of the simulations, as a scipp scalar.

  • priors – Optional priors for the [D_0, slope] parameters as frozen scipy.stats distributions, where slope = (k_B * T * xi) / (6 * pi * eta) and both are in the units of the data, i.e., D_0 in the diffusion unit and slope in the diffusion unit multiplied by the box_length unit. Defaults to D_0 uniform on [0.8, 1.2] * max(D) and slope uniform on the range given by viscosities of 1e-5 to 1e-1 Pa*s.

viscosity_to_slope(eta)#

Convert viscosity to slope for fitting.

max_likelihood()#

Find maximum likelihood parameters with better initial guess for YehHummer.

max_aposteriori()#

Find maximum aposteriori parameters with better initial guess for YehHummer.

property D_infinite: Variable | Samples#

Return infinite-system diffusion coefficient.

property shear_viscosity: Variable | Samples#

Return estimated shear viscosity (converted from slope samples).