A general method is proposed for smoothing torsional potentials when the dihedral angle becomes undefined.

Torsional potentials impose steric or geometric constraints between four bonded particles, e.g., the rotational barriers between conformations of the carbon backbone in atomistic models for hydrocarbons.^{1,2} Typically, torsional potentials are functions of the dihedral angle $\varphi $ between a plane *A* containing three particles at {**r**_{1}, **r**_{2}, **r**_{3}} and a plane *B* containing particle positions {**r**_{2}, **r**_{3}, **r**_{4}} (Fig. 1). The planes *A* and *B* have normal vectors $nA=r12\xd7r23$ and $nB=r23\xd7r34$, respectively, where **r**_{ij} = **r**_{j} − **r**_{i}. The dihedral angle between the planes is^{3}

In most cases, this definition can be straightforwardly applied to compute the torsional energy and forces.^{4} However, a degenerate state exists when {**r**_{1}, **r**_{2}, **r**_{3}} or {**r**_{2}, **r**_{3}, **r**_{4}} are collinear, and it is no longer possible to uniquely construct the required planes. The dihedral angle and torsional potential are then undefined, and the torsional forces are singular. Near this degenerate state, particles can be subjected to large forces, resulting in numerical integration errors or a complete crash for a molecular dynamics simulation.^{3} The singular nature of the torsional forces may also lead to unphysical motion or undesired restriction of conformations.

Fortunately, such degenerate conformations are rarely, if ever, observed in atomistic models for particles participating in torsional potentials because the bond angle $\mathit{\theta}ijk$ between them (Fig. 1),^{3}

is restricted by additional interactions to values far from the collinear conformations. However, some coarse-grained polymer models impose significantly softer interactions,^{7–9} leading to a finite probability of observing a degenerate conformation, $\mathit{\theta}ijk\u2009=\u2009180\xb0$. It is necessary to somehow modify the torsional potential in such a case in order to obtain physically, well-defined behavior in molecular dynamics simulations.

The steric interactions approximated by a torsional potential are expected to weaken when the end particles are farther apart and should be negligible when $??ijk\u2009=\u2009180\xb0$. Singular torsional forces can then be removed by modifying the potential so that forces go smoothly to zero when $\mathit{\theta}ijk$ approaches $180\xb0$. Other authors have demonstrated the effectiveness of this approach for certain polymer models.^{10–13} However, the functional forms of the potentials chosen in their works offer little control over the range of bond angles for which the potential is modified, which may be problematic for some geometries.

In this note, we propose a simple, general approach for smoothing a torsional potential as a function of the bond angle. The proposed method can be applied to existing torsional potentials over a controllable smoothing range and gives well-defined behavior in the degenerate case. Motivated by a common method for smoothing truncated pair potentials in molecular simulations, we define a smoothed torsional potential,

where $V0(\varphi )$ is the unsmoothed potential, *V*_{s} is the value to which the potential is smoothed, and *s* is a smoothing function. The force on particle *n* is

where $F0,n(\varphi )$ is the force on particle *n* in the absence of smoothing and $\u2207n$ is the gradient with respect to **r**_{n}. The smoothing function must satisfy the following conditions:

$s(cos\mathit{\theta}s)=1$ at the onset of smoothing (angle $\mathit{\theta}s$);

$s(cos\mathit{\theta}c)=0$ at the end of smoothing (angle $\mathit{\theta}c$);

the first derivatives of

*s*are zero at $\mathit{\theta}s$ and $\mathit{\theta}c$ so that**F**_{n}=**F**_{0,n}at $\mathit{\theta}s$ and $Fn=0$ at $\mathit{\theta}c$; and*s*must decay sufficiently quickly so that*V*and**F**_{n}have well-defined limits for all bond angles.

A suitable polynomial for *s* is

where $xs=cos\mathit{\theta}s$, $xc=cos\mathit{\theta}c$, and $m\u22652$. (In writing *s* piecewise, we assume without loss of generality that $\mathit{\theta}c>\mathit{\theta}s$.) The values of $\mathit{\theta}s$, $\mathit{\theta}c$, and *m* set the range and steepness of smoothing. The gradients of *s* can be computed by chain rule, $\u2207ns(cos\mathit{\theta}ijk)=s\u2032(cos\mathit{\theta}ijk)\u2207ncos\mathit{\theta}ijk$, where

and

Here $\u2207n\u2297rij$ denotes the outer product and is equal to the identity matrix **I** when *n* = *j*, −**I** when *n* = *i*, and the zero matrix **0** otherwise. In the degenerate limit, the unsmoothed torsional forces^{4} diverge as $1\u2215sin\mathit{\theta}ijk$. If $\mathit{\theta}c=0\xb0$ or $180\xb0$, $s\u2032\u2009\u223c\u2009(1\u2212cos2\mathit{\theta}ijk)m\u22121\u2009\u223c\u2009sin2(m\u22121)\mathit{\theta}ijk$, and **F**_{n} has a well-defined limit for $m\u22652$.

The proposed smoothing function was tested for a simple torsional potential, $V0(\varphi )\u2009=\u2009\u2212\u2009cos\varphi \u22152\u2009+\u2009cos2\varphi $. The dihedral angle was initially fixed at $\varphi =120\xb0$ with **r**_{1} = (−1, 0, 1), **r**_{2} = (−1, 0, 0), **r**_{3} = (0, 0, 0), and $r4=(0,\u2212sin\varphi ,cos\varphi )$. The angle $\mathit{\theta}234$ was then varied from its initial value of $90\xb0$ by rotating **r**_{4} around **r**_{3} in plane *B*, causing the dihedral angle to jump to $\u221260\xb0$ as $\mathit{\theta}234$ passed through $180\xb0$. Figure 2 shows the *z*-component of the torsional force on particle 4, *F*_{4,z}, as a function of $\mathit{\theta}234$ for different smoothing ranges. As expected, the unsmoothed force diverges at $\mathit{\theta}234=180\xb0$. The smoothed force is equal to the unsmoothed force until $\mathit{\theta}s$, at which point *F*_{4,z} goes continuously to zero at $\mathit{\theta}234=180\xb0$ before returning to the unsmoothed value at $\mathit{\theta}s$ for $\varphi =\u221260\xb0$.

The chosen form of *s* is particularly computationally convenient because (1) *s* and $\u2207ns$ can be calculated from quantities that are already required for the unsmoothed potential and (2) no additional square-root evaluations are necessary if smoothing is applied symmetrically around $90\xb0$ to eliminate both possible degeneracies (i.e., $\mathit{\theta}c=180\xb0$ also implies smoothing toward $\mathit{\theta}c=0\xb0$). We encourage the use of the smoothed torsional potential especially during the development of coarse-grained models, using *s* as an additional adjustable parameter, in order to obtain correct simulation behavior and physics.

See supplementary material for an example implementation of the smoothed torsional potential.

This work was supported by the Princeton Center for Complex Materials (PCCM), a U.S. National Science Foundation Materials Research Science and Engineering Center (Award No. DMR-1420541). This research is part of the Blue Waters sustained-petascale computing project, which is supported by the National Science Foundation (Award Nos. OCI-0725070 and ACI-1238993) and the state of Illinois. Blue Waters is a joint effort of the University of Illinois at Urbana-Champaign and its National Center for Supercomputing Applications.