Tidal tails and bridges in galactic encounters
=======

This repository contains the code necessary to reproduce the results of "Tidal tails and bridges in galactic encounters", which can be found here in _project-ja618.pdf_.

> Abstract: We develop a restricted n-body simulation to study tidal tail and bridge formation in galactic encounters, providing a quantitative analysis of their development and shape, as well as of the effects of varying the inclination of the encounter and the strength of the perturbation. We further show that a full n-body simulation of rotationally supported bulge : disk : dark matter halo galaxies leads to orbital decay and efficient angular momentum transfer away from the luminous components. The resulting merger is well-described as an elliptical galaxy approximated by a de Vaucouleur profile. Moreover, we make use of a simulated annealing algorithm to construct a model for the Antennae galaxies without human intervention and show that it matches its morphology and Doppler shift observations from the Hydrogen 21-cm line.

![](analysis/pics/README/1.npg)

Basic guide
-----

Legible documentation, automatically generated using pdoc from the docstrings, can be found in the `docs/` folder. The simplest way to run an encounter is through the command line:

```
> python run_simulation.py config.yml --output_folder --verbose
```

Configuration files in YAML (`.yml`) format are used, where one only needs to specify those parameters that differ from the default (`config/default.yml`). For example, a basic simulation of the Antennae can be specified as:

```yml
name: toomre1972
  galaxy1:
    orientation: [240, -30] 
    disk:
      l: .7
  galaxy2:
    orientation: [120, -30] 
    disk:
      particles: 2000
      l: .7
```   
   
A `.yml` can contain multiple encounters separated with three dashes. In this case, the extra encounters need only specify those parameters that change with respect to the first encounter, making parameter surveys simple. `.yml` files for the encounters we consider can be found in the `config/` folder. `config/default.yml` includes explanations of all possible parameters.

![](analysis/pics/README/2.npg)

The core of the simulation (Simulation, Galaxy) can be found in the file `simulation.py`, and makes use of the routines defined in `acceleration.py`. The gravitational computation routines are general —allowing some particles to be set as massless. The respository also includes an interactive widget (`analysis/interactive.ipynb`) that can be used to examine the encounters. 

![](analysis/pics/README/4.npg)

Simulation of the Antennae galaxies
------

![](analysis/pics/README/3.npg)
