Astronomy
Galaxy collision
Explore a galaxy encounter: tilt the discs, follow a star, and compare opposite rotations. Tidal bridges and tails emerge from test-star trajectories. Optional dark halos and dynamical friction illustrate how the nuclei can coalesce.

What happens
Stars rarely collide directly during a galactic encounter. Differential gravity stretches stellar discs into bridges and tails. The stars are massless tracers, without disc self-gravity or gas. With dark halos enabled, rigid Plummer potentials deepen the field; optional dynamical friction removes orbital energy. The nuclei join at a prescribed small separation. This illustrates a merger mechanism, not a calibrated merger time or a prediction for the Milky Way and Andromeda. Positive stellar energy is only an instantaneous diagnostic in the changing potential.
Equations used in the module
Equations units: G = 1, primary mass 1, disc radius 1; intruder mass q and disc radius sqrt(q); pair centre of mass at rest nuclei: softened potential, epsilon = 0.3; mu = q/(1+q); E = mu*v²/2 - q/sqrt(r²+epsilon²) start: D0 = 8; v_escape = sqrt(2*(1+q)/sqrt(D0²+epsilon²)); v = f*v_escape; E0 = q*(f-1)*(f+1)/sqrt(D0²+epsilon²) Without halos: f < 1 means bound; f = 1 is the escape limit; f > 1 means unbound. Softened orbits are not exact Kepler conics. A bound orbit alone does not guarantee coalescence. turning point: h²/(2*r_p²) - (1+q)/sqrt(r_p²+epsilon²) = E/mu; h = b*v stars: 2100 massless particles per disc at base resolution, scaled by the particle multiplier; 20 rings; initial speeds sqrt(M/r) use a point-mass approximation and softening 0.05 is used in the stellar forces. No disc self-gravity or equilibrium guarantee. integration: kick-drift-kick leapfrog dt = 0.005; the forecast uses the same nuclear integrator and samples its trajectory for display tail fraction: distance > 2 in primary-disc radius units from the birth nucleus; this is a geometric diagnostic, not an escape test Without halos, stellar energy: v²/2 - 1/sqrt(r1²+0.05²) - q/sqrt(r2²+0.05²), in the barycentric frame. Positive energy does not guarantee permanent escape from a time-dependent potential. stellar encounters (geometric estimate without gravitational focusing): n = 10^11/(pi*15000²*300) pc^(-3); solar radius = 2.3e-8 pc; sigma = pi*(2*2.3e-8)²; mean free path = 1/(n*sigma), about 3.19e14 pc friction: a = −4π ln Λ M ρ(r) [erf X − 2X/√π e^(−X²)] v/|v|³, X = |v|/(√2 σ) ; ρ = 3M_h/(4π a³)(1 + r²/a²)^(−5/2), σ² = M_h/(6√(r² + a²)) With halos: E_pair = mu v²/2 - q/sqrt(r²+epsilon²) - 2 eta q/sqrt(r²+a²) - eta² q/sqrt(r²+2a²); mu = q(1+eta)/(1+q) The stellar potential additionally contains -eta/sqrt(r1²+a²) - eta q/sqrt(r2²+a²). eta = M_h/M_nucleus; a = 1; R_merge = 0.3


