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.

3. Stochastic differential equations and FENE dumbbells

A constitutive equation for the conformation tensor is an average over polymer molecules that are moved by the flow and by thermal collisions with the solvent. The average can also be computed directly, by simulating many model molecules. The simplest model is a dumbbell: two beads joined by a spring, whose connector vector Q\mathbf{Q} obeys a stochastic differential equation.

For a spring of finite length (the FENE spring, whose force F(Q)=HQ1−Q2/Q02\mathbf{F}(\mathbf{Q}) = \frac{H\mathbf{Q}}{1 - Q^2/Q_0^2} diverges at the length Q0Q_0) the explicit Euler scheme fails: a random displacement can carry the connector beyond Q0Q_0, where the force changes sign. The semi-implicit scheme of Öttinger evaluates the spring force at the new length. This leads to a cubic equation with exactly one root below Q0Q_0, for any time step. The lecture derives the scheme and uses it to compute viscometric functions.

Learning objectives

  1. Write the dimensionless stochastic differential equation of a dumbbell with a Hookean, a FENE and a wormlike-chain spring.

  2. Derive the cubic equation R3−∥Y∥R2−b(1+α)R+b∥Y∥=0R^3 - \lVert\mathbf{Y}\rVert R^2 - b(1 + \alpha)R + b\lVert\mathbf{Y}\rVert = 0 of the semi-implicit scheme, show that it has one root in [0,b)[0, \sqrt{b}), and solve it with brownian_chains.solve_fene_cubic_radial.

  3. Compare the explicit scheme (explicit_unsafe=True) with the semi-implicit scheme (explicit_unsafe=False) in brownian_chains.simulate_dumbbell_bd.

  4. Compute the viscosity and the first normal stress coefficient in shear, and the stretch in extension above Wiext=1/2\mathrm{Wi}_{\mathrm{ext}} = 1/2.

Time: about 60 min

1. Stochastic differential equations of dumbbells, and spring laws

Lengths are scaled by kBT/H\sqrt{k_B T / H}, the root-mean-square length of one component of the connector of a Hookean dumbbell at equilibrium, and times by the relaxation time λH=ζ/(4H)\lambda_H = \zeta / (4H). The connector vector Q(t)\mathbf{Q}(t) then obeys the stochastic differential equation

dQ(t)=[L(t)Q(t)−12F(Q(t))]dt+dW(t),⟨dWi(t) dWj(t′)⟩=δijδ(t−t′) dt,d\mathbf{Q}(t) = \left[\mathbf{L}(t)\mathbf{Q}(t) - \frac{1}{2}\mathbf{F}(\mathbf{Q}(t))\right]dt + d\mathbf{W}(t), \qquad \langle dW_i(t)\,dW_j(t')\rangle = \delta_{ij}\delta(t - t')\,dt,

in which dWd\mathbf{W} is the increment of a Wiener process. For a spring of finite length, b=HQ02/(kBT)b = H Q_0^2 / (k_B T) is the square of the dimensionless maximum length, so that ∥Q∥<b\lVert\mathbf{Q}\rVert < \sqrt{b}. Three spring laws are used:

FHook(Q)=Q,FFENE(Q)=Q1−Q2/b,FWLC(Q)=2b3Q[1(1−Q/b)2−1+4Qb]Q.\mathbf{F}_{\mathrm{Hook}}(\mathbf{Q}) = \mathbf{Q}, \qquad \mathbf{F}_{\mathrm{FENE}}(\mathbf{Q}) = \frac{\mathbf{Q}}{1 - Q^2 / b}, \qquad \mathbf{F}_{\mathrm{WLC}}(\mathbf{Q}) = \frac{2\sqrt{b}}{3 Q}\left[\frac{1}{(1 - Q/\sqrt{b})^2} - 1 + \frac{4Q}{\sqrt{b}}\right]\mathbf{Q}.

