Archive for February, 2016
Working Through the NBody Problem in Universe Sandbox ²
Feb 26th
What is the nbody problem?
The nbody problem can be defined as “the problem of predicting the individual motions of a group of celestial objects interacting with each other gravitationally.” Or, in a gravitational system of n bodies (where n can be any number), where will they all be after one year?
It’s helpful to frame this in contrast to the twobody problem, which looks at the motion of just two objects interacting with each other. For example, you can look at the Earth and Moon as a twobody problem. The Earth pulls on the Moon quite a bit, keeping it in orbit, and the Moon pulls on the Earth just a little bit.
The issue here is that the Moon is not affected gravitationally by just the Earth; it is also being pulled by the Sun, and Jupiter, and every other object in space. The same is true when looking at the Sun and Earth: the Sun is not the only object pulling on Earth. So to account for all of these gravitational forces, you need to use an nbody solution.
The problem of the nbody problem in Universe Sandbox ²
In Universe Sandbox ², every object is simulated as part of an nbody problem. Unfortunately, when solving for many objects, or n objects, you can’t just jump forward in time without getting massive errors. There’s simply no way around this. Solving an nbody problem requires calculating how each object affects each other object every step of the way. Errors will still happen, but taking smaller steps reduces them.
By default, the simulations in Universe Sandbox ² try to set an accuracy which prevents orbits from falling apart due to error. This means setting a maximum error tolerance for each step and also making sure the total error doesn’t reach an upper limit.
If you crank up the time step, the simulation then has to take fewer, larger steps. This means the potential for greater error. And the greater the error, the more likely it is that an orbit, which otherwise would be stable, falls apart. Moons crash into planets, Mercury gets thrown out of the solar system — things like that.
This isn’t what most people want in their simulations. But at the same time, most people also don’t want a limit on how fast they can run their simulation. This is a problem.
An imperfect solution
So how can we get around this problem? How can we accurately simulate thousands of objects while still allowing for large steps forward in time? For example, what if you wanted to simulate our solar system on a time scale of millions of years per second so that you could see the evolution of our Sun?
One solution proposed by Thomas, our physics programmer, is to allow for a special mode within simulations running at high time steps. This mode (which of course could be toggled) would collapse the existing nbody simulation into a series of 2body problems: Moon & Earth, Earth & Sun, Europa & Jupiter, Jupiter & Sun, etc.
Solving a 2body problem is much easier than solving an nbody problem. Not only is it faster computationally, but there is also a relatively arbitrary difference between figuring out where the two objects will be in one year and where they’ll be in a million years — it still requires just one calculation. So if you collapse an nbody simulation into a series of twobody problems, the simulation could take one big step forward, instead of taking the small steps needed for calculating it as an nbody problem.
The results won’t be entirely accurate, as this method would effectively ignore all gravitational influences outside of the main attractor. As mentioned before, calculating Earth’s orbit by looking at how it interacts with just the Sun is not accurate, as Earth is also affected by every other body. The Sun, however, is the most significant factor by far, because it is much more massive than any other object in our solar system. The other, much smaller forces tend to have little effect overall in nonchaotic systems. So while it’s not correct, it’s close enough when simulating something relatively stable like our solar system.
This isn’t a perfect solution. But we think it could be an improvement over the current system and its limitations, which leave you with the choice of either destabilizing the orbits with massive errors, or waiting days for the simulation to advance the millions of years needed for the Sun to evolve. Neither is particularly interesting.
When is this coming to Universe Sandbox ²?
Not anytime soon.
This solution is just a proposed idea right now, and is not a high priority for us, as we already have a big list of exciting features planned. But we think it is useful to understand the complexity of accurately simulating the motions of hundreds to thousands of objects interacting gravitationally.
This is especially a challenge when attempting to do this in realtime on a home computer, which is why researchers run numerical simulations on supercomputers which take days to complete. With Universe Sandbox ², we’re exploring new territory and working through problems which haven’t been solved before. And this is a big part of why we love making it.
Gravitational Waves & Universe Sandbox ²
Feb 15th
What’s the significance of discovering gravitational waves?
This announcement is a huge deal. It is on par with the discovery of the Higgs Boson particle which provided the missing evidence for a prediction of the Standard Model of particle physics. Gravitational waves are a centuryold (almost exactly) prediction now confirmed by a huge number of relentless, and brilliant people after many years of hard work. It is the first direct confirmation of the prediction from Einstein’s General Relativity that matter and energy determine the motion of bodies by warping the fabric of spacetime itself, and in so doing, emanate ripples when massive bodies are accelerated through that space.
It is not only confirmation of general relativity, though. It is also the first of many future observations that will look at the universe in a completely new way. Up until now we’ve used only photons (telescopes all along the electromagnetic spectrum) and sometimes neutrinos. Now we can add listening to the fabric of space to our list of tools. This will allow us to see the dark and the obscured parts of the universe: the early universe, centers of galaxies, things blocked by dust clouds, and so on, by listening for changes in space itself. It is the start of a new age in astronomy.
In addition to this detection being the first direct proof that the predictions of general relativity that matter and energy warp space time are true, and some of the strongest evidence for the reality of black holes, this is also a new kind of astronomy. Though gravity is the weakest force and gravitational waves are very hard to detect, they do have a few advantages over observations of photons.
 First, gravitational waves are practically impervious to matter in their path. This means we can see into regions of space that are blocked to optical observatories, such as inside dense clouds of dust, the centers of galaxies, behind large or close bodies.
 Second, this is an observation of the warping of space itself, meaning we can detect things that have mass but might not produce observable light, such as black holes, dense sources of dark matter (if such were to exist), cosmic string breaks, etc.
 Third, gravitational waves fall off in amplitude much more slowly than light. This means that we can receive signals from very far away that we might not notice optically.
 And fourth, because gravitational waves also travel at the speed of light and don’t have to bounce off intervening matter, and begin to be potentially detectable from bodies getting close rather than just after the moment of collision, this means that we can work with other telescopes and tell them “Look over there! You’re probably going to see something exciting!”
