The challenge: N-Bodies problem

Well … just finished reading Liu Cixin’s 2+K page sci-fi trilogy. Verdict: high verbiage, pointless/naive scenario > avoid (stick to Sir Arthur Charles Clarke and the likes).

The story is about a planet orbiting 3 suns (thus motion is chaotic). This yields extreme conditions and aliens there become a bit bad/aggresive. So they seek some other steady planet … and due to some unfortunate events they discover Earth. Then mostly bad things happen.

Anyway … the only thing interesting is the N-Bodies problem: what are the orbits of 3 (or more) suns in some sort of proximity and why their CoG is linear?

Try to solve it. 10 cans of the finest sardines known to man are waiting for the brave winner.

Some hints/help:

Due to the random suns creation is better to split the whole thing in 2: One for the setup and one for the motion (where gravCoeff, Time, Time interval, max Grav Force etc etc are vars):

Given N bodies (suns) with random R, density and start velocities find their paths in time and space. Like (5 bodies rnd demo):

But what happens if 2 suns (or more) collide? So for a given position solution in time you should do some recursive ccx clustering. Like:

And if a collision occurs (a sun/sun fusion, that is) then this happens:

Moral: the end of days is nigh.


Too bad you didn’t like it, I thought is was a good read with a lot of interesting ideas. For one, the ideas behind the title of the second book (The Dark Forest) is an interesting take on the Fermi paradox (the highly likely existence of extraterrestrial life vs. having no proof of it). The idea that aliens hunt each other in silence “in the dark forest”, and making the smallest of “peeps” will give away your existence is one of the better explanations I have read recently.

Well … the scenario in Childhood’s End (Arthur C. Clarke) makes far more sense to me … since the more you evolve (NOT in the way that humans “evolve”) the more any threatening appears to be a non issue (i.e. if you can control anything [including time - Arrival style] why bother ?).

Anyway Cixin could tell the story in 300 (max => less is more) pages.

I’m awaiting the 300 page best seller by Peter Fire. Until then I think I’l reread the 4 books and perhaps even watch The Wandering Earth movie again.

Interesting demos btw. So are you going to have black holes forming when enough bodies merge?

1 Like

What 4? They are 3 .

Indeed this is how the C# may end (or we should “fall” into Cixin’x 2 dim Universe? - LOL). In the mean time some WOW graphics are required when a fusion happens (see space around arrow: i.e. the termination of one path and the “odd” change of the other):

Ah yes, but I read The Wandering Earth as being part of the lore.

I think you’re mixing with Flatlands (:

I played around a bit with periodic orbits back in Kangaroo1

Some that I found particularly interesting are the periodic ‘free-fall’ orbits.
Instead of moving along closed loops, all the bodies start at rest, fall along an open curve, then fall back along the same path (15.1 KB) (12.8 KB)

(the old solver was far worse than K2 for most form-finding things because of instability with stiff elastic systems, but one thing its symplectic integrator was great for was energy preservation as needed for orbital simulations)


No mix > In his 3rd book Cixin exposes rather explicitly the end of days (in 2D !! - LOL). Wonder what to add for a proper finale: a black hole OR a projection of everything in 2D .

N-body in JavaScript

That’s not a solution: it’s a nerd talking about a solution(?). Plus there’s no fancy graphics nor some provision for a proper finale. See a WIP thingy waiting for implementation (as one out of two options) in the motion C#:

Plus: the maths exposed are wrong: Here’s me dealing with the correct stuff:

Shiffmans’s upfront about it being more of a time-based physics simulation with some shortcomings, than a defined mathematical solution with differential equations.
He also does a great job explaining the n-body-problem (and many other concepts) in a way that many people can understand it, instead of trying to solve everything in the most complex way out there, and then posting little misanthropic troll videos about it for some kind of perverted self-gratification.

You miss the whole point: it’s a challenge (with a big first prize) - and not a tutorial by any means.

First you have to ask yourself “what makes” a problem in physics “a three body problem”.
Gas or liquid atoms or plasma, are they not N-body problems… oh, it is atom, not a body, OK.

Just because a solar system has two or three suns (the most massive object, may not be the biggest in size though), does not mean a planet there would jump from star to star!
Slow disturbance in orbits - yes! But jumping - no. Or, now if I think about it, the jump would be a quite warning sign that two of the stars will collide, so the jump would be your last concern*.

*Take note that stars have a “human\flora\fauna life belt for planets”, which is at a very narrow ring compared to other orbiting bodies (if present).

Regarding the Fermi paradox…
I always ask people this question:
"What would be an acceptable proof for you on the presence of extra-terrestrial life, including one that is on Earth (so called extra-terrestrials or the nonsense word ‘aliens’)?"*
*The general notion would suggest such a life, similar to our on Earth.

Hint: there are so many proofs for the presence of ET life on Earth, from past times till present days, but seems my question is valid still.

Indeed … but to be honest this challenge is about “validating” (kinda) Cixin’s assumption related with the 3 Sun (it could be (?) more) chaotic motion (yielding extreme climate conditions in the singular Planet > reset of civilization > aggresive aliens > let’s take Earth … blah, blah). That said the 30M human “computer” is … er … hmm … a rather extreme idea.

So the code is dealing with various random (grav coeff (LOL), pos, velocity, density, R) “comparable” (so to speak - at least to their mass [i.e. in rnd min-max Interval]) Sun collections and/or potential Sun collitions (I’ll add an option for bodies with far less mass [Planets so to speak]).

But I am not in the Academic bandwagon so I have no interest to deal with a “real” N-Bodies behaviour.

I think climate change would be related to precession of axis of rotation, depending on the star (current centre of orbit).

Frankly, I could not get a clear picture about the configuration of the star system in his book… somehow “predicting” or suspecting the existence of later confirmed KOI-5 star system (with one planet, allegedly confirmed).

I think the idea is that the planet’s orbit in such a system will have periods of oblong elliptic orbit and periods of circular (fairly stable) orbit.

Ah, good that you look at it more as a mathematical problem with some physics behind it. The real world as we know is far more bizarre.

For example, as a student using some Rhino3D v3.0, I tried to make a model of planets having stable precession configuration:

  1. “Natural”, straight perpendicular to the ecliptic plane (plane of orbit)
  2. Axis of rotation in the ecliptic plane:
    · every half turn it will be either pointing towards the sun\star or tangential to the orbit’s trajectory
  3. Stable angle of inclination (30°, 45°, 60°, etc.)

and trying to guess the seasons, day cycle… climate would be much more difficult as it will depend on winds (air fluid), water, surface activity (volcanos).

I still firmly believe that our solar system is a double star system.

Heavily “adjusted” for some sort of observable graphics, truth to be sad.

That’s the reason for frequent start-star collisions (and potentially some black holes [user defines when star’s new mass - post some collision(s) - is OK for a BH]). So the whole setup is mostly oriented towards death and distruction (BTW: does Cixin knows coding?)

In that “unreal scale of Bodies” (nothing to do with real distances and true G constant) a Planet has very limited future: in most runs is been absorbed by some star … meaning adios amigos.

Certainly, the gift of Life is Death in the end…

By mathematical (with some physics) I meant the pure trajectory picture of the bodies, which I find to be pointless. You need to model not only attraction forces, but their grav. fields as well. In a virtual 3D space.

Again, I do not believe that in such star systems (two\three\more? suns) there is chaos with orbiting planets, etc.

I also do firmly believe that together with the Universal law of attraction there must be another fundamental law of Universal Repulsion.


Well, lets say that the Big bang was one hell of a gigantic Repulsion. Wasn’t it?
Is the Expansion of the Universe a result of such a repulsion (“inertia” of its initial burst?), maybe it is.

But also if you compare the vastness of space against the organised structure of galaxies… the Entropy theory goes out the window.

Also, I do believe that the speed of Light decreases with the expansion of the Universe… and in the past it was way much higher. The expansion will end and then the Universe will start to shrink but the Time won’t be reversed, it will continue as is.

If astronomers think they could find the 0 point in Space (where the alleged Big Bang happened), they will be disappointed. It happened in another “dimension” of Time and Matter. Our 3D dimension is just a thought concept÷ a construct of our analytical minds… but those Space\Time entities do not care about our grid (cartesian\polar\etc.) constructs.

Our current speed of light in such current condition of Space\Time, I suggest (claim), is just some kind of a borderline (border membrane) for our “3D space”. Like in a high-speed camera: the more frames\speed of the shutter, the more decreased Time appears to be… for our very same eyes that require the very same Light to reach to our retinas. It is just an illusion.

But let’s continue further… Does reaching the relative\current speed of Light has any\some effect on our atoms\structure of the same matter. I think yes. I think the matter that reached the “border” appears to not be “spinning” anymore… but remember, can we see it? (what light would reach our eyes in this condition?) or will everything appear to be “frozen”. I say “Let it go!” :smiley:

Reaching the Speed of Light causes a tremendous resistance from the Ether (call it Space\Time if you do not like the term Ether, although they are not the same). We could say this resistance makes the Mass to appears as if has been increased. True indeed for conventional reach of high speeds by movement into Space = tearing it off. In such a way many roaming bodies have been attracted out of their orbits and now crossing the vastness of space, but that is another subject.

I think at this point something much more fundamental comes into play: thought
Of course thought is billion times manifold “faster” than Light. So, in such conditions thought is the ultimate guidance.

Those are much more important concepts and things.

The N-bodies problem is only applicable under specific conditions and we could say some final stages of attraction scenarios. Think of the so called galaxies collision.

Well … get the attached as a primitive indicative start … and finish it properly. (120.0 KB)

Ask yourself why the most distant stars newly discovered aren’t all red, as that is the age old argument for the theory in the first place.

Ok, but distant from what? I think I already mentioned that we won’t be able to find the point in space where Big bang started. It is not in our dimension… and this is crucial to be understood.