The Hookean spring has no maximum length. The FENE spring describes flexible polymers, and the wormlike-chain (WLC) spring describes semiflexible ones such as DNA; its force diverges more steeply at full extension.

The semi-implicit scheme of Öttinger is a predictor–corrector method. The predictor gives a vector Y\mathbf{Y}. In the corrector the spring force is evaluated at the new time, which makes the new connector parallel to the predictor, Qn+1=R Y/∥Y∥\mathbf{Q}^{n+1} = R\,\mathbf{Y}/\lVert\mathbf{Y}\rVert, and leaves one scalar equation for the new length R=∥Qn+1∥R = \lVert\mathbf{Q}^{n+1}\rVert, with α=Δt/4\alpha = \Delta t / 4:

R(1+α1−R2/b)=∥Y∥  ⟺  P(R)≡R3−∥Y∥R2−b(1+α)R+b∥Y∥=0.R\left(1 + \frac{\alpha}{1 - R^2 / b}\right) = \lVert\mathbf{Y}\rVert \iff P(R) \equiv R^3 - \lVert\mathbf{Y}\rVert R^2 - b(1 + \alpha)R + b\lVert\mathbf{Y}\rVert = 0.

Because P(0)=b∥Y∥≥0P(0) = b\lVert\mathbf{Y}\rVert \geq 0 and P(b)=−αb3/2<0P(\sqrt{b}) = -\alpha b^{3/2} < 0, the cubic P(R)P(R) has exactly one root in [0,b)[0, \sqrt{b}), however large the predictor ∥Y∥\lVert\mathbf{Y}\rVert is.


Demonstration 1: spring laws and the root of the cubic equation
===============================================================
Max algebraic residual across Y in [1e-2, 316]: 8.129e-12
At extreme RHS Y = 316.2 -> R = 6.98022188 < sqrt(b) = 7.0
<Figure size 1155x418 with 2 Axes>

Figure 3.1. (a) Magnitude of the Hookean, FENE and wormlike-chain spring forces against the fractional extension. (b) The root RR of the cubic equation of the semi-implicit step against the norm of its right-hand side: it stays below b=7\sqrt{b} = 7 for every input.

2. The explicit Euler scheme against the semi-implicit scheme

The explicit Euler–Maruyama scheme (explicit_unsafe=True) fails for FENE springs in two ways. Near Q≈bQ \approx \sqrt{b} the restoring displacement −12Q1−Q2/bΔt-\frac{1}{2}\frac{\mathbf{Q}}{1 - Q^2/b}\Delta t is either

  1. too small to compensate the displacement by the flow and by the noise, LQΔt+ΔW\mathbf{L}\mathbf{Q}\Delta t + \Delta\mathbf{W}, so that ∥Qn+1∥≥b\lVert\mathbf{Q}^{n+1}\rVert \geq \sqrt{b}; there 1−Q2/b<01 - Q^2/b < 0, and the spring force points outwards; or

  2. too large, so that the connector is carried through the origin and beyond the maximum length on the other side.

The demonstration runs the same ensemble (n_trajectories = 700, seed = 7) with both schemes in shear at Wi=8.0\mathrm{Wi} = 8.0 with the step Δt=0.10\Delta t = 0.10 (b_ext = 25).


Demonstration 2: explicit and semi-implicit schemes at Wi = 8 and dt = 0.1
==========================================================================
Explicit Euler (dt=0.10): overstretched events = 744, max <Q^2> = 947.71
Semi-implicit  (dt=0.10): overstretched events = 0, max <Q^2> = 9.35 (< b=25)
<Figure size 1155x418 with 2 Axes>

Figure 3.2. FENE dumbbells (b=25b = 25) in start-up of shear. (a) Mean-square extension with the explicit Euler step, which exceeds bb, with the semi-implicit step at the same Δt\Delta t, and with a fine reference step. (b) Shear stress of the semi-implicit run against the fine reference.

3. Viscosity and normal stress coefficient in shear

