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.

Solutions · 5. Rouse and Zimm chains with Rotne–Prager–Yamakawa hydrodynamic interactions

Worked solutions to the three exercises of Lecture 5. Each solution is computed here and checked with assert statements against an exact identity or an independent calculation. The first code cell sets up the notebook and runs Demonstration 1 of the lecture without showing its output, because some of the solutions use its variables.

Exercise 1

Problem. Check by sampling Gaussian chains (35 000 chains for each NN) with N∈{4,8,16,32,64}N \in \{4, 8, 16, 32, 64\} beads that ⟨Ree2⟩eq=3(N−1)\langle R_{ee}^2\rangle_{\mathrm{eq}} = 3(N - 1), ⟨Rg2⟩eq=N2−12N\langle R_g^2\rangle_{\mathrm{eq}} = \frac{N^2 - 1}{2N} and ⟨Ree2⟩/⟨Rg2⟩=6NN+1\langle R_{ee}^2\rangle / \langle R_g^2\rangle = \frac{6N}{N + 1}, which tends to 6 for long chains.


Exercise 1: end-to-end distance and radius of gyration of Gaussian chains
=========================================================================
Max relative error on <Ree^2>/<Rg^2> across N in [4, 64]: 0.0047
N=4 ratio = 4.799 (exact 4.800) -> N=64 ratio = 5.922 (exact 5.908 -> 6.0)
<Figure size 1122x407 with 2 Axes>

Figure S5.1. Gaussian chains of NN beads sampled directly. (a) ⟨Ree2⟩=3(N−1)\langle R_{ee}^2\rangle = 3(N-1) and ⟨Rg2⟩=(N2−1)/(2N)\langle R_g^2\rangle = (N^2-1)/(2N). (b) Their ratio 6N/(N+1)6N/(N+1), which tends to 6.

Explanation. For independent Gaussian steps ⟨(Ri−Rj)2⟩=3∣i−j∣\langle (\mathbf{R}_i - \mathbf{R}_j)^2 \rangle = 3\lvert i - j\rvert, and the double sum 12N2∑i,j3∣i−j∣=N2−12N\frac{1}{2N^2}\sum_{i,j} 3\lvert i - j\rvert = \frac{N^2 - 1}{2N} is the mean-square radius of gyration. The sampled ratio differs from 6N/(N+1)6N/(N+1) by at most 0.5 %: 4.799 against 4.800 for N=4N = 4 and 5.922 against 5.908 for N=64N = 64. These are equilibrium averages, which depend on the spring potential alone; hydrodynamic interaction changes the dynamics and leaves them unchanged.


Exercise 2

Problem. Compare the Oseen mobility (oseen_unsafe=True) with the Rotne–Prager–Yamakawa mobility (oseen_unsafe=False) for three beads of radius a=1.0a = 1.0 at the corners of an equilateral triangle of side ss, R(s)=s×[(0,0,0), (1,0,0), (0.5,0.866,0)]\mathbf{R}(s) = s \times [(0,0,0),\,(1,0,0),\,(0.5, 0.866, 0)], for ss between 0.20 and 2.50. Count the failures of the Cholesky factorization and plot the smallest eigenvalue against s/as/a.


Exercise 2: Cholesky factorization of the Oseen and Rotne-Prager-Yamakawa mobilities
====================================================================================
Cholesky factorization fails at: Oseen 34/47 spacings | RPY 0/47 spacings
3-bead equilateral Oseen requires s >= 1.90a for a positive definite mobility (two beads: 1.5a).
<Figure size 1122x407 with 2 Axes>

Figure S5.2. Three beads on an equilateral triangle of side ss. (a) Smallest eigenvalue of the mobility matrix (Oseen values clipped at -0.15). (b) Whether the Cholesky factorization succeeds: the Oseen matrix fails below s=1.9as = 1.9a, the Rotne–Prager–Yamakawa matrix never.

Explanation. The Cholesky factorization of the Oseen mobility fails at 34 of the 47 spacings, and that of the Rotne–Prager–Yamakawa mobility at none. For three beads the Oseen mobility is positive definite only for s≥1.90as \ge 1.90a, a larger distance than the limit 1.5a1.5a for two beads. In a simulation of a chain without excluded volume, beads often come closer than this (with h∗=0.25h^* = 0.25 the bead radius is h∗π≈0.44h^*\sqrt{\pi} \approx 0.44 in units of the spring length), and a simulation with the Oseen mobility stops at the first such configuration. The Rotne–Prager–Yamakawa form for r<2ar < 2a accounts for the overlap of the two spheres and is positive definite at all distances.


Exercise 3

Problem. Write a Brownian dynamics integrator in NumPy for chains with Rotne–Prager–Yamakawa hydrodynamic interaction that generates the correlated random displacements with a Cholesky factor of the diffusion matrix (np.linalg.cholesky). Use 6-bead chains with h∗=0.24h^* = 0.24, γ˙=1.0\dot{\gamma} = 1.0 and Δt=0.01\Delta t = 0.01, and compare ⟨Rg2⟩\langle R_g^2\rangle and the shear stress τxy\tau_{xy} with brownian_chains.simulate_rouse_zimm_chain_bd.


Exercise 3: a chain integrator with a Cholesky factor of the diffusion matrix
=============================================================================
Completed 1,080 Cholesky factorizations without failure
<Rg^2>: Cholesky=3.497 against eigh=3.517 (rel diff=0.006)
tau_xy: Cholesky=1.243 against eigh=1.304 (rel diff=0.047)
<Figure size 1122x407 with 2 Axes>

Figure S5.3. (a) The 18×1818 \times 18 Rotne–Prager–Yamakawa mobility matrix of the last configuration. (b) Shear stress from runs that take the Cholesky factor and the symmetric square root of the mobility; the 5 % difference is statistical.

Explanation. Any matrix B\mathbf{B} with BB⊤=D\mathbf{B}\mathbf{B}^\top = \mathbf{D} gives random displacements with the required covariance, so the Cholesky factor used here and the symmetric square root that the package computes with eigh are equivalent, and the Cholesky factor is cheaper to compute. All 1080 factorizations succeed. The two integrators agree to 0.6 % in ⟨Rg2⟩\langle R_g^2\rangle (3.497 against 3.517) and to 4.7 % in the shear stress (1.243 against 1.304); they use different random numbers, so differences of this size are expected from the statistical error. Lecture 6 compares simulations of this kind with the FENE-P and FENE-CR closures.