calculate_transport_coefficients¶
- mdhelper.analysis.transport.calculate_transport_coefficients(time: 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:
- timenumpy.ndarray
Changes in time \(t-t_0\).
Shape: \((N_t,)\).
Reference unit: \(\mathrm{ps}\).
- msd_crossnumpy.ndarray
MSDs/CDs for the \(N_\mathrm{g}\) groups over \(N_\mathrm{b}\) blocks of \(N_t\) trajectory frames each. Includes the dimensionality scaling factor.
Shape: \((C(N_\mathrm{g}+1,\,2),\,N_t)\) or \((C(N_\mathrm{g}+1,\,2),\,N_\mathrm{b},\,N_t)\).
Reference unit: \(\mathrm{Å}^2\).
- msd_selfnumpy.ndarray
Self MSDs for the \(N_\mathrm{g}\) groups over \(N_\mathrm{b}\) blocks of \(N_t\) trajectory frames each. Includes the dimensionality scaling factor.
Shape: \((N_\mathrm{g},\,N_t)\) or \((N_\mathrm{g},\,N_\mathrm{b},\,N_t)\).
Reference unit: \(\mathrm{Å}^2\).
- Nsnumpy.ndarray
Number of particles or centers of masses \(N\) 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 for fitting the self MSDs. If not provided, start_self shares a value with start.
- stop_selfint, keyword-only, optional
Ending frame 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 if detailed progress is shown.
- Returns:
- L_ijnumpy.ndarray
Onsager transport coefficients \(L_{ij}\).
Shape: \((N_\mathrm{b},\,N_\mathrm{g},\,N_\mathrm{g})\).
Reference unit: \(\mathrm{mol/(kJ\cdotÅ\cdot\mathrm ps)}\).
- L_ii_selfnumpy.ndarray
Self Onsager transport coefficient terms \(L_{ii}^\mathrm{self}\).
Shape: \((N_\mathrm{b},\,N_\mathrm{g})\).
Reference unit: \(\mathrm{mol/(kJ\cdotÅ\cdot\mathrm ps)}\).
- D_inumpy.ndarray
Self-diffusion coefficients \(D_i\).
Shape: \((N_\mathrm{b},\,N_\mathrm{g})\).
Reference unit: \(\mathrm{Å}/\mathrm{ps)}\).