Techniquecore
Gravitational softening
Also called Plummer softening, softening length.
Replaces the pair potential -G m / r by -G m / sqrt(r^2 + epsilon^2), so the force stays finite in close encounters; epsilon sets the smallest resolved scale.
Gravitational softening changes the pair force of an N-body code at short distances, so that the force stays finite when two bodies come close. The usual form, due to Plummer's model of a star cluster, replaces the Newtonian pair potential by
where points from body to body and is the softening parameter. The force is the gradient of the potential, so the softened system is still Hamiltonian and still conserves energy and momentum. Softening is used in collisionless simulations, where each body of the code is a sample of a smooth mass distribution of stars or dark matter, and the close encounters of the samples are an error of the method, not physics. It is not used in collisional simulations of star clusters and planets, which treat close encounters by regularization.
In plain words
In a computer model of a galaxy, each body stands for a large cloud of stars, not for one star. When two such bodies pass close to each other, true gravity gives them a very strong kick, and the computer must take tiny steps to follow it. Real clouds of stars do not kick each other like that.
Softening changes the pull between two very close bodies so that it becomes weak instead of very strong. Far away, the pull is almost the same as before. One number sets the distance below which the pull is weakened. A small number keeps more detail but gives more random kicks; a large number gives smoother results but blurs small structures.
When it applies
- The bodies of the code are tracers of a smooth density, as in galaxies, dark matter halos and cosmology. The Vlasov-Poisson system is the target, and two-body encounters are noise.
- The time step must stay bounded. With the largest acceleration from one body of mass is , so a shared step of order resolves every pair passage (heuristic).
- The force method has its own short-range resolution, such as a tree code or a TreePM code; softening sets this scale in a controlled way.
It does not apply to systems where close encounters are real, such as binaries, star clusters and planetary systems.
The template
- Choose for the problem. Smaller resolves smaller structures but increases the two-body noise; larger smooths the noise but biases the force below a few .
- Replace each pair potential by the softened one, for the Plummer form, or by a kernel with compact support (below). Use the gradient of the same potential as the force, so that energy is conserved.
- Use the same softening in the far-field approximation of the force method, or show that the difference is below the force error of the method. For a tree code, the softened monopole of a far cell differs from the Newtonian one by a relative amount of about .
- Choose the time step from and the local density, and report the relative energy error with the softened potential energy .
Classic examples
The Plummer force against Newton. The ratio of the Plummer pair force to the Newtonian one is .
| 0.5 | 0.7071 | 1 | 2 | 5 | 10 | |
|---|---|---|---|---|---|---|
| force ratio | 0.0894 | 0.1925 | 0.3536 | 0.7155 | 0.9428 | 0.9852 |
The softened force is largest at and goes to zero linearly as . The relative error at large is about , so it is still 1.5 percent at . The Plummer potential of a point mass is the exact potential of a Plummer sphere of mass and scale , with density , so the softened problem is the problem of bodies that are small spheres that pass through each other.
Tree codes for galaxies. Collisionless tree codes such as Barnes-Hut use a softened monopole for each accepted cell and a softened pair force for each nearby body (Aarseth 2003, Chapter 6).
Spline softening. TREESPH (Hernquist and Katz 1989) and GADGET-2 (Springel 2005) soften gravity with the cubic spline kernel of smoothed particle hydrodynamics. Each body is a spline mass distribution of finite radius, so the force is exactly Newtonian beyond that radius, unlike the Plummer force, which is wrong at every distance.
Variations
- Kernels with compact support. A smooth mass distribution with a finite radius , such as the spline, gives exactly the Newtonian force at . Codes quote the Plummer-equivalent , the one with the same potential at .
- Optimal softening. Dehnen (2001) splits the force error into a bias, which grows with , and a noise, which falls with . Their sum has a minimum at an that depends on the mass distribution and becomes smaller as grows (measurement and asymptotic analysis).
- Adaptive softening. Each body gets its own , from the local density, as for the smoothing length of SPH. The pair force then uses a symmetric combination, such as the mean or the maximum of and , to keep Newton's third law. A force that is not the gradient of one potential no longer conserves energy, and extra terms are needed to restore it.
- Comoving softening. In cosmology is fixed in comoving coordinates at early times and in physical coordinates later.
- Softening by type. Codes with stars, gas and dark matter use a different for each type of body.
Pitfalls
- Results below the softening scale. Structures smaller than about to are not resolved, and the density profiles of halos are wrong inside this radius.
- Too small for the time step. If is small and the step is not, close pairs gain energy at each step, and the energy error grows. Choose from , or use adaptive block time steps.
- Two-body relaxation still happens. Softening reduces the effect of close encounters only; the distant encounters still relax the system on a time scale of the order of crossing times.
- Mixing potentials. The energy must use the same softened potential as the force. A Newtonian with a softened force shows an energy error that is not an error of the integrator.
- Not physics for collisional systems. Softening a binary or a planetary system changes its orbits. Use regularization instead.
Exercises
- Show that the Plummer potential solves the Poisson equation with , and that this density has total mass .
- Show that the magnitude of the Plummer pair force is largest at , with the value .
- Show that the relative force error at is , and find the radius where the exact error is 1 percent. (Answer: .)
- Two bodies of mass start at rest at distance and fall toward each other with the Plummer potential. Show that they pass through each other with the finite relative speed .
References
- Sverre J. Aarseth, Gravitational N-Body Simulations, Tools and Algorithms, Cambridge University Press, 2003, Chapter 6 (tree codes), Section 6.2 (basic formulation)
- Walter Dehnen, Towards optimal softening in three-dimensional N-body codes - I. Minimizing the force error, Monthly Notices of the Royal Astronomical Society 324(2), 2001, 273-291, the bias and noise parts of the force error and the optimal softening as a function of N
- Lars Hernquist and Neal Katz, TREESPH: a unification of SPH with the hierarchical tree method, Astrophysical Journal Supplement Series 70, 1989, 419-446, the spline kernel softening
- Volker Springel, The cosmological simulation code GADGET-2, Monthly Notices of the Royal Astronomical Society 364(4), 2005, 1105-1134, the spline softening of the gravitational force
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 4YEZ3N Edit this page History Report an error Markdown