# A neural net solves the three-body problem 100 million times faster

Machine learning provides an entirely new way to tackle one of the classic problems of applied mathematics.

In the 18th century, the great scientific challenge of the age was to find a way for mariners to determine their position at sea. One of the most successful solutions was to measure the position of the moon in the sky relative to the fixed background of stars.

Because of parallax effects, this measurement depends on the observer’s position. And by comparing the measured position to a table of positions calculated for an observer in Greenwich in England, mariners could determine their longitude.

There was one problem, however. Calculating the moon’s position in advance is harder than it seems. The sun exerts a small but significant gravitational tug on the moon. And that makes the motion of the Earth, moon, and sun a three-body problem, one that many mathematicians have foundered on before and since.

The difficulty is that this kind of three-body motion is chaotic in all but a few special cases. So there is no easy way of calculating their exact positions in the future. This caused errors in the lunar navigation tables that sometimes led to inaccurate and potentially fatal results.

Nevertheless, mariners made the best of this flawed technique until the middle of the 19th century, when chronometers became cheap and accurate enough to be widely used onboard ships. Eventually, the chronometer method, famously pioneered by John Harrison, became the preferred way to calculate longitude.

However, the three-body problem continues to haunt mathematicians. The problem these days is to determine the structure of globular star clusters and galactic nuclei, which depend on the way black hole binaries interact with single black holes.

The advent of powerful computers allows mathematicians to iteratively calculate the positions of these black holes. But it requires enormous computational resources, and even then, some solutions remain beyond their ken. So a new, more powerful way to solve the three-body problem is desperately needed.

Enter Philip Breen at the University of Edinburgh and a few colleagues, who have trained a neural network to calculate such solutions. Their big news is that their network provides accurate solutions at a fixed computational cost and up to 100 million times faster than a state-of-the-art conventional solver.

They start with a typical training method for neural networks. This requires a database of three-body problems with the solutions calculated by a state-of-the-art solver.

Breen and co first simplify the problem by limiting it to those involving three equal-mass particles in a plane, each with zero velocity to start with. They choose the starting positions at random and solve the three-body motion using a state-of-the-art approach called Brutus. They then repeat this process 10,000 times.

The team use 9,900 examples to train their neural network and 100 to validate it. Finally, they test the network with 5,000 entirely new situations and by comparing the predictions to those calculated by Brutus.

The results make for interesting reading. The neural network accurately predicts the future motion of three bodies and, in particular, correctly emulates the divergence between nearby trajectories, closely matching the Brutus simulations. “We have shown that deep artificial neural networks produce fast and accurate solutions to the computationally challenging three-body problem over a fixed time interval,” say Breen and co.

What’s more, they test the neural network’s predictions by checking how well they conserve energy. With a few tweaks, the network’s predictions meet the energy conservation conditions with an error of just 10-5.

That’s an impressive outcome that has significant potential. In particular, Breen and co say the neural network could help solve three-body problems in situations that become computationally unfeasible for Brutus.

So their vision is to create a hybrid system. In this case, Brutus will do all the heavy lifting, but when the computational burden becomes too great, the neural network will step in until it becomes acceptable again.

In this, way neural networks should make it possible to simulate the motion of black bodies inside galactic nuclei and globular star clusters much more accurately than ever before.

And that’s just the beginning. “Eventually, we envision, that network may be trained on richer chaotic problems, such as the 4 and 5-body problem, reducing the computational burden even more,” say Breen and co.

Ref: arxiv.org/abs/1910.07291 : Newton vs The Machine: Solving The Chaotic Three-Body Problem Using Deep Neural Networks