Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

16. Passive microrheology and a frame-invariant, thermodynamically consistent stress model

The moduli G′(ω)G'(\omega) and G′′(ω)G''(\omega) of a sample of a few microlitres cannot be measured in a rheometer. Mason and Weitz (1995) showed that they can be obtained from the thermal motion of a small probe particle: the mean-square displacement of the probe is related to the modulus of the medium by a generalized Stokes–Einstein relation. The first half of this lecture simulates a probe in a viscoelastic medium and recovers the moduli.

The second half concerns stress models fitted to data. A neural network that maps the components of C\mathbf{C} to the components of the stress can fit its training data closely and still fail when the axes are rotated, because nothing in it expresses frame indifference. A model built on a tensor basis, as the derivative of a free energy with non-negative weights, is frame indifferent and has non-negative dissipation by construction. The data used in this lecture are synthetic.

Learning objectives

  1. Simulate a probe particle in a medium with several Maxwell modes, with one auxiliary variable for each mode.

  2. Obtain G′(ω)G'(\omega) and G′′(ω)G''(\omega) from the mean-square displacement ⟨Δx2(t)⟩\langle\Delta x^2(t)\rangle with the local power-law form of the generalized Stokes–Einstein relation (Mason, 2000), and check G′′/G′=tan⁡(πα/2)G''/G' = \tan(\pi\alpha/2) for a power law.

  3. Write a stress model τp(C)=2C ∂ψ/∂C\boldsymbol{\tau}_p(\mathbf{C}) = 2\mathbf{C}\,\partial\psi/\partial\mathbf{C} on a tensor basis, with weights wk≥0w_k \geq 0.

  4. Compare this model with a network that maps components to components (fit_naive_component_mlp) under a rotation of the axes.

Time: about 60 min

1. A probe particle in a viscoelastic medium

A spherical probe of radius aa, without inertia, moves in a medium that consists of a solvent of viscosity ηs\eta_s and MM Maxwell modes (Gm,τm)(G_m, \tau_m). Its position obeys a generalized Langevin equation with a memory kernel. The equation is equivalent to a system of M+1M + 1 equations without memory, in which each mode is a spring of stiffness km=6πaGmk_m = 6\pi a G_m whose other end ymy_m moves against the friction ζm=kmτm\zeta_m = k_m \tau_m (microrheology_rheoml.simulate_gle_thermal_probe):

ζsdxdt=−∑m=1Mkm(x−ym)+2ζskBT ξ0(t),ζmdymdt=km(x−ym)+2ζmkBT ξm(t)\zeta_s \frac{dx}{dt} = -\sum_{m=1}^{M} k_m (x - y_m) + \sqrt{2\zeta_s k_B T}\,\xi_0(t), \qquad \zeta_m \frac{dy_m}{dt} = k_m (x - y_m) + \sqrt{2\zeta_m k_B T}\,\xi_m(t)

The system is linear. After a symmetrizing transformation with the friction matrix K=diag⁡(ζs,ζ1,…,ζM)\mathbf{K} = \operatorname{diag}(\zeta_s, \zeta_1, \dots, \zeta_M) its normal modes give the exact mean-square displacement ⟨Δx2(t)⟩\langle \Delta x^2(t)\rangle and an exact update over a time step of any size, so that five decades of time can be covered. The mean-square displacement has three regimes, described by the local exponent α=dln⁡⟨Δx2⟩/dln⁡t\alpha = d\ln\langle \Delta x^2\rangle/d\ln t:

  • Short times, t≪ηs/G0t \ll \eta_s / G_0: diffusion in the solvent, ⟨Δx2⟩≈2(kBT/ζs)t\langle\Delta x^2\rangle \approx 2(k_B T/\zeta_s)t and α→1\alpha \to 1.

  • Intermediate times, ηs/G0≪t≪τmax⁡\eta_s/G_0 \ll t \ll \tau_{\max}: the elastic modes hold the probe, the mean-square displacement has a plateau, and α≪1\alpha \ll 1.

  • Long times, t≫τmax⁡t \gg \tau_{\max}: diffusion with the coefficient D∞=kBT/[6πa(ηs+∑mGmτm)]D_\infty = k_B T / [6\pi a (\eta_s + \sum_m G_m\tau_m)], set by the zero-shear viscosity, and α→1\alpha \to 1.


Demonstration 1: mean-square displacement of a probe over five decades of time
==============================================================================
Ensemble against exact normal-mode MSD mean relative error : 0.0326
Minimum subdiffusive caging slope min d(ln MSD)/d(ln t): 0.0304
Terminal logarithmic slope at t = 10 s                 : 0.8951
<Figure size 1188x440 with 2 Axes>

