Interactive simulations & visualizations

Visualizing the beauty in physics and mathematics


Project maintained by zhendrikse Hosted on GitHub Pages — Theme by mattgraham

Andromeda Milky Way collision ✨


In roughly four and a half billion years, our Milky Way galaxy will collide with our nearest neighbour, the Andromeda galaxy.

The demo below simulates this future collision. It is based on a very simple model:

πŸ‘‰ No star-star interaction, only gravitational forces from the galaxy cores (= sum of all masses) πŸ‘‰ Very limited amount of stars compared to the real amounts in both galaxy’s (1400 for Milky way, 2800 for Andromeda)
πŸ‘‰ No super-massive black holes at the center of either galaxy
πŸ‘‰ Masses and positions of stars are randomly picked from a normal distribution (with a Box-MΓΌller transform), circular velocities are $v=\sqrt{GM/r}$

Click to start the animation!

🌌 What am I looking at


In this model we use:

\[\begin{equation} a = \frac{GM}{r^2} \end{equation}\]

As a consequence

The bonding energy of a star in a point mass potentiaal is:

\[\begin{equation} E = -\frac{GMm}{2r} \end{equation}\]

So as $r$ increases, the energy becomes less negative β‡’ stars are less tightly bound and easier to be slurred away.

πŸ’₯ During collision

When to two cores approach:

  1. Outer stars experience a strong differential gravitational field
  2. The other galaxy pulls relatively stronger on the outside
  3. Tidal forces are being created

This causes:

And since this simulation is based on a

We observe this effect even stronger than in realistic simulations.

In reality a dark matter halo leads to $v(r) \approx \text{constant}$. Instead, in this model we have $v(r) \sim \frac{1}{\sqrt{r}}$. As a consequence, the outer stars are relatively even weaker bound.

Additional information


Spiral galaxy renderer


On this site, you can also find a live demo of a way more advanced 2D spiral galaxy simulator that is based on the density wave theory (on GitHub β†’ Galaxy renderer). It is written by Ingo Berg in TypeScript. Click on the image below to activate this demo!

Daylight variations
Click on the image to play with a live demo of a way more advanced 2D spiral galaxy renderer!


Share on: