Felipe Fontinele was the main person responsible for motivating us to participate on the McGill Physics Hackathon and for giving and developing the main physical ideas for the project. He's our inspiration :)

What it does


Welcome to our relativistic interactive three body problem simulation project for McGill Physics Hackathon 2021! Here, we implement Post-Newtonian general relativistic corrections to the orbits of each body. In addition, we also obtain gravitational waves for some orbit configurations in an intuitive interface built with PyQT5.

We've made one interactive window so that you can focus primarily on the physics. You can select one of our preconfigured orbits (from stable and famous configurations such as the figure 8 to marginally stable (M) and unstable orbits (U)) in the first box of our panel. The code takes about 10-30 seconds to solve the differential equations and plot it on the main panel. You can then watch the simulation until the end, or select "Stop simulation" to test other configurations.

In the main panel, you'll be able to see the famous classical orbits obtained only from Newton's equations of gravity side-by-side with the orbits obtained with the relativistic corrections via the Einstein–Infeld–Hoffmann equations. The orbit plots aren't fixed in order to encourage exploring different points of view from the orbits: just click and drag the mouse around the orbits in each plot.

For more information about the theoretical background, take a look at our website.

How we built it

The program was developed using python3. The main structure is based on solving both the Newtonian and Post-Newtonian equations of motion for planet's orbits using the scipy solve_ivp built-in function. All the user interface was developed via a mixture of matplotlib and PyQT5.

Challenges we ran into

  • Obtaining the gravitational waves were quite challenging and Felipe was the main person responsible for all analytical/numerical derivations of the physics involved!

  • The implementation of the Einstein–Infeld–Hoffmann were also difficult to implement, but Felipe, Vitor and Igor managed to do an excellent job in the time that we had.

  • Sometimes the force in the simulation diverges when two bodies come very close to each other, effectively occupying the same space. We did implement a softening term to prevent the force from diverging, however the post newtonian correction terms still make the force explode quickly, sometimes (some newtonian orbits quickly diverge in the relativistic correction in these cases).

Accomplishments that we're proud of

  • The implementation of the Post-Newtonian physics was quite challenging, and we did a pretty good job obtaining meaningful results in the 24-hour period. We are also quite proud of the user interface/website developed using PyQT5 by João Augusto and Pedro Cintra.

What we learned

  • We learned a lot about solving differential equations and data visualization, and some of us (who did not have a gravitational background) had a lot of fun generating the new orbits and learning more about gravitational aspects of the problem :)
  • João and Pedro worked for the first time developing a user interface via PyQT5;

What's next for General Relativistic Three-Body Simulator

  • Integration of the gravitational waves emission to the main interface;
  • Investigation of different methods for solving coupled differential equations of second order. In particular, we want to investigate the problem of convergence when planets are closer to each other in the Post-Newtonian implementation.

We'll probably continue exploring different facets of this problem in the following months. It was quite fun to work together once again after graduation on this hackathon :)

Built With

+ 57 more
Share this project: