Lab 4.6 · 40 min

Lab: a molecule by hand

So far our atoms only felt Lennard-Jones forces. A molecule needs more: bonds, angles and dihedrals, plus rules for which atoms inside a molecule may also feel LJ. We take one butane molecule, four beads, and compute every term by hand. The numbers show why each term is needed, what the force-field choices (1–4 scaling, combining rules) do to the result, and why constraining bonds lets us take three times longer time steps.

The setup

Our molecule is n-butane, CH₃–CH₂–CH₂–CH₃, in the united-atom picture: each carbon together with its hydrogens is one bead. Four beads, three bonds, two angles, one dihedral. Parameters are those of the TraPPE force field. From here on we use the units of GROMACS, so the numbers can be compared with real input files.

beads CH₃ (15.035) CH₂ (14.027) CH₂ CH₃ g/mol units length nm, time ps, energy kJ/mol force kJ/mol/nm; F/m comes out in nm/ps² T = 300 K: k_B T = 0.0083145 × 300 = 2.494 kJ/mol bond U = ½ k_b (r − 0.154)², k_b = 224 262 kJ/mol/nm² angle U = ½ k_θ (θ − 114°)², k_θ = 519.66 kJ/mol/rad² dihedral U = c₁(1 + cos φ) + c₂(1 − cos 2φ) + c₃(1 + cos 3φ) c₁ = 2.9519, c₂ = −0.5670, c₃ = 6.5794 kJ/mol LJ CH₃: ε = 0.8148, σ = 0.375 CH₂: ε = 0.3825, σ = 0.395

(TraPPE keeps the bonds rigid; for the flexible runs we give them a typical C–C spring.) Every energy below is compared with k_B T = 2.494 kJ/mol: anything much larger is almost never visited at 300 K, anything smaller is visited all the time.

Step 1

Why a molecule needs bonded terms, and exclusions

Why: If LJ were enough, we could just put four beads together and let them stick. Let us check what LJ says about two carbons at the length of a real C–C bond.

two CH₂ beads, LJ only LJ minimum at 2^(1/6) σ = 1.1225 × 0.395 = 0.4434 nm a C–C bond is 0.154 nm LJ at 0.154 nm: σ/r = 2.565 U = 4 × 0.3825 × (81 081 − 284.7) = 123 607 kJ/mol 1–3 pair (two bonds apart), distance 2 × 0.154 × sin(57°) = 0.2583 nm: U_LJ = 230.5 kJ/mol

What the numbers say: LJ describes how separate molecules touch, at about 0.4 nm. A chemical bond is a much shorter, much stronger thing: at 0.154 nm LJ gives 123 607 kJ/mol, 50 000 times k_B T, and would blow the molecule apart in one step. Two consequences. First, the shape of a molecule is held by its own terms: bonds, angles, dihedrals. Second, atoms 1 bond apart (1–2) and 2 bonds apart (1–3) must be excluded from LJ, otherwise 230 kJ/mol of fake repulsion fights the angle term. Every MD code keeps such an exclusion list.

Step 2

The bond: a stiff spring that sets the time step

Why: The bond keeps two beads near 0.154 nm. The simplest description is a spring. We need its force for the dynamics, and its vibration period, because the time step has to follow the fastest motion in the system (Lab 1).

stretched to r = 0.160 nm: U = ½ × 224 262 × 0.006² = 4.037 kJ/mol F = −224 262 × 0.006 = −1345.6 kJ/mol/nm thermal stretch √(k_B T / k_b) = √(2.494/224 262) = 0.00334 nm (2.2 %) vibration: reduced mass μ = 14.027 × 14.027 / 28.054 = 7.0135 g/mol ω = √(k_b/μ) = √(224 262 / 7.0135) = 178.8 /ps period = 2π/ω = 35.1 fs (measured in a run: 37 fs) all-atom C–H bond, k = 284 512, μ = 0.9300: ω = 553.1 /ps, period = 11.4 fs

What the numbers say: At 300 K the bond only wiggles by 2 %, so for most purposes it is effectively rigid, yet it is by far the fastest motion: one period every 35 fs. With about 15–20 steps per period (Lab 1), this alone limits us to about 2 fs. In an all-atom model the C–H bond vibrates every 11 fs, forcing 0.5–1 fs. We spend most of the computer time following a motion we do not care about. Step 7 shows the fix.

Step 3

The angle: dot product, energy, force

Why: Bonds alone would let the chain fold flat onto itself. The angle term keeps C–C–C near 114°. To use it we must get the angle from coordinates, then turn the energy into forces on the atoms.

