## Discussion > N-body simulations

"I'm doing a 5 planet system at this very moment."

What does "doing" mean in this context? Waiting for a prewritten code to run? Writing a code? Developing and defining parameters? Developing theory? Other?

I'd like to know more please ATTP - or anybody else with skills and knowledge in this area.

Thanks.

There's an introduction to the problems at Wikepedia:

https://en.wikipedia.org/wiki/N-body_problem

Thanks - a useful page that I can follow the gist of. I'm left concluding that "doing" in the context of aTTP's comment means running code. It appears to be a standard student type assignement - for example:

http://www.cs.ucsb.edu/~gilbert/cs140/old/cs140Win2011/assignments/hw3.pdf

NBY, don't forget he also teaches "astrobiology". I wasn't really sure on which planet(s) he was teaching about biology, but perhaps he'll enlighten us as to where they are. Perhaps it is all five.

I wonder if they have a soup-dragon on planet aTTTP.

N-body problems and simulation of planetary systems is an interesting area, although as ever the comparison to climate models is massively disingenuous. The original point being made is that even relatively simple systems can exhibit chaos and create problems with regard to predictability. Moving from that to far more complex numerical problems - such as climate - and those difficulties get orders of magnitude worse.

The reason N-body problems and planetary systems are relatively straightforward is that the interaction between the bodies is very limited. Planets live in a vacuum and the only relevant force needed to describe their motion is gravity. So if you are modelling the solar system (say sun+8 planets), you model this as 9 point masses, giving a total number of forces to compute at each time step of 81 (9x9). The equations of gravitation and mechanics are well known, and shown to be correct by experiments to staggering levels of accuracy. Yet even with this, there are strict limits on predictability.

By comparison, climate models are far more complex and far less well defined. They consist of millions of points, which interact with each other in complex ways. Each point is described by pressure, temperature, velocity fields. On top of this you have to model all manner of chemical and biological interactions, from the carbon cycle to the hydrological cycle. The hydrological cycle includes everything from humidity to cloud microphysics to precipitation to river flows to ocean cycles. Unlike the N body problem, many of these equations contain nothing better than crude empirical models (from which we extrapolate behaviour in a system with changed climate, which is nothing more than a crude guess) to gross simplifications because the true scales cannot be represented. To argue that climate is anything like the N-body problem is simply delusional. Yet even the N-body problem has a distinct limit to its horizon of predictability.

OK, rant over, I'll try to write something more on the N-body problem...

There was an interesting paper on simulation of the solar system some years back. Preprint link and new scientist article links below.

There are some really interesting observations in this paper, in which the authors simulated the solar system for around 5 billion years (the life of the sun) to see what might happen. 1001 simulations were run, each with tiny perturbations from the starting conditions, and the trajectory of the solar system mapped for each run. In all runs the system was stable for tens of millions of years; this represents the predictability horizon, measured by the Lyapunov exponent, the rate at which exponential growth of initial condition errors dominates the results.

The solar system is pretty stable. Each planet lives in its own orbit with little interaction with other planets. And for many simulations, this continued for 5 billion years, leaving the solar system much as it is today near the end of its life. However, some simulations ended very differently. The most common breakdown of stable orbits was caused by Jupiter slowly elongating Mercury's orbit (Mercury is light compared to other planets and most easily dragged out of position over hundreds of millions of years). Mercury can then go on to interact with Venus, in turn interacting with Earth and Mars creating all kinds of strange behaviours, in some runs planets were thrown into the sun; in one run, Mercury and Venus collide, and in another run a slingshot causes Mars to be ejected entirely from the solar system.

The ejection of Mars from the solar system highlight the absurdity of "ensemble" measures from such runs. Once Mars is ejected from the gravitational pull of the sun, it will simply continue to get further and further from the solar system. Over hundreds of millions of years, it will become millions of time further from the solar system than its original orbit. But it represents 1/1001th of the data points. So if you were to measure - for example - the ensemble mean distance of Mars from the sun after 2 billion years, this one data point will make the entire ensemble mean outside the solar system, despite the fact that in the other 1000/1001 cases it stays within. The standard deviation of this would be equally absurd. And this is one of the key points: the distribution of planetary positions beyond the Lyapunov exponent has what is known as a "fat tail", which renders many of the ensemble statistics largely meaningless.

Climate, too, has a power law ("fat") tail to its distributions (easily shown from instrumental and proxy data) which also calls into question the meaning of ensemble statistics. This is absolutely fundamental and never addressed in the climate literature.

There are some other interesting subtleties in the linked paper. For example, numerical analysis requires the choice of a number of parameters, such as the time step of the calculations and integration. The paper has an interesting note that the time step required to properly preserve the solar system behaviour initially is around 8 days. However, as Mercury's orbit elongates, a numerical instability arises that causes variation in result not from the fundamentals of the equations at hand, but due to numerical errors in the integration steps. The paper notes that when this happens, the results rapidly become unphysical, failing to conserve energy and momentum. Quite rightly, the authors state that this renders the ensemble results incorrect and unusable. They go to lengths to determine the time steps and accuracy of the calculations needed to avoid this problem.

