N-Body Simulator

Integrate particles in 1D/2D/3D with custom pair forces and global fields

About this tool

Integrate an N-particle system in 1D, 2D, or 3D with velocity Verlet. Pairwise forces use editable formulas; an optional global field and per-particle overrides are supported.

Pair force variables

t, masses m, mj, charges q, qj, separation dx,dy,dz (xi−xj), r, r2, positions x,y,z and xj,yj,zj, constants G, k, softening eps.

Global / per-particle field

t,m,q,x,y,z,G,k — returned value is force (divided by mass for acceleration). Disable a component with 0.

Presets

Gravity, Coulomb, harmonic spring, Lennard-Jones. Use softening ε to avoid singularities at r=0.