MD integration methods with manifold constraints very sensitive and crashes #1868
Replies: 1 comment 3 replies
-
Do your You are also using the NVE integrator for a simulation that is anything but constant energy. Your "rapid telomere movement" and bond creation are not conservative processes. You should use an integration method that can dissipate the energy you are creating, such as Langevin or Brownian (note: Brownian has error O(dt) and will require an order of magnitude smaller dt). These methods can dissipate some energy, but may still be destabilized by a violent event (e.g. a bond created with 1000kT of potential energy). I would troubleshoot a situation like this by starting with no walls, no bond creation, and no RTM - only the sphere constraint and the polymers. Determine the maximum dt needed to integrate this system stably. Run future simulations at half this maximum dt. Then add walls, bond creation, and RTM - only one at a time. Determine which of these destabilizes the system and how. Realize that even with a dissipative integrator such as Langevin, you may need to lower your dt even further from the initial value to properly integrate the equations of motion immediately after introducing a discontinuity to the system. Last, I would question whether MD is the proper tool for your model. A Monte Carlo method would have no numerical stability issues during bond creation or rapid movement steps. And your simulation size appears small enough that a hand-coded MC simulation (in a compiled language) would provide sufficient performance. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm currently working on a project where I model two pairs of chromosomes as chains of beads connected by springs. These chains are contained within a spherical nucleus, which exerts an external wall force. The telomeres (the ends of each polymer chain, in red on the picture) should be constrained to the inner surface of the sphere and allowed to move only along this surface.
To achieve this, I am using NVE integration with a spherical manifold constraint as follows:
I'm encountering a problem in my simulation where, despite adjusting various parameters, the simulation frequently crashes due to particles acquiring NaN positions. Also, this issue arises more frequently if a custom action applied to telomeres and beads near the telomeres.
Tolerance Issue: By default, the tolerance is set to 1e-6 (documentation). However, I discovered that if I set the tolerance below 1e-2, the simulation crashes almost immediately, regardless of the
dt
value. I experimented with tolerance values like 0.01, 0.1, and even 1. While these higher tolerances reduce the frequency of crashes, the simulation still fails intermittently.Telomere Forces: telomeres may undergo a phenomenon called rapid telomere movement (RTM), where each telomere has a probability of experiencing a force of magnitude M, displacing it rapidly in a random direction on the sphere's surface. This behavior is implemented using a
custom.Action
andhoomd.md.force.ActiveOnManifold
.New bonds : In addition, when beads from homologous pairs (e.g., bead 10 from polymer 1 and bead 10 from polymer 2) come into proximity, a new bond is formed between them.
Disabling the custom actions reduces the frequency of crashes but doesn’t completely resolve the issue. I’ve also attempted to address this by modifying the tolerance parameter, adjusting dt, and fine-tuning other parameters, but the problem persists.
Before switching to HOOMD-blue, I used LAMMPS, which has similar features for manifold constraints (
nve/manifold/rattle
). In LAMMPS, there was an additional parameter calledmaxit
(maximum number of iterations to perform) that seemed to help in preventing similar crashes. I wonder if a similar approach or workaround might help in HOOMD-blue, or if there are other suggestions for a better usage of the manifold constrain.Thanks in advance
EDIT: I just found out that if I use a slightly smaller radius than the actual one:
sphere = hoomd.md.manifold.Sphere(r=radius - 0.5, P=(0, 0, 0))
It does work better.
Beta Was this translation helpful? Give feedback.
All reactions