For Hookean dumbbells the viscosity ηp=npkBTλH\eta_p = n_p k_B T \lambda_H and the first normal stress coefficient Ψ1=2npkBTλH2\Psi_1 = 2 n_p k_B T \lambda_H^2 do not depend on the shear rate. A finite length bb limits the stretch of a dumbbell along the axis of extension of the shear flow, at 45∘45^\circ, before the rotation of the flow turns it towards the flow direction. FENE dumbbells therefore thin in shear, with ηp\eta_p decreasing approximately as Wi−2/3\mathrm{Wi}^{-2/3} at high Wi\mathrm{Wi}. The simulation gives this result directly, without a closure approximation.


Demonstration 3: viscosity and first normal stress coefficient against shear rate
=================================================================================
FENE (b=20) viscosity drops from 0.753 (Wi=0.4) to 0.410 (Wi=7.0)
FENE (b=60) viscosity drops from 0.874 (Wi=0.4) to 0.541 (Wi=7.0)
<Figure size 1155x418 with 2 Axes>

Figure 3.3. Steady shear of FENE dumbbells from Brownian dynamics. (a) Polymer viscosity for b=20b = 20 and 60. (b) First normal stress coefficient for b=20b = 20. The dotted lines are the Hookean values.

4. Uniaxial extension: Hookean, FENE and wormlike-chain springs

In Lecture 1 the stress of the Oldroyd-B model diverged in uniaxial extension at Wiext=1/2\mathrm{Wi}_{\mathrm{ext}} = 1/2. The demonstration follows the molecules above this value, at Wiext=1.0\mathrm{Wi}_{\mathrm{ext}} = 1.0 with b=30b = 30. The extension of Hookean dumbbells grows exponentially without limit. FENE and wormlike-chain dumbbells reach a steady extension with ⟨Q2⟩<b\langle Q^2 \rangle < b.


Demonstration 4: uniaxial extension at Wi_ext = 1.0
===================================================
At t=5.0 (Wi_ext=1.0, b=30):
  Hookean <Q^2> = 311.4 (diverges exponentially >> b=30)
  FENE    <Q^2> = 11.51 (< 30.0, steady stretched plateau)
  WLC     <Q^2> = 11.11 (< FENE due to stiffer (1 - Q/sqrt(b))^-2 force)
<Figure size 1155x418 with 2 Axes>

Figure 3.4. (a) Uniaxial extension above the coil–stretch transition: the Hookean dumbbells extend without bound, the FENE and wormlike-chain dumbbells (b=30b = 30) reach a plateau below bb. (b) Error of ⟨Q2⟩\langle Q^2\rangle at t=1.5t = 1.5 against the time step; with this ensemble the statistical error hides the first-order trend (dashed).

Inside the algorithm

The cell below prints the source of brownian_chains.solve_fene_cubic_radial. The substitution R=x+Y/3R = x + Y/3 reduces R3−YR2−b(1+α)R+bY=0R^3 - Y R^2 - b(1+\alpha)R + b Y = 0 to x3+px+q=0x^3 + p x + q = 0 with p=−b(1+α)−Y2/3p = -b(1+\alpha) - Y^2/3, which is negative for all Y≥0Y \geq 0. The cubic then has three real roots, R1<0≤R2<b<R3R_1 < 0 \leq R_2 < \sqrt{b} < R_3. The function takes the middle root from the trigonometric formula for the roots of a cubic and improves it with one Newton step.

Check against the package

The check below computes the three roots of P(R)=0P(R) = 0 with np.roots for random values of (Y,b,α)(Y, b, \alpha), and verifies that exactly one of them lies in [0,b)[0, \sqrt{b}) and that it agrees with solve_fene_cubic_radial to 10-13.


