Skip to content

Tutorial T08: Primitive Cylindrical Polyelectrolyte Electrostatics & Manning Counterion Condensation ​

Scripts: tutorials/T08_dna_manning_condensation/run.jl · analyze.jl · plot.py

Double-stranded B-DNA carries two elementary negative charges per   base pair (axial charge spacing   ), giving a dimensionless Manning linear charge-density parameter        in room-temperature water. Whenever the effective line-charge parameter   exceeds unity, the logarithmic cylindrical Coulomb attraction overwhelms radial translational entropy and a macroscopic fraction    of counterions of valency condenses onto the rod, as predicted by Manning (1969) and analyzed via the cylindrical Poisson–Boltzmann (PB) cell model and molecular dynamics by Deserno, Holm & May (2000).

Here we study a primitive-model (implicit-solvent) cylindrical polyelectrolyte rod calibrated to B-DNA's linear charge density ( ) with mobile monovalent (  ) and divalent (  ) WCA counterions, rather than an atomistic model of B-DNA or explicitly hydrated / . As detailed in Section 1, the rod–ion contact radius     is thinner than B-DNA's physical steric radius ( , ion–axis contact  ), which raises the surface electrostatic coupling parameter by   relative to atomistic B-DNA. Within this primitive-model framework, we reproduce the Manning (1969) and Deserno, Holm & May (2000) benchmarks across four polyelectrolyte cells while exercising ParticleDynamics v1.2.0 electrostatics and constraint capabilities:

  1. Immobile periodic charged rod via FreezeGroup(rod; mode=:hold), pinning 160 charged monomers along the -axis ( ) while excluding frozen DOFs from the mobile-ion thermostat, observables, and automatic COM-momentum removal.

  2. Multi-type WCA excluded volume via PairTable on ClusterPairList(force_accumulation=:fixed64) (Float32), zeroing rod–rod steric work ( ) while retaining deterministic 64-bit fixed-point pair-force summation.

  3. ESP(continuity=:c2) + CompactFFT long-range electrostatics (P = 6, mesh = (24, 24, 32)), audited directly against a Float64 ( ) reference to   relative counterion force error at   per force call.

  4. Explicit net_charge=:background uniform jellium control vs. strict electroneutrality (net_charge=:error), verifying both the non-neutral safety guard and analytical background-energy matching (  ) under partial counterion neutralization.

  5. BAOAB Langevin dynamics with TableWriter (thermodynamic traces) and InMemoryWriter (radial and condensed axial correlation histograms across 8 statistical blocks).

Trajectory Visualization ​

Live Fresnel Studio Dashboard (T08): Side-by-side primitive cylindrical polyelectrolyte cells at DNA-like linear charge density (ξ = 4.2) with monovalent z = +1 (left, close to cylindrical Poisson–Boltzmann outside the WCA contact zone) vs. divalent z = +2 counterions (right, showing strong correlation-induced over-condensation) alongside live P(R_M, t) and radial P(r) curves (tutorials/render_movies.py --targets T08).

Studio Fresnel snapshot of primitive cylindrical polyelectrolyte Manning counterion condensation for z=+1 vs z=+2


1. Physical Model & Analytical PB Cell Solution ​

All simulations use reduced Bjerrum / WCA units ( ,  ,  ,  ,   ), in which the Bjerrum length equals the Coulomb prefactor    ( ).

Primitive Rod Geometry & Coupling Regimes ​

A rigid, periodically continuous line of charged beads lies along   in an orthorhombic periodic box of dimensions     and   , composed of   monomers at uniform axial spacing   . The area-equivalent cylindrical Wigner–Seitz (WS) cell radius and rod–ion excluded contact radius are:

with an inscribed cylinder radius    . Mapping    sets      and      (water at  ), matching the B-DNA linear charge density   .

Model scope note (r_0 and coupling parameter ): Because this primitive model uses a single-bead-radius contact distance    , the rod is narrower than physical B-DNA (steric radius  , hydrated ion–axis contact   , where   rather than ). Since the cylindrical surface electrostatic coupling parameter   (Netz 2001) scales inversely with , this thinner primitive cylinder increases by 1.47–1.76× (~1.5–1.8×) relative to atomistic B-DNA (amplifying both contact-layer steric crowding for    and correlation-driven over-condensation for   ). In addition, continuum dielectric solvent and WCA counterion spheres omit ion-specific hydration shells and helical groove binding.