atoms: A (0.154, 0, 0), B (0, 0, 0), C (−0.077, 0.13337, 0) (B is the middle) u = A − B, v = C − B u·v = 0.154 × (−0.077) = −0.011858 |u||v| = 0.154 × 0.154 = 0.023716 cos θ = −0.5000 -> θ = 120.0° dθ = 6.0° = 0.10472 rad U = ½ × 519.66 × 0.10472² = 2.849 kJ/mol dU/dθ = 519.66 × 0.10472 = 54.42 kJ/mol/rad force on an end atom = 54.42 / 0.154 = 353.4 kJ/mol/nm (perpendicular to its bond, closing the angle) thermal spread √(k_B T / k_θ) = 0.0693 rad = 3.97° vibration period measured in a run: 91 fs

What the numbers say: Turning an angle into forces needs nothing beyond the derivative and a lever arm: the torque dU/dθ divided by the bond length. At 300 K the angle wanders by about 4°, much more than the bond (2 %), and it vibrates 2.5 times more slowly (91 fs vs 37 fs). That ratio is exactly what we gain in step 7 when the bonds are frozen and the angle becomes the fastest motion.

Step 4

The dihedral: where the chemistry is

Why: With bonds and angles fixed, butane can still twist around its central bond. This twist decides whether the chain is straight (trans) or kinked (gauche), and in polymers and lipids it controls the whole shape. The dihedral angle φ needs four atoms and two cross products.

gauche butane (bonds 0.154, angles 114°), nm: atom 1 (0.00000, 0.00000, 0.00000) atom 2 (0.15400, 0.00000, 0.00000) atom 3 (0.21664, 0.14069, 0.00000) atom 4 (0.17785, 0.22652, 0.12184) b1 = 2 − 1 = (0.154, 0, 0) b2 = 3 − 2 = (0.06264, 0.14069, 0) b3 = 4 − 3 = (−0.03878, 0.08583, 0.12184) m = b1 × b2 = (0, 0, 0.02167) plane of 1-2-3 n = b2 × b3 = (0.01714, −0.00763, 0.01083) plane of 2-3-4 cos φ = m·n / (|m||n|) = 0.0002347 / (0.021666 × 0.021666) = 0.5000 φ = 60.0° (gauche) trans φ = 180°: U = 0.000 gauche φ = 60°: 2.9519×1.5 − 0.5670×1.5 = 3.577 barrier φ = 120°: 1.476 − 0.851 + 13.159 = 13.784 cis φ = 0°: 19.063 kJ/mol each gauche / trans = e^(−3.577/2.494) = 0.238 two gauche states: trans fraction = 1/(1 + 2 × 0.238) = 0.677 whole curve, summed in 1° steps: 0.663

How fast does the molecule switch? An escape over a barrier happens at a rate of (vibration frequency) × e^(−barrier/k_B T):

curvature at trans c₁ + 4c₂ + 9c₃ = 59.90 kJ/mol/rad² moment of inertia I = 0.1488 g/mol nm² frequency ν = √(59.90/0.1488)/2π = 3.19 /ps rate = 2 × 3.19 × e^(−13.784/2.494) = 2 × 3.19 × 0.00398 = 0.0254 /ps -> one escape every 39 ps
10-ps window12345710
start all trans0.9050.7740.7230.7170.7400.7190.675
start all gauche0.1590.3640.5200.5720.6050.6220.651

Trans fraction in a Langevin run of 200 molecules at 300 K; one jump every 23 ps per molecule.

What the numbers say: The dihedral needs only two cross products, and its three-term formula gives the whole story of butane: trans is lowest, gauche is 3.6 kJ/mol higher (1.4 k_B T, so still common: about one third of the molecules), cis is almost never visited. The full sum (0.663) differs a little from the three-state count (0.677) because the wells have different widths. Limitation, by numbers: the molecule switches only every few tens of picoseconds. Starting from all-trans or all-gauche, 200 molecules need about 100 ps before both runs agree on 0.65–0.68. A longer chain, or a higher barrier, makes this nanoseconds to microseconds: sampling dihedrals is often the real bottleneck of a simulation (Chapter 7, metadynamics).

Step 5

1–4 pairs: exclude, scale or keep?

Why: Atoms 1 and 4 are three bonds apart. They are not held at a fixed distance by bonds and angles: their distance changes with φ. Should they feel LJ? Different force fields answer differently, and the numbers show this is not a detail.

CH₃ ... CH₃ distance and LJ (ε = 0.8148, σ = 0.375): trans r₁₄ = 0.3964 nm U_LJ = −0.662 gauche r₁₄ = 0.3127 nm U_LJ = +19.135 cis r₁₄ = 0.2793 nm U_LJ = +92.870 kJ/mol
1–4 LJ with the TraPPE dihedralgauche − transtrans fraction
excluded (TraPPE's rule)3.58 kJ/mol0.663
scaled by 0.5 (OPLS's rule)13.48 kJ/mol0.957
full23.37 kJ/mol0.988

What the numbers say: In gauche the two CH₃ ends are only 0.313 nm apart, inside σ = 0.375, so their LJ is strongly repulsive (+19 kJ/mol). TraPPE fitted its dihedral with this pair excluded; OPLS fitted its own dihedral with this pair at half strength. Mixing the two, TraPPE's dihedral with OPLS's rule, turns butane 96 % trans, almost no gauche left: the chains come out far too straight. The lesson: a force field is a package. Dihedral parameters, 1–4 scaling and exclusions were fitted together, and must be used together. In GROMACS this is gen-pairs, fudgeLJ and fudgeQQ; in LAMMPS special_bonds.

Step 6

Combining rules: CH₃ meets CH₂

Why: We have LJ parameters for CH₃–CH₃ and CH₂–CH₂, but a simulation also needs CH₃–CH₂, and with many atom types there are far too many pairs to fit each one. Combining rules make the cross parameters from the pure ones.

Lorentz–Berthelot (TraPPE, AMBER, CHARMM): σ = (0.375 + 0.395)/2 = 0.3850 ε = √(0.8148 × 0.3825) = 0.5582 geometric σ (OPLS): √(0.375 × 0.395) = 0.3849 very different sizes, σ = 0.15 and 0.40 nm (ε = 0.5): arithmetic σ = 0.2750, geometric σ = 0.2449 (12 % apart) at r = 0.25: U = +2.734 vs −0.204 kJ/mol contact distance 2^(1/6)σ: 0.3087 vs 0.2749 nm

What the numbers say: For similar atoms like CH₃ and CH₂, the two rules agree to 0.0001 nm and the choice does not matter. For very different sizes, such as a small cation next to a large anion, they disagree by 12 % in σ: at 0.25 nm one rule says strong repulsion, the other mild attraction, and the contact distance moves by 0.034 nm. That directly shifts the radial distribution function and the binding. Like 1–4 scaling, the combining rule belongs to the force field (GROMACS comb-rule, LAMMPS pair_modify mix). Ion–ion and ion–solvent pairs are often fitted separately for exactly this reason.

Step 7

Constraints: SHAKE by hand, and the time step it buys

Why: The bond is stiff (2 % wiggle) and fast (35 fs). If we freeze it at 0.154 nm, the fastest motion becomes the angle (91 fs) and the time step can grow. SHAKE does this: after each normal step, it moves atoms along their old bond directions until every bond length is right again.

one bond, old direction along x, masses 14.027 each after an unconstrained step: atoms (0.001, 0.002), (0.1565, −0.001): bond 0.1555289 g = (|d|² − b₀²) / (2 (1/m₁ + 1/m₂) d·d_old) = 0.0004732 / (2 × 0.14258 × 0.023947) = 0.069302 move: atom 1 by +g/m₁ along d_old, atom 2 by −g/m₂ iteration 0 bond 0.1555289 error +1.5×10⁻³ nm iteration 1 bond 0.1540075 error +7.5×10⁻⁶ iteration 2 bond 0.1540000 error +1.8×10⁻¹⁰ butane, 3 coupled bonds, to 10⁻¹⁰: about 10 iterations degrees of freedom: 4 beads × 3 = 12, minus 3 bonds = 9 (T computed with 12 would read 25 % low)
time stepflexible bondsrigid bonds (SHAKE)
1 fs0.0117—
2 fs0.04820.0042
4 fs0.21730.0169
6 fs0.61190.0392
8 fs1.73110.0729
10–12 fsunstable0.1887 (12 fs)

Energy fluctuation in NVE (kJ/mol, 20 molecules × 10 ps): smaller means a more accurate trajectory.

What the numbers say: The error falls very fast (1.5×10⁻³ → 7.5×10⁻⁶ → 1.8×10⁻¹⁰ nm), so two or three iterations are enough for one bond; coupled bonds in a chain need about 10, because fixing one bond disturbs its neighbours. The payoff: rigid bonds at 6 fs are as accurate as flexible bonds at 2 fs (0.039 vs 0.048), three times fewer steps for the same physics, and flexible bonds blow up at 10 fs while rigid ones still run at 12 fs. This matches the period ratio of step 3 (91/37 ≈ 2.5). In all-atom models, constraining only the bonds to H already doubles the time step (1 -> 2 fs). Limitations: the iterations cost time and are hard to parallelise (GROMACS prefers LINCS, and SETTLE for water); constraining angles in long chains converges badly; and every constraint removes a degree of freedom, which must be subtracted when computing the temperature.

Summary

ingredientwhy (number)limitation / caution (number)
bonds + 1–2, 1–3 exclusionsLJ at 0.154 nm = 123 607 kJ/molbond period 35 fs (C–H 11 fs) limits dt
anglekeeps 114°, spread 4°period 91 fs: next limit on dt
dihedraltrans 0.66, gauche 0.34one jump per ~30 ps: slow sampling
1–4 rulemust match the dihedral fitwrong rule: trans 0.96 instead of 0.66
combining rulecross terms for freeσ 12 % apart for unlike sizes
SHAKE / LINCSdt 2 -> 6 fs at equal accuracy~10 iterations; N_f 12 -> 9