manybody_force: Model attraction or repulsion between all particles in the...

manybody_forceR Documentation

Model attraction or repulsion between all particles in the system


This force implements a n-body simulation using the Barnes-Hut approximation for improved performance. An n-body simulation calculates attraction or repulsion between all particles in a system based on their relative distances and each particles capacity and can thus mimick gravity or electrostatic repulsion.

Training parameters

The following parameters defines the training of the force and can be passed along a call to wield()

  • strength : The attractive or repulsive force of the particles. If positive the particle attracts, if negative the particle repulses. The default is -30. (tidy eval)

  • theta : The Barnes-Hut criterion governing the precision of the approximation. If 0, no approximation is made. Defaults to 0.9.

  • min_dist : A lower distance threshold below which the forces will be damped, in order to avoid explosive forces when two particles gets very near each other.

  • max_dist : A distance threshold above which the forces between particles are ignored. Using this will result in more local changes.

See Also

Other forces: center_force, collision_force, field_force, link_force, map_force, mean_force, random_force, reset_force, trap_force, x_force, y_force

particles documentation built on Aug. 19, 2022, 5:06 p.m.