Case  net_charge ()Physical Regime (Primitive Rod Model)
mono_bdna:error ()DNA-like  , monovalent    (moderate coupling; PB + contact steric crowding)
diva_bdna:error ()DNA-like  , divalent    (strong coupling; correlation over-condensation)
subcrit_weak:error ()Sub-critical weak rod (  ; no condensation)
bg_partial:background ( )50% explicit counterions + 50% uniform neutralizing jellium

Analytical Cylindrical Poisson–Boltzmann Cell Model (Point-Ion Hard Wall) ​

For point counterions of valency neutralizing a cylindrical hard rod of radius inside a salt-free WS cell of radius , the cumulative counterion charge fraction within radius is:

The analytical cylindrical Poisson–Boltzmann solution (Fuoss, Katchalsky & Lifson 1951; Deserno, Holm & May 2000) splits at the finite-cell threshold    into two closed-form analytical branches solved to precision in analyze.jl:

  • Branch A ( , trigonometric; Cases 1 & 2): Solve the 1-parameter transcendental equation for  :

    Whenever  , the Deserno–Holm–May inflection radius   where   is given by  , and the integrated charge fraction and radial density take closed form:

    At  , the tangent vanishes identically, yielding the Manning condensed fraction     ( for   ; for   ).

  • Branch B ( , hyperbolic; Case 3,  ): Substituting   with    solves:

    yielding a strictly convex curve in (  everywhere, zero inflection point) that approaches the uniform ideal-gas distribution     as  :


2. ParticleDynamics API Walkthrough ​

Multi-Type WCA Excluded Volume (PairTable) + ClusterPairList(:fixed64) ​

Because adjacent rod beads are spaced by     and held rigidly fixed by FreezeGroup, zeroing   in PairTable eliminates rod–rod steric overlap and skips frozen–frozen pair evaluations while retaining WCA repulsion for all rod–ion and ion–ion pairs:

julia
pt = PairTable(
    sigma=[1.0 1.0; 1.0 1.0],
    epsilon=[0.0 1.0; 1.0 1.0],          # zero rod-rod WCA work
    cutoff=[0.0 WCA_RC; WCA_RC WCA_RC],  # WCA_RC = 2^(1/6) * sigma
    type_names=[:Rod, :Ion],
)
wca = WCA(
    pair_table=pt,
    pairs=:neighborlist,
    neighborlist=ClusterPairList(buffer=0.5, force_accumulation=:fixed64),
)

With precision=Float32, ClusterPairList(force_accumulation=:fixed64) accumulates pair forces in 64-bit fixed point (use_fixed64 == true), ensuring associative, order-independent pair-force summation across launches.

ESP(continuity=:c2) + CompactFFT & net_charge=:background ​

Long-range electrostatics uses the -continuous generalized prolate split (ESP(continuity=:c2), backed by B2ProlateWindow in v1.2.0) with real_cutoff = 6.0 (   ) and tolerance = 1e-4, which resolves stencil width P = 6 and smooth FFT mesh (24, 24, 32), activating the fused shared-memory CompactFFT pipeline (compact_fft !== nothing) across all four cells:

julia
esp = ESP(
    coulomb_prefactor=c.l_B,
    real_cutoff=6.0,
    tolerance=1e-4,
    order=6,
    continuity=:c2,
    mesh=(24, 24, 32),
    net_charge=c.net_charge,   # :error (Cases 1-3) or :background (Case 4)
    boundary=:tin_foil,
)

On Case 4 (   ), run.jl first confirms that ESP(..., net_charge=:error) throws an ArgumentError refusing the non-neutral configuration, then switches to net_charge=:background, which inserts the explicit uniform neutralizing jellium background and contributes the analytical background energy correction:

FreezeGroup(:hold) + BAOAB + TableWriter / InMemoryWriter ​