This all of means that this detection means the beginning of a new kind of observational astronomy, as well as a better understanding of of of the fundamental forces of the universe, gravity.
What role did Jenn, astrophysicist and Universe Sandbox ² developer, play in the discovery?
While I was in the field I ran supercomputer simulations to make predictions about the gravitational wave signals that would be produced by binary black hole mergers. Those waveforms are used as templates in the detector pipeline. The detector matches the template banks against the incoming data to find real signals amidst the noise of the detector, while also doing searches for large burst signals (how this one was found). Those waveforms are then used again to determine where the signal came from, what it was (two black holes, a neutron star and a black hole, two neutron stars, etc), and the properties of the bodies that created the signal (spins, masses, separation, etc.). I also worked on developing the analytical formulas to determine those spins and masses from those signals.
Here’s one of the scientific papers on the process of determining the properties of the source of the signal, with three papers cited on which Jenn Seiler was an author:
https://dcc.ligo.org/public/0122/P1500218/012/GW150914_parameter_estimation_v13.pdf
The Einstein equations for general relativity are ten highly nonlinear partial differential equations. This means that it is only possible to obtain exact solutions for astrophysical situations for some very idealized conditions (such as spherical symmetry and a single body). In order to predict the gravitational waveforms produced by compact multibody systems, or stellar collapse, it is necessary to solve the equations numerically (computationally). This means formulating initial data for spacetimes of interest (such as two inspiralling black holes of various spins and mass ratios) and evolving them by integrating the solutions of the Einstein equations stepping forward in time by discrete steps. To prove that these computer simulations approximate reality more than just by equations on paper we would run these simulations at multiple resolutions for our discrete spacetimes and show that our solutions converged to a single solution as we approach infinite resolution (that would represent real continuous space) at the rate we expect for the method we were using.
There were many obstacles in creating these simulations: vast amounts of computational power required for accuracy; the fact that we needed to run tons of these large, slow, computationally intensive simulations in order to cover the parameter space (spins, masses, orientations, etc) of potential sources of gravitational waves; and so on. For black holes, one major challenge was the fact that they contain a singularity. A singularity means an infinity, and computers don’t like to simulate infinities. Numerical relativity researchers had to find a way to simulate black holes without having the singularity point in the slicing of the spacetime integrated in the simulation. The first successful simulation of this kind didn’t happen until 2005 (http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.95.121101).
Once we had working simulations, groups around the world set to work on simulating the gamut of major potential gravitational wave signal sources. These simulation results were not just useful to the detectors to help identify signals, but also to the theorists to help formulate predictions about the results of such astrophysical events. Predictions such as: the resulting velocity of merged black holes from binaries of various spins, the amount of energy released by black hole mergers, the effect that black hole spins have on the spins and orbits of other bodies, etc.
When will you add gravitational waves into Universe Sandbox ²?
We really can’t do gravitational waves in an nbody simulation, which is the method Universe Sandbox ² uses to simulate gravity. Nbody simulations look at the effect that each body has on each other body in a system at small discrete time steps.
General relativity requires simulating the spacetime itself. That is, taking your simulation space, discretizing it to a hires 3D grid and checking the effect that each and every point in that grid has on all neighboring points at every timestep. Instead of simulating N number of bodies, you are simulating a huge number of points. You start with some initial data of the shape of your spacetime and then see how it evolves according to the Einstein equations, which are 10 highly nonlinear partial differential equations. Accurate general relativity simulations require supercomputers.
There are some effects and features related to relativity that would be possible to add to Universe Sandbox ², however. Here are a few we are discussing:

Gravity travelling at the speed of light.

Currently if you delete a body in a simulation, the paths of all other bodies instantly respond to the change. The reality is that it would not be instantaneous; it would take time for that information about the altered gravitational landscape to reach a distant object.


Spinning black holes.

Most black holes are very highly spinning. If you imagine a spinning star collapsing it is easy to understand why. This is the same effect as when a spinning figure skater pulls in their arms; because of conservation of angular momentum, they spin faster. A consequence of this spin is that, while the event horizon would remain spherical, there would be an oblate spheroid (squished ball) around the black hole called an ergosphere. This ergosphere twists up the spacetime contained within it and accelerates bodies that enter this region (as well as affecting their spins). Because it is outside of the event horizon, this means one can slingshot away from this region and even steal energy from the rotation of that black hole.


Corrections to the motions of bodies to approximate general relativity.

Loss of momentum due to the emission of gravitational waves causes close massive bodies to inspiral. With this you could recreate the decaying orbits of binary pulsars.

Spins of close bodies affect each other’s motion and spins (see above). This would give you things like spun up accretion disks around black holes.

These corrections would be made by adding postnewtonian corrections to body velocities.

Learn more
Bad Astronomy article: LIGO Sees First Ever Gravitational Waves as Two Black Holes Eat Each Other
Video and Comic Explaining Gravitational Waves
Reddit AMA (Ask Me Anything) by LIGO Scientists
Paper by LIGO Researchers: Observation of Gravitational Waves from a Binary Black Hole Merger