# What is Gravitational softening length?

I was reading the Aquarius simulation preprint (Springel et al. 2008) The Aquarius Project: the subhalos of galactic halos as a reference for my internship. I came across the term Gravitational softening length in the Initial conditions section and couldn't get a clear explanation when I searched online.

Can someone explain what it means in this context?

2.2 The Aquarius simulation suite

In Table 1, we provide an overview of the basic numerical parameters of our simulations. This includes a symbolic simulation name, the particle mass in the high-resolution region, the gravitational softening length, the total particle numbers in the high- and low-resolution regions, as well as various characteristic masses and radii for the final halos, and the corresponding particle numbers. Our naming convention is such that we use the tags “Aq-A” to “Aq-F” to refer to simulations of the six Aquarius halos. An additional suffix “1” to “5” denotes the resolution level. “Aq-A-1” is our highest resolution calculation with ∼ 1.5 billion halo particles. We have level 2 simulations of all 6 halos, corresponding to 160 to 224 million particles per halo.

We kept the gravitational softening length fixed in comoving coordinates throughout the evolution of all our halos. The dynamics is then governed by a Hamiltonian and the phase-space density of the discretized particle system should be strictly conserved as a function of time (Springel, 2005), modulo the noise introduced by finite force and time integration errors. Timestepping was carried out with a kick-driftkick leap-frog integrator where the timesteps were based on the local gravitational acceleration, together with a conservatively chosen maximum allowed timestep for all particles

• Hi @Sriram, you should give some more details. Please cite exactly the paper (if there is an online version, eg on Arkive then link to it too. And please quote relevant parts of the paper. Without these details, the question may not be answerable and might be closed. Aug 4 at 9:59
• Is the paper arxiv.org/abs/1810.07055 ? If so can you explain what is unclear about the definition given in the introduction. If not, then that paper will probably let you write your own answer below. Aug 4 at 10:02
• There are different answer to this, depending on whether you read this in a particle-based or grid-based code paper. A link would help greatly. Aug 4 at 13:58
• It's an interesting question, but as it stands, it is IMHO too brief and too short on the details, like the actual references. It looks 'lazy' and shows much less effort than already the first answer by pela. If you address the issues raised in the previous comments by an edit, I shall remove my downvote. Aug 4 at 21:25
• I was reading the Aquarius simulation paper arxiv.org/abs/0809.0898 as a reference for my internship. I came across the term Gravitational softening length in the Initial conditions section and couldn't get a clear explanation when I searched online. Aug 5 at 21:53

Gravitational softening is a numerical trick introduced in particle simulations to avoid too close encounters that would otherwise result in unrealistic motion of particles.

The gravitational force between two particles of masses $$m_i$$ and $$m_j$$ (where in simulations, usually $$m_i=m_2$$), separated by a distance $$r_{ij}$$, is $$F_\mathrm{real} = \frac{G m_i m_j}{r_{ij}^2},$$ where $$G$$ is the gravitational constant. This expression diverges for $$r\rightarrow0$$. The particles in a simulation represent a large amount of mass, thousands or even millions of Solar masses, so in reality if two masses come close, other forces (e.g viscosity) will dominate, and masses will disperse. In a simulation, particles may come arbitrarily and unnaturally close, and numerical rounding may blow up, so instead we substitute the force by $$F_\mathrm{soft} = \frac{G m_i m_j}{r_{ij}^2 + \varepsilon^2},$$ where $$\varepsilon$$ is the gravitational softening length. For $$r_{ij}\gg\varepsilon$$, this approaches the regular force, whereas for $$r\ll\varepsilon$$, the force is constant.

The value of $$\varepsilon$$ sets a limit to how small structures you can resolve in your simulation, and choosing a proper value for $$\varepsilon$$ is an art; a too small value reduces the desired effect, while a too large value reduces the resolution. Often the value of $$\varepsilon$$ is set to a certain fraction of the mean interparticle distance, e.g. 1/10 or 1/100. The choice will also affect the density profile of structures, so in order to make sure that your result doesn't depend too heavily on your chosen value, you need to run convergence test with various values, varying number of particles, etc.

The paper that @James K links to, Zhang et al. (2019), has a good list of resources if you want to dig further into the effect of the softening length.

As an example, I've plotted the forces for particles of mass $$m_{i,j}=10^5\,M_\odot$$, and a gravitational softening length of $$\varepsilon=100\,\mathrm{pc}$$:

• Thank you for the simple explanation, now it's clear to me. Aug 5 at 21:54
• @SriramRamaswamy You're welcome :) Note that the parameters I chose for the figure coincide rather closely with the simulation called "Aq-A-3" in the paper you link to in your comment, for which the radius of the halo is ~250 kpc, i.e. 3½ times larger than the x axis in my plot. In other words, the chosen softening length only affects scales much smaller than the halo radius, as it should. On the other hand, with such a simulation you shouldn't expect to be able to simulate globular clusters realistically.
– pela
Aug 6 at 7:08
• @uhoh That's an issue, but it's more about physics: If the particles represented point masses, e.g. stars or black holes, it wouldn't be unrealistic to come so close as to get slingshot away. But if they represent, say, 1e6 M☉, you should rather think of them as tracers of a mixture of various gas phases, a stellar population, or a field of dark matter (for gas, star, and DM particles, respectively). If 1e6 M☉ of gas comes close, it is compressed, mixed, converted to stars, etc, while if 1e6 M☉ of stars or DM comes close, it would be dispersed rather than all 1e6 stars being flung out.
– pela
Aug 7 at 9:38
• @uhoh You could say that, but I don't think I fancy the word "unrealistic". I'd rather say "quite realistic within its domain", which among other things means "down to a certain limiting scale". Another approach is grid-based codes where, rather than using particles, you have cells between which you calculate the diffusion of gas (and other matter). Here you also have a limiting scale, set by the size of the cells, which may refine adaptively to certain criteria (usually decreasing in regions of high density), or even move around like particles.
– pela
Aug 7 at 18:36
• @uhoh You’re welcome :) Note also that, although the number of particles/cells sets the resolution, a simulation will usually have subgrid physics, e.g. star formation and feedback, supermassive black holes, and turbulence.
– pela
Aug 8 at 6:13