Similar problems have been known to dog climate models, in which energy conservation is not always maintained. But rather than admitting that this fundamentally undermines the validity of the ensemble as in the paper above, climate modellers just add some fudge factors (e.g. "flux adjustments") to preserve conservation laws and just pretend that it is fine to do this.

Now not all models require flux adjustments, but it is this kind of brushing problems under the carpet - the problems of poorly understood or represented physics, complexity of interaction, fudge factors to force models to obey conservation laws, fat tailed distributions, are all problems that in any other scientific field would give scientists, mathematicians and statisticians serious concerns over the validity and meaning of ensemble results. Not so in climate science, and is it any wonder that so many scientifically literate people have a hard time believing the output of climate models.

Thanks Spence_UK. There is an n-body routine in Matlab, so I think you are correct to conclude that the problem is a lot more tractable than that attempted by climate models:

http://www.mathworks.com/matlabcentral/fileexchange/27820-vectorized-n-body-equation

PS: Just for interest, a google of "matlab climate model" pulled up this:

http://www.siam.org/books/mm19/mm19_exercises.pdf

Spence_UK

Thanks for the explanation, which as usual with these things triggered a whole thought explosion as I read it.

Isn't the solar system far more complex than than describe in your explanation causing the long term runs you describe being purely academic? For example the Earth/moon combination is almost a binary planet and over time the moon is "drifting" further away from the earth. Then going down a level Jupiter is the centre of an N-body group and going up a level the solar system is in an N-Body system in the Milky Way?

SandyS

You ask good questions, and the answers to those questions are not straightforward!

There are many things that are not modelled. You give good examples; gravitational forces exerted from other bodies outside the solar system; and large bodies within the solar system, such as the moon. There are also other bodies in the solar system, including large asteroids, and so on. In addition to that, there are also numerical limits - the numerical analysis may be conducted to (say) 10 significant figures, but if you re-ran it to 20 significant figures, you'd get a different answer.

