N-body simulations of interacting galaxies

N-body simulations of interacting galaxies
Master of Science Thesis
Per Bjerkeli
Supervisor: Docent Cathy Horellou
Onsala Space Observatory
Department of Radio and Space Science
CHALMERS UNIVERSITY OF TECHNOLOGY
Göteborg, Sweden, 2007
N-body simulations of interacting galaxies
c Per Bjerkeli, 2007
Onsala Space Observatory
Chalmers University of Technology
43 992 Onsala
Sweden
Cover picture: Simulation of the Medusa galaxy
Abstract
This master thesis is about N-body simulations of interacting galaxies. Methods have been
developed to generate stable spherical systems as well as compound systems containing a
stellar disk and a dark matter halo. The Medusa galaxy has been modelled as an ongoing
merger between an elliptical galaxy and a smaller spiral galaxy. The simulations clearly
show how the main observed features, especially the long tidal tail, form and evolve during
the interaction.
The underlying theory governing potentials, kinematics and structure formation is described in detail as well as the procedures required to set up initial conditions for various types of galaxies. The Matlab programs written to generate different kinds of selfgravitating systems are not included in this report but they can be retrieved from the
website http://www.bjerkeli.se. The algorithm used to perform simulations is the current
version of the treecode originally written by Joshua Barnes & Piet Hut in 1986.
i
ii
Acknowledgments
I want to thank Cathy Horellou for her never ending support and helpfulness during every
day of this project. The possibility to work with a supervisor that at each part of the process is so involved, interested and enthusiastic has been a privilege. Also a big ’thank you’ is
sent to Daniel Johansson for his scientific contribution in the form of numerous discussions
governing treecodes, potential theory and much more. I would also like to acknowledge
Alessandro Romeo for his contributions at the early stages of this project.
A necessary tool for this project has been the treecode 1.4 that has been used to make
the simulations. For that reason I want to thank Joshua Barnes who freely distributes the
code from his website. I would also like to thank the people around the coffee table and
everyone else that makes the Onsala Space Observatory such a nice environment to work in.
During the last weeks prior to my presentation I got a lot of help from people who
read my thesis and listened to my presentation. They contributed with valuable recommendations and for that reason I would like to thank John, Kalle, Moa, Susanna, Sofia and
Tong
iii
CONTENTS
CONTENTS
Contents
1 Introduction
1
2 Galaxies
2.1 The Hubble classification scheme . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Light from galaxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 The Mass-Luminosity ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
3
4
5
3 Potentials
3.1 Introduction . . . . . . . . . . . . .
3.2 Spherical potentials . . . . . . . . .
3.2.1 Point mass . . . . . . . . . .
3.2.2 The homogeneous sphere . .
3.2.3 The Plummer model . . . .
3.2.4 The Hernquist model . . . .
3.3 Potentials of flattened systems . . .
3.3.1 The Toomre-Kuzmin model
3.3.2 The Miyamoto model . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6
6
7
7
7
7
8
8
8
9
4 Kinematics and structures
4.1 Observational background . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Elliptical galaxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 The surface brightness . . . . . . . . . . . . . . . . . . . . . . . .
4.2.2 The Phase-space distribution function . . . . . . . . . . . . . . .
4.2.3 The Jeans equations . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.4 Deriving the differential energy distribution for a spherical system
4.3 Spiral galaxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.1 Epicyclic theory . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3.2 Azimuthal moments of the disk . . . . . . . . . . . . . . . . . . .
4.4 Interacting galaxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.1 Tidal tails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.2 Shells . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10
10
11
11
12
12
14
15
15
17
18
18
18
5 The
5.1
5.2
5.3
Barnes-Hut tree code
Introduction . . . . . . . .
Structure of the code . . .
Running the code . . . . .
5.3.1 Optimal smoothing
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
19
19
19
19
21
6 Simulations of isolated systems
6.1 Units and scales . . . . . . . . . . . . . . . . . . . . . .
6.2 Elliptical galaxies . . . . . . . . . . . . . . . . . . . . .
6.2.1 Initial conditions for the Plummer distribution .
6.2.2 Initial conditions for the Hernquist distribution
6.2.3 Simulation results . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
22
22
22
23
24
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
CONTENTS
CONTENTS
6.3
6.4
Disk galaxies . . . . . . . . . . . .
6.3.1 The Miyamoto distribution .
6.3.2 Simulation results . . . . . .
Composite systems . . . . . . . . .
6.4.1 Simulation results . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
24
24
26
27
30
7 Simulations of interacting galaxies
31
7.1 Interactions between ellipticals and spirals . . . . . . . . . . . . . . . . . . . 32
7.2 A possible scenario for the Medusa merger . . . . . . . . . . . . . . . . . . . 32
8 Conclusions and personal reflections
34
A How to use treecode 1.4
35
A.1 Installation of the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
A.2 Running the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
v
1
1
INTRODUCTION
Introduction
In the very beginning of time there were small quantum fluctuations in the hot distribution
of matter and radiation. Because of the inflationary growth shortly after big bang, these
fluctuations became huge. In areas of high matter concentration, gravity led to the formation of even higher density accumulations. This effect of gravity organized the universe into
different structures. The stars were clustered into galaxies. The galaxies were clustered into
groups, the groups into clusters and the clusters were organized into super clusters. This
is a still ongoing process that can be observed and cosmologic research is made within the
area. The non linear growth of galaxies from the initial baryonic density fluctuation is a
field of astronomy where a lot of simulations are carried out.
The gravitationally bound clusters of galaxies are structures of varying size and mass.
A cluster may hold between less than hundred up to several thousands of galaxies. Clusters
of high density contain a large fraction of elliptical galaxies, while spiral galaxies are found
mainly in low density clusters. Spiral galaxies are also frequently found in the space between
the large clusters. From observations one also knows that the size of individual galaxies tend
to grow over time. Nearby galaxies tend to be larger than those at a higher redshift. The
fact that galaxies seem to merge with each other agrees with the fact that many observed
galaxies are in an ongoing interaction with one or several companions. Also, the mean
separation between galaxies is not more than a few ten times the galactic diameter, which
is yet another fact that supports this scenario. The characteristics of different interactions
is very much distinguished from the initial conditions. For example, there are distant interactions where the partners are hardly disturbed at all but there are also interactions
where several galaxies merge into a big one. The latter ones are usually the most violent
type of interaction. Compared to the human lifetime, these interactions last for a very
long time. This is the reason why only snapshots of ongoing interactions can be observed.
Although a lot of conclusions can be drawn from observations, there is a need for computational simulations because they can improve the understanding of the underlying dynamics.
The first simulations were carried out by the Swedish astronomer Erik Holmberg (1941)
who did some pioneering work well before the time of super computers. He used light bulbs
as a representation of stars and in this way he was able to calculate the forces between stars
in clusters. Although his work was very innovative it did not make any significant impact
on the scientific community. It was not until more than 30 years later that the subject
became a hot topic. Alar and Jurij Toomre (1972) made the first computer simulations of
interacting galaxies. Even though the computers in that time couldn’t handle many particles they where able to recreate many of the ongoing collisions between galaxies that are
observed. They also contributed to the understanding of how tidal tails are formed. From
that time many simulations have been made and today both stars and gas are included.
This makes it possible to learn how star formation is triggered.
The endeavour of understanding has also led to the development of many different
codes that can be used for simulations. A code that only governs particles is the treecode
1
1
INTRODUCTION
developed by Joshua Barnes and Piet Hut (1986). The code is used in this master thesis
to simulate isolated galaxies consisting both stars and dark matter. It is also used while
simulating interacting systems of two galaxies. One of the initial goals is to resemble
interactions where long tidal tails are created. The questions raised in this thesis work are:
• How is the treecode performing for different kind of particle distributions?
• What is the fundamental theory behind distributions of spherical and flattened systems?
• How does one use this theory to create stable systems?
• What is the stability of a compound system of a disk and a dark matter halo and
how are these systems created in a good way?
• What kind of initial conditions are possible for the NGC 4194 ’Medusa’ merger?
These questions will be discussed. A careful description of the underlying mathematics
governing potential theory, kinematics and structure formation will also be given. Finally,
a set of possible initial conditions for the Medusa galaxy will be described.
2
2
GALAXIES
2
Galaxies
The main building block of the universe are the galaxies. There is a wide range of them,
some more common than others. There are simple spherical galaxies containing mainly
stars that show no special features. But there are also complex systems made of neutral
and ionized gas, stars, dust, magnetic fields etc. The galaxies can be found as individual
systems or in groups of many galaxies. The luminosity from a galaxy can vary a lot. The
faintest ones discovered have a luminosity not more than 100 000 times that of the sun
while normal galaxies have a luminosity about 1012 times that of the sun. Also, the size of
a galaxy is a parameter than can have a wide range of values and it seems that galaxies are
mostly made out of dark matter. This makes it even more difficult to estimate their size.
Finally, galaxies collide with each other and that distinguishes them from the stars.
2.1
The Hubble classification scheme
Hubble (1926) made the first attempt to give a systematic description of the most common
structures among galaxies. The scheme made in his paper, known as the Hubble scheme,
is still used. Although the classifications to some extent are dependent on the astronomers
doing them, it is a good reference when one discusses different types of galaxies. The Hubble
scheme sorts galaxies from early types on the left hand side to late types on the right. There
are also three different types of galaxies within the scheme.
1. Elliptical galaxies are collections of stars that take the form of an ellipse. The only
thing that defines the ellipse is the shape and it can for that reason vary a lot in size.
They are classified as En, where n can be calculated from the formula
b
(2.1)
n = 10 1 −
a
where a is the major and b is the minor axis of the galaxy. It is easy to understand
that this makes the classification sensitive to the direction it is viewed from. For
example, an E0 galaxy can be truly spherical or just a disk viewed face on. Further
on, one can say that the density falls of from the middle to the outer regions and the
influence on the brightness from the interstellar medium is small compared to other
galaxies. Approximately 2/3 of all galaxies can be classified as ellipticals.
2. Lenticular galaxies or S0 galaxies are found between the spirals and the ellipticals in
the Hubble scheme. They have in common with the ellipticals that they contain little
interstellar matter. Like the spirals they have a flat disk made of stars but this disk
does not show any evidence of a spiral pattern.
3. Spiral galaxies are galaxies that have a spiral pattern in the galactic disk. Spiral
galaxies can be divided into three main components. The stellar disk is the biggest
visible component that consists mainly of stars, gas and other interstellar matter. In
addition, there is a central bulge that individually could be classified as an elliptical
galaxy. There is also evidence for a third component of dark matter that surrounds
the disk and the bulge. The evidence for the dark matter halo is the very characteristic
3
2
2.2
GALAXIES
Light from galaxies
rotation curves that spiral galaxies have. This will be discussed in detail in chapter
4. The spiral structure that origins from the formation of stars in the disk can be
divided into two different subgroups. The normal Sa, Sb, Sc and the barred SBa,
SBb, SBc galaxies. In barred spirals the spiral arms origin from a central bar. The
Milky Way is a spiral galaxy somewhere between an Sb and Sc.
4. Irregular galaxies are those that do not fit into any of the other three groups in the
Hubble scheme. The irregulars can be divided into two subgroups. The IrrI that show
some structure and the IrrII that don’t. Other galaxies that can be classified into this
group are the dwarf galaxies and the starburst galaxies.
Figure 2.1: The Hubble classification scheme (http://www.astro.psu.edu)
2.2
Light from galaxies
The classification of galaxies, discussed in section 2.1, is based on optical images. But also
the distance to the galaxy is of importance when analysis are to be carried out. Distances
are an important property when it comes to the determination of absolute luminosities and
masses. In the immediate neighborhood of our own galaxy distances can be measured with
the help from variable stars. On larger scales one has to use the expansion of the universe
itself to measure the distance. Consider the well known Hubble law that in terms of redshift
can be written as
v = cz = Hd
(2.2)
where z is the redshift, c the speed of light, H the Hubble constant and d the distance.
There is also a range of distances too large to make use of standard candles like variable
stars but too close to show any cosmological redshift that can be separated from the peculiar
velocity of the galaxy itself. In this region the distances can be inferred from observations of
different components such as the sizes of H II regions or the magnitudes of globular clusters.
There are also other properties that can be used to determine distances such as the color,
the surface brightness and the velocity components of the galaxy. Rotational velocities can
4
2
2.3
GALAXIES
The Mass-Luminosity ratio
be measured with a high accuracy from the 21 cm hydrogen line (see Sect. 4.1).
A galaxy does not have a sharp edge, which makes it impossible to determine an exact
total luminosity. Instead one usually measures the surface brightness out to a certain
value. 26.5 mag per square arc second is a popular choice more known as the Holmberg
radius. The distribution of luminosities is determined by a luminosity function. From observed magnitudes of galaxies one can assume a function that determines the total number
of galaxies within a certain luminosity interval L and L + dL. One version of this relation
is the Schechter relation in the form given by Karttunen et al. (1996)
α
L
L
L
∗
φ(L)dL = φ
exp
d
(2.3)
L∗
L∗
L∗
where φ∗ , L∗ and α are determined from observations. The number of galaxies brighter
than the luminosity L∗ drops very rapidly. The parameter φ∗ is proportional to the space
density of galaxies in the region observed. The formula (2.3) overestimates the density of
faint galaxies and even predicts that the total number density of galaxies is infinite when
L goes to 0. Nevertheless, most of the light comes from the galaxies with luminosities close
to L∗ , and equation (2.3) can be integrated to estimate the total luminosity density.
2.3
The Mass-Luminosity ratio
The rotational velocity can be an indicator of the total mass of the galaxy. The measured
masses can be combined with the observed luminosity to calculate the mass to light ratio,
or mass to luminosity ratio M/L. The value in the solar neighborhood is M/L = 3 and
assuming that this ratio is constant makes it possible to estimate the masses while observing
the luminosity. Furthermore, the masses of elliptical galaxies can be estimated using the
spectral broadening caused by the velocity dispersion. The virial theorem reads
2T + Φ = 0
(2.4)
where T is the kinetic energy and Φ is the potential energy. A rough estimate of the total
kinetic energy and the total potential energy of an elliptical galaxy can be made from the
relations
M v2
T =
(2.5)
2
GM 2
Φ=−
(2.6)
2R
Inserting these relations into equation (2.4) gives the total mass from the velocity dispersion
v and the suitable average radius R.
2Rv 2
(2.7)
G
Knowing the total mass of the galaxy one can, due to the assumption that M/L is constant,
calculate the luminosity. It seems that for very early type galaxies, no dark matter is
required inside the Holmberg radius. The rotation curve of these kind of galaxies is also
falling outside a certain radius.
M=
5
3
POTENTIALS
3
3.1
Potentials
Introduction
This section will encompass the details regarding potential theory. This is required knowledge when realistic galaxy models are to be made. The models discussed in this chapter
will be treated in more detail in chapter 6
In Newtonian physics, gravity is a force that acts instantly between all bodies in a system.
With the theory of special relativity this is of course not true. However, the rotational
period of a typical galaxy is far longer than the time it takes the light to cross the galaxy.
To use Newtonian physics while calculating forces within galaxies is not to commit a big
error. A real galaxy contains approximately 1011 stars. Even though such a high number
can not be modelled in a computer, as many particles as possible can be used to calculate
the forces between each particle. To avoid strong or weak encounters between stars the
potential of particles is smoothed when other particles come close.
Given a distribution of point masses in space ρ(x), the total gravitational potential can
be written as
Z
ρ(x0 ) 3 0
d x.
(3.1)
Φ(x) = −G
|x0 − x|
The gradient of the potential is defined as the force acting on a body
Z
Gρ(x0 ) 3 0
F(x) = ∇
dx
|x0 − x|
(3.2)
= −∇Φ.
Calculating ∇·F(x) and making use of the divergence theorem, converting a volume integral
to a surface integral, the Poisson equation can be obtained
∇2 Φ = 4πGρ.
(3.3)
If the density is equal to 0, the right hand side of this equation becomes 0 and it is called the
Laplace equation. The Poisson equation is a very important relation between gravitational
potential and density, and the various potential density pairs that can be calculated are of
fundamental importance when modelling galaxies. To make a model of a galaxy, different
potentials for different parts of the galaxy can be chosen. As an example, one potential can
be used for the dark matter halo while other potentials are used for the disk and the bulge.
The Poisson equation for a compound system can be written as
∇2 Φ = 4πG(ρdisk + ρbulge + ρhalo ).
(3.4)
Another important property of the particle distributions is the circular speed of a particle
in a stable orbit. This value can be calculated from the gravitational potential as
r
dΦ(r)
vc (r) = r
.
(3.5)
dr
The escape speed is another important quantity that is defined as
p
ve (r) = 2|Φ(r)|.
(3.6)
6
3
3.2
POTENTIALS
3.2
Spherical potentials
Spherical potentials
When modelling spherical galaxies, halos and bulges, the natural first choice should be
some kind of spherical potential. There is however an infinite number of them and some
are more valid as a galaxy model than others. It is instructive to show these distributions
and in this chapter some of them will be analyzed more carefully. The mass inside a certain
radius can be calculated from the density distribution
Z r Z π Z 2π
M (r) =
ρ(r, θ, φ) r2 sin θdrdθdφ
(3.7)
0
3.2.1
0
0
Point mass
The simplest spherical model is that of a point mass
GM
.
r
From equation (3.5) the circular velocity is obtained
r
GM
vc (r) =
r
Φ(r) = −
and the escape speed can be calculated from equation (3.6)
r
2GM
.
ve (r) =
r
3.2.2
(3.8)
(3.9)
(3.10)
The homogeneous sphere
In the case where the density is constant, the mass distribution M (r) = 34 πr3 ρ and the
circular velocity is equal to the rigid body rotational speed
r
4πGρ
vc (r) =
r.
(3.11)
3
3.2.3
The Plummer model
The models discussed up until now are of course not realistic choices when it comes to
describing spherical galaxies, bulges or halos. A better alternative is the Plummer potential.
It was originally developed to characterize the distribution of stars in globular clusters but
it has been widely used to model spherical galaxies. According to Plummer (1911) one can
write the density profile as
r 2 −5/2
3 M
ρ(r) =
1+
(3.12)
4π a3
a
where a is the scale radius of the sphere. Using this density relation, the massfraction inside
radius r can be calculated from equation (3.7)
r 2 −3/2
M (r) r 3
=
1+
.
(3.13)
M
a
a
7
3
3.3
POTENTIALS
Potentials of flattened systems
Using the Poisson equation (3.3), the potential can be calculated from
1 ∂
2
2 ∂Φ
∇ Φ= 2
r
= 4πGρ(r).
r ∂r
∂r
(3.14)
This equation can be solved analytically and the solution is
r 2 −1/2
GM
.
1+
Φ(r) = −
a
a
(3.15)
The escape velocity is now
ve (r) =
3.2.4
2GM
a
1/2 r 2 −1/4
1+
.
a
(3.16)
The Hernquist model
An even more realistic model is the one proposed by Hernquist (1990).
ρ(r) =
1
Ma
.
2π r (r + a)3
(3.17)
Again, the mass fraction inside radius r can be calculated by evaluating the integral (3.7)
and dividing by the total mass
M (r)
r2
.
(3.18)
=
M
(r + a)2
The potential can once again be calculated analytically by use of the Poisson equation (3.3)
Φ(r) = −
GM
.
r+a
(3.19)
The maximum speed at radius r is the escape velocity. Using equation (3.6) one obtains
ve (r) =
3.3
2GM
r+a
1/2
.
(3.20)
Potentials of flattened systems
In this section, two potentials that can be used to model flattened systems, are introduced.
3.3.1
The Toomre-Kuzmin model
The first potential is the one introduced by G. Kuzmin in 1956 and re-derived by Toomre
(1963).
GM
Φ(R, z) = p
.
(3.21)
2
R + (a + |z|)2
8
3
3.3
POTENTIALS
Potentials of flattened systems
Integrating both sides of the Poisson equation over an arbitrary volume containing the total
mass M , one can write
Z
Z
2
∇ φ dV = 4πG
ρ dV = 4πGM.
(3.22)
V
V
Applying the divergence theorem leads to
Z
Z
4πG
ρ dV =
∇φ · N dS
V
(3.23)
S
(a+|z|)
∂φ ∂φ
, ∂z and ∂φ
= (R2GM
. For a flat system where z = 0, the surface
where ∇φ = ∂R
∂z
+(a+|z|)2 )3/2
integral on the right hand side of equation (3.23) has the normal direction parallel to the
z-axis. Since the system is flat, one can also write the volume integral on the left hand side
as a surface integral over the surface density. Using cylindrical coordinates one obtains
Z R
Z R
aGM
dR.
(3.24)
Σ(R) dR = 2
4πG
2
2 3/2
0
0 (R + a )
Differentiating this with respect to r for all different r gives
aGM
(R2 + a2 )3/2
(3.25)
1
aM
.
2π (R2 + a2 )3/2
(3.26)
4πGΣ(R) = 2
which leads to the surface density
Σ(R) =
3.3.2
The Miyamoto model
The second potential is a combination of the Plummer sphere and the Toomre-Kuzmin
model. Depending on the choice of the constants a and b one can use it to represent either
a spherical or infinitesimally thin galaxy. Miyamoto & Nagai (1975) proposed the potential
GM
Φ(R, z) = − q
.
√
2
2
2
2
R + (a + z + b )
(3.27)
Also in this case the Poisson equation can be solved analytically to obtain the density
√
√
2 b M aR2 + (a + 3 z 2 + b2 )(a + z 2 + b2 )2
√
ρ(R, z) =
.
(3.28)
4π
[R2 + (a + z 2 + b2 )2 ]5/2 (z 2 + b2 )3/2
The advantage of using this potential is that it is defined everywhere and its shape can be
used to model a real galactic disk with a bulge. To use a flat potential is of course also
possible but this requires the bulge to be modelled individually. The Miyamoto potential
is the one that will be used in chapter 6 and 7 to model disk galaxies.
Apart from these two potentials there are also logarithmic potentials. These can be used to
obtain the flat rotation curves without adding the extra component of a dark matter halo.
This theory will however not be described here.
9
4
KINEMATICS AND STRUCTURES
4
Kinematics and structures
In chapter 3 different potentials and their behavior were discussed. The attention will now
be turned to the orbits of stars and matter moving in these potentials. The phase space
distribution function, which is of fundamental importance when modelling galaxies, will
be discussed as well as the mathematics behind the epicycles that stars undergo during
their orbits. These are the origin of the beautiful spiral arms and bars that arise in many
disk galaxies. The phase space distribution function will be examined even more in later
chapters when some specific potentials used in this work will be analyzed.
4.1
Observational background
Until 1970 all information about the kinematics of galaxies were obtained through optical
observations. Starting from the 1920’s one had used absorption lines in spectra from external galaxies to determine the velocities as a function of radius in galactic disks. These
rotation curves can be measured from optical observations where one looks at emission lines
from H II regions in the outer parts of the disks. The drawback of these kind of optical
observations is that the integration times required are very long. Also, they do not cover
the entire disk. However, they are very important to infer how stars move in the galaxy.
While radio observations mainly look at the gas one can combine the two methods to draw
the conclusion that the velocity of the stars and the gas does not differ more than the
measurement error (∼ 30 km/s). This is however not entirely true in the galactic bulge
where the gas typically has velocities two times as big as those for the stars. To study the
differences in velocities of the two components is important when making research in the
field of star formation.
One thing that strikes the observer who looks at a rotation curve from a disk galaxy is
the shape of the curve. If one assumes a simple axisymmetric potential one may expect a
rapid increase in velocity from the center and outwards. This velocity will at some point
start to decrease the farther out in the galaxy one look. Instead, when looking on a real
rotation curve one may see that the curve climbs rapidly out to a distance less than a few
kpc. Instead of declining, it then remains constant throughout the entire disk. The reason
for this is believed to be due to the presence of some dark matter that does not emit light.
A large dark matter halo surrounding the galaxy could be an explanation of the problem
with flat rotation curves. In this work the presence of a dark matter halo will be used to
obtain the flat rotation curves observed. When observing the gas in radio one usually uses
the 21 cm emission line of H I. This line is produced when the hydrogen electron is changing
spin. This is very unlikely to happen in a single hydrogen atom. But in the interstellar
medium, the amount of hydrogen is so huge, that this transition is possible to observe.
Since H I is a gas with a weak velocity dispersion it is a good trace of the spiral structure
in galaxies. Even better is to observe the CO molecule that is colder and therefore tracks
the density waves at a greater detail.
10
4
4.2
KINEMATICS AND STRUCTURES
Elliptical galaxies
Figure 4.1: The rotation curves for some spiral galaxies. (Rubin et al. (1978))
4.2
Elliptical galaxies
The analysis of kinematics governing different classes of galaxies will start with the elliptical
galaxy. The reason is that this is the simplest one. The word simple is somewhat misleading
since the physicists did not understand these systems in a correct way until the 1970s. The
simple shape of a sphere or a flattened sphere led to the conclusion that elliptical galaxies
where just spheroids more or less flattened by axisymmetric rotation. Now it is known that
an elliptical galaxy does not have any global rotation. The spectroscopic observation of
these systems are made by studying stellar absorption lines (Ca II, Na I, Mg I, etc). From
these lines it is possible to determine the redshift and also the velocity dispersion from the
broadening of the lines.
4.2.1
The surface brightness
The de Vaucouleurs law describes the surface brightness as a function of radius
" #
1/4
I(R)
R
= −3.331
log10
−1 .
I(Re )
Re
(4.1)
In this equation, 50 percent of the total light is radiated from within the effective radius Re
and I(Re ) is the surface brightness at that radius. This relation is purely empirical and by
fitting equation (4.1) to observed brightness profiles, Re and I(Re ) can be determined. Still
there may be deviations from this law in the outer parts of the galaxy. The reason could
be that the outer parts have been disturbed by some interacting companion. For example
dwarf spherical galaxies have a surface brightness that is generally steeper than what is
predicted by equation (4.1).
11
4
4.2
KINEMATICS AND STRUCTURES
4.2.2
Elliptical galaxies
The Phase-space distribution function
Stars in a galaxy do not collide with each other. Not even distant weak encounters are
important when it comes to stellar interactions. For that reason a galaxy can be viewed as
a non collisional system. This implies that the net force acting on a star origins from the
potential of the entire galaxy and not the potentials of nearby stars. A consequence of this
is that the speed of a star varies slowly while the star is moving on its orbit in the galactic
potential.
In a system with N stars that moves in a galactic potential Φ, the state of the system
can be defined by the distribution function f (x, v, t). This function, that is also called the
phase-space density, gives the probability density in the six dimensional phase space. The
number of stars at a certain position and time can be evaluated by the integral
Z ∞Z ∞Z ∞
n(x, t) =
f (x, v, t)d3 xd3 v.
(4.2)
−∞
−∞
−∞
Using the same reasoning as Binney & Tremaine (1987) one can write the coordinates in
phase space as (x, v) = w. Differentiating this, the velocity flow is obtained as ẇ = (ẋ, v̇) =
(v, −∇Φ). The flow with coordinates in six dimensions can be regarded in the same way
as a flow of particles with only three dimensional coordinates. By visualizing a box where
stars enters and exits, it is reasonable to assume that the average number of stars in the
box stays the same over time. The phase space density of stars can therefore be assumed to
obey a continuity equation in the same way as the density is obeying a continuity equation.
∂f
∂f
+ v · ∇f − ∇Φ ·
=0
∂t
∂v
(4.3)
3 ∂Φ ∂f
∂f
∂f X
+
vi
−
= 0.
∂t
∂xi ∂xi ∂vi
i=1
(4.4)
or, equivalently
Equation (4.4) is only true if stars are neither destroyed nor created. It is also required
that they change their positions and velocities smoothly. Otherwise an additional collisional
term has to be included in the equation. To sum this up one can say that there has to be
an incompressible fluid. In section 4.3 the spiral structures will be studied in detail. It is
therefore convenient to include the cylindrical version of equation (4.4) in the mathematical
repository
2
vφ ∂Φ ∂f
∂f
∂f vφ ∂f
∂f
1
∂Φ ∂f ∂Φ ∂f
+vR
+
+vz
+
−
−
vR vφ +
−
= 0 (4.5)
∂t
∂R R ∂φ
∂z
R
∂R ∂vR R
∂φ ∂vφ ∂z ∂vz
4.2.3
The Jeans equations
Integrating the distribution function over all velocities gives
Z
Z
Z
∂f 3
∂f 3
∂Φ
∂f 3
d v + vi
d v−
d v = 0.
∂t
∂xi
∂xi
∂vi
12
(4.6)
4
4.2
KINEMATICS AND STRUCTURES
Elliptical galaxies
In the first term of this equation the partial derivative may be taken outside the integral
since the velocities integrated over does not depend on time. In the same way v does not
depend on x. This makes it possible to rewrite the equation. But once again referring to
the argumentation used by Binney & Tremaine (1987) the last term on the left hand side
of the equation can be removed due to an application of the divergence theorem and the
fact that f (x, v, t) = 0 at enough large velocities. The spatial density may now be defined
as
Z
ν ≡ f d3 v.
(4.7)
and the mean stellar velocity
1
v̄i ≡
ν
Z
f vd3 v.
(4.8)
∂ν ∂(ν v̄i )
+
= 0.
∂t
∂xi
(4.9)
Using this in equation (4.6) one obtains
Using these relations and a multiplication of equation (4.4) by vj and integrating it over all
velocities one can write
∂(νv̄j ) ∂(νvi vj )
∂Φ
+
+ν
=0
(4.10)
∂t
∂xi
∂xj
where
1
vi vj ≡
ν
Z
vi vj f d3 v.
(4.11)
To obtain a version of the continuity equation (4.9) in cylindrical coordinates, equation
(4.5) is integrated over all velocities. The equation obtained is
1 ∂(Rνv̄R ) ∂(νv̄z )
∂ν
+
+
= 0.
∂t
R ∂R
∂z
(4.12)
The mean value vi vj of equation (4.11) may be broken into two parts. The first one v̄i v̄j
comes from the streaming motion and the other one comes from the fact that not all stars
close to a certain position has the same velocity
σij2 ≡ (vi − v̄i )(vj − v̄j ) = vi vj − v̄i v̄j .
(4.13)
This relation can be used in equations (4.9) and (4.10) to derive a version of the Euler
equation
∂(νσij2 )
∂v̄j
∂Φ
∂v̄j
ν
+ νv̄i
= −ν
−
.
(4.14)
∂t
∂xi
∂xj
∂xi
Equations (4.9), (4.10) and (4.14) were originally derived by Maxwell but are known as the
Jeans equations.
13
4
4.2
KINEMATICS AND STRUCTURES
4.2.4
Elliptical galaxies
Deriving the differential energy distribution for a spherical system
Of fundamental importance when modeling spherical galaxies is the ability to distribute the
speeds from a given distribution function. In this section the differential energy distribution
function will be derived from a given density profile of a spherical system.
Even if there is a risk of mix up different equations it is convenient for the calculations
to define the relative potential
ψ ≡ −Φ + Φ0
(4.15)
and the relative energy ε
1
(4.16)
ε ≡ −E + Φ0 = ψ − v 2 .
2
Φ0 is chosen in such a way that f > 0 for ε > 0 and f = 0 for ε ≤ 0. Also, the distribution
function is only dependent on the energy and not the angular momentum. The derivation
is started by observing the Poisson equation
Z
2
∇ ψ = −4πGρ = −4πG f d3 v.
(4.17)
2
From equation (4.16) the energy per unit mass of a star is defined as ε = ψ−vp
/2. Rearranging this gives the speed as a function of the relative potential and energy v = 2 (ψ − ε). To
leave the gravitational system a particle needs to have a speed corresponding to the relative
√
potential. Setting the relative energy equal to zero gives the escape velocity vesc = 2ψ.
Using spherical symmetry one can step by step write
Z √2ψ 1 2 2
1 d
dψ
2
2
r
= −16π G
f ψ − v v dv
r2 dr
dr
2
0
Z ψ
2(ψ − ε)
= −16π 2 G
f (ε) p
dε
2(ψ − ε)
0
Z −ψ
p
(4.18)
2
= −16π G
f (ε) 2 (ψ − ε)dε
0
Z ψ
p
= −16π 2 G
f (ε) 2 (ψ − ε)dε.
0
In order to derive the distribution function from the density profile one has to solve the
Abel integral. Consider an integral of the form
Z x
g(t)dt
,
0 < α < 1.
(4.19)
f (x) =
α
0 (x − t)
Solving for g(t) one obtains
Z
sin πα d t f (x)dx
g(t) =
π dt 0 (t − x)1−α
Z t
sin πα
df
dx
f (0)
=
+ 1−α .
1−α
π
t
0 dx (t − x)
14
(4.20)
4
4.3
KINEMATICS AND STRUCTURES
Spiral galaxies
A new variant of the Poisson equation has already been derived. One can use (3.3) to
get an expression for the density at radius r
Z ψ
p
ρ(r) = 4π
f (ε) 2(ψ − ε)dε.
(4.21)
0
But ρ can also be expressed as a function of ψ
Z ψ
p
1
√ ρ(ψ) = 2
f (ε) 2(ψ − ε)dε
8π
0
(4.22)
Differentiating this leads to
1 dρ
√
=
8π dψ
Z
ψ
0
f (ε)dε
p
.
(ψ − ε)
(4.23)
Equation (4.23) is an Abel integral and the solution is
Z
1 d ε dρ dψ
√
f (ε) = √
8π 2 dε 0 dψ ε − ψ
(4.24)
which is equivalent to
1
f (ε) = √
8π 2
"Z
0
ε
1
d2 ρ dψ
√
+√
2
dψ ε − ψ
ε
dρ
dψ
#
.
(4.25)
ψ=0
Equation (4.25) is called Eddington’s formula due to its originator. This equation is of
substantial importance when it comes to modelling spherical galaxies in a computer.
4.3
Spiral galaxies
Spiral galaxies are the most common type of galaxy and more than 70 percent of them
have a well developed two-armed spiral structure. Also in spiral galaxies, the time between
star collisions is far greater than the age of the universe and it is a correct assumption
that also the spiral galaxies are non collisional systems. Also in this case one can assume
that there is a smooth galactic potential and the stars moving in it changes their velocities
and positions in a smooth fashion. The theoretical background that governs stability of
axisymmetric systems will also be considered. For a flat potential it is straightforward to
calculate the rotational velocity for a particle. However, in the case where particles are
given their rotational velocity without any dispersion, the system will immediately develop
instabilities. To avoid these so called Jeans instabilities one has to introduce velocity
dispersions into the system.
4.3.1
Epicyclic theory
The theory of how Jeans instabilities form and grow will not be considered in any detail
in this thesis. There is a lot of literature that encompasses this subject. On the other
hand there will now be focus on the theory of how to calculate the velocity dispersions and
15
4
4.3
KINEMATICS AND STRUCTURES
Spiral galaxies
the orbits of stars in flattened systems. The start will be with the theory describing the
orbits in a galactic disk. In a similar manner as Combes et al. (2002), consider a flattened
axisymmetric potential. One can write
r = R + δr
θ = Ωt + δθ
(4.26)
where δR and δθ are the radial and azimuthal deviations respectively and Ω is the angular
velocity for a particle on a circular orbit. The angular velocity is related to the gravitational
potential by
1 ∂Φ(R, 0)
Ω2 =
.
(4.27)
R
∂r
If the gravitational potential is expanded in a Taylor series in a region of the circular orbit
and it is also taken into consideration that there is a symmetry in the z direction one can
write
∂Φ(R, 0)
∂Φ
∂ 2 Φ(R, 0)
=
+ δr
.
(4.28)
∂R
∂R
∂r2
The radial and azimuthal equations of motion in polar coordinates are
r̈ − θ̇2 r = −
∂Φ
∂r
(4.29)
rθ̈ + 2ṙθ̇ = 0.
Combining (4.28) and (4.29) one can write
2
¨ − 2ΩδθR
˙ − Ω2 δr = −δr ∂ Φ(R, 0)
δr
∂r2
¨ + 2δrΩ
˙ = 0.
Rδθ
(4.30)
The Taylor expansion made earlier is only true to the first order. The approximation made
by not expanding the series longer is called the epicyclic approximation. Integrating the
second equation in (4.30) and inserting it into the first one leads to
2
¨ − 2Ω(a − 2δrΩ) − Ω2 δr = −δr ∂ Φ(R, 0)
δr
∂r2
(4.31)
where a is the constant from the integration. When a = 0 and the oscillations are occurring
around δr = 0 this equation may be written in the form
¨ + κ2 δr = 0
δr
˙ = − 2Ωδr
δθ
R
(4.32)
where κ is the epicyclic frequency and
κ2 =
∂ 2 Φ(R, 0)
+ 3Ω2 .
∂r2
16
(4.33)
4
4.3
KINEMATICS AND STRUCTURES
Spiral galaxies
Combining this with equation (4.27) yields
dΩ2
κ =R
+ 4Ω2 .
dR
2
(4.34)
This implies that the motion of a star in a flattened potential is not just a circular orbit. It
is also an epicyclic orbit where the star is rotating on a small elliptic orbit in the rotating
frame of reference. As mentioned earlier there will not be focus on the theory behind
Jeans instabilities. This thesis will be content by stating that the minimum radial velocity
dispersion needed to stabilize a flat disk is
σr,crit =
3.36GΣ(r)
κ
(4.35)
where Σ(r) is the surface density of the disk. Now, the parameter Q is defined as the ratio
between the observed and the critical velocity dispersion. When Q > 1 there is a stable
system. This is called the Toomre criterion. If this Toomre parameter is calculated in the
neighborhood of the sun one obtains a value between 1 and 2.
4.3.2
Azimuthal moments of the disk
For a moment the discussion started in section 4.2.3 will be resumed in purpose of deriving
the equivalent equations for an axisymmetric system. In this case there will be no dependence in the φ direction. To compute the azimuthal moments from the velocity field of a
disk equation (4.5) is multiplied by vR . Using the same procedure as Binney & Tremaine
(1987) one integrates over the radial velocity to obtain
!
vR2 − vφ2
∂(νv̄R ) ∂(νvR2 ) ∂(νvr vz )
∂Φ
= 0.
(4.36)
+
+
+ν
+
∂t
∂R
∂z
R
∂R
Assuming that the disk is in steady state the first term on the left hand side of equation
(4.36)
will be zero. Multiplication by R/ν and identification of the circular velocity vc =
p
R(∂Φ/∂R) leads to
R ∂(νvR2 ) R ∂(νvR vz )
+
+ vR2 − vφ2 + vc2 = 0.
ν ∂R
ν
∂z
(4.37)
The azimuthal velocity dispersion is defined as
σφ2 = vφ2 − v̄φ2 .
(4.38)
For an infinitesimally thin axisymmetric disk the spatial density ν is equal to the surface
density Σ. This quantity is not dependent on z and equation (4.37) can be written in the
form
R ∂(ΣvR2 )
∂(vR vz )
σφ2 − vR2 −
−R
= vc2 − vφ2 .
(4.39)
Σ ∂R
∂z
17
4
4.4
KINEMATICS AND STRUCTURES
4.4
4.4.1
Interacting galaxies
Interacting galaxies
Tidal tails
The tidal force experienced by an object in a gravitational potential is the differential of
the attraction force. Since the tidal force is decreasing with distance as 1/d3 the forces
will diminish rapidly. This implies that the effect of tidal interaction is at a maximum
when the galaxies are at the smallest distance of separation. At this point the particles
are undergoing an acceleration that triggers the formation of the tail. Because of symmetry, the tidal forces of a target galaxy that is perturbed by a companion, will trigger the
formation of two tails, one on each side of the galaxy. This is beautifully illustrated from
the interaction between M51 and its companion. If two spiral galaxies interact with each
other, these symmetries will lead to the formation of four spiral arms, two in each galaxy.
If the two galaxies are of approximately the same size, these arms can join each other to
form a bridge. In the antenna galaxy the bridge has already disappeared while the other
two spirals are forming the remaining two large ’antennas’.
The shape of the tidal tails created in a merger are dependent on the initial conditions
of the interaction. For a heads on collision the spiral arms are closed up to a ring, which is
the case of the Cartwheel galaxy, while the arms of a distant merger is very open.
4.4.2
Shells
In 1983 Malin & Carter (1983) observed 137 galaxies with fine rings
surrounding elliptical galaxies.
The
shells have in common that they are
circular in the plane of sight with
origin in the center of the elliptical galaxy.
This indicates that
they are actually three dimensional
objects.
Although these structures
were not discovered until very recently they are quite common.
Almost 20% of all elliptical galaxies have
shells.
The structures are believed to originate
from an interaction between a big ellip- Figure 4.2: The M51 galaxy illustrates the phetical galaxy and a small spiral galaxy. nomenon of spiral wave generation from tidal interIn these kind of collisions almost noth- actions
ing will happen to the structure of the
elliptical while the spiral will be totally swallowed up. Simulations made by Quinn (1984)
showed that a collision of this kind makes the spiral galaxy stars oscillate within the elliptical galaxy potential. Since the speed of these stars are at a minimum further out from the
center, they will spend the longest time in this region and that will form the optical shell.
18
5
THE BARNES-HUT TREE CODE
5
5.1
The Barnes-Hut tree code
Introduction
When simulating systems like isolated or interacting galaxies the true number of system
particles can never be reached due to limitation of computer power. The largest simulation
ever made is the Millennium simulation that handles more than 1010 particles but this
is still less than the 1011 particles in a typical galaxy. To keep a great computational
accuracy in simulations, the target is always to keep the number of particles as high as
possible. Calculating forces between bodies in an N-body system of particles requires
o(N 2 ) operations if all forces are calculated. To do this for a large system would be a
waste of computer time and this is the reason why different hierarchical methods have been
developed. One of these hierarchical methods that requires only o(N logN ) operations is
the treecode that will be described in detail in this chapter (Barnes & Hut (1986)). A
hierarchical algorithm like the treecode organizes the particles into a tree structure where
each level contain information about particles in a certain volume. By using this method
a lot of simplifications can be made while calculating the forces. In the treecode used in
this project the calculations are also speeded up by the fact that nearby particles have
similar interaction lists. In this way the program does not have to make interaction lists for
all particles in the simulation. Another advantage with treecodes is the performance with
abnormal particle distributions. Since the tree structure is adaptive, there is an advantage
in comparison with particle mesh methods.
5.2
Structure of the code
The treecode uses an oct-tree that consists of cells at different levels. Building the tree
structure can be described in the following way. The program starts by constructing a
root cell big enough to hold all the particles of the system. The particles are then loaded
into this large cell. The idea of the treecode is that a cell is divided into eight sub cells
as soon as the number of particles in a cell exceeds one. The first cell will therefore be
divided into eight sub cells as soon as one has a system of more than one particle. This
system of dividing cells into sub cells is continued until all particles are loaded. The result
will be a system of cells with a maximum of one particle in each cell. Every cell is then
assigned information about its sub cells, mass, center of mass and gravitational multipole
moments. The force on a particle can now be recursively calculated in the following way.
If the cell containing the particle has sides of length l and the distance from the particle
to the center of mass for the root cell is D the interaction is included if l/D < θ where
θ is a parameter, usually 0.75. Otherwise the root cell is resolved into its sub cells and
the criterion is rechecked. In this way the force on each particle can be calculated and the
system can be advanced by calculating the new positions and velocities.
5.3
Running the code
The treecode is freely available and can be retrieved from Joshua Barnes’ homepage at
http://ifa.hawaii.edu/∼barnes/treecode. More detailed information about the structure of
19
5
5.3
THE BARNES-HUT TREE CODE
Running the code
Figure 5.1: A 2-D illustration of how the subcells are created depending on the position of a
particle
the code and how to use it can be retrieved from that website but it is also described in
Appendix A. The parameters used to run the code are:
• in: is the input file that contain the mass, position and velocity of each particle
• out: is the output file in the same format as the input file.
• dtime: is the parameter that determines the time step of integration.
• eps: is the gravitational force softening used to smooth the mass distribution. Each
particle is replaced by a plummer sphere with scale length . This parameter is more
carefully discussed in section 5.3.1
• theta: is the opening angle mentioned in section 5.2. A lower value calculates more
accurate forces on the cost of computing time.
• usequad: determines whether quadropole moments are used while calculating gravitational potentials or not.
• options: is a set of options used to include various information
• tstop: is the time when the calculation ends
• dtout: is the time between output files. This value should be a multiple of dtime
20
5
5.3
THE BARNES-HUT TREE CODE
5.3.1
Running the code
Optimal smoothing
Smoothing the forces in an N-body code is necessary to avoid close encounters between
stars. The idea behind smoothing is to obtain more accurate forces that in a correct way
represents the real smooth system being modelled. Intuitively it is easy to realize that a too
short smoothing length will lead to fluctuations in the force field while a to large smoothing
length will lead to a system where the real features disappears in the smoothing.
Merritt (1996) considered the simplest N-body algorithm which is the direct summation
method. Since the difference between imposing the softening via a fix smoothening length
and other methods are small, the force acting on a particle can be written
Fi = Gm
2
N
X
j=1
(2
xj − xi
+ |xi − xj |2 )3/2
(5.1)
where is the smoothening length and m is the mass of each star. Since there is a real value
for the forces, the aim is to minimize the average difference between the two forces. Merritt
(1996) has minimized the mean value of the integrated square error which is defined as
Z
ρ(x)|F(x) − Ftrue (x)|2 dx
(5.2)
where ρ(x) is normalized density from the true distribution. Minimizing the mean of this
integral gives the following optimal smoothing lengths for the Plummer and the Hernquist
distributions.
P lummer ≈ 1.1 · N −0.28
Hernquist ≈ 1.5 · N −0.44
(5.3)
In the simulations made in chapter 6 and 7, these smoothing lengths has been used also in
the case of composite systems. Although an error is committed for the disk particles, no
significant change in the dynamics of the system is observed while changing the smoothing.
21
6
SIMULATIONS OF ISOLATED SYSTEMS
6
6.1
Simulations of isolated systems
Units and scales
For numerical and physical reasons it is often convenient to reduce equations to a non dimensional form. In galactic dynamics one combines huge values describing distances and
masses with a small value for the gravitational constant. This makes the risk of round off
errors imminent. To avoid problems of this kind one often uses non dimensional units and
that practise is used also in this thesis.
A typical galaxy has a size that can be measured in kilo-parsec and a mass that can be
measured in hundred billion sun masses. Using dimensional arguments one can calculate a
typical rotational velocity from (3.5)
r
10−11 · 1011 · 1030
v'
' 300 km/s.
(6.1)
1019
The same argumentation can be used to calculate a typical timescale
t' √
(1019 )3/2
10−11
·
1011
·
1030
' 106 years.
(6.2)
Consider a galaxy like the Milky with 400 billion stars and a radius of around 30 kpc, then
there is a corresponding typical time scale of 122 million years.
6.2
Elliptical galaxies
In section 3.2, the Plummer and Hernquist profiles and their suitable density distributions
were discussed. Elliptical galaxies are slowly rotating objects and their dynamic is governed
by the chaotic motion of stars. Many elliptical galaxies are thought to be very old due to
the many red giant stars. They are also showing little evidence of gas or other interstellar
material. It is therefore a good choice to model these galaxies as spherical Plummer or
Hernquist halos containing only stars. The Hernquist profile is the one that best agree with
de Vaucouleurs law (4.1) but in this project there has also been made simulations with
Plummer distributions for comparison.
6.2.1
Initial conditions for the Plummer distribution
To generate the positions of particles equation (3.13) is used. By drawing random numbers
for the mass fraction, different radii can be calculated. Since the task is to model spherical
systems, each particle is randomly distributed on the corresponding sphere. The density
distribution and the potential are recalled from section 3.2.3.
r 2 −5/2
3 M
ρ(r) =
1+
(3.12)
4π a3
a
r 2 −1/2
GM
1+
.
(3.15)
Φ(r) = −
a
a
22
6
6.2
SIMULATIONS OF ISOLATED SYSTEMS
Elliptical galaxies
First, the distribution function has to be derived. In the same way as Aarseth et al. (1974)
one starts from equation (3.12) and (3.15) to obtain
ρ(r) =
3 R2
Φ5 (r).
4π M 4 G5
(6.3)
We have that (dρ/dΦ)Φ=0 = 0 and the second derivative of the density with respect to Φ is
15 R2
d2 ρ
=
Φ3 .
dΦ2
π M 4 G5
(6.4)
This can now be used in the Eddington formula (4.25) to obtain
Z E
1 15 R2
Φ3
p
dΦ
f (E) = √
8π 2 π M 4 G5 0
(Φ − E)
√
24 2 R2
(−E)7/2 .
=
7π 3 M 4 G5
(6.5)
The procedure to generate the velocities is straightforward. For each of the particles a
random number between 0 and the escape velocity is drawn. Then the total energy for a
particle with this velocity is calculated. Finally a acceptance rejection method is used to
keep the values that fall under the distribution function and reject the values that are above
the distribution function. Note that the distribution function is calculated in the possible
interval of energies corresponding to the current radius.
6.2.2
Initial conditions for the Hernquist distribution
The procedure to generate particle positions for the Hernquist distribution is similar to
that for the Plummer distribution. The density distribution and the potential are recalled
from section 3.2.4
Ma
1
(3.17)
ρ(r) =
2π r (r + a)3
GM
.
r+a
Hernquist (1990) defines dimensionless forms of the density and potentials.
Φ(r) = −
ρ̃ = −
2πa3
ρ(r)
M
a
Φ(r).
GM
Combining this with equations (3.17) and (3.19) leads to the simple relation
Φ̃ = −
Φ̃4 (r)
ρ̃ =
1 − Φ̃(r)
23
(3.19)
(6.6)
(6.7)
(6.8)
6
6.3
SIMULATIONS OF ISOLATED SYSTEMS
Disk galaxies
Figure 6.1: The density distribution for Plum- Figure 6.2: The distribution function when
mer (dashed) and Hernquist (solid line) when a = 0.45. The Plummer (dashed) and Hernquist
a=1
(solid line) distributions is compared with that for
the R1/4 law (dashed dotted)(see Binney, 1982)
Using the same method as for the Plummer distribution Hernquist (1990) derive the distribution function
M
1
2 1/2
2
4
2
3
arcsin
q
+
q(1
−
q
)
(1
−
2q
)(8q
−
8q
−
3)
.
f (E) = √
8 2π 3 a3 vg3 (1 − q 2 )5/2
(6.9)
p
p
where q = −aE/GM and vg = GM/a. To generate velocities, the same procedure as
for the Plummer distribution is used.
6.2.3
Simulation results
As already mentioned it is the Hernquist profile that best agree with observations of real
elliptical galaxies. It is also the model used in this thesis work to describe the elliptical
galaxy. Simulations has been carried out for both Hernquist and Plummer distributions
and the density distributions for the systems stays the same over a long time of evolution.
For simulations with a small number of particles the system starts to drift in some random
direction since the code does not conserve linear momentum. This is however not a problem
when many particles are used.
6.3
6.3.1
Disk galaxies
The Miyamoto distribution
As there are a variety of models describing spherical galaxies, one can use different methods
to model a disk galaxy. In this thesis however, the Miyamoto distribution has been used
because of its simplicity. In the event of modelling compound systems one does not have
to use separate distributions for the disk and the bulge of a galaxy. Instead the Miyamoto
24
6
6.3
SIMULATIONS OF ISOLATED SYSTEMS
Disk galaxies
distribution can be used to describe both components. It also defines the potential everywhere which makes it easy to calculate velocities. As already mentioned in section 3.3.2, the
model by Miyamoto & Nagai (1975) is a generalization of the Plummer and the ToomreKuzmin models. For different values on a and b one can create disks of various thickness.
A comparison of four different disks with different b/a ratios are shown in figure 6.3. In
Figure 6.3: The density contours of the Miyamoto disk when b/a = 10 (upper left), b/a = 1
(upper right), b/a = 0.1 (lower left) and b/a = 0.01 (lower right). The density is normalized so
that the peak density equals unity. The ratio b/a = 0.1 is the is used when modelling disk galaxies.
the Milky Way, the ratio b/a is approximately 0.1. One can to a good approximation say
that the disk is 100.000 light years wide and 10.000 light years thick. Using these quantities
and once again M = G = 1 gives a density distribution like the one in Figure 6.4. An
acceptance-rejection technique is once again used to distribute particles according to this
density distribution.
Observations made by van der Kruit & Searle (1981) shows that the radial velocity dispersion is proportional to the surface density that decreases exponentially with radius.
25
6
6.3
SIMULATIONS OF ISOLATED SYSTEMS
Disk galaxies
Therefor, the radial velocity dispersion scales as
vR2 ∼ e−R/a
(6.10)
where a is the scale radius. For the isothermal sheet, the vertical velocity dispersion is
related to the surface density of the disk Hernquist (1993)
vz2 = πGΣ(R)z0 .
(6.11)
Hernquist (1993) also suggest that the azimuthal velocity dispersion can be related to the
radial velocity dispersion from the epicyclic approximation
σφ2
=
vR2
κ2
.
4Ω2
(6.12)
Knowing that the surface density is decreasing exponentially, equation (6.12) can be used
to rewrite (4.38). This leads to the expression
"
#
2
2
κ
)
R
v
∂(ln
R
∂(v
v
)
R
z
R
− +
vφ 2 − vc2 = vR2 1 −
+
.
(6.13)
4Ω2
a
∂ ln R
vR2 ∂z
This equation can be even more simplified with help from the assumption in (6.10)
κ2
R
2
2
2
vφ − vc = vR 1 −
−2
.
(6.14)
4Ω2
a
The procedure to assign speeds to each particle is as follows. The circular speed is first
calculated from equation (3.5). vR2 , vz2 , κ and Ω are then calculated from equations (4.35),
(6.11), (4.33) and (4.27). When this is done the azimuthal velocity dispersion is calculated
from equation (6.12). Finally the azimuthal streaming velocity is obtained from equation
(6.14). The total random velocity is now the sum of the streaming velocity and a random
velocity drawn from σφ . In the radial and vertical directions random velocities are drawn
from vR2 and vz2 respectively.
6.3.2
Simulation results
The way to characterize the velocity dispersion in the disk is through the choice of the
Toomre parameter, Q. The development of spiral structure is dependent on this value.
Several tests has been made for different Q0 s and the difference in result is the amount of
time it takes the spiral structure to be visible. One of the simulations is shown in figure
6.4. It is also important to point out the need of a large number of particles in these kind
of simulations. In the case where a spherical distribution is simulated, it is enough to use
∼ 1000 particles to show the stability. Although the treecode does not conserve the linear
momentum very well for few particles one can at least observe that the system is stable in
its shape. However, when simulating disk galaxies a large number of particles is required.
To have the ability to resolve the spiral structure that is formed, a large number of particles
is favorable.
26
6
6.4
SIMULATIONS OF ISOLATED SYSTEMS
Composite systems
Figure 6.4: The Miyamoto disk for N = 10000 particles projected on the x-y plane when t = 0
(left) and t = 20 (right). In the simulation M = G = a = 1, b = 0.1 and Q=1.2. The timestep
used in the simulation is 1/1024. The bar and the two spiral arms are clearly visible.
6.4
Composite systems
There are several ways to describe a model of a galaxy containing a stellar disk, bulge and a
surrounding dark matter halo. In the procedure introduced by Barnes (1988) the different
components are allowed to relax in the presence of each other until equilibrium is reached.
The drawback of this procedure is of course that the galaxy is modified by the adjustment
to equilibrium. Another approach is the one used by Hernquist (1993). In that method, the
density profiles are implemented exactly while the distribution function is approximated.
In this thesis yet another method has been used. Instead of approximating the distribution
function a Miyamoto potential has been combined with a Plummer or a Hernquist potential.
The initial velocities in the halo are calculated from the distribution function and in addition
they are given a circular velocity in a random direction that corresponds to the circular
velocity around the Miyamoto distribution. In this way the velocities are not any longer
exactly equivalent to the distribution function but the error committed should be small
when taking into consideration that the disk is much smaller and lighter. The disk is also
not a spherical system which result in yet another small error. For the disk particles, the
velocities are calculated from the potential of the combined system. Recalling equation
(3.4) the total gravitational potential can be written
Φtotal = Φdisk + Φhalo .
(6.15)
As a consequence of the dark matter halo, the rotational velocity of the disk will change.
In figure 6.5 and 6.6 the circular velocities at different radii are plotted for all the particles
at the beginning of a simulation. Also the speeds with no dark matter halo are plotted.
As one can see the rotational curve becomes flat to a varying degree for different mass and
size of the halo. From these figures it is clear that at suitable flat rotationcurve is obtained
when Mhalo = 10Mdisk and ahalo = 10adisk for both the case with a Plummer halo and the
case with a Hernquist halo.
27
6
6.4
SIMULATIONS OF ISOLATED SYSTEMS
Composite systems
Figure 6.5: The o’s represents the rotational velocities for a system with 100 particles in the
disk and 3000 particles in the Plummer halo while the +’s represents the rotational velocities for
a isolated disk with 100 particles. In all four figures Mdisk , adisk and G is equal to 1 Upper left:
Mhalo = 20 and ahalo = 10 Upper right: Mhalo = 10 and ahalo = 5 Lower left: Mhalo = 5 and
ahalo = 10 Lower right: Mhalo = 10 and ahalo = 10.
28
6
6.4
SIMULATIONS OF ISOLATED SYSTEMS
Composite systems
Figure 6.6: The o’s represents the rotational velocities for a system with 100 particles in the
disk and 3000 particles in the Hernquist halo while the +’s represents the rotational velocities for
a isolated disk with 100 particles. In all four figures Mdisk , adisk and G is equal to 1 Upper left:
Mhalo = 20 and ahalo = 10 Upper right: Mhalo = 10 and ahalo = 5 Lower left: Mhalo = 5 and
ahalo = 10 Lower right: Mhalo = 10 and ahalo = 10.
29
6
6.4
SIMULATIONS OF ISOLATED SYSTEMS
Composite systems
Figure 6.7: At T=0, the solid line represent the massfraction for the disk. The dotted-dashed
line represent the massfraction for the disk and the halo. The dashed line represents the halo
massfraction. At T=50, that for unit scaling corresponds to ∼ 5 rotations for the galaxy, the mass
fractions are plotted with +, * and . respectively. In the simulation, a halo that is ten times as
heavy and 10 times as large as the disk has been used. As one can see the distribution stays the
same over a long time.
6.4.1
Simulation results
Simulations has been carried out for the case where G = 1, Mdisk = 1, adisk = 1, Mhalo = 10,
ahalo = 10 and Q = 1.2 with the Plummer and Hernquist distributions representing the
dark matter halo. The difference with these simulations and the simulations made with
an isolated Miyamoto disk is that the rotation curves now are represented more correct.
Depending on the masses and sizes of the disk and halo the system will react different. For
a simulation with a Hernquist halo, the massfractions remains fairly constant over a long
time. This is illustrated in figure 6.7. Simulations has also been made with a Plummer
dark matter halo. In this case, the halo undergoes a slight infall in the beginning of the
simulation. This is however stabilized quickly.
30
7
7
SIMULATIONS OF INTERACTING GALAXIES
Simulations of interacting galaxies
One of the initial goals of this project has been to make simulations of interacting E0 and
spiral galaxies. This chapter will focus on some specific interactions between galaxies that
to some extent can explain the behavior of the the Medusa Galaxy (NGC 4194) and other
interacting galaxies.
Several papers governing the interaction between ellipticals and spirals have been written.
Quinn (1984) and Kojima & Noguchi (1997) are two examples where the shell structure and
the tidal tail has been showed in simulations. In the Medusa case, optical imaginary shows
structure that is believed to be a kind of shell oscillation in the center of the system. Also a
long tidal tail, approximately six times larger than the optical nucleus, is visible. This tail
is however composed of neutral hydrogen and contains almost no stars. One believes that
this structure formed when a small spiral galaxy fell into a bigger elliptical galaxy. The
distribution of stars near the center of the system could be caused by parts of the original
spiral galaxy oscillating in the elliptical galactic potential. There is only one nucleus visible
in the system which leaves two possible scenarios. Either, the spiral galaxy is in an ongoing
passage through the elliptical nucleus, or the two nuclei have already merged completely.
Figure 7.1: The left picture shows the center of the Medusa merger at optical wavelengths. There
are stars that surround the center in a shell like structure. The right hand picture is a contour
plot of the H I distribution. (Manthey et al. in prep)
31
7
7.1
SIMULATIONS OF INTERACTING GALAXIES
7.1
Interactions between ellipticals and spirals
Interactions between ellipticals and spirals
The galaxy models used in the simulations are built on the content in previous chapters.
The spiral galaxy is modelled with a Hernquist halo surrounding a Miyamoto disk. Tests
have been made with a spiral galaxy containing no dark matter. However, these tests show
that the dark matter plays an important role for the dynamics of the system. Tidal tail
formation is for example more sensitive to external forces in a non halo system. For that
reason, most tests have been carried out with the presence of a dark matter halo. It is interesting to observe that the type of halo is not very important. Tests made with a Plummer
halo give approximately the same results as tests made with a Hernquist halo.
7.2
A possible scenario for the Medusa merger
Different initial conditions have been used for the Medusa merger. The initial separation
has however been chosen not more than a few times the scale radius of the elliptical galaxy.
The reason is that the tidal forces goes as 1/d3 and thus diminish rapidly. In the simulation
showed in figure 7.2, the spiral galaxy has fallen in on prograde motion. The reason for this
choice is that a retrograde motion does not form the type of tidal tail that can be seen in
the HI images. Also, it has fallen in on a non-stable orbit to be able to merge completely
with the elliptical galaxy. From the time sequence showed in the figure one can see that the
tidal tail starts to form early in the interaction. What is not visible in the figures, but can
be analyzed, is that it is the outer parts of the spiral galaxy that forms the tail. Although
gas is not included in the simulation one can at least draw the conclusion that it is the
regions normally containing a lot of gas that forms the tail. To model the observed tail
more accurately one has to include gas since the HI region is not a collisionless system. In
the simulations showed in figure 7.2 non dimensional units have been used for simplicity.
32
7
7.2
SIMULATIONS OF INTERACTING GALAXIES
A possible scenario for the Medusa merger
Figure 7.2: A time sequence for T = 12,21,30 and 39 is shown. The spiral disk is plotted in
yellow while the elliptical galaxy is plotted in white. The dark matter Hernquist halo is not plotted.
The spiral galaxy has Mdisk = 7,Mhalo = 71,adisk = 1 and ahalo = 10. The elliptical galaxy has
M = 400 and a = 4. The initial separation between the galaxies is x = 40, y = 20 and z = 0. The
initial velocity for the spiral galaxy is vx = −0.6,vy = 1.2 and vz = 0.
33
8
8
CONCLUSIONS AND PERSONAL REFLECTIONS
Conclusions and personal reflections
When I started to work on this thesis I had the preconceived notion that it would be an easy
task to build the model galaxies. At the end it turned out not to be so. In my preliminary
plan I was also determined to invoke gas in my simulations. Unfortunately the time has
not been long enough to do so. The most time consuming part of the work has actually
been to build the models. The composite system used to model galaxies in section 6 has
drawn my attention for several hours. Nevertheless, this has been a time of great learning,
especially in the theory behind galactic structure and behavior. A great deal of knowledge
about galactic dynamics can also be retrieved from particles simulations.
Beside building models of various types of galaxies I have also made some special tests
with the ambition to reproduce the main features of the Medusa merger. From the simulations it has been shown how the infall of a small spiral galaxy into a bigger elliptical
galaxy can be the initial condition for the observed scenario. The formation of a long tidal
tail from the outer parts of the disk is clearly visible as well as the shell oscillations of
stars in the center of the system. Although the particles are collisionless one can see that
the tail is formed of particles originating from the regions normally containing a lot of gas.
One can also assume that the inclusion of a gaseous component might make the choice of
initial conditions even more complicated. Already with two fairly simple galaxy models
the complexity of the system is obvious. A slight change in the initial infall angle might
for example result in a totally different kind of shell oscillation in the center. With these
things in mind I find it reasonable to argue that an N-body simulation very well can show
the main features of this particular merger.
However, future research in this area should include simulations of the gas. More tests
of different initial conditions should also be made to get a better match for this system.
34
A
HOW TO USE TREECODE 1.4
A
A.1
How to use treecode 1.4
Installation of the code
The treecode can be downloaded as a gzipped tar file from Joshua Barnes homepage. The
address is http://ifa.hawaii.edu/∼barnes/treecode/treecode.tar.gz. When the file has been
downloaded to its appropriate catalogue it has to be unzipped and unpacked with the commands
gunzip treecode.tar.gz
tar xvf treecode.tar
The catalogue should now contain the files treecode.h treedefs.h treecode.c treegrav.c
treeio.c treeload.c getparam.c mathfns.h stdinc.h vectdefs.h vectmath.h clib.c
getparam.c mathfns.c and Makefile. In the case where where the treecode is installed
into a linux system no changes to the Makefile have to be made. The treecode can be built
by giving the command
make treecode
Whether the installation has succeeded or not can be tested by giving the command
treecode
In this case the treecode will make a test calculation. The steps will be visible on the
screen and the calculation can be aborted anytime by typing Ctrl - C.
A.2
Running the code
The parameters given to the treecode have already been listed in 5. The use of the treecode
is illustrated by an example
treecode in=galaxy.data out=outgalaxy.data dtime=1/1024 eps=0.0128 tstop=200
dtout=1
In this case the treecode uses the input file galaxy.data and writes the result to outgalaxy.data.
The simulation uses a timestep (dtime) of 1/1024. It is preferable to give this number on
the form n/d where n is an integer and d is a power of 2. The smoothing length is 0.0128
and the simulation continues until T = 200 and writes to the output file at a time interval
of T = 1.
The input file used has to be on the form
35
A
A.2
HOW TO USE TREECODE 1.4
nbody
dimension
time
mass(1)
↓
mass(nbody)
x(1)
y(1)
↓
↓
x(nbody)
y(nbody)
vx(1)
vy(1)
↓
↓
vx(nbody)
vy(nbody)
Running the code
z(1)
↓
z(nbody)
vz(1)
↓
vz(nbody)
The output files are written in the same format with each timestep adding up at the bottom
line of the outputfile. In the case where an output file already exists, the new values will
also be added up starting from the bottom line. There is a risk of making mistakes and for
that reason it is recommended to check whether files with similar names exist.
36
REFERENCES
REFERENCES
References
Aarseth S. J., Henon M., Wielen R., 1974, A&A, 37, 183
Barnes J., Hut P., 1986, Nature, 324, 446
Barnes J. E., 1988, ApJ, 331, 699
Binney J., 1982, MNRAS, 200, 951
Binney J., Tremaine S., 1987, Galactic dynamics. Princeton, NJ, Princeton University
Press, 1987, 747 p.
Combes F., Boisse P., Mazure A., Blanchard A., Seymour M., 2002, Galaxies and cosmology. Galaxies and cosmology (2nd ed.). by F. Combes et al. (M. Seymour, Trans.). New
York: Springer, 2002.
Hernquist L., 1990, ApJ, 356, 359
Hernquist L., 1993, ApJ, 86, 389
Holmberg E., 1941, ApJ, 94, 385
Hubble E. P., 1926, ApJ, 64, 321
Karttunen H., Kröger P., Oja H., Poutanen M., Donner K. J., 1996, Fundamental Astronomy. Fundamental Astronomy, XV, 521 pp. 402 figs., 36 in color. Springer-Verlag Berlin
Heidelberg New York
Kojima M., Noguchi M., 1997, ApJ, 481, 132
Malin D. F., Carter D., 1983, ApJ, 274, 534
Merritt D., 1996, AJ, 111, 2462
Miyamoto M., Nagai R., 1975, PASJ, 27, 533
Plummer H. C., 1911, MNRAS, 71, 460
Quinn P. J., 1984, ApJ, 279, 596
Rubin V. C., Thonnard N., Ford Jr. W. K., 1978, ApJ, 225, L107
Toomre A., 1963, ApJ, 138, 385
Toomre A., Toomre J., 1972, ApJ, 178, 623
van der Kruit P. C., Searle L., 1981, A&A, 95, 105
37