Math 2.0

Astronomy and astrophysics Definition

Barnes–Hut simulation

Builds on N-body simulationTreeNewton's law of universal gravitation

Definition

Let particles with masses m1,…,mN>0m_1, \dots, m_N > 0 and positions x1,…,xN∈ℝ3x_1, \dots, x_N \in \R^3 be given, and fix an opening angle θ>0\theta > 0. The Barnes–Hut algorithm computes approximate gravitational accelerations as follows.

  1. Build an octree. The root is a cube containing all particles. A cube with more than one particle is split into eight equal subcubes, recursively, until each leaf holds at most one particle.
  2. For each cell CC of the tree, store its total mass MCM_C and its centre of mass XCX_C.
  3. To compute the acceleration of particle ii, traverse the tree from the root. Let a cell CC have side sCs_C and distance d=∥xi−XC∥d = \norm{x_i - X_C}. If sC/d<θs_C / d < \theta or CC is a leaf, add the term −GMC(xi−XC)/d3-G M_C (x_i - X_C)/d^3, omitting particle ii itself. Otherwise visit the children of CC.

A Barnes–Hut simulation is an N-body simulation whose accelerations at each time step are computed by this algorithm.

Remarks

Example: with θ→0\theta \to 0, every cell is opened down to the leaves, and the method returns the exact sum of Newton's law of gravitation over all pairs. With a typical value θ≈0.5\theta \approx 0.5 to 11, the number of cells visited per particle grows like log⁡N\log N for roughly uniform distributions, so the cost per step is of order Nlog⁡NN \log N.

Non-example: replacing every cell, near or far, by its centre of mass (no opening criterion) is not the Barnes–Hut algorithm; it gives large errors for nearby particles.

The approximation by the centre of mass is the monopole term of a multipole expansion; variants add the quadrupole term for better accuracy.

Reading path

To understand this page from the ground up, read these 46 pages in order. The foundations come first.

  1. Derivative concept
  2. Differential equation concept
  3. Euclidean space object
  4. Euclidean vector concept
  5. Function concept
  6. Interval concept
  7. N-body simulation concept
  8. Ordinary differential equation concept
  9. Tree concept
  10. Velocity concept
  11. Fréchet derivative definition
  12. Ordinary differential equation definition
  13. Cross product definition
  14. Function of several variables concept
  15. Vector-valued function concept
  16. Lipschitz condition definition
  17. Classical mechanics concept
  18. Limit of a function of several variables concept
  19. Momentum concept
  20. Solution of an ordinary differential equation definition
  21. Partial derivative concept
  22. Inertial frame of reference concept
  23. Continuity in R^n definition
  24. Differentiable function of several variables definition
  25. Initial value problem definition
  26. Partial derivative definition
  27. Newton's laws of motion statement
  28. Differentiable on an open set definition
  29. Gradient definition
  30. Higher partial derivatives definition
  31. Picard–Lindelöf hypotheses definition
  32. Iterated derivative definition
  33. Picard operator definition
  34. C^k function characterised by continuous derivatives statement
  35. Integral equation form of an initial value problem statement
  36. An iterate of the Picard operator is a contraction statement
  37. Vector field definition
  38. Picard–Lindelöf theorem statement
  39. Conservative vector field definition
  40. Classical mechanics definition
  41. Momentum definition
  42. Potential energy definition
  43. Angular momentum definition
  44. Central force definition
  45. Newton's law of universal gravitation statement
  46. Barnes–Hut simulation definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation
About this page
TagS60M061DZZ
URIm2://S60M061DZZ
Kinddefinition
WritingW0 stub
MSC85-08, 70F10, 65Z05
DefinesBarnes–Hut simulation
UsesN-body simulation, Tree, Newton's law of universal gravitation
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.