If the impacts of other objects are of the order of 10^-10, which is probably true for other objects in the milky way (I haven't run the numbers though!), the net effect is probably no different to the limit of numerical resolution. This is clearly not true for the orbit of the moon, which will have a non-trivial impact. In the paper above, they handle the earth and moon by representing them as a single point at the barycentre of the two bodies. This is a valid approximation, although they don't mention the growth of the moons orbit, which is probably not. However, the approximation would most certainly not be representative if one of the planets interacted with earth, although it could be valid up to that point.

The trick used to determine the validity of small errors in both the numerical integration and the impact of exogenous variables to the system (e.g. small bodies in the solar system or massive bodies a long way away, which generate tiny forces of the order of the numerical integration accuracy) is the Shadowing Lemma. Shadowing is not valid for all chaotic systems, and it should not be assumed, but systems can be tested as to whether it applies.

The concept of shadowing is that the numerical solution contains a limit in the accuracy of the calculation, and a more accurate calculation would generate a different trajectory and a different result. However, since we can perturb the initial conditions by arbitrarily small amounts and get a different result anyway, for some classes of system, we can know that even though the exact solution would be different, there exists a different set of initial conditions arbitrarily close to the initial conditions that were used, which would follow closely the trajectory that was actually simulated. As long as the shadowing lemma holds, the ensemble distribution should be representative. If the shadowing lemma does not hold for a system, numerical computation beyond the horizon of deterministic predictability is largely pointless.

Proving the shadowing lemma for a system is hard enough when you know the equations (as in the N-body problem), but entirely meaningless when you only have a set of equations which is something a bit like how the system behaves - as with climate!

Spence_UK

Thanks for that, there's rain forecast for the weekend as I'm a fair weather cyclist I'll have a bit of time to research some of what you've said. I also thought that gravity waves might be interesting to look at starting with how they are detected.

I read somewhere once (so large grain of NaCl) that uncertainty introduces incalculable errors into most everyday kinetics over time.

The example they gave was bouncing a snooker ball off the cushions of a snooker table. Even if you knew the exact speed, spin and trajectory of the initial shot, the friction from air and felt, the elasticity of the cushions, etc etc, all the effects that we understand as forces acting on the ball.... after 12 bounces off the cushions the error introduced by quantum uncertainty meant that the error in the position of the ball was on the same order as the size of the table.

So after 12 bounces - nobody - no matter how accurately they understood the forces - could predict where the ball would end up on that table.

Worth pondering.

Certainly worth pondering, TBYJ, especially if you add a few other balls to the table. This is a very good analogy of what is happening in the atmosphere; it is a table with many balls bouncing around. While you do know that the balls will be confined to the table, you really have no idea whereabouts they are going to end up. The scale of these metaphorical balls doesn’t help, either, whether they be entire weather systems, or the flaps of mythical butterflies’ wings; a larger scale just makes it easier to observe.

*So after 12 bounces - nobody - no matter how accurately they understood the forces - could predict where the ball would ...Feb 26, 2016 at 9:18 AM | Unregistered CommenterTheBigYinJames *

I read an explanation by Richard Feynman (I can't find it and I don't remember where I read it).

Somebody had said that it was the unpredictability of quantum effects that meant that we cannot predict the future state of the world from its current state.

Feynman explained that, even if quantum effects did not exist, the macro-scale universe would be no different in terms of our ability to predict its future. The precision with which the starting state and the dynamics would have to be known to predict the future state of complicated dynamic systems more than a short way into the future means that the future states of such a systems are essentially unknowable.

_____________________________________________________________________________________________

Excuse my ignorance, but are the orbital frequencies of the planets around the Earth (or the planets around any star) interrelated - for example being integer multiples of a common subharmonic?

I haven't ever heard of such a correlation. Orbital speeds are mathematically related to distance from the sun, and the distances from the sun are all fairly random, since the planets formed from an irregular accretion disk*. So don't think there can be any correlation. Also the word 'harmonic' is a trigger word when it comes to planetary science, so beware. There are a few weird theories about everything being caused by planetary harmonics.

* so in theory you can get planets of any size forming at any distance depending on the particular irregularities of the accretion disk but the caveat is that larger gas planets are unable to form and stay stable very close to the sun - due to tidal effects - which is why we only have small rocky ones near the sun, and on the fringes, large gas ones, which have collected many smaller rock ones as moons.

tbyj - fwiw:

http://billiards.colostate.edu/physics/Mathavan_IMechE_2010.pdf

I can't locate the 12 bounce thing online anywhere. It was most likely from a John Gribbin book or a Roger Penrose book, from the 80s or 90s.

tbyj - no neither could I. That is what prompted my google - it's a long while since I played but 12 bounces for a single ball on a full size table sounds to be pretty high to me. However the other ref looks fun from a quick skim :-)

Martin A

Try Tallblokes Talk Shop, he has regular postings on the solar system. For example

https://tallbloke.wordpress.com/2016/02/19/why-phi-lunar-eclipses-at-stonehenge/

https://tallbloke.wordpress.com/2016/02/06/why-phi-solar-rotation-notes/

https://tallbloke.wordpress.com/2016/02/01/why-phi-a-unified-precession-model/

https://tallbloke.wordpress.com/2016/01/29/renu-malhotra-nonlinear-resonances-in-the-solar-system/

I play once a week with my son, and I think it would be near on impossible to get it to bounce 12 times, but it was to demonstrate the principle that collisions even in the macro world are inherently sub-atomic in nature, and are thus subject to the usual Heisenberg shenanigans. A tiny uncertainty on the first bounce is compounded to a macro uncertainty by the time you get to the 12th.

*I haven't ever heard of such a correlation. Orbital speeds are mathematically related to distance from the sun, and the distances from the sun are all fairly random, since the planets formed from an irregular accretion disk*. So don't think there can be any correlation. Also the word 'harmonic' is a trigger word when it comes to planetary science, so beware. There are a few weird theories about everything being caused by planetary harmonics.(...)Feb 26, 2016 at 12:21 PM | Unregistered CommenterTheBigYinJames*

Thanks for the warning. I meant it only in the normal sense of one frequency being an integer multiple of another.

Before the days of frequency synthesisers, it was very difficult to build a piece of equipment with containing two oscillators running at very close frequencies. Even a very small amount of coupling between the two (despite screening and decoupling of power supplies) would result in them pulling in to a common frequency. It is a nonlinear effect but there is normally enough nonlinearity present.

Years back I attended a talk on the evolution of planetary systems and somebody mentioned this effect as possibly applying to orbits but I can't remember any more than that. I was familiar with the effect at the time which is why I remember it.

I guess that one instance of the effect is that the Moon's rotation has pulled into synch with its rotation around the Earth.

I was wondering if there are any pairs of planets where the ratio of their orbital frequencies was a rational fraction.

Feynman covers the basics

Martin A,

It's complicated, but see https://en.wikipedia.org/wiki/Orbital_resonance for a basic introduction.

Thank you Jonathan - oodles of interesting information there.

"How simple is the physics of two point masses affected only by their gravitational attraction. We've cracked that one, but add a third mass and trouble ensues. A struggle to find special cases that continued through the 20th C, and still is problematic. Add a fourth or more, and the physics is of little practical use."

What? Have you never heard of N-body simulations. We might not be able to solve some of these problems analytically, but that doesn't mean that we can't determine the gravitational evolution of a multi-body system. I'm doing a 5 planet system at this very moment.

Feb 24, 2016 at 9:51 AM | Unregistered Commenter...and Then There's Physics