N-Body Simulation
Also known as: gravitational N-body problem, many-body simulation
N-body simulation is a computational method for modeling the dynamics of a system of particles under mutual gravitational forces. Originating from Newton's laws of motion and gravitation, it solves the fundamental equations of celestial mechanics. This technique is essential for understanding planetary orbits, star cluster evolution, and cosmological structure formation.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use N-body simulation when studying planetary systems, stellar dynamics, galaxy formation, or spacecraft trajectory design. It applies when the system is too complex for analytical solutions and when direct integration of Newton's equations is feasible. Avoid when extremely long timescales (Gyr) are needed without approximations, or when relativistic effects dominate.
Strengths & limitations
- Directly implements physical laws; results are physically transparent
- Flexible for arbitrary number of bodies and configurations
- Can detect orbital chaos and resonances
- Suitable for hierarchical integration (using adaptive timesteps)
- Computational cost scales O(N²) or worse; impractical for >10⁶ bodies without approximations
- Numerical errors accumulate over long timescales; long-term stability is questionable
- Cannot easily handle collision or close approaches without special handling
Frequently asked
What integration method should I use?
Verlet or leapfrog methods conserve energy well and are popular. For high precision, use Runge–Kutta or symplectic integrators. For large systems, adaptive timestepping (using cluster methods) is more efficient.
How do I handle close approaches or collisions?
Use softening (add a small softening length to the denominator in the force law) to smooth near-singularities, or use collision detection and merging rules if realistic collision is desired.
Why does my simulation show energy loss over time?
Timestep too large, poor integration scheme, or accumulation of rounding errors. Reduce timestep, upgrade to a symplectic integrator, or use double-precision arithmetic.
Sources
- Poincaré, H. (1892). Les méthodes nouvelles de la mécanique céleste. Gauthier-Villars. link ↗
- Newton, I. (1687). Philosophiæ Naturalis Principia Mathematica. Royal Society. link ↗
- Aarseth, S. J. (1985). Direct methods for N-body simulations. In Multiple Time Scales (pp. 377-418). Springer. DOI: 10.1016/b978-0-12-123420-1.50017-3 ↗
How to cite this page
ScholarGate. (2026, June 3). N-Body Simulation. ScholarGate. https://scholargate.app/en/applied-physics/n-body-simulation
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Cosmological Perturbation TheoryApplied Physics↔ compare
- Gravity AssistApplied Physics↔ compare
- Hohmann TransferApplied Physics↔ compare
- Light Curve AnalysisApplied Physics↔ compare
- Orbit Determination (Lambert's Problem)Applied Physics↔ compare