Figure 16.1. A probe in a viscoelastic medium. (a) Mean-square displacement of 1800 simulated probes against the exact result. (b) Logarithmic slope of the exact result: near 1 at short times, 0.03 at its minimum, rising again at long times.

2. Moduli from the mean-square displacement

The moduli follow from the Laplace transform of the mean-square displacement, which is difficult to compute from noisy data. Mason (2000) approximated the mean-square displacement around the time t=1/ωt = 1/\omega by a power law, ⟨Δr2(t)⟩∼tα(ω)\langle\Delta r^2(t)\rangle \sim t^{\alpha(\omega)} with α(ω)=dln⁡⟨Δr2(t)⟩dln⁡t∣t=1/ω\alpha(\omega) = \left.\frac{d\ln\langle\Delta r^2(t)\rangle}{d\ln t}\right|_{t=1/\omega} between 0 and 1. This gives algebraic formulas for the moduli, in d=1d = 1, 2 or 3 dimensions:

∣G∗(ω)∣=d kBT3πa⟨Δr2(1/ω)⟩Γ ⁣(1+α(ω)),G′(ω)=∣G∗(ω)∣cos⁡ ⁣(πα(ω)2),G′′(ω)=∣G∗(ω)∣sin⁡ ⁣(πα(ω)2)\lvert G^*(\omega)\rvert = \frac{d\,k_B T}{3\pi a \langle\Delta r^2(1/\omega)\rangle \Gamma\!\big(1 + \alpha(\omega)\big)}, \qquad G'(\omega) = \lvert G^*(\omega)\rvert\cos\!\left(\frac{\pi\alpha(\omega)}{2}\right), \qquad G''(\omega) = \lvert G^*(\omega)\rvert\sin\!\left(\frac{\pi\alpha(\omega)}{2}\right)

The formulas give tan⁡δ(ω)=G′′(ω)/G′(ω)=tan⁡(πα(ω)/2)\tan\delta(\omega) = G''(\omega)/G'(\omega) = \tan(\pi\alpha(\omega)/2). Where α→0\alpha \to 0 (the plateau), G′≫G′′G' \gg G'' and the medium responds as an elastic solid; where α→1\alpha \to 1 (diffusion), G′′≫G′G'' \gg G' and it responds as a viscous liquid.


Demonstration 2: moduli from the generalized Stokes-Einstein relation against the exact moduli
==============================================================================================
Local Kramers-Kronig |G''/G' - tan(pi*alpha/2)| error : 1.776e-15
Plateau storage modulus G'(omega) mean error against exact : 0.0663
Terminal regime liquid check G''(0.2) > G'(0.2)       : 0.265 > 0.066 Pa
<Figure size 1188x440 with 2 Axes>

Figure 16.2. Moduli from the generalized Stokes–Einstein relation in Mason’s form. (a) From the exact mean-square displacement, against the moduli of the medium; the method is approximate where the slope changes quickly. (b) From the simulated probes, where the noise is amplified.

3. A stress model on a tensor basis with non-negative weights

Suppose that simulations of the microstructure provide pairs {(C(n),τp(n))}n=1N\{(\mathbf{C}^{(n)}, \boldsymbol{\tau}_p^{(n)})\}_{n=1}^N of the conformation tensor and the polymer stress. A function τp(C)\boldsymbol{\tau}_p(\mathbf{C}) fitted to them should satisfy three conditions, for every positive definite C\mathbf{C} and every rotation Q\mathbf{Q}:

  1. Zero stress at equilibrium and symmetry: τp(I)=0\boldsymbol{\tau}_p(\mathbf{I}) = \mathbf{0} and τpT=τp\boldsymbol{\tau}_p^T = \boldsymbol{\tau}_p.

  2. Frame indifference: τp(QCQT)=Qτp(C)QT\boldsymbol{\tau}_p(\mathbf{Q}\mathbf{C}\mathbf{Q}^T) = \mathbf{Q}\boldsymbol{\tau}_p(\mathbf{C})\mathbf{Q}^T.

  3. Non-negative dissipation (Grmela and Öttinger, 1997). If the stress is derived from a free energy that is a sum of convex functions of the invariants with non-negative weights, ψ(I1,I2,det⁡C)=∑k=1Kwkϕk(C)\psi(I_1, I_2, \det\mathbf{C}) = \sum_{k=1}^K w_k \phi_k(\mathbf{C}) with wk≥0w_k \geq 0, through