Mobile counterions evolve under canonical BAOAB Langevin dynamics (  ,   ,  ) while the charged rod remains pinned via FreezeGroup(rod_grp; mode=:hold):

julia
sim = Simulation(
    built.system;
    groups=Groups(all_grp, rod_grp, ion_grp),
    integrator=Integrator(
        dt=0.004,
        scheme=BAOAB(track_thermo=false),
        forces=[wca, esp],
        methods=[
            Langevin(ion_grp; gamma=0.5, kT=1.0),
            Langevin(rod_grp; gamma=0.5, kT=0.0),
        ],
        constraints=[FreezeGroup(rod_grp; mode=:hold)],
    ),
    observables=[thermo_ion, thermo_all],
    writers=[table_w, mem_w],   # TableWriter CSV + InMemoryWriter frames
    precision=Float32,
)

After GPU-batched step_many! equilibration (60,000 steps =  ), production runs for 320,000 steps ( ) split into 8 equal blocks (40,000 steps/block), recording thermodynamic traces with TableWriter and coordinate/force frames with InMemoryWriter (every = 100, 3,200 frames total).


3. Results & Visual Verification ​

Manning Condensation Curves, Steric Crowding & Divalent Correlations ​

Manning counterion condensation curves versus cylindrical Poisson-Boltzmann theory and divalent correlation excess

  • Monovalent rod (    ; Panels a & b, Navy): Across the full inscribed cell  , follows the Branch A Poisson–Boltzmann curve closely (RMSE = 0.0097 ± 0.0006). At the Deserno–Holm–May inflection radius   , MD yields    vs. Manning's     (   , ). Panel (b) shows that near contact (  ), monovalent    is non-zero, averaging -0.0156 ± 0.0013 (-12.0σ) and dipping to    right outside . This under-condensation relative to point-ion PB is a genuine physical finite-size effect documented by Deserno, Holm & May (2000): whereas analytical PB treats counterions as point particles against a hard cylinder at  , the MD ions have finite WCA diameter   and interact with the rod through a soft repulsive WCA wall (whose effective distance of closest approach slightly exceeds ) plus inter-ion steric crowding in the dense condensed sheath. Both effects deplete the immediate contact layer relative to the singular point-ion PB density profile before catches up by  .

  • Divalent rod (     ; Panels a & b, Crimson): Strong electrostatic correlations overwhelm the WCA steric depletion and drive pronounced over-condensation beyond mean-field PB near the rod, reproducing the headline result of Deserno, Holm & May (2000):    vs. PB (   , ; and   higher than monovalent). In the near-rod window   , averages +0.1043 ± 0.0015 (+69.5σ) with a sharp peak ΔP_max = +0.1455 ± 0.0013 at   .

  • Sub-critical weak-charge control (    ; Panels a & b, Teal): MD matches the hyperbolic Branch B PB curve to RMSE = 0.0030 ± 0.0026, remains strictly convex in (outer/inner log-slope ratio  , zero inflection point), gives     vs. PB (   , ), and exhibits negligible near-rod steric deviation (   , ) because the ion density at contact is low.

Local Counterion Density, Axial Correlation Hole & Uniform Jellium Background ​

Radial counterion density profiles with condensed axial correlations and uniform neutralizing background comparison

  • Radial density enrichment/depletion & condensed axial correlation hole (Panel a): On a logarithmic scale, monovalent (Navy) and sub-critical (Teal) track analytical (dashed) over more than three orders of magnitude outside the immediate WCA contact zone. By contrast, divalent (Crimson) exceeds in the immediate contact sheath (  ) and is depleted below PB by nearly a factor of in the outer cell (  ). The inset displays the 1D axial pair correlation function of condensed counterions (  ): divalent ions carve a deeper and wider electrostatic correlation hole (   vs. for   , depressed out to   ) followed by a liquid-like ordering peak (  at   ), consistent with the lateral-correlation mechanism that lowers the chemical potential of the condensed layer below mean-field PB.

  • Explicit partial counterions in uniform jellium (net_charge=:background, Panel b): When half of the monovalent counterions are replaced by a uniform neutralizing background ( ,    ), the explicit rod-neutralization curve (Cobalt) rises steeply and saturates at while the remaining of charge is neutralized uniformly over the cell volume. Because the jellium encloses negligible charge near the rod (), even complete condensation of all explicit counterions leaves a super-critical residual charge   ; consequently,   of the available explicit counterions condense within    (Amber dashed curve), compared to in the fully neutralized cell.


