Gravitational N-body problem:
direct summation | 0:38:
Visually useful, but actually wrong about the number of
gravitational force calculations
needed using
Newton's law of universal gravitation.
The video calculates each
interaction explicitly:
10 point particles,
9 interactions each,
so 10*9 = 81 calculations.
This is inefficient.
To explicate:
Newton's law of universal gravitation
explicitly obeys
Newton's 3rd law of motion:
for every
force there is an equal
(in magnitude) and opposite (in direction)
force.
So you actually only need to calculate one of the
pair of
gravitational forces between
two point particles.
The total number of calculations M for N
point particles is given by:
M = sum_(k=1)^(N) (N-k) = N**2 - sum_(k=1)^(N) k = N**2 - N(N+1)/2 = N(N+1)/2
(see Wikipedia:
Summation: Powers and logarithm of arithmetic progressions).
The number of calculations for N = 10 is thus M = 55, and NOT 81.
Having solved for the gravitational forces,
one can calculate the motions of the
point particles over
a short time step and one then advances their positions accordingly.
Then one recalculates their
gravitational forces
and so on.
The procedure is the essence of
N-body simulations.
Short enough for classroom.