
Infinite Force? Forty-year-old Fortran to the rescue - musgravepeter
http://nbodyphysics.com/blog/2015/12/08/threebody-2-0/
======
dietrichepp
I'd like to say to everyone starting out doing math with computers: You see
that old book of numerical recipes or physics problems done in Fortran? Yeah,
those are pretty damn good recipes. Do you need some weird function, like a
gamma function or hypergeometric function? Maybe you want to minimize a
function with simulated annealing or you want to design a Chebyshev filter?
You can dig up a library somewhere or you can just look in that dusty old book
on the shelf.

There's a C version but the Fortran version is easier to find.

~~~
cwyers
> You see that old book of numerical recipes or physics problems done in
> Fortran? Yeah, those are pretty damn good recipes.

If I don't have that book, what's a good one to get?

~~~
tosseraccount
[https://www.gnu.org/software/gsl/manual/html_node/](https://www.gnu.org/software/gsl/manual/html_node/)

------
douche
I think porting code from one language over into another is one of the better
ways to learn a new language. Especially older, lower-level code. I've
probably learned more from rewriting an old school project ray tracer in three
or four different languages, or grinding away at utilities to load up Quake
and Wolfenstein 3D assets based on the ID code, than I have in my actual day
job.

------
evincarofautumn
This reminds me of something that’s always struck me as odd about large-scale
physics simulations: using invariant spacial coordinates when doing a
gravitational simulation is totally absurd. Wouldn’t precision problems be
much less of an issue if you distorted space according to gravitational
influence, as happens in real life?

~~~
bainsfather
The 'resources' section of the post has 2 links, e.g.
www.ma.utexas.edu/mp_arc/e/03-547.pdf goes through several rather clever
transformations of (spatial and/or time) variables to improve accuracy.

------
siscia
I just took a class of dynamic systems and this post struck me.

Actually it is possible to model the planets using simple mathematical tools
and find a space of solution to the problem (have planets that keep staying
together) in an analytic or simil-analytic form.

All this can be done on paper, which is actually faster than code integrator
but way less cool to watch...

~~~
nickhuh
The three body problem though is famous for having no solution in terms of
basic functions. I think for your planets model you must have been making
different assumptions than in the article.

~~~
siscia
In system dynamic you can divide a problem in simple (with a finite number of
solution) and complex (with an infinite, fractal shaped, number of solution).

If the problem is "complicated" (a lot of strange, ugly, non analytic
equation)but simple you can roughly cut the solution space by hand, assuming a
small number of solution.

If the problem is complex all you can do is looking for cycle and equilibrium
point using your intuition about the system or being lucky and find a strage
attractor (chaotic behavior) slightly moving the parameter.

So, yes, I was to quick writing my reply, you can definitely model the n-body
problem, exactly solve it is another beast, check a solution however is still
relatively easy...

------
blablabla123
Actually since the earlier 90s there are mathematical proofs showing how to
generate infinite velocities using 4 objects. (In the Newtonian framework)

~~~
adrianN
Do you have a reference?

~~~
blablabla123
One guy is called Xia and he proofed it 1994. (For only 4 objects using a non-
constructional proof)

Here is a reference for an earlier proof with 5 objects:
[https://en.wikipedia.org/wiki/N-body_problem#cite_note-34](https://en.wikipedia.org/wiki/N-body_problem#cite_note-34)

Update:
[https://en.wikipedia.org/wiki/N-body_problem#Singularities_o...](https://en.wikipedia.org/wiki/N-body_problem#Singularities_of_the_n-
body_problem)

~~~
musgravepeter
Thanks! There is also a discussion in The Million Body Problem (Heggie & Hut).
Looking forward to poking around in this.

~~~
blablabla123
No problem! Wow, this sounds fancy, gotta read this!

------
musgravepeter
nbody here.

Note the Android Lite version 2.0 somehow ended up in Occulus mode in the
final APK. A fix is uploading to Google play now!

I have no idea how to even turn that on in Unity - so it's a bit of a puzzle!