4. Quantitative Production Summary ​

Production parameters on NVIDIA V100 (Float32, ClusterPairList(:fixed64), C²-ESP P = 6, mesh = (24, 24, 32), CompactFFT):  ,   ,   ,   ,  , 60,000 equilibration + 320,000 production steps ( ), 8-block standard errors (~15,000 steps/s warm GPU throughput, 25.2–25.9 s per warm production cell).

CasePB Branch ( / ) ()RMSE vs PB
mono_bdnatrig ()    () 
diva_bdnatrig ()    () 
subcrit_weakhyp ()none    () 
bg_partial:background  ( avail.)——— 

Evaluated at     for comparison against the monovalent super-critical rod.

Software/API Integrity Checks vs. Physical Validation ​

Software and API checks are reported separately from physical validation metrics:

CategoryMetricMeasured (ParticleDynamics)Target / Reference
Software checkC²-ESP mobile-ion rel. force error vs Float64 ()  (0.288 ms/call) 
Software checkCompactFFT & ClusterPairList(:fixed64) active4 / 4 and 4 / 4 cells4 / 4
Software checkFrozen rod displacement (FreezeGroup(:hold)) & NaN count0.0 σ, 0 NaNs0.0 σ, 0 NaNs
Software checknet_charge=:error guard & :background auditGuard rejected  ;   Analytical   
DiagnosticBAOAB mobile-ion temperature   Target  
DiagnosticMonovalent contact steric depletion   (; min  )Expected WCA finite-ion excluded volume (Deserno et al. 2000)
Physics checkMonovalent PB curve fidelity   (Deserno, Holm & May 2000)
Physics checkMonovalent Manning fraction   (   , ) (  , Manning 1969)
Physics checkDivalent Manning fraction   (    vs. PB) (PB   )
Physics checkDivalent vs. monovalent condensation gap  
Physics checkDivalent correlation excess   (; peak at  )  (Deserno, Holm & May 2000)
Physics checkSub-critical Branch B PB fidelity  
Physics checkSub-critical no-condensation check    (   , )Branch B PB ; convex slope ratio  
Physics checkPartial-neutralization available ion condensation at   (  )

5. Running the Tutorial ​

bash
# Quick GPU smoke verification (~16 s warm GPU compute across all 4 cells)
TUTORIAL_FAST=1 julia --project tutorials/T08_dna_manning_condensation/run.jl
TUTORIAL_FAST=1 julia --project tutorials/T08_dna_manning_condensation/analyze.jl

# Full production validation (320,000 steps / 1280 tau per cell + Float64 ESP audit)
julia --project tutorials/T08_dna_manning_condensation/run.jl
julia --project tutorials/T08_dna_manning_condensation/analyze.jl

# Regenerate 300-DPI documentation figures
python3 tutorials/T08_dna_manning_condensation/plot.py

References ​

  1. G. S. Manning, "Limiting laws and counterion condensation in polyelectrolyte solutions I. Colligative properties," J. Chem. Phys. 51, 924–933 (1969).

  2. R. M. Fuoss, A. Katchalsky & S. Lifson, "The potential of an infinite rod-like molecule and the distribution of the counter ions," Proc. Natl. Acad. Sci. USA 37, 579–589 (1951).

  3. M. Deserno, C. Holm & S. May, "Fraction of condensed counterions around a charged rod: Comparison of Poisson–Boltzmann theory and computer simulations," Macromolecules 33, 199–206 (2000).

  4. R. R. Netz, "Electrostatics of counter-ions at and between planar charged walls: From Poisson–Boltzmann to the strong-coupling theory," Eur. Phys. J. E 5, 557–574 (2001).

ParticleDynamics v1.2.0 · GPU-native molecular dynamics in pure Julia · MIT License