τp(C)=2 C∂ψ∂C=w1(C−I)+w2(tr⁡C−d)C+w3(C2−C)+w4(tr⁡C−d)2C,wk≥0\boldsymbol{\tau}_p(\mathbf{C}) = 2\,\mathbf{C}\frac{\partial \psi}{\partial \mathbf{C}} = w_1(\mathbf{C}-\mathbf{I}) + w_2(\operatorname{tr}\mathbf{C}-d)\mathbf{C} + w_3(\mathbf{C}^2-\mathbf{C}) + w_4(\operatorname{tr}\mathbf{C}-d)^2\mathbf{C}, \qquad w_k \geq 0

then the dissipation, which is proportional to tr⁡ ⁣(τp(I−C−1))\operatorname{tr}\!\big(\boldsymbol{\tau}_p(\mathbf{I} - \mathbf{C}^{-1})\big), is non-negative for every positive definite C\mathbf{C}.


Demonstration 3: fit of a tensor-basis stress model to synthetic data
=====================================================================
True basis weights w_true    : [2.4  0.35 0.18 0.04]
Learned NNLS weights w_hat   : [2.4056 0.3487 0.1773 0.041 ]
Training R^2 score           : 0.999979
SO(3) equivariance error     : 1.986e-15
Min Clausius-Duhem rate >= 0 : 0.3660 (admissible = True)
<Figure size 1166x429 with 2 Axes>

Figure 16.3. Fit of four non-negative weights of a tensor basis to synthetic stress data with noise. (a) Fitted against given stress components. (b) Recovered weights against the weights used to make the data.

4. Rotation of the axes: tensor-basis model against component-wise network

The function fit_thermodynamic_tensor_rheoml is now compared with a network that maps the nine components CijC_{ij} to the nine components τij\tau_{ij} (fit_naive_component_mlp). Both are fitted to the same synthetic data C_data, tau_data, in which the principal axes of C\mathbf{C} are close to the coordinate axes, and both have a small error on these data. The demonstration then rotates the principal axes by an angle θ\theta between 0∘0^\circ and 180∘180^\circ, as happens to a fluid element along a curved streamline, and measures how far each model departs from τp(QCQT)=Qτp(C)QT\boldsymbol{\tau}_p(\mathbf{Q}\mathbf{C}\mathbf{Q}^T) = \mathbf{Q}\boldsymbol{\tau}_p(\mathbf{C})\mathbf{Q}^T.


Demonstration 4: rotation of the axes from 0 to 180 degrees
===========================================================
Component-wise network in-frame training R^2          : 0.99998 (data aligned with the axes)
Equivariance error at ~42 deg: MLP = 13.8789 Pa against tensor-basis model = 4.28e-15 Pa
<Figure size 1188x440 with 2 Axes>

Figure 16.4. (a) Norm of τ(QCQ⊤)−Qτ(C)Q⊤\boldsymbol\tau(\mathbf{Q}\mathbf{C}\mathbf{Q}^\top) - \mathbf{Q}\boldsymbol\tau(\mathbf{C})\mathbf{Q}^\top against the rotation angle for the component-wise network and for the tensor-basis model. (b) Principal stress difference in uniaxial extension rotated by 42°: the tensor-basis model follows the exact curve, the network does not.

Inside the algorithm: Mason’s relation for a power-law medium

The cell below prints the source of microrheology_rheoml.mason_gser_moduli and checks it on a medium with a power-law mean-square displacement, for which Mason’s relation is exact.

Check against the package

In a medium at the gel point the mean-square displacement of a probe is a power law at all times, ⟨Δx2(t)⟩=Atα\langle\Delta x^2(t)\rangle = A t^\alpha with 0<α<10 < \alpha < 1, and the moduli are known in closed form:

G′(ω)=kBT3πaA Γ(1+α)ωαcos⁡ ⁣(πα2),G′′(ω)=kBT3πaA Γ(1+α)ωαsin⁡ ⁣(πα2)G'(\omega) = \frac{k_B T}{3\pi a A\,\Gamma(1+\alpha)}\omega^\alpha \cos\!\left(\frac{\pi\alpha}{2}\right), \qquad G''(\omega) = \frac{k_B T}{3\pi a A\,\Gamma(1+\alpha)}\omega^\alpha \sin\!\left(\frac{\pi\alpha}{2}\right)

Because ln⁡⟨Δx2(t)⟩=ln⁡A+αln⁡t\ln\langle\Delta x^2(t)\rangle = \ln A + \alpha\ln t is linear in ln⁡t\ln t, the local power-law approximation is exact for such a medium, and the function reproduces these moduli to rounding error (< 1e-14).


