# How to compute newtonian gravitation from an infinite array of attractors?

In a flat toric universe (up connects down, right connects left and front connects back), every points repeats at $$size_x$$, $$size_y$$ and $$size_z$$ intervals.

In such case the Newtonian gravitational acceleration undergone in one point x, y, from a single mass M placed in one corner of a cube, would be undergone from every «image» of this mass M.

eg: lets take one cube of space with a mass (the red dot) in a corner :

Then let's repeat it ad-infinitum in every direction, we see that the mass appears in all corners of every cubes:

In such a situation, the acceleration undergone in the center of any cube would be null and it's general formula would be: $$a(x, y, z) = - M G \lim\limits_{N\to\infty}\sum\limits_{i=-N}^{N}\sum\limits_{j=-N}^{N}\sum\limits_{k=-N}^{N} {(x-size_x.i, y-size_y.i, z-size_z.i) \over |{(x-size_x.i, y-size_y.i, z-size_z.i)}|^3}$$

To make computing simpler, it would be nice to have a simple equivalent of this formula. which is obviously a periodic function.

In a first approach, I should be able to bring back this problem to a simpler one dimensional function : \begin{align}f(x) &= \lim\limits_{N\to\infty}\sum\limits_{n=-N}^{N}{x-n\pi \over ((x-n\pi)^2+a^2)^{3/2}} \\\\ &={x \over (x^2+a^2)^{3/2}} + \lim\limits_{N\to\infty}[\sum\limits_{n=-N}^{-1}{x-n\pi \over ((x-n\pi)^2+a^2)^{3/2}} + \sum\limits_{n=1}^{N}{x-n\pi \over ((x-n\pi)^2+a^2)^{3/2}}] \\\\ &={x \over (x^2+a^2)^{3/2}} + \sum\limits_{n=1}^{\infty}[{x+n\pi \over ((x+n\pi)^2+a^2)^{3/2}} + {x-n\pi \over ((x-n\pi)^2+a^2)^{3/2}}]\end{align}

But then, I wonder how I could compute f(x)... As told above, it will obviously be a periodic function, but it doesn't look like an obvious one. On this simulation I made, one can see various graphs for this function (red for a = 0.6, green for a = 0.3 and blue for a = 0). In addition, cyan is a graph of $$-\cot x$$, magenta is a graph of $$-\cot x/f(x)$$ and yellow is $$|\sin x|$$ (The «V» shape on the magenta graph is caused by the 0/0 situation).

• On a 2D universe shouldn't the acceleration be proportional to the inverse of the distance?(rather than the inverse squared). – themaker May 7 at 0:45
• Theoretically, it's probably the case, but if you wan't to make a simulation on a computer screen, having the inverse of the distance will have completely different solutions and I had the feeling the problem was complex enough with 2 dimension, so I didn't wan't to add a third one. – Camion May 7 at 0:53
• Let's say I will keep the 3D version for later, when the 2D is OK ;-) – Camion May 7 at 0:54
• I see.But it isn't always the case that less dimensions is better. In this case if you work with the inverse square law in 3D, the potencial satisfies the Poisson equation $\Delta U = C \delta_{x_0}$ in the torus ( this also works if you take the inverse law in 2D but not for the inverse law in 3D). So for intance, if you are interested in plotting, you could solve that system using the FFT in 3d which should be fearly fast and then compute the acceleration, and if you want you cant plot a 2d slice to obtain the solution that you are looking for). – themaker May 7 at 1:03
• The problem, is the infinite number of attractors. I'd like to find an analytical solution because it would make the operations much simpler – Camion May 7 at 1:07

A possible solution might be to take the Fourier transform and multiply it by a dirac comb (Ш function) and take the reverse Fourier transform - or said otherwise, to take the value corresponding with ω being an integer multiple of $$2 \pi$$. I tried it online with the WolframAlpha website but the result are quite obfuscated :
\begin{align}ℱ_x[{x \over (x^2 + a^2)^{3/2}}](ω) = -ⅈ [&\sqrt{2 \over π} \sqrt{1 \over a^2} K_1(\sqrt{a^2} ω sgn(ω)) Abs'(ω)\\\\ &+ {1 \over \sqrt{2π}}\sqrt{1 \over a^2} |ω| (\sqrt{a^2} ω sgn'(ω) + \sqrt{a^2} sgn(ω)) (-K_0(\sqrt{a^2} ω sgn(ω)) - K_2(\sqrt{a^2} ω sgn(ω)))]\end{align}
I don't know if it is due to my own misunderstanding, but it seems that many of those notations might be quite simplified. What are $$Abs'(⬚)$$ and $$Sgn'(⬚)$$ ? Aren't they just the same as respectively $$Sgn(⬚)$$ and $$2\delta(⬚)$$ ? Why do they mix «$$|⬚|$$», «$$⬚ sgn(⬚)$$» and «$$\sqrt{⬚^2}$$» ? Isn't it all the same thing ? If I follow this, I should rewrite this formula as:
\begin{align}ℱ_x[{x \over (x^2 + a^2)^{3/2}}](ω) &=-ⅈ \left[\sqrt{2 \over π} {1 \over |a|} K_1(|a ω|) sgn(ω) + {1 \over \sqrt{2π}}{1 \over |a|} |ω| (|a| ω 2 \delta(ω) + |a| sgn(ω)) (-K_0(|a ω|) - K_2(|a ω|))\right]\\\\ &= {ⅈ \over |a|}\sqrt{2 \over π}[|aω| (ω \delta(ω) + sgn(ω)/2) (K_0(|aω|) + K_2(|aω|)) - sgn(ω) K_1(|a ω|) ]\\\\ &\text{(for ω=0, ωδ(ω) is undetermined but since I'm looking for a symmetric} \\ &\ \ \text{solution, I will reject a continuous component by setting ωδ(ω)=0)} \\\\ &= {ⅈ \over |a|}\sqrt{2 \over π}[{|a|ω \over 2} (K_0(|aω|) + K_2(|aω|)) - sgn(ω) K_1(|a ω|) ]\end{align}