text:
### Dr Alessia Gualandris

Lecturer

Astrophysics Research Group.

### Biography

Alessia Gualandris joined the Department as lecturer in 2013.She started her research at the University of Milano Bicocca in Italy, where she obtained her MPhys degree for her theoretical/numerical studies of dynamical encounters in the dense cores of globular clusters. She received her PhD in 2006 from the University of Amsterdam, the Netherlands, for her interdisciplinary work between astronomy and computer science, and in particular for the development of software for the simulation of dense stellar systems and her study of the ejection of high velocity stars. In those years, she became one of the few experts in adopting special purpose hardware for the efficient simulation of globular clusters and galactic nuclei.During her postdoctoral studies at the Rochester Institute of Technology (USA), at the Max-Planck Institute for Astrophysics in Garching, Germany and at the University of Leicester, she used state-of-the-art numerical simulations to study the dynamics of the Milky Way centre and other galactic nuclei hosting supermassive black holes. Through international collaborations and software development, she continues to push the limits of numerical methods to study the formation and dynamical evolution of the densest astrophysical systems.

### Research interests

• Dynamics of dense stellar systems: star clusters, galactic nuclei.
• Evolution of supermassive black hole binaries and gravitational wave sources.
• Computational astrophysics.

### In the media

Gravitational waves emitted from black holes in the Galactic Centre
Zentrum fuer Astronomie Heidelberg
###### Media Contacts

Contact the press team

Email:

mediarelations@surrey.ac.uk

Phone: +44 (0)1483 684380 / 688914 / 684378
Out-of-hours: +44 (0)7773 479911
Senate House, University of Surrey
Guildford, Surrey GU2 7XH

### Publications