Inside the algorithm: Mason's relation for a power-law medium
=============================================================
def mason_gser_moduli(
    t_lag: np.ndarray,
    msd: np.ndarray,
    probe_radius_a: float = 0.5e-6,
    kT: float = 4.11e-21,
    dim: int = 1,
) -> dict:
    """G'(omega) and G''(omega) from a mean-square displacement with the local power-law relation of Mason (2000)."""
    t = np.asarray(t_lag, dtype=float).ravel()
    m = np.asarray(msd, dtype=float).ravel()
    mask = (t > 0.0) & (m > 0.0)
    t_p = t[mask]
    m_p = m[mask]
    if t_p.size < 5 or probe_radius_a <= 0.0 or kT <= 0.0 or dim not in (1, 2, 3):
        raise ValueError("Require >= 5 positive lag times/MSD points, probe_radius_a > 0, kT > 0, and dim in {1,2,3}.")

    log_t = np.log(t_p)
    log_m = np.log(m_p)
    # Central finite-difference logarithmic slope alpha(omega = 1/t) = d(ln MSD)/d(ln t) in [0, 1]:
    alpha = np.clip(np.gradient(log_m, log_t), 1e-4, 0.9999)
    omega = 1.0 / t_p
    gamma_val = np.array([math.gamma(1.0 + float(al)) for al in alpha])
    # In d dimensions, <Delta r^2(t)> = (d * kT) / (3 * pi * a * |G*(omega)| * Gamma(1 + alpha)):
    g_abs = (float(dim) * float(kT)) / (3.0 * math.pi * float(probe_radius_a) * m_p * gamma_val)
    g_prime = g_abs * np.cos(0.5 * math.pi * alpha)
    g_double_prime = g_abs * np.sin(0.5 * math.pi * alpha)

    # Local Kramers-Kronig consistency check: tan(delta) == G'' / G' == tan(pi * alpha / 2):
    kk_err = float(np.max(np.abs((g_double_prime / np.maximum(g_prime, 1e-30)) - np.tan(0.5 * math.pi * alpha))))
    order = np.argsort(omega)
    return {
        "omega": omega[order],
        "G_prime": g_prime[order],
        "G_double_prime": g_double_prime[order],
        "alpha_log_slope": alpha[order],
        "kramers_kronig_tan_err": kk_err,
    }

Critical gel (alpha = 0.62) |G'_GSER - G'_exact|_inf   : 3.109e-15 Pa
Critical gel (alpha = 0.62) |G''_GSER - G''_exact|_inf : 1.693e-15 Pa

Exercises

Worked solutions are in 16_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. A probe of radius a=0.5 μma = 0.5\,\mu\text{m} at kBT=4.11×10−21 Jk_B T = 4.11\times 10^{-21}\text{ J} moves in one dimension in a medium with one Maxwell mode and a solvent (G0=4.0 Pa,τ1=0.25 s,ηs=2×10−3 Pa⋅sG_0 = 4.0\text{ Pa}, \tau_1 = 0.25\text{ s}, \eta_s = 2\times 10^{-3}\text{ Pa}\cdot\text{s}). Derive the plateau of the mean-square displacement at intermediate times, ⟨Δx2⟩plat=kBT/(3πaG0)\langle\Delta x^2\rangle_{\mathrm{plat}} = k_B T / (3\pi a G_0), and its slope at long times, 2D∞=2kBT/[6πa(ηs+G0τ1)]2 D_\infty = 2 k_B T / [6\pi a (\eta_s + G_0\tau_1)], and compare both with simulate_gle_thermal_probe.

  2. Find how it fails. (1) Compare the error of fit_naive_component_mlp and of fit_thermodynamic_tensor_rheoml on test data in the frame of the training data and in a frame rotated by 42∘42^\circ. (2) Fit the weights of the tensor basis by ordinary least squares (np.linalg.lstsq, without the condition wk≥0w_k \geq 0) to noisy synthetic data at small stretch, and evaluate the dissipation in uniaxial stretch, C=diag⁡(λ2,1/λ,1/λ)\mathbf{C} = \operatorname{diag}(\lambda^2, 1/\lambda, 1/\lambda), for λ\lambda between 1.1 and 3.2. Compare with the fit with non-negative weights.

  3. Implement it yourself. Combine the log-conformation equation with a fitted stress model. Generate training data with entangled_tubes.solve_fenep_fenecr(..., b_ext=28.0, variant="fenep") at the shear rates γ˙∈{1.0,2.5}\dot{\gamma} \in \{1.0, 2.5\}, fit the tensor-basis model for τp(C)\boldsymbol{\tau}_p(\mathbf{C}), then integrate dΨ/dtd\boldsymbol{\Psi}/dt at the shear rate γ˙=3.4\dot{\gamma} = 3.4, which is outside the training data, with the relaxation term −(τp(C)/G0)/λ-(\boldsymbol{\tau}_p(\mathbf{C})/G_0)/\lambda, and compare with the FENE-P model.


Self-check for the exercises
============================
All checks passed.