2

If while distributing particles to their corresponding nodes, two particles comes closer to a level smaller than the machine precision (or $\Delta d \to 0$), how is the situation to be treated? Should the recursive distribution stop and both of them be added to a single node?

This happens because of treating particles as point objects rather than 2D objects. Imagine a machine having a precision level of 3 decimal points (mm in SI) and a situation in which the bodies come within $10^{-6}$ (micro level) of one another.

user1535629
  • 105
  • 4
Renae Lider
  • 123
  • 3
  • This doesn't look like a research level question in theoretical computer science?mass such! it is off-topic here, if you comment or flag then I can migrate it to CS.SE where it would be on topic. – Artem Kaznatcheev Mar 01 '14 at 19:52
  • @ArtemKaznatcheev This is at best marginal on [cs.se], as it's about numeric computation with direct relevance to physics. [scicomp.se] would be a better place, I've flagged to migrate there instead. – Gilles 'SO- stop being evil' Mar 02 '14 at 19:04

1 Answers1

0

Is the issue the division by zero (or close to zero) when computing the forces? I think what is often done (and what I did when implementing Barnes-Hut) was to include what is known as a softening factor. In other words when computing the radius between the centre of mass of the box and the specific particle you do something like:

r=sqrt((bx-px)^2+(by-py)^2+epsilon)

where (bx,by) is the location of the box centre of mass, and (px,py) is the location of the particle, epsilon is the softening factor.

Note: I have only done Barnes-Hut for particles rotating around a large mass (black-hole for example). This method my not be good for star clusters where collisions are common.

James
  • 1,889
  • 1
  • 16
  • 31
  • Softening factor so that separation can't be zero, right? Good suggestion. – Renae Lider Mar 09 '14 at 14:08
  • Right, so basically it sets a maximum on the force between two particles that way as they approach each other they dont get ridicules velocities. – James Mar 10 '14 at 16:05