Rycerz K, Tirado-Ramos A, Gualandris A, Zwart SP, Bubak M, Sloot PMA (2007) Regular Paper: Interactive N-Body Simulations On the Grid: HLA Versus MPI., IJHPCA 21 2 pp. 210-221
Gualandris A, Merritt D (2007) Ejection of Supermassive Black Holes from Galaxy Cores,
[Abridged] Recent numerical relativity simulations have shown that the
emission of gravitational waves during the merger of two supermassive black
holes (SMBHs) delivers a kick to the final hole, with a magnitude as large as
4000 km/s. We study the motion of SMBHs ejected from galaxy cores by such kicks
and the effects on the stellar distribution using high-accuracy direct N-body
simulations. Following the kick, the motion of the SMBH exhibits three distinct
phases. (1) The SMBH oscillates with decreasing amplitude, losing energy via
dynamical friction each time it passes through the core. Chandrasekhar's theory
accurately reproduces the motion of the SMBH in this regime if 2 3 and if the changing core density is taken into account. (2) When the
amplitude of the motion has fallen to roughly the core radius, the SMBH and
core begin to exhibit oscillations about their common center of mass. These
oscillations decay with a time constant that is at least 10 times longer than
would be predicted by naive application of the dynamical friction formula. (3)
Eventually, the SMBH reaches thermal equilibrium with the stars. We estimate
the time for the SMBH's oscillations to damp to the Brownian level in real
galaxies and infer times as long as 1 Gyr in the brightest galaxies. Ejection
of SMBHs also results in a lowered density of stars near the galaxy center;
mass deficits as large as five times the SMBH mass are produced for kick
velocities near the escape velocity. We compare the N-body density profiles
with luminosity profiles of early-type galaxies in Virgo and show that even the
largest observed cores can be reproduced by the kicks, without the need to
postulate hypermassive binary SMBHs. Implications for displaced AGNs and
Gualandris A, Zwart SP, Tirado-Ramos A (2004) Performance analysis of direct N-body algorithms for astrophysical
simulations on distributed systems,
ParallelComput. 33 pp. 159-173
We discuss the performance of direct summation codes used in the simulation
of astrophysical stellar systems on highly distributed architectures. These
codes compute the gravitational interaction among stars in an exact way and
have an O(N^2) scaling with the number of particles. They can be applied to a
variety of astrophysical problems, like the evolution of star clusters, the
dynamics of black holes, the formation of planetary systems, and cosmological
simulations. The simulation of realistic star clusters with sufficiently high
accuracy cannot be performed on a single workstation but may be possible on
parallel computers or grids. We have implemented two parallel schemes for a
direct N-body code and we study their performance on general purpose parallel
computers and large computational grids. We present the results of timing
analyzes conducted on the different architectures and compare them with the
predictions from theoretical models. We conclude that the simulation of star
clusters with up to a million particles will be possible on large distributed
computers in the next decade. Simulating entire galaxies however will in
addition require new hybrid methods to speedup the calculation.
Zubovas K, Wynn GA, Gualandris A (2013) Supernovae in the Central Parsec: A Mechanism for Producing Spatially
Anisotropic Hypervelocity Stars,
Astrophysical Journal
Several tens of hyper-velocity stars (HVSs) have been discovered escaping our
Galaxy. These stars share a common origin in the Galactic centre and are
distributed anisotropically in Galactic longitude and latitude. We examine the
possibility that HVSs may be created as the result of supernovae occurring
within binary systems in a disc of stars around Sgr A* over the last 100 Myr.
Monte Carlo simulations show that the rate of binary disruption is ~10^-4
yr^-1, comparable to that of tidal disruption models. The supernova-induced HVS
production rate (\Gamma_HVS) is significantly increased if the binaries are
hardened via migration through a gaseous disc. Moderate hardening gives
\Gamma_HVS ~ 2*10^-7 yr^-1 and an estimated population of ~20 HVSs in the last
100 Myr. Supernova-induced HVS production requires the internal and external
orbital velocity vectors of the secondary binary component to be aligned when
the binary is disrupted. This leaves an imprint of the disc geometry on the
spatial distribution of the HVSs, producing a distinct anisotropy.
Gualandris A, Colpi M, Zwart SP, Possenti A (2004) Has the black hole in XTE J1118+480 experienced an asymmetric natal
kick?,
Astrophys.J. 618 pp. 845-851
We explore the origin of the Galactic high latitude black hole X-ray binary
XTE J1118+480, and in particular its birth location and the magnitude of the
kick received by the black hole upon formation in the supernova explosion. We
constrain the age of the companion to the black hole using stellar evolution
calculations between 2 Gyr and 5 Gyr, making an origin in a globular cluster
unlikely. We therefore argue that the system was born in the Galactic disk and
the supernova propelled it in its current high latitude orbit. Given the
current estimates on its distance, proper motion and radial velocity, we
back-trace the orbit of XTE J1118+480 in the Galactic potential to infer the
peculiar velocity of the system at different disk crossings over the last 5
Gyr. Taking into account the uncertainties on the velocity components, we infer
an average peculiar velocity of 183 \pm 31 km/s. The maximum velocity which the
binary can acquire by symmetric supernova mass loss is about 100 km/s, which is
2.7 sigma away from the mean of the peculiar velocity distribution. We
therefore argue that an additional asymmetric kick velocity is required. By
considering the orientation of the system relative to the plane of the sky, we
derive a 95% probability for a non null component of the kick perpendicular to
the orbital plane of the binary. The distribution of perpendicular velocities
is skewed to lower velocities with an average of 93^{+55}_{-60} km/s.
Baumgardt H, Gualandris A, Zwart SP (2006) Ejection of hyper-velocity stars by intermediate-mass black holes, Journal of Physics: Conference Series 54 (1) pp. 301-305
We have performed N-body simulations of the formation of hyper-velocity stars (HVS) in the centre of the Milky Way due to inspiralling intermediate-mass black holes (IMBHs). We find that due to dynamical friction, IMBHs sink into the centre of the Galaxy where they deplete the central cusp of stars. Some of these stars become HVS and are ejected with velocities sufficiently high to escape the Galaxy. Our simulations show that HVS are generated in short bursts which last only a few Myrs until the IMBH is swallowed by the supermassive black hole (SMBH). After the HVS have reached the galactic halo, their escape velocities correlate with the distance from the Galactic centre in the sense that the fastest HVS can be found furthest away from the centre. Finally, our simulations show that the presence of an IMBH in the Galactic centre changes the stellar density distribution inside r
Merritt D, Gualandris A, Mikkola S (2008) Explaining the Orbits of the Galactic Center S-Stars, Astrophysical Journal Letters, 693, L35 (2009)
The young stars near the supermassive black hole at the galactic center
follow orbits that are nearly random in orientation and that have an
approximately thermal distribution of eccentricities, N(e) ~ e. We show that
both of these properties are a natural consequence of a few million years'
interaction with an intermediate-mass black hole (IBH), if the latter's orbit
is mildly eccentric and if its mass exceeds approximately 1500 solar masses.
Producing the most tightly-bound S-stars requires an IBH orbit with periastron
distance less than about 10 mpc. Our results provide support for a model in
which the young stars are carried to the galactic center while bound to an IBH,
and are consistent with the hypothesis that an IBH may still be orbiting within
the nuclear star cluster.
Colpi M, Possenti A, Gualandris A (2002) The case of PSR J1911-5958A in the outskirts of NGC 6752: signature of a
black hole binary in the cluster core?,
We have investigated different scenarios for the origin of the binary
millisecond pulsar PSR J1911-5958A in NGC 6752, the most distant pulsar
discovered from the core of a globular cluster to date. The hypothesis that it
results from a truly primordial binary born in the halo calls for
accretion-induced collapse and negligible recoil speed at the moment of neutron
star formation. Scattering or exchange interactions off cluster stars are not
consistent with both the observed orbital period and its offset position. We
show that a binary system of two black holes with (unequal) masses in the range
of 3-100 solar masses can live in NGC 6752 until present time and can have
propelled PSR J1911-5958A into an eccentric peripheral orbit during the last ~1
Gyr.
Baumgardt H, Gualandris A, Zwart SP (2006) Ejection of Hyper-Velocity Stars from the Galactic Centre by
Intermediate-Mass Black Holes,
Mon.Not.Roy.Astron.Soc. 372 pp. 174-182
We have performed N-body simulations of the formation of hyper-velocity stars
(HVS) in the centre of the Milky Way due to inspiralling intermediate-mass
black holes (IMBHs). We considered IMBHs of different masses, all starting from
circular orbits at an initial distance of 0.1 pc.
We find that the IMBHs sink to the centre of the Galaxy due to dynamical
friction, where they deplete the central cusp of stars. Some of these stars
become HVS and are ejected with velocities sufficiently high to escape the
Galaxy. Since the HVS carry with them information about their origin, in
particular in the moment of ejection, the velocity distribution and the
direction in which they escape the Galaxy, detecting a population of HVS will
provide insight in the ejection processes and could therefore provide indirect
evidence for the existence of IMBHs.
Our simulations show that HVS are generated in short bursts which last only a
few Myrs until the IMBH is swallowed by the supermassive black hole (SMBH). HVS
are ejected almost isotropically, which makes IMBH induced ejections hard to
distinguish from ejections due to encounters of stellar binaries with a SMBH.
After the HVS have reached the galactic halo, their escape velocities correlate
with the distance from the Galactic centre in the sense that the fastest HVS
can be found furthest away from the centre. The velocity distribution of HVS
generated by inspiralling IMBHs is also nearly independent of the mass of the
IMBH and can be quite distinct from one generated by binary encounters.
Finally, our simulations show that the presence of an IMBH in the Galactic
centre changes the stellar density distribution inside r profile, which takes at least 100 Myrs to replenish.
Petts JA, Gualandris A, Read JI (2015) A semi-analytic dynamical friction model that reproduces core stalling, MONTHLY NOTICES OF THE ROYAL ASTRONOMICAL SOCIETY 454 (4) pp. 3778-3791 OXFORD UNIV PRESS
Harfst S, Gualandris A, Merritt D, Mikkola S (2008) A Hybrid N-Body Code Incorporating Algorithmic Regularization and
Post-Newtonian Forces,
Monthly Notices of the Royal Astronomical Society
We describe a novel N-body code designed for simulations of the central
regions of galaxies containing massive black holes. The code incorporates
Mikkola's 'algorithmic' chain regularization scheme including post-Newtonian
terms up to PN2.5 order. Stars moving beyond the chain are advanced using a
fourth-order integrator with forces computed on a GRAPE board. Performance
tests confirm that the hybrid code achieves better energy conservation, in less
elapsed time, than the standard scheme and that it reproduces the orbits of
stars tightly bound to the black hole with high precision. The hybrid code is
applied to two sample problems: the effect of finite-N gravitational
fluctuations on the orbits of the S-stars; and inspiral of an intermediate-mass
black hole into the galactic center.
Mapelli M, Ripamonti E, Vecchio A, Graham AW, Gualandris A (2012) A cosmological view of extreme mass-ratio inspirals in nuclear star clusters, Astronomy and Astrophysics 542
There is increasing evidence that many galaxies host both a nuclear star cluster (NC) and a super-massive black hole (SMBH). Their coexistence is particularly prevalent in spheroids with stellar mass 10 8-10 10 M ?. We study the possibility that a stellar-mass black hole (BH) hosted by a NC inspirals and merges with the central SMBH. Due to the high stellar density in NCs, extreme mass-ratio inspirals (EMRIs) of BHs onto SMBHs in NCs may be important sources of gravitational waves (GWs). We consider sensitivity curves for three different space-based GW laser interferometric mission concepts: the Laser Interferometer Space Antenna (LISA), the New Gravitational wave Observatory (NGO) and the DECi-hertz Interferometer Gravitational wave Observatory (DECIGO). We predict that, under the most optimistic assumptions, LISA and DECIGO will detect up to thousands of EMRIs in NCs per year, while NGO will observe up to tens of EMRIs per year. We explore how a number of factors may affect the predicted rates. In particular, if we assume that the mass of the SMBH scales with the square of the host spheroid mass in galaxies with NCs, rather than a linear scaling, then the event rates are more than a factor of 10 lower for both LISA and NGO, while they are almost unaffected in the case of DECIGO. © 2012 ESO.
Gvaramadze VV, Gualandris A, Zwart SP (2007) Hyperfast pulsars as the remnants of massive stars ejected from young
star clusters,
Mon.Not.Roy.Astron.Soc. 385 pp. 929-938
Recent proper motion and parallax measurements for the pulsar PSR B1508+55
indicate a transverse velocity of ~1100 km/s, which exceeds earlier
measurements for any neutron star. The spin-down characteristics of PSR
B1508+55 are typical for a non-recycled pulsar, which implies that the velocity
of the pulsar cannot have originated from the second supernova disruption of a
massive binary system. The high velocity of PSR B1508+55 can be accounted for
by assuming that it received a kick at birth or that the neutron star was
accelerated after its formation in the supernova explosion. We propose an
explanation for the origin of hyperfast neutron stars based on the hypothesis
that they could be the remnants of a symmetric supernova explosion of a
high-velocity massive star which attained its peculiar velocity (similar to
that of the pulsar) in the course of a strong dynamical three- or four-body
encounter in the core of dense young star cluster. To check this hypothesis we
investigated three dynamical processes involving close encounters between: (i)
two hard massive binaries, (ii) a hard binary and an intermediate-mass black
hole, and (iii) a single star and a hard binary intermediate-mass black hole.
We find that main-sequence O-type stars cannot be ejected from young massive
star clusters with peculiar velocities high enough to explain the origin of
hyperfast neutron stars, but lower mass main-sequence stars or the stripped
helium cores of massive stars could be accelerated to hypervelocities. Our
explanation for the origin of hyperfast pulsars requires a very dense stellar
environment of the order of 10^6 -10^7 stars pc^{-3}. Although such high
densities may exist during the core collapse of young massive star clusters, we
caution that they have never been observed.
Mapelli M, Gualandris A, Hayfield T (2013) Perturbations induced by a molecular cloud on the young stellar disc in
the Galactic Centre,
The Galactic centre (GC) is a crowded environment: observations have revealed
the presence of (molecular, atomic and ionized) gas, of a cusp of late-type
stars, and of ~100 early-type stars, about half of which lying in one or
possibly two discs. In this paper, we study the perturbations exerted on a thin
stellar disc (with outer radius ~0.4 pc) by a molecular cloud that falls
towards the GC and is disrupted by the supermassive black hole (SMBH). The
initial conditions for the stellar disc were drawn from the results of previous
simulations of molecular cloud infall and disruption in the SMBH potential. We
find that most of the gas from the disrupted molecular cloud settles into a
dense and irregular disc surrounding the SMBH. If the gas disc and the stellar
disc are slightly misaligned (~5-20 deg), the precession of the stellar orbits
induced by the gas disc significantly increases the inclinations of the stellar
orbits (by a factor of ~3-5 in 1.5 Myr) with respect to the normal vector to
the disc. Furthermore, the distribution of orbit inclinations becomes
significantly broader. These results might be the clue to explain the broad
distribution of observed inclinations of the early-type stars with respect to
the normal vector of the main disc. We discuss the implications for the
possibility that fresh gas was accreted by the GC after the formation of the
disc(s) of early-type stars.
Mapelli M, Gualandris A (2015) Star Formation and Dynamics in the Galactic Centre,
The centre of our Galaxy is one of the most studied and yet enigmatic places
in the Universe. At a distance of about 8 kpc from our Sun, the Galactic centre
(GC) is the ideal environment to study the extreme processes that take place in
the vicinity of a supermassive black hole (SMBH). Despite the hostile
environment, several tens of early-type stars populate the central parsec of
our Galaxy. A fraction of them lie in a thin ring with mild eccentricity and
inner radius ~0.04 pc, while the S-stars, i.e. the ~30 stars closest to the
SMBH ( formation of such early-type stars has been a puzzle for a long time: molecular
clouds should be tidally disrupted by the SMBH before they can fragment into
stars. We review the main scenarios proposed to explain the formation and the
dynamical evolution of the early-type stars in the GC. In particular, we
discuss the most popular in situ scenarios (accretion disc fragmentation and
molecular cloud disruption) and migration scenarios (star cluster inspiral and
Hills mechanism). We focus on the most pressing challenges that must be faced
to shed light on the process of star formation in the vicinity of a SMBH.
Pontzen A, Read J, Teyssier R, Governato F, Gualandris A, Roth N, Devriendt J (2015) Milking the spherical cow: on aspherical dynamics in spherical
coordinates,
MNRAS 2015
Galaxies and the dark matter halos that host them are not spherically
symmetric, yet spherical symmetry is a helpful simplifying approximation for
idealised calculations and analysis of observational data. The assumption leads
to an exact conservation of angular momentum for every particle, making the
dynamics unrealistic. But how much does that inaccuracy matter in practice for
analyses of stellar distribution functions, collisionless relaxation, or dark
matter core-creation?
We provide a general answer to this question for a wide class of aspherical
systems; specifically, we consider distribution functions that are "maximally
stable", i.e. that do not evolve at first order when external potentials (which
arise from baryons, large scale tidal fields or infalling substructure) are
applied. We show that a spherically-symmetric analysis of such systems gives
rise to the false conclusion that the density of particles in phase space is
ergodic (a function of energy alone).
Using this idea we are able to demonstrate that: (a) observational analyses
that falsely assume spherical symmetry are made more accurate by imposing a
strong prior preference for near-isotropic velocity dispersions in the centre
of spheroids; (b) numerical simulations that use an idealised
spherically-symmetric setup can yield misleading results and should be avoided
where possible; and (c) triaxial dark matter halos (formed in collisionless
cosmological simulations) nearly attain our maximally-stable limit, but their
evolution freezes out before reaching it.
Gualandris A, Zwart SP, Sipior M (2005) Three-body encounters in the Galactic centre: the origin of the
hypervelocity star SDSS J090745.0+024507,
Mon.Not.Roy.Astron.Soc. 363 pp. 223-228
Hills (1988) predicted that runaway stars could be accelerated to velocities
larger than 1000 km/s by dynamical encounters with the supermassive black hole
(SMBH) in the Galactic center. The recently discovered hypervelocity star SDSS
J090745.0+024507 (hereafter HVS) is escaping the Galaxy at high speed and could
be the first object in this class. With the measured radial velocity and the
estimated distance to the HVS, we trace back its trajectory in the Galactic
potential. Assuming it was ejected from the center, we find that a $\sim$ 2
mas/yr proper motion is necessary for the star to have come within a few
parsecs of the SMBH. We perform three-body scattering experiments to constrain
the progenitor encounter which accelerated the HVS. As proposed by Yu &
Tremaine (2003), we consider the tidal disruption of binary systems by the SMBH
and the encounter between a star and a binary black hole, as well as an
alternative scenario involving intermediate mass black holes. We find that the
tidal disruption of a stellar binary ejects stars with a larger velocity
compared to the encounter between a single star and a binary black hole, but
has a somewhat smaller ejection rate due to the greater availability of single
stars.
Gaburov E, Gualandris A, Zwart SP (2007) On the onset of runaway stellar collisions in dense star clusters I.
Dynamics of the first collision,
We study the circumstances under which first collisions occur in young and
dense star clusters. The initial conditions for our direct $N$-body simulations
are chosen such that the clusters experience core collapse within a few million
years, before the most massive stars have left the main-sequence. It turns out
that the first collision is typically driven by the most massive stars in the
cluster. Upon arrival in the cluster core, by dynamical friction, massive stars
tend to form binaries. The enhanced cross section of the binary compared to a
single star causes other stars to engage the binary. A collision between one of
the binary components and the incoming third star is then mediated by the
encounters between the binary and other cluster members. Due to the geometry of
the binary-single star engagement the relative velocity at the moment of impact
is substantially different than in a two-body encounter. This may have profound
consequences for the further evolution of the collision product.
Gualandris A, Mapelli M, Perets HB (2012) Eccentric disc instability in stellar discs formed from inspiralling gas clouds in the Galactic Centre, Monthly Notices of the Royal Astronomical Society 427 (2) pp. 1793-1799
The inspiral of a turbulent molecular cloud in the Galactic Centre may result in the formation of a small, dense and moderately eccentric gas disc around the supermassive black hole (SMBH). Such a disc is unstable to fragmentation and may lead to the formation of young massive stars in the central parsec of the Galaxy. Here we perform high-accuracy direct summation N-body simulations of a ring of massive stars (with initial semimajor axes 0.1 d a(pc) d 0.4 and eccentricities 0.2 d e d 0.4), subject to the potential of the SMBH, a stellar cusp and the parent gas disc, to study how the orbital elements of the ring evolve in time. The initial conditions for the stellar ring are drawn from the results of previous simulations of molecular cloud infall and disruption in the SMBH potential. While semimajor axes do not evolve significantly, the distribution of eccentricities spreads out very fast (H1Myr) as a consequence of cusp precession. In particular, stellar orbits with initial eccentricity e > 0.3 (e
Gualandris A, Merritt D (2011) Long-term evolution of massive black hole binaries. IV. Mergers of galaxies with collisionally relaxed nuclei, Astrophysical Journal 744 (1)
We simulate mergers between galaxies containing collisionally relaxed nuclei around massive black holes (MBHs). Our galaxies contain four mass groups, representative of old stellar populations; a primary goal is to understand the distribution of stellar-mass black holes (BHs) after the merger. Mergers are followed using direct-summation N-body simulations, assuming a mass ratio of 1:3 and two different orbits. Evolution of the binary MBH is followed until its separation has shrunk by a factor of 20 below the hard-binary separation. During the galaxy merger, large cores are carved out in the stellar distribution, with radii several times the influence radius of the massive binary. Much of the pre-existing mass segregation is erased during this phase. We follow the evolution of the merged galaxies for approximately three central relaxation times after coalescence of the massive binary; both standard and top-heavy mass functions are considered. The cores that were formed in the stellar distribution persist, and the distribution of the stellar-mass BHs evolves against this essentially fixed background. Even after one central relaxation time, these models look very different from the relaxed, multi-mass models that are often assumed to describe the distribution of stars and stellar remnants near a massive BH. While the stellar BHs do form a cusp on roughly a relaxation timescale, the BH density can be much smaller than in those models. We discuss the implications of our results for the extreme-mass-ratio inspiral problem and for the existence of Bahcall-Wolf cusps.
Perets HB, Gualandris A (2010) Dynamical constraints on the origin of the young B-stars in the Galactic center, Astrophysical Journal 719 (1) pp. 220-228
Regular star formation is thought to be inhibited close to the massive black hole (MBH) in the Galactic center. Nevertheless, tens of young main-sequence B-stars have been observed in an isotropic distribution close to it. These stars are observed to have an apparently continuous distribution from very close to the MBH (
Perets HB, Gualandris A, Kupi G, Merritt D, Alexander T (2009) Dynamical evolution of the young stars in the galactic center: N-body simulations of the s-stars, Astrophysical Journal 702 (2) pp. 884-889
We use Newtonian N-body simulations to study the evolution of the orbital eccentricities of stars deposited near (r0.05 pc) the Milky Way massive black hole (MBH), starting from initial conditions motivated by two competing models for their origin: formation in a disk followed by inward migration and exchange interactions involving a binary star. The first model predicts modest eccentricities, lower than those observed in the S-star cluster, while the second model predicts higher eccentricities than observed. The Newtonian N-body simulations include a dense cluster of 10 M  stellar-mass black holes (SBHs), expected to accumulate near the MBH by mass segregation. Perturbations from the SBHs tend to randomize the stellar orbits, partially erasing the dynamical signatures of their origin. The eccentricities of the initially highly eccentric stars evolve, in 20 Myr (the S-star lifespan), to a distribution that is consistent with the observed eccentricity distribution. In contrast, the eccentricities of the initially more circular orbits fail to evolve to the observed values in 20 Myr, arguing against the disk migration scenario. We find that 20%-30% of the S-stars are tidally disrupted by the MBH over their lifetimes, and that the S-stars are not likely to be ejected as hypervelocity stars outside the central 0.05 pc by close encounters with SBHs. © 2009 The American Astronomical Society. All rights reserved.
Lützgendorf N, Gualandris A, Kissler-Patig M, Gebhardt K, Baumgardt H, Noyola E, Kruijssen JMD, Jalali B, De Zeeuw PT, Neumayer N (2012) High-velocity stars in the cores of globular clusters: The illustrative case of NGC 2808, Astronomy and Astrophysics 543
Context. We report the detection of five high-velocity stars in the core of the globular cluster NGC 2808. The stars lie on the red giant branch and show total velocities between 40 and 45 km s -1. For a core velocity dispersion Ã c = 13.4 km s -1, this corresponds to up to 3.4Ã c. These velocities are close to the estimated escape velocity (
Gvaramadze VV, Gualandris A, Portegies Zwart S (2009) High-velocity runaway stars from three-body encounters, Proceedings of the International Astronomical Union 5 (S266) pp. 413-416
We performed numerical simulations of dynamical encounters between hard, massive binaries and a very massive star (VMS; formed through runaway mergers of ordinary stars in the dense core of a young massive star cluster) to explore the hypothesis that this dynamical process could be responsible for the origin of high-velocity (e 200 - 400 km s-1) early or late B-type stars. We estimated the typical velocities produced in encounters between very tight massive binaries and VMSs (of mass of e 200 M.) and found that about 3 - 4% of all encounters produce velocities e 400 kms -1, while in about 2% of encounters the escapers attain velocities exceeding the Milky Ways's escape velocity. We therefore argue that the origin of high-velocity (e 200 - 400 kms-1) runaway stars and at least some so-called hypervelocity stars could be associated with dynamical encounters between the tightest massive binaries and VMSs formed in the cores of star clusters. We also simulated dynamical encounters between tight massive binaries and single ordinary 50 - 100 M. stars. We found that from 1 to H 4% of these encounters can produce runaway stars with velocities of e 300 - 400 km s-1 (typical of the bound population of high-velocity halo B-type stars) and occasionally (in less than 1% of encounters) produce hypervelocity (e 700 kms-1) late B-type escapers. © International Astronomical Union 2010.
Gualandris A, Read JI, Dehnen W, Bortolas E (2017) Collisionless loss-cone refilling: there is no final parsec problem, Monthly Notices of the Royal Astronomical Society 464 (2) pp. 2301-2310
Coalescing massive black hole binaries, formed during galaxy mergers, are expected to be a primary source of low-frequency gravitational waves. Yet in isolated gas-free spherical stellar systems, the hardening of the binary stalls at parsec-scale separations owing to the inefficiency of relaxation-driven loss-cone refilling. Repopulation via collisionless orbit diffusion in triaxial systems is more efficient, but published simulation results are contradictory. While sustained hardening has been reported in simulations of galaxy mergers with N
Antonini F, Faber J, Gualandris A, Merritt D (2009) Tidal breakup of binary stars at the galactic center and its consequences, Astrophysical Journal 713 (1) pp. 90-104
The tidal breakup of binary star systems by the supermassive black hole (SMBH) in the center of the galaxy has been suggested as the source of both the observed sample of hypervelocity stars (HVSs) in the halo of the Galaxy and the S stars that remain in tight orbits around Sgr A*. Here, we use a post-Newtonian N-body code to study the dynamics of main-sequence binaries on highly elliptical bound orbits whose periapsides lie close to the SMBH, determining the properties of ejected and bound stars as well as collision products. Unlike previous studies, we follow binaries that remain bound for several revolutions around the SMBH, finding that in the case of relatively large periapsides and highly inclined binaries the Kozai resonance can lead to large periodic oscillations in the internal binary eccentricity and inclination. Collisions and mergers of the binary elements are found to increase significantly for multiple orbits around the SMBH, while HVSs are primarily produced during a binary's first passage. This process can lead to stellar coalescence and eventually serve as an important source of young stars at the Galactic center. © 2010. The American Astronomical Society. All rights reserved.
Gualandris A, Zwart SP, Eggleton PP (2004) N-body simulations of stars escaping from the Orion nebula, Mon.Not.Roy.Astron.Soc. 350
We study the dynamical interaction in which the two single runaway stars AE
Aurigae and mu Columbae and the binary iota Orionis acquired their unusually
high space velocity. The two single runaways move in almost opposite directions
with a velocity greater than 100 km/s away from the Trapezium cluster. The star
iota Ori is an eccentric (e=0.8) binary moving with a velocity of about 10 km/s
at almost right angles with respect to the two single stars. The kinematic
properties of the system suggest that a strong dynamical encounter occurred in
the Trapezium cluster about 2.5 Myr ago. Curiously enough, the two binary
components have similar spectral type but very different masses, indicating
that their ages must be quite different. This observation leads to the
hypothesis that an exchange interaction occurred in which an older star was
swapped into the original iota Orionis binary. We test this hypothesis by a
combination of numerical and theoretical techniques, using N-body simulations
to constrain the dynamical encounter, binary evolution calculations to
constrain the high orbital eccentricity of iota Orionis and stellar evolution
calculations to constrain the age discrepancy of the two binary components. We
find that an encounter between two low eccentricity (0.4 comparable binding energy, leading to an exchange and the ionization of the
wider binary, provides a reasonable solution to this problem.
Gualandris A, Merritt D (2009) Perturbations of Intermediate-mass Black Holes on Stellar Orbits in the
Galactic Center,
Astrophys.J. 705 pp. 361-371
We study the short- and long-term effects of an intermediate mass black hole
(IMBH) on the orbits of stars bound to the supermassive black hole (SMBH) at
the center of the Milky Way. A regularized N-body code including post-Newtonian
terms is used to carry out direct integrations of 19 stars in the S-star
cluster for 10 Myr. The mass of the IMBH is assigned one of four values from
400 Msun to 4000 Msun, and its initial semi-major axis with respect to the SMBH
is varied from 0.3-30 mpc, bracketing the radii at which inspiral of the IMBH
is expected to stall. We consider two values for the eccentricity of the
IMBH/SMBH binary, e=(0,0.7), and 12 values for the orientation of the binary's
plane. Changes at the level of 1% in the orbital elements of the S-stars could
occur in just a few years if the IMBH is sufficiently massive. On time scales
of 1 Myr or longer, the IMBH efficiently randomizes the eccentricities and
orbital inclinations of the S-stars. Kozai oscillations are observed when the
IMBH lies well outside the orbits of the stars. Perturbations from the IMBH can
eject stars from the cluster, producing hypervelocity stars, and can also
scatter stars into the SMBH; stars with high initial eccentricities are most
likely to be affected in both cases. The distribution of S-star orbital
elements is significantly altered from its currently-observed form by IMBHs
with masses greater than 1000 Msun if the IMBH/SMBH semi-major axis lies in the
range 3-10 mpc. We use these results to further constrain the allowed
parameters of an IMBH/SMBH binary at the Galactic center.
Zwart SP, McMillan S, Groen D, Gualandris A, Sipior M, Vermin W (2007) A parallel gravitational N-body kernel,
We describe source code level parallelization for the {\tt kira} direct
gravitational $N$-body integrator, the workhorse of the {\tt starlab}
production environment for simulating dense stellar systems. The
parallelization strategy, called j-parallelization'', involves the partition
of the computational domain by distributing all particles in the system among
the available processors. Partial forces on the particles to be advanced are
calculated in parallel by their parent processors, and are then summed in a
final global operation. Once total forces are obtained, the computing elements
proceed to the computation of their particle trajectories. We report the
results of timing measurements on four different parallel computers, and
compare them with theoretical predictions. The computers employ either a
high-speed interconnect, a NUMA architecture to minimize the communication
overhead or are distributed in a grid. The code scales well in the domain
tested, which ranges from 1024 - 65536 stars on 1 - 128 processors, providing
satisfactory speedup. Running the production environment on a grid becomes
inefficient for more than 60 processors distributed across three sites.
Perets HB, Gualandris A, Merritt D, Alexander T (2008) Dynamical evolution of the young stars in the Galactic center,
Recent observations of the Galactic center revealed a nuclear disk of young
OB stars near the massive black hole (MBH), in addition to many similar
outlying stars with higher eccentricities and/or high inclinations relative to
the disk (some of them possibly belonging to a second disk). In addition,
observations show the existence of young B stars (the 'S-cluster') in an
isotropic distribution in the close vicinity of the MBH (\$ extended N-body simulations to probe the dynamical evolution of these two
populations. We show that the stellar disk could have evolved to its currently
observed state from a thin disk of stars formed in a gaseous disk, and that the
dominant component in its evolution is the interaction with stars in the cusp
around the MBH. We also show that the currently observed distribution of the
S-stars could be consistent with a capture origin through 3-body binary-MBH
interactions. In this scenario the stars are captured at highly eccentric
orbits, but scattering by stellar black holes could change their eccentricity
distribution to be consistent with current observations.
Gvaramadze VV, Gualandris A (2010) Very massive runaway stars from three-body encounters, Monthly Notices of the Royal Astronomical Society 410 (1) pp. 304-312
Very massive stars preferentially reside in the cores of their parent clusters and form binary or multiple systems. We study the role of tight very massive binaries in the origin of the field population of very massive stars. We performed numerical simulations of dynamical encounters between single (massive) stars and a very massive binary with parameters similar to those of the most massive known Galactic binaries, WR 20a and NGC 3603-A1. We found that these three-body encounters could be responsible for the origin of high peculiar velocities (e70 km s-1) observed for some very massive (e60-70 M/) runaway stars in the Milky Way and the Large Magellanic Cloud (e.g. » Cep, BD+43°3654, Sk -67°22, BI 237, 30 Dor 016), which can hardly be explained within the framework of the binary-supernova scenario. The production of high-velocity massive stars via three-body encounters is accompanied by the recoil of the binary in the opposite direction to the ejected star. We show that the relative position of the very massive binary R145 and the runaway early B-type star Sk-69°206 on the sky is consistent with the possibility that both objects were ejected from the central cluster, R136, of the star-forming region 30 Doradus via the same dynamical event - a three-body encounter. © 2010 The Authors. Journal compilation © 2010 RAS.
Kouwenhoven T, Brown A, Zinnecker H, Kaper L, Zwart SP, Gualandris A (2003) A search for close companions in Sco OB2,
Using adaptive optics we study the binary population in the nearby OB
association Scorpius OB2. We present the first results of our near-infrared
adaptive optics survey among 199 (mainly) A- and B-type stars in Sco OB2. In
total 151 components other than the target stars are found, out of which 77 are
probably background stars. Our findings are compared with data collected from
literature. Out of the remaining 74 candidate physical companions 42 are new,
demonstrating that many stars A/B stars have faint, close companions.
Gvaramadze VV, Gualandris A, Zwart SP (2009) On the origin of high-velocity runaway stars, Monthly Notices of the Royal Astronomical Society 396 (1) pp. 570-578
We explore the hypothesis that some high-velocity runaway stars attain their peculiar velocities in the course of exchange encounters between hard massive binaries and a very massive star (either an ordinary 50-100 M  star or a more massive one, formed through runaway mergers of ordinary stars in the core of a young massive star cluster). In this process, one of the binary components becomes gravitationally bound to the very massive star, while the second one is ejected, sometimes with a high speed. We performed three-body scattering experiments and found that early B-type stars (the progenitors of the majority of neutron stars) can be ejected with velocities of s200-400 km s-1 (typical of pulsars), while 3-4 M  stars can attain velocities of s300-400 km s-1 (typical of the bound population of halo late B-type stars). We also found that the ejected stars can occasionally attain velocities exceeding the Milky Ways's escape velocity. © 2009 RAS.
Gualandris A, Harfst S, Merritt D, Mikkola S (2008) Evolution of stellar orbits in the Galactic centre, Astronomische Nachrichten 329 (9-10) pp. 1008-1011
We describe a novel N-body code designed for simulations of the central regions of galaxies containing massive black holes. The code incorporates Mikkola's "algorithmic" chain regularization scheme including post-Newtonian terms up to PN2.5 order. Stars moving beyond the chain are advanced using a fourth-order integrator with forces computed on a GRAPE board. Performance tests confirm that the hybrid code achieves better energy conservation, in less elapsed time, than the standard scheme and that it reproduces the orbits of stars tightly bound to the black hole with high precision. The hybrid code is applied to two sample problems: the effect of finite-N gravitational fluctuations on the orbits of the S-stars; and inspiral of an intermediate-mass black hole into the galactic centre. © 2008 WILEY-VCH Verlag GmbH & Co. KGaA.
Spurzem R, Berentzen I, Berczik P, Merritt D, Amaro-Seoane P, Harfst S, Gualandris A (2008) Parallelization, special hardware and post-newtonian dynamics in direct N-Body simulations, Lecture Notes in Physics 760 pp. 377-389
Sesana A, Gualandris A, Dotti M (2011) Massive black hole binary eccentricity in rotating stellar systems, Monthly Notices of the Royal Astronomical Society: Letters 415 (1)
In this Letter we study the eccentricity evolution of a massive black hole (MBH) binary (MBHB) embedded in a rotating stellar cusp. Following the observation that stars on counter-rotating (with respect to the MBHB) orbits extract angular momentum from the binary more efficiently than their corotating counterparts, the eccentricity evolution of the MBHB must depend on the degree of corotation (counter-rotation) of the surrounding stellar distribution. Using an hybrid scheme that couples numerical three-body scatterings to an analytical formalism for the cusp-binary interaction, we verify this hypothesis by evolving the MBHB in spherically symmetric cusps with different fractionsof corotating stars. Consistent with previous works, binaries in isotropic cusps () tend to increase their eccentricity, and whenapproaches zero (counter-rotating cusps) the eccentricity rapidly increases to almost unity. Conversely, binaries in cusps with a significant degree of corotation () tend to become less and less eccentric, circularizing quite quickly forapproaching unity. DirectN-body integrations performed to test the theory corroborate the results of the hybrid scheme, at least at a qualitative level. We discuss quantitative differences, ascribing their origin to the oversimplified nature of the hybrid approach. © 2011 The Authors Monthly Notices of the Royal Astronomical Society © 2011 RAS.
Harfst S, Gualandris A, Merritt D, Spurzem R, Zwart SP, Berczik P (2006) Performance Analysis of Direct N-Body Algorithms on Special-Purpose
Supercomputers,
NewAstron. 12 pp. 357-377
Direct-summation N-body algorithms compute the gravitational interaction
between stars in an exact way and have a computational complexity of O(N^2).
Performance can be greatly enhanced via the use of special-purpose accelerator
boards like the GRAPE-6A. However the memory of the GRAPE boards is limited.
Here, we present a performance analysis of direct N-body codes on two parallel
supercomputers that incorporate special-purpose boards, allowing as many as
four million particles to be integrated. Both computers employ high-speed,
Infiniband interconnects to minimize communication overhead, which can
otherwise become significant due to the small number of "active" particles at
each time step. We find that the computation time scales well with processor
number; for 2*10^6 particles, efficiencies greater than 50% and speeds in
excess of 2 TFlops are reached.
Gualandris A, Gillessen S, Merritt D (2010) The Galactic Centre star S2 as a dynamical probe for intermediate-mass black holes, Monthly Notices of the Royal Astronomical Society 409 (3) pp. 1146-1154
We study the short-term effects of an intermediate-mass black hole (IBH) on the orbit of star S2 (S02), the shortest period star known to orbit the supermassive black hole (MBH) in the centre of the Milky Way. Near-infrared imaging and spectroscopic observations allow an accurate determination of the orbit of the star. Given S2's short orbital period and large eccentricity, general relativity (GR) needs to be taken into account, and its effects are potentially measurable with current technology. We show that perturbations due to an IBH in orbit around the MBH can produce a shift in the apoapsis of S2 that is as large or even larger than the GR shift. An IBH will also induce changes in the plane of S2's orbit at a level as large as 1° per period. We apply observational orbital fitting techniques to simulations of the S-cluster in the presence of an IBH and find that an IBH more massive than about 1000 M at the distance of the S-stars will be detectable at the next periapse passage of S2, which will occur in 2018. © 2010 The Authors. Journal compilation © 2010 RAS.
Colpi M, Gualandris A, Possenti A (2002) Is NGC6752 hiding a double black hole binary in its core ?,
NGC6752 hosts in its halo PSR J1911-5958A, a newly discovered binary
millisecond pulsar which is the most distant pulsar ever known from the core of
a globular cluster. Interestingly, its recycling history seems in conflict with
a scenario of ejection resulting from ordinary stellar dynamical encounters. A
scattering event off a binary system of two black holes with masses in the
range of 3-50 solar masses that propelled PSR J1911-5958A into its current
peripheral orbit seems more likely. It is still an observational challenge to
unveil the imprint(s) left from such a dark massive binary on cluster's stars:
PSR J1911-5958A may be the first case.
Kouwenhoven MBN, Brown AGA, Gualandris A, Kaper L, Zwart SFP, Zinnecker H (2003) The Primordial Binary Population in OB Associations,
For understanding the process of star formation it is essential to know how
many stars are formed as singles or in multiple systems, as a function of
environment and binary parameters. This requires a characterization of the
primordial binary population, which we define as the population of binaries
that is present just after star formation has ceased, but before dynamical and
stellar evolution have significantly altered its characteristics. In this
article we present the first results of our adaptive optics survey of 200
(mainly) A-type stars in the nearby OB association Sco OB2. We report the
discovery of 47 new candidate companions of Sco OB2 members. The next step will
be to combine these observations with detailed simulations of young star
clusters, in order to find the primordial binary population.
Gvaramadze VV, Gualandris A, Zwart SP (2007) On the origin of hyperfast neutron stars, IAU Symp. 246 pp. 365-366
We propose an explanation for the origin of hyperfast neutron stars (e.g. PSR
B1508+55, PSR B2224+65, RX J0822-4300) based on the hypothesis that they could
be the remnants of a symmetric supernova explosion of a high-velocity massive
star (or its helium core) which attained its peculiar velocity (similar to that
of the neutron star) in the course of a strong three- or four-body dynamical
encounter in the core of a young massive star cluster. This hypothesis implies
that the dense cores of star clusters (located either in the Galactic disk or
near the Galactic centre) could also produce the so-called hypervelocity stars
-- the ordinary stars moving with a speed of ~1000 km/s.
Gualandris A, Zwart SP (2006) A hypervelocity star from the Large Magellanic Cloud, Mon.Not.Roy.Astron.Soc.Lett. 376 pp. L29-L33
We study the acceleration of the star HE0437-5439, to hypervelocity and
discuss its possible origin in the Large Magellanic Cloud (LMC). The star has a
radial velocity of 723 km/s and is located at a distance of 61 kpc from the
Sun. With a mass of about 8 Msun, the travel time from the Galactic centre is
of about 100 Myr, much longer than its main sequence lifetime. Given the
relatively small distance to the LMC (18 kpc), we consider it likely that
HE0437-5439 originated in the cloud rather than in the Galactic centre, like
the other hypervelocity stars. The minimum ejection velocity required to travel
from the LMC to its current location within its lifetime is of about 500 km/s.
Such a high velocity can only be obtained in a dynamical encounter with a
massive black hole. We perform 3-body scattering simulations in which a stellar
binary encounters a massive black hole and find that a black hole more massive
than 1000 Msun is necessary to explain the high velocity of HE0437-5439. We
look for possible parent clusters for HE0437-5439 and find that NGC 2100 and
NGC 2004 are young enough to host stars coeval to HE0437-5439 and dense enough
to produce an intermediate mass black hole able to eject an 8 Msun star with
hypervelocity.
Gualandris A, Colpi M, Possenti A (2002) Unveiling black holes ejected from globular clusters,
Was the black hole in XTE J1118+480 ejected from a globular cluster or kicked
away from the galactic disk?
Gualandris A, Dotti M, Sesana A (2011) Massive black hole binary plane reorientation in rotating stellar systems, Monthly Notices of the Royal Astronomical Society: Letters 420 (1)
We study the evolution of the orientation of the orbital plane of massive black hole binaries (BHBs) in rotating stellar systems in which the total angular momentum of the stellar cusp is misaligned with respect to that of the binary. We compare results from direct summation N-body simulations with predictions from a simple theoretical model. We find that the same encounters between cusp stars and the BHBs that are responsible for the hardening and eccentricity evolution of the binary lead to a reorientation of the binary orbital plane. In particular, binaries whose angular momentum is initially misaligned with respect to that of the stellar cusp tend to realign their orbital planes with the angular momentum of the cusp on a time-scale of a few hardening times. This is due to angular momentum exchange between stars and the BHBs during close encounters, and may have important implications for the relative orientation of host galaxies and radio jets. © 2012 The Authors Monthly Notices of the Royal Astronomical Society © 2012 RAS.
Gualandris A, Merritt D (2007) Dynamics around supermassive black holes,
The dynamics of galactic nuclei reflects the presence of supermassive black
holes (SBHs) in many ways. Single SBHs act as sinks, destroying a mass in stars
equal to their own mass in roughly one relaxation time and forcing nuclei to
expand. Formation of binary SBHs displaces a mass in stars roughly equal to the
binary mass, creating low-density cores and ejecting hyper-velocity stars.
Gravitational radiation recoil can eject coalescing binary SBHs from nuclei,
resulting in offset SBHs and lopsided cores. We review recent work on these
mechanisms and discuss the observable consequences.
Petts J, Gualandris A (2017) Infalling Young Clusters in the Galactic Centre: implications for IMBHs and young stellar populations, Monthly Notices of the Royal Astronomical Society 467 (4) pp. 3775-3787 Oxford University Press
The central parsec of the Milky Way hosts two puzzlingly young stellar populations, a tight isotropic distribution of B stars around SgrA* (the S-stars) and a disk of OB stars extending to 0.5 pc. Using a modified version of Sverre Aarseth?s direct summation code NBODY6 we explore the scenario in which a young star cluster migrates to the Galactic Centre within the lifetime of the OB disk population via dynamical friction. We find that star clusters massive and dense enough to reach the central parsec form a very massive star via physical collisions on a mass segregation timescale. We follow the evolution of the merger product using the most up to date, yet conservative, mass loss recipes for very massive stars. Over a large range of initial conditions, we find that the very massive star expels most of its mass via a strong stellar wind, eventually collapsing to form a black hole of mass 20?400M , incapable of bringing massive stars to the Galactic Centre. No massive intermediate mass black hole can form in this scenario. The presence of a star cluster in the central 10 pc within the last 15 Myr would also leave a 2 pc ring of massive stars, which is not currently observed. Thus, we conclude that the star cluster migration model is highly unlikely to be the origin of either young population, and in-situ formation models or binary disruptions are favoured.
Peuten M, Zocchi A, Gieles M, Gualandris A, Henault-Brunet V (2016) A stellar-mass black hole population in the globular cluster NGC 6101?, Monthly Notices of the Royal Astronomical Society 462 (3) pp. 2333-2342 Oxford University Press
Dalessandro et al. observed a similar distribution for blue straggler stars and main-sequence turn-off stars in the Galactic globular cluster NGC 6101, and interpreted this feature as an indication that this cluster is not mass-segregated. Using direct N-body simulations, we find that a significant amount of mass segregation is expected for a cluster with the mass, radius and age of NGC 6101. Therefore, the absence of mass segregation cannot be explained by the argument that the cluster is not yet dynamically evolved. By varying the retention fraction of stellar-mass black holes, we show that segregation is not observable in clusters with a high black hole retention fraction (>50 per cent after supernova kicks and >50 per cent after dynamical evolution). Yet all model clusters have the same amount of mass segregation in terms of the decline of the mean mass of stars and remnants with distance to the centre. We also discuss how kinematics can be used to further constrain the presence of a stellar-mass black hole population and distinguish it from the effect of an intermediate-mass black hole. Our results imply that the kick velocities of black holes are lower than those of neutron stars. The large retention fraction during its dynamical evolution can be explained if NGC 6101 formed with a large initial radius in a Milky Way satellite.
Petts J, Read JI, Gualandris A (2016) A semi-analytic dynamical friction model for cored galaxies, Monthly Notices of the Royal Astronomical Society 463 (1) pp. 858-869 Oxford University Press
We present a dynamical friction model based on Chandrasekhar?s formula that reproduces the fast inspiral and stalling experienced by satellites orbiting galaxies with a large constant density core. We show that the fast inspiral phase does not owe to resonance. Rather, it owes to the background velocity distribution function for the constant density core being dissimilar from the usually-assumed Maxwellian distribution. Using the correct background velocity distribution function and the semi-analytic model from Petts, Gualandris & Read (2015), we are able to correctly reproduce the infall rate in both cored and cusped potentials. However, in the case of large cores, our model is no longer able to correctly capture core-stalling. We show that this stalling owes to the tidal radius of the satellite approaching the size of the core. By switching off dynamical friction when rt(r) = r (where rt is the tidal radius at the satellite?s position) we arrive at a model which reproduces the N-body results remarkably well. Since the tidal radius can be very large for constant density background distributions, our model recovers the result that stalling can occur for Ms/Menc 1, where Ms and Menc are the mass of the satellite and the enclosed galaxy mass, respectively. Finally, we include the contribution to dynamical friction that comes from stars moving faster than the satellite. This next-to-leading order effect becomes the dominant driver of inspiral near the core region, prior to stalling.
Bortolas E, Gualandris A, Dotti M, Spera M, Mapelli M (2016) Brownian motion of massive black hole binaries and the final parsec problem, Monthly Notices of the Royal Astronomical Society 461 (1) pp. 1023-1031 Oxford University Press
Massive black hole binaries (BHBs) are expected to be one of the most powerful sources of gravitational waves in the frequency range of the pulsar timing array and of forthcoming space-borne detectors. They are believed to form in the final stages of galaxy mergers, and then harden by slingshot ejections of passing stars. However, evolution via the slingshot mechanism may be ineffective if the reservoir of interacting stars is not readily replenished, and the binary shrinking may come to a halt at roughly a parsec separation. Recent simulations suggest that the departure from spherical symmetry, naturally produced in merger remnants, leads to efficient loss cone refilling, preventing the binary from stalling. However, current N-body simulations able to accurately follow the evolution of BHBs are limited to very modest particle numbers. Brownian motion may artificially enhance the loss cone refilling rate in low-N simulations, where the binary encounters a larger population of stars due its random motion. Here we study the significance of Brownian motion of BHBs in merger remnants in the context of the final parsec problem. We simulate mergers with various particle numbers (from 8k to 1M) and with several density profiles. Moreover, we compare simulations where the BHB is fixed at the centre of the merger remnant with simulations where the BHB is free to random walk. We find that Brownian motion does not significantly affect the evolution of BHBs in simulations with particle numbers in excess of one million, and that the hardening measured in merger simulations is due to collisionless loss cone refilling.
Petts J (2017) Dynamical friction on star clusters : implications for the galactic centre.,
I present a new semi-analytic dynamical friction model built upon Chandrasekhar's formalism (Petts et al., 2015, 2016), and its first scientific application regarding the origin of the young stellar populations in the Galactic Centre (Petts and Gualandris, 2017). The model is accurate for spherical potentials of varying inner slope, gamma=[0,2], due to a few key novelties. Firstly, I use physically motivated, radially varying maximum and minimum impact parameters, that describe the range over which interactions are important. Secondly, I use the self-consistent velocity distribution as derived from the distribution function of the galactic potential, including the effect of stars moving faster than satellite. Finally, I reproduce the core-stalling effect seen in simulations of cored galaxies with a tidal-stalling'' prescription, which describes when the satellite disrupts the galaxy and forms a steady-state. I implemented dynamical friction analytically in the direct summation N-body code, NBODY6, excellently reproducing the orbital decay of clusters as compared with full N-body models. Since only cluster stars need be modelled in an N-body fashion, my method allows for simulation possibilities that were previously prohibited (e.g. Contenta et al., 2017; Inoue, 2017; Cole et al., 2017).

Using this new method, I explore the scenario in which the young stellar populations in the central parsec of the Milky Way were formed by infalling star clusters. I find that clusters massive enough to reach the central parsec within the lifetime of these populations form very massive stars via collisions. Using up to date - yet conservative - mass loss recipes, I find that these very massive stars lose most of their mass via strong stellar winds, forming large stellar mass black holes incapable of bringing stars to the central parsec. A star cluster infalling in the Galactic Centre within the last 15 Myr would leave an observable population of massive stars from ~1-10 pc, contradicting observations. Thus, I rule out the star cluster inspiral scenario, favouring in-situ formation and/or binary disruption for the origin of the young stars.

Fragione G, Gualandris A (2018) Tidal breakup of triple stars in the Galactic Centre, Monthly Notices of the Royal Astronomical Society 475 (4) pp. 4986-4993 Oxford University Press
The last decade has seen the detection of fast moving stars in the Galactic halo, the so-called hypervelocity stars (HVSs). While the bulk of this population is likely the result of a close encounter between a stellar binary and the supermassive black hole (MBH) in the Galactic Centre (GC), other mechanims may contribute fast stars to the sample. Few observed HVSs show apparent ages which are shorter than the flight time from the GC, thereby making the binary disruption scenario unlikely. These stars may be the result of the breakup of a stellar triple in the GC which led to the ejection of a hypervelocity binary (HVB). If such binary evolves into a blue straggler star due to internal processes after ejection, a rejuvenation is possible that make the star appear younger once detected in the halo. A triple disruption may also be responsible for the presence of HVBs, of which one candidate has now been observed. We present a numerical study of triple disruptions by the MBH in the GC and find that the most likely outcomes are the production of single HVSs and single/binary stars bound to the MBH, while the production of HVBs has a probability r1% regardless of the initial parameters. Assuming a triple fraction of H10% results in an ejection rate of r1 Gyr?1, insufficient to explain the sample of HVSs with lifetimes shorter than their flight time. We conclude that alternative mechanisms are responsible for the origin of such objects and HVBs in general.
Contenta F, Balbinot E, Petts J, Read J, Gieles M, Collins M, Peñarrubia J, Delorme M, Gualandris A (2018) Probing dark matter with star clusters: a dark matter core in the ultra-faint dwarf Eridanus II, Monthly Notices of the Royal Astronomical Society Oxford University Press (OUP)
We present a new technique to probe the central dark matter (DM) density profile of galaxies that harnesses both the survival and observed properties of star clusters. As a first application, we apply our method to the ultra-faint' dwarf Eridanus II (Eri II) that has a lone star cluster ~45 pc from its centre. Using a grid of collisional N-body simulations, incorporating the effects of stellar evolution, external tides and dynamical friction, we show that a DM core for Eri II naturally reproduces the size and the projected position of its star cluster. By contrast, a dense cusped galaxy requires the cluster to lie implausibly far from the centre of Eri II (>1 kpc), with a high inclination orbit that must be observed at a particular orbital phase. Our results imply that either a cold DM cusp was heated up' at the centre of Eri II by bursty star formation, or we are seeing an evidence for physics beyond cold DM.
Bortolas E, Gualandris A, Dotti M, Read J (2018) The influence of Massive Black Hole Binaries on the Morphology of Merger Remnants, Monthly Notices of the Royal Astronomical Society Oxford University Press (OUP)
Massive black hole (MBH) binaries, formed as a result of galaxy mergers, are expected to harden by dynamical friction and three-body stellar scatterings, until emission of gravitational waves (GWs) leads to their final coalescence. According to recent simulations, MBH binaries can efficiently harden via stellar encounters only when the host geometry is triaxial, even if only modestly, as angular momentum diffusion allows an efficient repopulation of the binary loss cone. In this paper, we carry out a suite of N-body simulations of equal-mass galaxy collisions, varying the initial orbits and density profiles for the merging galaxies and running simulations both with and without central MBHs. We find that the presence of an MBH binary in the remnant makes the system nearly oblate, aligned with the galaxy merger plane, within a radius enclosing 100 MBH masses. We never find binary hosts to be prolate on any scale. The decaying MBHs slightly enhance the tangential anisotropy in the centre of the remnant due to angular momentum injection and the slingshot ejection of stars on nearly radial orbits. This latter effect results in about 1% of the remnant stars being expelled from the galactic nucleus. Finally, we do not find any strong connection between the remnant morphology and the binary hardening rate, which depends only on the inner density slope of the remnant galaxy. Our results suggest that MBH binaries are able to coalesce within a few Gyr, even if the binary is found to partially erase the merger-induced triaxiality from the remnant.
Gieles M, Charbonnel C, Krause M, Hénault-Brunet V, Agertz O, Lamers H, Bastian N, Gualandris A, Zocchi A, Petts J (2018) Concurrent formation of supermassive stars and globular clusters:
implications for early self-enrichment,
Monthly Notices of the Royal Astronomical Society Oxford University Press
We present a model for the concurrent formation of globular clusters (GCs) and supermassive stars (SMSs, >103M) to address the origin of the HeCNONaMgAl abundance anomalies in GCs. GCs form in converging gas flows and accumulate low-angular momentum gas, which accretes onto protostars. This leads to an adiabatic contraction of the cluster and an increase of the stellar collision rate. A SMS can form via runaway collisions if the cluster reaches sufficiently high density before two-body relaxation halts the contraction. This condition is met if the number of stars s106 and the gas accretion rate s105M/Myr, reminiscent of GC formation in high gas-density environments, such as -- but not restricted to -- the early Universe. The strong SMS wind mixes with the inflowing pristine gas, such that the protostars accrete diluted hot-hydrogen burning yields of the SMS. Because of continuous rejuvenation, the amount of processed material liberated by the SMS can be an order of magnitude higher than its maximum mass. This `conveyor-belt' production of hot-hydrogen burning products provides a solution to the mass budget problem that plagues other scenarios. Additionally, the liberated material is mildly enriched in helium and relatively rich in other hot-hydrogen burning products, in agreement with abundances of GCs today. Finally, we find a super-linear scaling between the amount of processed material and cluster mass, providing an explanation for the observed increase of the fraction of processed material with GC mass. We discuss open questions of this new GC enrichment scenario and propose observational tests.


text:
Question

# Solve the equation 5x−312=1. The value of x is ___

Solution

## 5x−312=1 Multiplying both the sides by 12, we get ⇒5x−312×12=1×12 ⇒5x−3=12 Adding 3 on both the sides, we get ⇒5x−3+3=12+3 ⇒5x=15 Dividing both the sides by 5, we get ⇒5x5=155 ⇒x=3

Suggest corrections

format: plain


text:
Vertical dots not horizontally centered

I am trying to get the following equation, but I can't find a way to center the vertical dots.

My current code is this:

\begin{aligned} b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0\\ b(n_2) &= a_2 n_2{^2} + a_1n_2 + a_ 0\\ & \vdots \\ b(n_L) &= a_2 n_L{^2} + a_1n_L + a_ 0, \end{aligned}

Which gives this:

Can anyone help me?

• This alignment never vertically centers things, but left-aligns the signs after &. One thing you might do is to replace \vdots by \makebox[12pt][c]{\vdots}. Of course, if you are very picky, you may insist on precisely centered \vdots. Frankly, I would be much more concerned about the placement of the equation number. I'd use an ordinary align instead (which does not help on the issue with \vdots though) and only number the last equation. But that's just an opinion. – user121799 Sep 27 '18 at 23:24
• When I want to dots etc in such a situation I it manually using one or more of \quad, \qquad or \hspace*{16mm}. It might be a matter of taste but like you I would prefer one equation number that is centered on the system of equations here, rather than an equation at the end as suggested by marmot. – user30471 Sep 27 '18 at 23:33
• Marmot can you post this as an answer? :) thanks – Take2 Sep 27 '18 at 23:42

Sorry, I did not read the question carefully. If you really want to use aligned, you could do

\documentclass{article}
\usepackage{amsmath,calc}
\begin{document}
\begin{aligned} b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0\\ b(n_2) &= a_2 n_2{^2} + a_1n_2 + a_ 0\\ &\makebox[\widthof{=a_2 n_2{^2} + a_1n_2 + a_ 0}-\widthof{b(n_2)}][c]{\vdots} \\ b(n_L) &= a_2 n_L{^2} + a_1n_L + a_ 0, \end{aligned}
\end{document}

I picked a random line and computed its approximate width with calc to center the \vdots. (Approximate because of the spacing around the =.) Let's see how well that works.

\documentclass{article}
\usepackage{amsmath,calc}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{aligned} b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0\\ \tikzmark{1}b(n_2) &= a_2 n_2{^2} + a_1n_2 + a_ 0\tikzmark{2}\\ &\makebox[\widthof{=a_2 n_2{^2} + a_1n_2 + a_ 0}-\widthof{b(n_2)}][c]{\vdots} \\ b(n_L) &= a_2 n_L{^2} + a_1n_L + a_ 0, \end{aligned} \tikz[overlay,remember picture]{\draw[red] (pic cs:1) -- (pic cs:2) coordinate[midway](3); \draw[red](3) -- ++(0,-1);}
\end{document}

Modulo the above-mentioned spacing around = that seems to work. I personally wouldn't use this in my own notes or papers, nor have I ever used aligned there because IMHO these vertically centered equation numbers insult my eyes. But of course this is only an opinion, so feel free to disagree. And I do not think my answer is the better option, when you wrote your comment you didn't even know it.... wait, do you have my crystal ball??? ;-)

• But then the \vdots are horizontally centered only w.r.t. the RHS and not w.r.t. the full line width. – Henri Menke Sep 27 '18 at 23:47
• This isn't really centered sadly :'( I think it is because \widthof{$=a_2 n_2{^2} + a_1n_2 + a_ 0$} does not give the width of b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0 (because of the &) – Take2 Sep 27 '18 at 23:48
• @DiogoTec Yes, sorry, I misread your question. I thought you wanted it to be centered w.r.t. the stuff on the right-hand side. – user121799 Sep 28 '18 at 0:16

Another possibility, with the \vdotswithin command from mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\label{eqlbl} \begin{alignedat}{2} b(n_1) &= a_2 n_1{^2} & & + a_1n_1 + a_ 0\\ b(n_2) &= a_2 n_2{^2} & & + a_1n_2 + a_ 0\\[-1.2ex] &\vdotswithin{ = } & & \vdotswithin{ + }\\[-1ex] b(n_L) &= a_2 n_L{^2} & & + a_1n_L + a_ 0, \end{alignedat}

\end{document}

• Why do you need eqparbox? – Henri Menke Sep 28 '18 at 0:10
• @HenriMenke: It was a first attempt – notsatisfying. I forgot to remove it from the code. Fixed now. Thanks for pointing the leftover! – Bernard Sep 28 '18 at 7:46

You can make use of the fact that aligned is actually just \halign under the hood. Then you can insert content spanning several columns using the Plain TeX macro \multispan. You only need to know the number of columns for this to work.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{aligned} b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0\\ b(n_2) &= a_2 n_2{^2} + a_1n_2 + a_ 0\\ \multispan{2}\hfil\vdots\hfil\\ b(n_L) &= a_2 n_L{^2} + a_1n_L + a_ 0, \end{aligned}
\end{document}

I can offer another solution for align.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
b(n_1) &= a_2 n_1{^2} + a_1n_1 + a_ 0\\
b(n_2) &= a_2 n_2{^2} + a_1n_2 + a_ 0\\
\noalign{\centering$\vdots$}
b(n_L) &= a_2 n_L{^2} + a_1n_L + a_ 0,
\end{align*}
\end{document}

• Any way to number the whole system as one equation (as in my images), and that the number is centered vertically? – Take2 Sep 27 '18 at 23:37
• @DiogoTec You can place \nonumber on the lines you don't want to have numbered. Vertically centered numbering is only possible with aligned but then the above trick does not work. – Henri Menke Sep 27 '18 at 23:39
• Alright, thank you! Given that I want the number centered, marmot answer seems a better option. Many thanks tho :) – Take2 Sep 27 '18 at 23:42
• @DiogoTec I added a second part to my answer. – Henri Menke Sep 27 '18 at 23:48
• @DiogoTec I have found another solution which does not require you to know the width of the alignment. – Henri Menke Sep 28 '18 at 21:39


text:
Search
>> Home >> Products >> Stata 10 >> Dynamic panel data analysis

## Dynamic panel-data (DPD) analysis

Stata 10 now has a suite of commands for dynamic panel-data analysis:

• Improved command xtabond implements the Arellano and Bond estimator, which uses moment conditions in which lags of the dependent variable and first differences of the exogenous variables are instruments for the first-differenced equation.
• New command xtdpdsys implements the Arellano and Bover/Blundell and Bond system estimator, which uses the xtabond moment conditions and moment conditions in which lagged first differences of the dependent variable are instruments for the level equation.
• New command xtdpd, for advanced users, is a more flexible alternative that can fit models with low-order moving-average correlations in the idiosyncratic errors and predetermined variables with a more complicated structure than allowed with xtabond and xtdpdsys.
• Postestimation tools allow you to test for serial correlation in the first-differenced residuals and test the validity of the overidentifying restrictions.

### Example

Building on the work of Layard and Nickell (1986), Arellano and Bond (1991) fit a dynamic model of labor demand to an unbalanced panel of firms located in the United Kingdom. First we model employment on wages, capital stock, industry output, year dummies, and a time trend, including one lag of employment and two lags of wages and capital stock. We will use the one-step Arellano–Bond estimator and request their robust VCE:

    . use http://www.stata-press.com/data/r10/abdata, clear
. xtabond n L(0/2).(w k) yr1980-yr1984 year, vce(robust)

Because we included one lag of n in our regression model, xtabond used lags 2 and back as instruments. Differences of the exogenous variables also serve as instruments.

Here we refit our model, using the xtdpdsys command instead so that we can obtain the Arellano–Bover/Blundell–Bond estimates:

    . xtdpdsys n L(0/2).(w k) yr1980-yr1984 year, vce(robust)

Comparing the footers of the two commands’ output illustrates the key difference between the two estimators. xtdpdsys included the lagged differences of n as instruments in the level equation; xtabond did not.

The moment conditions of these GMM estimators are valid only if there is no serial correlation in the idiosyncratic errors. Because the first difference of white noise is necessarily autocorrelated, we need only concern ourselves with second and higher autocorrelation. We can use estat abond to test for autocorrelation:

    . estat abond, artests(4)

### References

Arellano, M., and S. Bond. 1991.
Some tests of specification for panel data: Monte Carlo evidence and an application to employment equations. The Review of Econometric Studies 58: 277–297.
Layard, R., and S. J. Nickell. 1986.
Unemployment in Britain. Economica 53: 5121–5169.


text:
# Does using the softmax function in Q learning not defeat the purpose of Q learning?

It is my understanding that, in Q-learning, you are trying to mimic the optimal $$Q$$ function $$Q*$$, where $$Q*$$ is a measure of the predicted reward received from taking action $$a$$ at state $$s$$ so that the reward is maximised.

I understand for this to be properly calculated, you must explore all possible game states, and as that is obviously intractable, a neural network is used to approximate this function.

In a normal case, the network is updated based on the MSE of the actual reward received and the networks predicted reward. So a simple network that is meant to chose a direction to move would receive a positive gradient for all state predictions for the entire game and do a normal backprop step from there.

However, to me, it makes intuitive sense to have the final layer of the network be a softmax function for some games. This is because in a lot of cases (like Go for example), only one "move" can be chosen per game state, and as such, only one neuron should be active. It also seems to me that would work well with the gradient update, and the network would learn appropriately.

But the big problem here is, this is no longer Q learning. The network no longer predicts the reward for each possible move, it now predicts which move is likely to give the greatest reward.

Am I wrong in my assumptions about Q learning? Is the softmax function used in Q learning at all?

• Just to let you know I have updated my answer as I thought of a way in which softamx distribution is used in Q learning, indirectly. – Neil Slater Dec 8 '19 at 14:30

However, to me, it makes intuitive sense to have the final layer of the network be a softmax function for some games. This is because in a lot of cases (like Go for example), only one "move" can be chosen per game state, and as such, only one neuron should be active.

You are describing a network that approximates as policy function, $$\pi(a|s)$$, for a discrete set of actions.

It also seems to me that would work well with the gradient update, and the network would learn appropriately.

Yes there are ways to do this, based on the Policy Gradient Theorem. If you read it you will probably discover this is more complex to understand than you first thought, the problem being that the agent is never directly told what the "best" action is in order to simply learn in a supervised manner. Instead, it has to be inferred from rewards observed whilst acting. This is a bit harder to figure out than the Q learning update rules which are just sampling from the Bellman optimality equation.

You can split Reinforcement Learning methods broadly into value-based methods and policy gradient methods. Q learning is a value-based method, whilst REINFORCE is a basic policy gradient method. It is also common to use a value based method within a policy gradient method in order to help estimate likely future return used to drive the polcy gradient updates - this combination is called Actor-Critic where the actor learns a policy function $$\pi(a|s)$$ and the critic learns a value function e.g. $$V(s)$$.

But the big problem here is, this is no longer Q learning. The network no longer predicts the reward for each possible move, it now predicts which move is likely to give the greatest reward.

This is true, but it is not a big problem. The main issue is that policy gradient methods are more complex than value based methods. They may or may not be more effective, it depends on the environment you are tryng to create an optimal agent for.

Is the softmax function used in Q learning at all?

I cannot think of any non-contrived environment in which this function would be useful for an action value approximation.

However, it is possible to use a variant of softmax to create a behaviour policy for Q learning. This uses a temperature hyperparameter $$T$$ to weight the Q values, and provide a probability of selecting an action, as follows

$$\pi(a_i|s) = \frac{e^{Q(s,a_i)/T}}{\sum_j e^{Q(s,a_j)/T}}$$

when $$T$$ is high all the probabilities of actions will be similar, when it is low even a small difference in $$Q(s,a_i)$$ will make a big difference to probability of selecting action $$a_i$$. This is quite a nice distribution for exploring whilst avoiding previously bad decisions. It will tend to focus the agent on exploring differences between similarly high rated actions. The main issue with it is that it introduces hyperparameters for deciding starting $$T$$, ending $$T$$ and how to move between them.

This is still Q-learning, remember Q-learning is off-policy value-based. For Bellman optimality operator $$\mathcal{T}Q=r+max\ Q'$$. If you have enough exploration, it always takes $$Q$$ to the optimal fixed point.


text:
• anonymous
Calculate number of formula units in 160.0g of copper(II) sulfate. Clearly show work using Avagadro's number, digits, units, and final label.
Chemistry

Looking for something else?

Not the answer you are looking for? Search for more explanations.


text:
Genetic algorithms are fun, they require a different way of thinking. Here I’ll guide you through my process of building an algorithm that evolves 150 random triangles into a famous piece of art. The work I picked to re-draw: Van Gogh’s The Starry Night. The original and the version the algorithm created after 5000 generations are shown below.

The code for this post can be found on GitHub here

Update 25/03/20201: There was a change in the Evol API in version 0.5.2 where the function apply() has been renamed to callback(), the code here and in the repository has been updated.

## Genetic algorithms

Before we start, a quick word about genetic algorithms. There is a rather lengthy description on WikiPedia, but here we’ll keep it short and simple. These algorithms are heavily based on biological principles of inheritance, breeding and evolution. You have a number of solutions, called the population. Each individual solution having a list of items, values, … called the chromosome. There is a fitness function to assess how good a certain solution is for our problem. Within this population, individuals can be removed (the ones with the worst fitness), they can breed (combine their chromosomes into a new individual), and mutate (introduce random changes to the chromosome).

In this context:

• the population is a collection of 200 paintings
• each individual is a single painting
• the chromosome is a list of 150 triangles with a certain shape, position and color (red, green, blue and opacity)
• the fitness is the distance (based on pixels) from the target painting (we need to minimize this score)
• individuals can breed, create a new painting with half of the triangles from one parent and half from the other
• individuals can mutate, triangles can move, change shape, change color, swap position in the chromosome or reset
• the population can go through a bottleneck, where a large portion of individuals (with the worst fitness) is discarded and then the survivors are used to grow the population back to the desired size

## Implementing the algorithm in Python

Coding all steps yourself wouldn’t be that difficult, though the Evol provides a great API that takes care of all the scoring, breeding, … and has multi-processing build in for calculating the finess of each individual in a population.

### The triangle class

A chromosome here is a list of triangles. A single triangle has three point with x,y coordinates and a color with opacity. A few different changes can occur during a mutation, the triangle can move (shift all points), change shape (move points individually) or the color can change. There also is a more significant event that will destroy the current triangle and replace it with a totally random one. This is all taken care of by the .mutate function. The sigma value can be used to specify the strenght of a mutation (how strong the change will be) and the weights are used to specify which types of mutation will occur more often than others.

import random

class Triangle:
def __init__(self, img_width, img_height):
x = random.randint(0, int(img_width))
y = random.randint(0, int(img_height))

self.points = [
(x + random.randint(-50, 50), y + random.randint(-50, 50)),
(x + random.randint(-50, 50), y + random.randint(-50, 50)),
(x + random.randint(-50, 50), y + random.randint(-50, 50))]
self.color = (
random.randint(0, 256),
random.randint(0, 256),
random.randint(0, 256),
random.randint(0, 256)
)

self._img_width = img_width
self._img_height = img_height

def __repr__(self):
return "Trangle: %s in color %s" % (','.join([str(p) for p in self.points]), str(self.color))

def mutate(self, sigma=1.0):
mutations = ['shift', 'point', 'color', 'reset']
weights = [30, 35, 30, 5]

mutation_type = random.choices(mutations, weights=weights, k=1)[0]

if mutation_type == 'shift':
x_shift = int(random.randint(-50, 50)*sigma)
y_shift = int(random.randint(-50, 50)*sigma)
self.points = [(x + x_shift, y + y_shift) for x, y in self.points]
elif mutation_type == 'point':
index = random.choice(list(range(len(self.points))))

self.points[index] = (self.points[index][0] + int(random.randint(-50, 50)*sigma),
self.points[index][1] + int(random.randint(-50, 50)*sigma),)
elif mutation_type == 'color':
self.color = tuple(
c + int(random.randint(-50, 50)*sigma) for c in self.color
)

# Ensure color is within correct range
self.color = tuple(
min(max(c, 0), 255) for c in self.color
)
else:
new_triangle = Triangle(self._img_width, self._img_height)

self.points = new_triangle.points
self.color = new_triangle.color

### The painting class

The painting contains a list of Triangles, along with the necessary functions to draw the triangles (using the Pillow library) and to compare the image with the target (using the Imagecompare library). Furthermore, there is a function to mate two paintings, this is inspired by crossing over events in biology where two chromosomes exchange parts to create two new chromosomes.

from triangle import Triangle
from random import shuffle, randint
from PIL import Image, ImageDraw
from imgcompare import image_diff
import random

class Painting:
def __init__(self, num_triangles, target_image, background_color=(0, 0, 0)):
self._img_width, self._img_height = target_image.size
self.triangles = [Triangle(self._img_width, self._img_height) for _ in range(num_triangles)]
self._background_color = (*background_color, 255)
self.target_image = target_image

@property
def get_background_color(self):
return self._background_color[:3]

@property
def get_img_width(self):
return self._img_width

@property
def get_img_height(self):
return self._img_height

@property
def num_triangles(self):
return len(self.triangles)

def __repr__(self):
return "Painting with %d triangles" % self.num_triangles

def mutate_triangles(self, rate=0.04, swap=0.5, sigma=1.0):
total_mutations = int(rate*self.num_triangles)
random_indices = list(range(self.num_triangles))
shuffle(random_indices)

# mutate random triangles
for i in range(total_mutations):
index = random_indices[i]
self.triangles[index].mutate(sigma=sigma)

# Swap two triangles randomly
if random.random() < swap:
shuffle(random_indices)
self.triangles[random_indices[0]], self.triangles[random_indices[1]] = self.triangles[random_indices[1]], self.triangles[random_indices[0]]

def draw(self, scale=1) -> Image:
image = Image.new("RGBA", (self._img_width*scale, self._img_height*scale))
draw = ImageDraw.Draw(image)

if not hasattr(self, '_background_color'):
self._background_color = (0, 0, 0, 255)

draw.polygon([(0, 0), (0, self._img_height*scale), (self._img_width*scale, self._img_height*scale), (self._img_width*scale, 0)],
fill=self._background_color)

for t in self.triangles:
new_triangle = Image.new("RGBA", (self._img_width*scale, self._img_height*scale))
tdraw = ImageDraw.Draw(new_triangle)
tdraw.polygon([(x*scale, y*scale) for x, y in t.points], fill=t.color)

image = Image.alpha_composite(image, new_triangle)

return image

@staticmethod
def _mate_possible(a, b) -> bool:
return all([a.num_triangles == b.num_triangles,
a.get_img_width == b.get_img_width,
a.get_img_height == b.get_img_height])

@staticmethod
def mate(a, b):
if not Painting._mate_possible(a, b):
raise Exception("Cannot mate images with different dimensions or number of triangles")

ab = a.get_background_color
bb = b.get_background_color
new_background = (int((ab[i] + bb[i])/2) for i in range(3))

child_a = Painting(0, a.target_image, background_color=new_background)
child_b = Painting(0, a.target_image, background_color=new_background)

for at, bt in zip(a.triangles, b.triangles):
if randint(0, 1) == 0:
child_a.triangles.append(at)
child_b.triangles.append(bt)
else:
child_a.triangles.append(bt)
child_b.triangles.append(at)

return child_a, child_b

def image_diff(self, target: Image) -> float:
source = self.draw()

return image_diff(source, target)

### Putting the algorithm together

The Evol package will take care of most of the work for use, but we do need to define a couple functions to get started. We will have a score function, that checks the distance to the target image. A function how individuals will find a partner to mate with and define how we wish to evolve the population. We’ll also add a function to print the fitness scores (so we can see if there is still progress), that stores the image of the best individual and that stores the population every fifty generations (so we don’t have to start over again if something goes wrong).

from PIL import Image
from evol import Evolution, Population

import random
import os
from copy import deepcopy

from painting import Painting

def score(x: Painting) -> float:
"""
Calculate the distance to the target image

:param x: a Painting object to calculate the distance for
:return: distance based on pixel differences
"""
current_score = x.image_diff(x.target_image)
print(".", end='', flush=True)
return current_score

def pick_best_and_random(pop, maximize=False):
"""
Here we select the best individual from a population and pair it with a random individual from a population

:param pop: input population
:param maximize: when true a higher fitness score is better, otherwise a lower score is considered better
:return: a tuple with the best and a random individual
"""
evaluated_individuals = tuple(filter(lambda x: x.fitness is not None, pop))
if len(evaluated_individuals) > 0:
mom = max(evaluated_individuals, key=lambda x: x.fitness if maximize else -x.fitness)
else:
mom = random.choice(pop)

def mutate_painting(x: Painting, rate=0.04, swap=0.5, sigma=1) -> Painting:
"""
This will mutate a painting by randomly applying changes to the triangles.

:param x: Painting to mutate
:param rate: the chance a triangle will be mutated
:param swap: the chance a pair of traingles will be swapped
:param sigma: the strenght of the mutation (how much a triangle can be changed)
:return: New painting object with mutations
"""
x.mutate_triangles(rate=rate, swap=swap, sigma=sigma)
return deepcopy(x)

"""
Takes two paintings, the mom and dad, to create a new painting object made up with triangles from both parents

:param mom: One parent painting
:return: new Painting with features from both parents
"""

return deepcopy(child_a)

def print_summary(pop, img_template="output%d.png", checkpoint_path="output") -> Population:
"""
This will print a summary of the population fitness and store an image of the best individual of the current
generation. Every fifty generations the entire population is stored.

:param pop: Population
:param img_template: a template for the name of the output images, should contain %d as the number of the generation is included
:param checkpoint_path: directory to write output.
:return: The input population
"""
avg_fitness = sum([i.fitness for i in pop.individuals])/len(pop.individuals)

print("\nCurrent generation %d, best score %f, pop. avg. %f " % (pop.generation,
pop.current_best.fitness,
avg_fitness))
img = pop.current_best.chromosome.draw()
img.save(img_template % pop.generation, 'PNG')

if pop.generation % 50 == 0:
pop.checkpoint(target=checkpoint_path, method='pickle')

return pop

if __name__ == "__main__":
target_image_path = "./img/starry_night_half.jpg"
checkpoint_path = "./starry_night/"
image_template = os.path.join(checkpoint_path, "drawing_%05d.png")
target_image = Image.open(target_image_path).convert('RGBA')

num_triangles = 150
population_size = 200

pop = Population(chromosomes=[Painting(num_triangles, target_image, background_color=(255, 255, 255)) for _ in range(population_size)],
eval_function=score, maximize=False, concurrent_workers=6)

evolution = (Evolution()
.survive(fraction=0.05)
.breed(parent_picker=pick_best_and_random, combiner=mate, population_size=population_size)
.mutate(mutate_function=mutate_painting, rate=0.05, swap=0.25)
.evaluate(lazy=False)
.callback(print_summary,
img_template=image_template,
checkpoint_path=checkpoint_path))

pop = pop.evolve(evolution, n=5000)

## The output

Here you can see the best individual from generation 1, 250, 500, 750, 1000, 1500, 2500, 3500 and 4500 (left to right, top to bottom).

### Different runs, different output

As the start of the evolution is random, as well as all mutations and breeding events, the output can differ between runs. Below you can see the result of two independent runs each running for 5000 generations. Even though these images have comparable distances to the target image, they are quite different from each other.

## Conclusion & outlook

There results are quite cool, and since there is very little difference between generation 4500 and 5000 this is probably as good as it gets using only 150 triangles. There are a few things that could be improved though. The algorithm tries to match as many pixels correctly as possible. So matching pixels in large even spaces yields a much better score than getting details right. You could generate a mask, highlighting detailed areas, and rewarding correct pixels in those areas.

The chromosomes in this case are very static, they are always the same length (150 items) and apart from the occasional swapping of items nothing happens. In nature chromosomes evolve continuously in size and duplication of genes is often a source of innovation. The mutation function could be adjusted to add an extra triangle every so often or you could come up with more complex ways to mate paintings so lists of different numbers of items could be mated. However, adding additional triangles should come at a cost that should be taken into account for the fitness. In nature having a larger genome means copying more DNA each time a cell divides, so genomes cannot grow infinitely large. There needs to be a similar penalty to the fitness here. Tweaking this extra parameter could be difficult.

Finally, different styles could be used. Here using a limited number of triangles was used because it was the first thing that popped into my mind when starting this project. However, while working on this a few more (and potentially better) ideas emerged. These I’ll work out and I will cover them in a later post!


text:
### A New Polynomial-time Algorithm For Linear Programming

5

4

3

2

1

Basic infomation
Authors: Narendra K Karmarkar
Published in: Symposium On The Theory Of Computing
Published in: Combinatorica
Year: 1984
DOI: 10.1007/BF02579150
Citations: 1427
EI: NO
Abstract:
abstract we present a new polynomial time algorithm for linear programming in the worst case , the algorithm requireso \( n 3 5 l \) arithmetic operations ono \( l \) bit numbers , wheren is the number of variables andl is the number of bits in the input the running time of this algorithm is better than the ellipsoid algorithm by a factor ofo \( n 2 5 \) we prove that given a polytopep and a strictly interior point a \? p , there is a projective transformation of the space that mapsp , a top \? , a \? having the following property the ratio of the radius of the smallest sphere with center a \? , containingp \? to the radius of the largest sphere with center a \? contained inp \? iso \( n \) the algorithm consists of repeated application of such projective transformations each followed by optimization over an inscribed sphere to create a sequence of points which converges to the optimal solution in polynomial time
Popular Words:


text:
Suppose 2 J of work is needed to stretch a spring from its natural length of 30 cm to a length of 42 cm.Then how much work is needed to stretch it from 30 cm to 40 cm.

$\begin{array}{1 1}\large\frac{1}{18}\\\large\frac{1}{28}\\18\\28\end{array}$

Answer : $\large\frac{1}{18}$
From Hooke's law : $F=kx$ where $x$ is the distance the spring is stretched from its natural length,and $k$ is the (usually unknown) spring constant.
The spring's natural length is 30 cm,so it is stretched 12 cm from the natural length,we can use
$W=\int dW=\int F dx$
$2J=\int_0^{.12m}kx dx$
$\quad\;=\large\frac{k}{2}$$x^2\bigg|_0^{.12m} \quad\;=\large\frac{k}{2}$$(0.0144m^2)$
$k=\large\frac{4Nm}{0.0144m^2}$
$\;\;\;=\large\frac{100}{9}$N/m
Once we have k,we can calculate the work done as follows
$W=\int dW$
$\;\;\;\;=\int\limits_0^{.1}F dx$
$\;\;\;\;=\int\limits_0^{.1} \large\frac{100}{9}$$xdx \;\;\;\;=\large\frac{50}{9}$$x^2\bigg|_0^{.1}$
$\;\;\;\;=\large\frac{1}{18}$
edited Sep 2, 2014