Inside the algorithm: the root of the cubic equation against np.roots
=====================================================================
def solve_fene_cubic_radial(y_rhs_norm: np.ndarray, b_ext: float, coeff_alpha: float) -> np.ndarray:
    """Solve R * (1 + coeff_alpha / (1 - R^2 / b_ext)) = Y in closed form for the one root R in [0, sqrt(b_ext))."""
    Y = np.asarray(y_rhs_norm, dtype=float)
    if b_ext <= 0.0 or coeff_alpha <= 0.0 or np.any(Y < 0.0):
        raise ValueError("Require b_ext > 0, coeff_alpha > 0, and non-negative radial norm Y >= 0.")

    # Cubic R^3 - Y R^2 - b*(1 + alpha)*R + b*Y = 0; depress via R = x + Y/3 -> x^3 + p*x + q = 0:
    b = float(b_ext)
    a1 = -Y
    a2 = -b * (1.0 + float(coeff_alpha))
    a3 = b * Y

    p = a2 - (a1**2) / 3.0
    q = (2.0 * (a1**3)) / 27.0 - (a1 * a2) / 3.0 + a3
    # Since 3 distinct real roots (-inf, 0), [0, sqrt(b)), (sqrt(b), +inf) always exist, p < 0 strictly:
    r_trig = np.sqrt(np.maximum(-p / 3.0, 1e-30))
    cos_arg = np.clip(-q / (2.0 * (r_trig**3)), -1.0, 1.0)
    phi = np.arccos(cos_arg)
    # Middle root k = 2 lies strictly in [0, sqrt(b)); polish once with exact Newton step for < 1e-14 residual:
    r_est = 2.0 * r_trig * np.cos((phi - 2.0 * math.pi) / 3.0) - a1 / 3.0
    r_est = np.where(Y == 0.0, 0.0, np.clip(r_est, 0.0, math.sqrt(b) * (1.0 - 1e-11)))
    denom = np.maximum(1.0 - (r_est**2) / b, 1e-15)
    f_val = r_est * (1.0 + float(coeff_alpha) / denom) - Y
    df_dr = 1.0 + float(coeff_alpha) * (1.0 + (r_est**2) / b) / (denom**2)
    r_refined = np.where(Y == 0.0, 0.0, r_est - f_val / df_dr)
    return np.clip(r_refined, 0.0, math.sqrt(b) * (1.0 - 1e-14))

Verified root ordering R_1 < 0 < R_2 < sqrt(b) < R_3 across all 25 test cases.
Max |R_viete_newton - np.roots middle root|: 2.665e-15

Exercises

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

  1. Verify a result. Check by numerical quadrature, for bb between 6 and 200, that the equilibrium distribution ψeq(Q)∝(1−Q2/b)b/2\psi_{\mathrm{eq}}(\mathbf{Q}) \propto (1 - Q^2/b)^{b/2} of a FENE dumbbell gives ⟨Q2⟩eq=3bb+5\langle Q^2\rangle_{\mathrm{eq}} = \frac{3b}{b + 5}, and compare with a Brownian dynamics simulation without flow (simulate_dumbbell_bd with L=0\mathbf{L} = \mathbf{0}).

  2. Find how it fails. Run the explicit Euler–Maruyama scheme (explicit_unsafe=True) and the semi-implicit scheme (explicit_unsafe=False) for Wi∈{2,5,8,12}\mathrm{Wi} \in \{2, 5, 8, 12\} and Δt∈{0.02,0.05,0.10,0.15}\Delta t \in \{0.02, 0.05, 0.10, 0.15\} with b_ext = 25, n_trajectories = 500 and t_end = 1.8, and count the events in which a connector reaches or exceeds its maximum length, Q≥bQ \geq \sqrt{b}.

  3. Implement it yourself. Write a vectorized semi-implicit Brownian dynamics solver for FENE dumbbells in NumPy (b=36b = 36, Wi=5.0\mathrm{Wi} = 5.0, 3000 trajectories, 0≤t≤3.00 \le t \le 3.0), and compare ⟨Q2⟩(t)\langle Q^2\rangle(t), τxy(t)\tau_{xy}(t) and N1(t)N_1(t) with brownian_chains.simulate_dumbbell_bd; the two should agree within 3 %.


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