Milky Way Galaxy Collision Simulator
Restricted N-body simulation of the Milky Way / Andromeda merger over 8 billion years. Two galaxy cores under full mutual gravity with Plummer softened potentials, plus thousands of massless tracer particles feeling both cores. Symplectic leapfrog integration in a background worker. Drag to rotate, scroll or pinch to zoom.
This module uses the restricted N-body method pioneered by Toomre and Toomre (1972) for galaxy merger simulations. Two galaxy cores carry the gravitational mass; they orbit each other under direct Newtonian gravity. Thousands of massless tracer particles represent stars, feeling the gravitational potential of both galaxy cores but not contributing to it.
This approach reproduces the iconic dynamical features of real galaxy mergers (bridges, tidal tails, disk warping, eventual coalescence) at a fraction of the computational cost of full self-gravitating N-body. It is still used in modern research where tidal kinematics, not internal galaxy structure, is the question of interest.
- Galaxy cores :: each modelled as a Plummer softened point mass. Potential Phi(r) = -GM/sqrt(r^2 + a^2). Acceleration has no singularity at r=0, which keeps the integrator stable through close passages.
- Core-core force :: full Newtonian mutual gravity. The two cores form a self-consistent two-body orbit (modified by Plummer softening at close range).
- Tracer-core force :: each tracer feels the Plummer-softened pull of both galaxy cores simultaneously. Pulled toward whichever core dominates at its current position.
- What is not in the model :: tracer-tracer self-gravity is omitted (the "restricted" in restricted N-body). This means dynamical friction, bar formation, and internal disk substructure are not captured. Central supermassive black holes, gas hydrodynamics, star formation, and dark matter halo distortion are also out of scope.
- Symplectic leapfrog in kick-drift-kick (KDK) form. Time-reversible, energy-conserving to round-off over arbitrarily long integrations. Standard choice for collisionless N-body.
- Timestep :: 5 Myr default. Adapted to the orbital period of the closest tracer (typically the inner-disk stars at ~100 Myr orbit) so dt is well below the dynamical time everywhere.
- Float64Array state vectors throughout. The integrator runs in a Web Worker via inline Blob URL so the canvas render loop is never blocked.
- MW-M31 separation :: 770 kpc, current best estimate from Cepheid and detached eclipsing binary distance ladder.
- Approach velocity :: -110 km/s line-of-sight, measured from M31 systemic blueshift.
- Transverse velocity :: +17 km/s (van der Marel et al. 2012, refined from HST proper motions). The transverse component was the largest open question until that paper.
- MW mass :: 1.2 x 10^12 M_sun (total including dark matter halo).
- M31 mass :: 1.5 x 10^12 M_sun (slightly more massive than MW per recent constraints).
- Disk orientations :: MW disk in the xy plane; M31 disk inclined 50 deg from MW (real value approximately 77 deg from line of sight, but we orient relative to the merger plane for visual clarity).
- 0 - 2 Gyr :: gradual approach phase. Tidal effects negligible.
- 2 - 3.5 Gyr :: tidal interaction begins. Outer-disk stars start to feel the perturbation. Disks begin to warp.
- 3.5 - 4.5 Gyr :: first close passage. Minimum separation around 30-50 kpc. Spectacular tidal bridges and tails form.
- 4.5 - 6 Gyr :: apocentre after first passage at 100-200 kpc separation. Tidal tails fully developed. Disks heavily distorted.
- 6 - 7 Gyr :: second passage and final coalescence. Both galaxies merge into a single elliptical-like remnant ("Milkomeda").
- 7+ Gyr :: violently relaxed merger remnant.
- PLAY / PAUSE :: freeze or resume time evolution. Camera still rotates and zooms when paused.
- RESET :: rewind to t = 0 (today). Regenerates the tracer distribution from scratch.
- ZOOM +/- :: discrete zoom steps. Initial scale shows the full 770 kpc separation.
- TOP :: snap to plan view (looking down the MW disk normal).
- SIDE :: snap to edge-on view (showing disk thickness and orbit plane).
- Speed :: time acceleration. 1x is the default (about 300 Myr per real second, full 7 Gyr merger in roughly 25 seconds). 500x compresses the entire merger into seconds; useful for context, less for studying tidal detail.
- Particles :: total tracer count. 1k is sparse but fast. 3k is default. 10k is dense but may stutter on older mobile devices. Changing this resets the simulation.
- 0 - 2 Gyr :: disks rotate normally. Approach is slow at this phase.
- 3 - 4 Gyr :: outer-disk stars start being pulled toward the other galaxy. Bridges form between the two.
- 4 - 5 Gyr :: first passage. Spectacular tidal tails on the far sides of each galaxy. Closest approach 30-50 kpc.
- 5 - 6 Gyr :: apocentre. Galaxies briefly separate to 100-200 kpc. Tails are long streams.
- 6 - 7 Gyr :: second close passage, then rapid coalescence into a single diffuse remnant.
- No tracer self-gravity :: this is restricted N-body. Tracer particles do not pull on each other or on the cores. The merger timeline is therefore slightly idealised compared to full self-gravitating simulations.
- No gas, no star formation, no central SMBHs :: purely gravitational kinematic simulation. The Cox and Loeb (2008) paper adds those physics.
- Plummer softened potentials :: real galaxies have NFW dark halos plus disk plus bulge profiles. Plummer is a single-component approximation chosen for stability and clarity.