calculate_transport_coefficients

mdcraft.analysis.transport.calculate_transport_coefficients(times: ndarray[float], msd_cross: ndarray[float], msd_self: ndarray[float], Ns: ndarray[int], dimensions: ndarray[float], kBT: float, start: int = 1, stop: int = None, scale: str = 'log', *, start_self: int = None, stop_self: int = None, scale_self: str = None, enforce_linear: bool = True, verbose: bool = False) tuple[ndarray[float], ndarray[float], ndarray[float]][source]

Fits the mean squared displacements (MSDs) or the analogous cross displacements (CDs) to evaluate the self-diffusion coefficients \(D_i\) and the Onsager transport coefficients \(L_{ij}\) and \(L_{ii}^\mathrm{self}\).

Parameters:
timesnumpy.ndarray

Changes in time \(t-t_0\).

Shape: \((N_t,)\).

Reference unit: \(\mathrm{ps}\).

msd_crossnumpy.ndarray

MSDs and CDs that include the dimensionality scaling factor.

Shape: \((C(N_\mathrm{groups}+1,\,2),\,N_t)\) or \((C(N_\mathrm{groups}+1,\,2),\,N_\mathrm{blocks},\,N_t)\).

Reference unit: \(\mathrm{Å}^2\).

msd_selfnumpy.ndarray

Self MSDs that include the dimensionality scaling factor.

Shape: \((N_\mathrm{groups},\,N_t)\) or \((N_\mathrm{groups},\,N_\mathrm{blocks},\,N_t)\).

Reference unit: \(\mathrm{Å}^2\).

Nsnumpy.ndarray

Number of atoms or centers of mass \(N_i\) in each group.

dimensionsnumpy.ndarray

System dimensions.

Shape: \((3,)\).

Reference unit: \(\mathrm{Å}\).

kBTfloat

Thermal energy scale.

Reference unit: \(\mathrm{kJ/mol}\).

startint, default: 1

Starting frame with respect to the interval used in Onsager.run() for fitting the MSDs (or their analogs).

stopint, optional

Ending frame with respect to the interval used in Onsager.run() for fitting the MSDs (or their analogs).

scalestr, {"log", "linear"}

Data scaling for fitting the MSDs (or their analogs) against time.

Valid values:

  • "linear": Linear \(x\)- and \(y\)-axes.

  • "log": Logarithmic \(x\)- and \(y\)-axes.

start_selfint, keyword-only, optional

Starting frame with respect to the interval used in Onsager.run() for fitting the self MSDs. If not provided, start_self shares a value with start.

stop_selfint, keyword-only, optional

Ending frame with respect to the interval used in Onsager.run() for fitting the self MSDs. If not provided, stop_self shares a value with stop.

scale_selfstr, keyword-only, optional

Data scaling for fitting the self MSDs against time. If not provided, scale_self shares a value with scale.

Valid values:

  • "linear": Linear \(x\)- and \(y\)-axes.

  • "log": Logarithmic \(x\)- and \(y\)-axes.

enforce_linearbool, keyword-only, default: True

Enforce linear fits for data on a logarithmic scale by setting the slope to \(1\), or

\[\log(\mathrm{MSD})=\log(t)+b\]
verbosebool, keyword-only, default: False

Determines whether detailed progress is shown.

Returns:
L_ijnumpy.ndarray

Onsager transport coefficients \(L_{ij}\).

Shape: \((N_\mathrm{blocks},\,N_\mathrm{groups},\, N_\mathrm{groups})\).

Reference unit: \(\mathrm{mol/(kJ\cdotÅ\cdot ps)}\).

L_ii_selfnumpy.ndarray

Self-diffusion contribution to the single-species Onsager transport coefficients \(L_{ii}^\mathrm{self}\).

Shape: \((N_\mathrm{blocks},\,N_\mathrm{groups})\).

Reference unit: \(\mathrm{mol/(kJ\cdotÅ\cdot ps)}\).

D_inumpy.ndarray

Self-diffusion coefficients \(D_i\).

Shape: \((N_\mathrm{blocks},\,N_\mathrm{groups})\).

Reference unit: \(\mathrm{Å/ps}\).