# Tag Info

0

What exactly do you think the formula to_add=(rj-ri)*big_g*masses(i)*masses(j)/((abs(rj-ri))**3.0d0) does, especially the denominator? For the correct physics it should be the third power of the Euclidean distance.

1

The problem is probably that the value of $\alpha$ is large compared to the values of $x^2$ that the numerical integrator is probably choosing. For any value $x \gg 1/\sqrt{\alpha}$ the integrand will be close to zero (for large enough values it will be exactly zero in floating point). The integrand is also zero at $x = 0$. So there is no point in setting ...

1

This is speculation, as I do not know the Lipschitz constant or the derivative scales of your simulation. Also, there might be some resonance effect in the interplay of the discrete and continuous parts. But what I would first draw attention to is that the error of RK4 (and any other method) has a V shape in a loglog plot vs. the step size. This is the ...

Top 50 recent answers are included