Tidal stripping is an astrophysical phenomenon which occurs when galaxies come within gravitationally significant distances. The galaxy of larger mass will significantly influence the stars of the other galaxy, sometimes removing or capturing them.
With a few simplifying assumptions and knowledge of the solution to the two-body problem, tidal stripping can be simulated accurately enough to explore the phenomenon. Firstly, we assume Newtonian mechanics, which means bodies in the presence of two gravitational fields will travel in ellipses, which we can numerically solve for quite easily. Next let us consider the gravitational field of the galaxies to dominate those of the individual stars. Thus our stars become test particles only under the influence of two gravitational fields.
Running our program with default settings we have,
from IPython.display import HTML
HTML("""
<video title="tidal stripping movie" controls>
<source src="videos/movie.mp4" type="video/mp4">
</video>
""")
Here the blue galaxy has 1 mass unit and the red galaxy, 0.2 mass units. At first the two galaxies seem to orbit each other peacefully until at about 4 seconds the stars of the second (red) galaxy go haywire, flying off in varying directions. By five seconds one can make out two arms extending outward from galaxy two.
HTML("""
<img alt="arms" source src="images/snapshot_0.jpg">
</img>
""")
Quickly afterwards many of red's stars are engulfed and captured by galaxy one (blue). Also notice how at three seconds, before red loses any of its stars, that red's stars are orbiting with much higher eccentricity, so that the whole galaxy has become more elliptical, that is, squashed in one axis.
HTML("""
<img alt="squashed" src="snapshot_1.jpg">
</img>
""")
Similar to the formation of 'arms' alluded to previously, galaxies that undergo tidal forces from neighbouring galaxies may form tidal tails. These tails may be present long after the galaxies passed by each other or merged.
HTML("""
<img alt="tail" source src="tidaltails3a.jpg">
</img>
""")
Let's see if we can produce a tidal tail artifact with out simulation. We can vary both the mass and speed (in the direction of the y-axis) of galaxy two. Considering the many symmetries of our setup, this allows us to model most encounters. Specifying a mass of 1 (same as galaxy one mass) and the stable orbit velocity (default),
HTML("""
<video title="tidal stripping movie" controls>
<source src="movie_2.mp4" type="video/mp4">
</video>
""")
As the galaxies pass each other, at three seconds, both form well defined tidal tails. The tails do not last long, as the galaxies while orbiting each other, continue to apply strong tidal forces.
HTML("""
<img alt="tail" src="snapshot_2.jpg">
</img>
""")
How accurate is this picture of galaxy gravitational interaction? This depends on where the assumptions are valid. While the stars from each galaxy remain captured the centre of mass will not change much from the two-body elliptical orbit it has been placed on in. When foreign test particles (stars of another galaxy) are experiencing significant gravitational forces they will move according to the centre of mass so long as they do not actually enter the galaxy itself. Many of the captured stars may move differently if they come in close contact with other stars but they will still for the most part orbit the new galaxy's centre of mass.
To further extend this project the velocity of the second galaxy could be variable, not just its speed along the it's tangent at apastron (the vertical axis), where it starts.