3

I have been trying to implement a 2D $N$-body physics simulator and am currently using newton's law of gravitation to calculate the magnitude of the force a pair of particles experiences. $$F=\frac{GM_1M_2}{r^2}. \tag{1}$$

However, as I have found in this thread, it seems more accurate to alter the inverse square law to simply $1/r$ instead, which makes sense to me since we are working in 2 dimensions instead of 3. Something along the lines of $$F=\frac{GM_1M_2}{r}. \tag{2}$$

However, every other 2D implementation of the $N$-body problem uses the former equation, and I am wondering whether one is more correct than the other? Which one is more suitable for my case?

Qmechanic
  • 201,751

2 Answers2

3

It depends on what you want to simulate. When you use the inverse square law $$F = \frac{G M_1 M_2}{r^2},$$ the particles will behave as they do in our 3-dimensional space as viewed from a certain angle, thereby "ignoring" the spacial coordinate that is perpendicular to the plane of view.

If you actually want to see how particles would behave unter the influence of gravity if our universe only had 2 spacial dimensions, then you would use $$F = \frac{G M_1 M_2}{r}.$$ It's interesting to play around with both cases, as they give you very different dynamics.

1

To elaborate on Lenard's great answer, it could help to use the Gaussian Form of Newtons' Law.

Newton's Law can be reformulated as a divergence expression $\nabla \cdot \vec{a} = 4 \pi G \rho$, where $\vec{a}$ is the acceleration do to gravity, $G$ is the universal gravitational constant, approx $6.673e^{-11} \frac{N m^2}{Kg^2}$ and $\rho$ is the density.

By Gauss' Law, $\int \nabla \cdot \vec{a} dV=\int \vec{a}\cdot \hat{n} dA=4\pi R^2 a=4\pi G M\implies a=\frac{GM}{R^2}$ in the usual 3 dimensions, thus recovering the inverse square law. This all depends on the meaning of $\nabla \cdot \vec{a}$ which varies based on your dimensions.

The divergence is equal to zero in regions of space without mass.

In Three dimensions $\nabla \cdot \vec{a}= \frac{1}{r^2}\frac{\partial (a_rr^2)}{\partial r}=0\implies a_r=\frac{C}{r^2}$ for some constant $C$.

$(1/r)\partial (rE_r)/\partial r + (1/r)\partial E_\theta/\partial \theta + \frac{\partial E_z}{\partial z} $

In two dimensions, $\nabla \cdot \vec{a} = (1/r)\partial (ra_r)/\partial r=0 \implies a_r=C/r$

The divergence varies based on local geometry,e.g. how many dimensions are used, whether or not there is inherent curvature.

This can serve as a point of departure for gravity in curved spacetime.

R. Romero
  • 2,618