1 Main text
RAPID
) code, which combines both methods into a “best of both worlds” approach. In this method, the majority of particles are modeled with our parallel Hénon-style code, the Cluster MC (CMC
) code (Pattabiraman et al. 2013), while the orbits of BHs are integrated directly with the Kira N-body integrator (Portegies Zwart et al. 2001). We find that this technique accurately reproduces the core radii and BH dynamics of a full direct N-body integration, with similar runtimes to the MC approach. Although we only integrate the BH orbits directly in the current work, the method is general, allowing us to select any population of particles in the cluster for N-body integration.RAPID
code. In Sect. 3, we describe a single RAPID
timestep, illustrating the technical details of the approach, while in Sect. 4, we describe the parallelization strategy that allows us to compute particle positions and velocities via orbit sampling and direct N-body simultaneously. In Sect. 5, we show the results of an analytic toy model, comparing the inspiral due to dynamical friction of a single particle as predicted by theory, direct N-body, and RAPID
. Finally, in Sect. 6, we compare the properties of four idealized GCs as modeled by NBODY6
, CMC
, and RAPID
. Throughout the paper, we will frequently refer to the “stars” and “BHs” in the cluster separately. In our current method, the stars are modeled with CMC and the BHs are integrated with Kira. This shorthand is to delineate which systems are being modeled by which technique, even though the particles under consideration are point-mass particles.2 Hybridization approach
RAPID
is not the first attempt at a hybrid N-body/statistical sampling approach to stellar dynamics. In particular, the hybrid approach developed by McMillan and Lightman (1984b) combined a Fokker-Planck sampling code with a direct N-body approach, in order to study GCs undergoing core collapse (McMillan and Lightman 1984a; McMillan 1986). The RAPID
code continues this tradition of attempting to “have it all”, by combining the best of the direct integration and statistical sampling methods.2.1 Direct N-body integration
NBODY
series of codes, have been improved and finely tuned with additional physics, including stellar evolution (Hurley et al. 2001), algorithmic regularization (Aarseth 1999), post-Newtonian chain regularization (Aarseth 2012), and GPU acceleration (Nitadori and Aarseth 2012). With advanced hardware and a minimal number of simplifying assumptions, direct integration is the most precise method available for modeling dense stellar systems.NBODY6
is currently the \(N = 5\times 10^{5}\) model of galactic GC M4 performed by Heggie (2014), requiring 2.5 years on a dedicated GPU system. More recently, the current state-of-the-art parallelized code NBODY6++GPU
(Wang et al. 2015) can model a realistic (\(N = 10^{6}\)) cluster in little more than a year (Wang et al. 2016). Despite these remarkable achievements, simulation times in excess of ∼1 year for large systems preclude any reasonable exploration of the parameter space of initial conditions of GCs, and any collisional models of GN (\(N = 10^{7}\mbox{--}10^{9}\)) remain beyond the capabilities of the current generation of direct summation techniques. To answer astrophysical questions related to such systems, a more rapid technique is called for.Starlab
software package (Portegies Zwart et al. 2001). Like the NBODY
series of codes, Kira is a 4th-order Hermite predictor-corrector integrator with a block timestep scheme. Kira also integrates close encounters and tightly-bound multiples using Keplerian regularization, where sufficiently-isolated hyperbolic and tightly bound binaries are evolved as analytic two-body systems. Additionally, Kira organizes its internal data using easily-modifiable C++ class structures, and includes an easily-customizable module for including an external gravitational potential. These two features make it ideal for inclusion in the hybrid method.2.2 Orbit-sampled Monte Carlo
CMC
, was first developed by Joshi et al. (2000), based on the original developments by Hénon (1971) and Stodoikiewicz (1982). As the code considers interactions between individual stars, CMC
incorporates multiple physical processes, including stellar evolution (Hurley et al. 2000; Hurley et al. 2002), strong three-body and four-body scatterings with the small-N integrator Fewbody
(Fregeau et al. 2004), probabilistic three-body binary formation (Morscher et al. 2013), and physical collisions. Additionally, CMC
has recently been parallelized to run on an arbitrary number of computer processors (Pattabiraman et al. 2013). This MPI parallelizaion makes CMC
an ideal code base for RAPID
, as the current parallelization scheme can be easily expanded to allow the N-body integration to run in parallel to the MC2.3 Hybrid partitioning
CMC
integrates all the remaining stars in the cluster. By default, RAPID
divides the system using one of two criteria: -
a mass criterion, which divides the system according to a specified threshold, where particles above the threshold are considered BHs and particles below it are considered stars, and
-
a stellar evolution criterion, in which objects identified as BHs by stellar evolution are integrated by Kira, and all other objects are integrated by
CMC
.
SPRCORRmiscellaneous0SPRCORR
employs the first criterion for point-mass simulations (with a user-specified threshold mass), and the second criterion for simulations using stellar evolution. Any mixed objects (e.g., a BH-star binary) are evolved in CMC
, in order to treat the binary stellar evolution consistently.SeBa
package), it is not compatible with the stellar evolution in CMC
(the Binary Stellar Evolution of Hurley et al. 2002). We will explore ways to integrate self-consistent stellar evolution into the hybrid approach in a future work.RAPID
code builds upon the CMC
parallelization described in Pattabiraman et al. (2013), and is designed to be run on a distributed computational system with at least 2 parallel MPI processes: one for the MC integration, and one for the N-body integration. An initial RAPID
run begins with all objects integrated with CMC on all available processes. After a user-specified criterion is met, a single MPI process initializes the Kira N-body integrator. At this point, any stars that are on that CMC
process are transferred to the remaining CMC
process(es), and the BHs are collected on the Kira process for the N-body integration. Once both integrators have been initialized, particles can be transferred back and forth between the Kira and CMC
processes (e.g., a star becomes a BH through stellar evolution, and is copied from CMC
to Kira). Additionally, information about the particles must frequently be communicated back and forth between CMC
and Kira. At each timestep, CMC
needs to know the positions and velocities of the BHs, while Kira needs to know the external potential of the stars. See Sect. 4 for the details of the parallelization strategy. At the end of each timestep, the information from Kira and CMC
is combined and printed to file, in order to create a coherent cluster model. See Fig. 1. RAPID
Code The majority of particles are evolved via the MC approach, with their positions and velocities determined by randomly sampling orbits in the spherical potential of the entire cluster. Meanwhile, a small handful of the most massive objects (the BHs) have their positions and velocities determined by direct N-body integration inside the external potential of the MC stars. Particles from both codes can interact via two-body encounters and strong scattering encounters, allowing energy to flow between the two systems3 RAPID
timestep
RAPID
and CMC
is the computation of the orbits and positions of the BHs. Here, we describe in detail a single RAPID
timestep, highlighting the differences between the hybrid approach and a standard CMC
integration. See Fig. 3. RAPID
Code—After the hybridization is initialized, the BHs are transferred to the Kira process, while the remaining Monte Carlo processes sample the orbital positions of the remaining stars. The communication between the Kira process and the CMC
process(es) is handled by an extension of the MPI scheme developed in CMC
(Pattabiraman et al. 2013), while the N-body process can be run in serial or with OpenMP threading3.1 Compute the potential
RAPID
code, two potentials are calculated: the full spherical potential, Φ, of all stars and BHs, and a MC-only potential, \(\varPhi ^{\mathrm{MC}}\), computed only with the stars in CMC
. The MC potential is sent from the CMC
processes to the N-body process, and used as an external potential for the Kira integration.3.2 Select the timestep
CMC
and RAPID
consider multiple physical processes, the timestep selection must consider multiple relevant timescales: the timescale for two-body relaxation (\(T_{\mathrm{rel}}\)), the timescales for binary-single and binary-binary strong scatterings (\(T_{\mathrm{BS}}\) and \(T_{\mathrm{BB}}\)), the timescale for physical collisions (\(T_{\mathrm{coll}}\)), the timescale for stellar evolution to contribute a change in an objects mass (\(T_{\mathrm{SE}}\)), and the timescale for tidal stripping of stars to alter the cluster mass (\(T _{\mathrm{tid}}\)). The simulation timestep is then selected to be the minimum of each of these timescales, or
RAPID
timestep is chosen in a similar fashion. The timescale for each physical process is computed for all particles in the cluster (stars and BHs), and the minimum (or a fraction of the minimum) is selected as the current timestep. In Kira, this timestep determines how many dynamical times the N-body system will be advanced.CMC
, RAPID
can produce BH multiples with an arbitrary number of components. To compute the interaction timescale for scatterings between stars and BH multiple systems, the timestep is chosen using the same prescription as the \(T_{\mathrm{BS}}\) and \(T_{\mathrm{BB}}\) timesteps, but with the semi-major axis of the outermost binary pair as the effective width of the system.3.3 Perform dynamical interactions
CMC
processes apply the standard nearest-neighbor interactions (two-body relaxations, strong encounters, and collisions) to successive pairs of particles in the radially sorted array of all cluster particles. The interactions are identical to those employed in our previous CMC
studies. What differs in the RAPID
approach is how the outcomes of interactions between CMC
stars and Kira BHs are handled. Specifically: -
Star-Star interactions are handled in the same fashion as in a pure-
CMC
integration (see Pattabiraman et al. 2013 and references therein). -
Star-BH interactions are also handled in the same fashion (by
CMC
); however, in addition to updating the local BH information stored inCMC
, the dynamical changes to each particle are communicated back to the Kira process once the interaction step is complete. -
BH-BH nearest-neighbor interactions are skipped, since such encounters will be performed with greater accuracy in the N-body integration.
CMC
, two-body relaxations are performed by setting nearest-neighbor stars along randomly selected hyperbolic orbits that are consistent with their radial and tangential velocities. The hyperbolic encounter modifies the velocities of both stars, allowing for an exchange of energy and angular momentum. At the end of the timestep, we communicate the full 3D velocity changes for each BH to the Kira process. The velocity of each particle in the N-body is updated by adding the full-3D velocity perturbation to previous 3D velocity of the BH.CMC
integrates strong scattering encounters between neighboring multiples (such as binary-single neighbors or binary-binary neighbors) using the Fewbody
small-N integrator (Fregeau et al. 2004). In RAPID
, we also allow for strong encounters between neighboring stars and BHs. However, as Kira can produce BH higher-order multiple systems, (triples, quadruples, etc), we have modified Fewbody
to perform scatterings between systems of arbitrary multiplicity, such as single-multiple and binary-multiple encounters. We ignore multiple-multiple scatterings, since CMC
does not track higher-order stellar triples, and BH-BH encounters are performed naturally in Kira.Fewbody
has completed the scattering (which can take several seconds of CPU time for compact higher-order multiple systems) the output is then sent back to CMC
and Kira separately. For higher-order multiples, the full 3D position and velocity of each BH component, relative to the multiple center-of-mass, is sent to the Kira process. The multiple is then reinserted into the N-body integration at its previous position.CMC
. For higher-order multiples with both stellar and BH components, the multiple is hierarchically broken apart into smaller components. Any star or BH-Star is evolved by CMC
, while any BH, binary BH, or BH multiple is evolved by Kira. The kinetic energies of the newly-broken components are adjusted to ensure conservation of energy. While this limits the modeling of BH-non BH systems (such as low-mass X-ray binaries), these systems predominatly form with low mass BHs at the outer region of the BH subsystem, where mixing between stars and BHs is more common (Kremer et al. 2018b). Because of this, these systems are less likely to participate in the strong three-body encounters that form BH binaries in the central regions of the cluster.3.4 Perform stellar evolution
RAPID
considers realistic stellar evolution using the Single Stellar Evolution (SSE) and Binary Stellar Evolution (BSE) packages of Hurley et al. (2000, 2002). This is identical to the previous implementation in CMC
. No stellar evolution is required by the direct N-body, since the only particles integrated by Kira are BHs. As stated above, all mixed BH-Star objects are integrated in CMC
. This is to ensure that the binary stellar evolution for BH-star systems is performed consistently.3.5 Calculate new orbits and positions
CMC
and Kira, the MC and N-body integrations can be performed in parallel by their respective processes.3.5.1 Orbit calculation (MC)
CMC
are determined using the standard Hénon-style orbit-sampling approach. We assume that the orbit is entirely a function of the star’s kinetic energy and the spherical potential of the cluster. We first constrain the radial extent of the orbit by computing the two zeros (\(r_{\mathrm{min}}\) and \(r_{\mathrm{max}}\)) of the energy equation:
3.5.2 Orbit calculation (N-body)
RAPID
timestep. For each particle, the total force is computed as the sum of the external force, from \(\varPhi ^{\mathrm{MC}}\), and the internal force computed via direct summation of the other BHs. We apply the external CMC
potential to each isolated BH and the center-of-mass of each bound multiple system by computing the acceleration and jerk from the external potential
CMC
star to the stripping radius of the N-body simulation, and copy their radii and \(\varPhi ^{\mathrm{MC}}\) values to the N-body integrator. The values of \(\varPhi ^{\mathrm{MC}}\) and its radial derivatives are then calculated via 5th-order Lagrange Polynomial interpolation. This technique is inspired by the radial potential sampling used in Vasiliev (2014).3.6 Sort radially
CMC
processes, the particles must be sorted in order of increasing radial distance from the GC center. The sorting is performed in parallel by all CMC
processes using the parallel Sample Sort algorithm described in Pattabiraman et al. (2013).4 Parallelization strategy
CMC
, we make the following modifications to our parallelization strategy. When the simulation starts, all particles are evolved using the CMC
scheme. As described in Sect. 2.3, the activation criterion for the N-body integrator depends on the type of particles being integrated. For point particle simulations, the N-body integrator is begun immediately, whereas for star clusters modeled with stellar evolution, the N-body integrator is only activated once a certain number (∼25) of BHs have been formed. Once the activation condition is met, we divide the entire set of particles into two sets: MC stars and N-body BHs.CMC
processes for integrating the stars. Any MPI communication is handled by two custom intracommunicators: one corresponding to all p processes and one restricting communication to the \(p-1\)
CMC
processes. The latter allows us to employ the same parallelization strategy described in Pattabiraman et al. (2013) with minimal modification. When the processes are split, all the BHs are sent to the Kira process, where their coordinates are converted from \((r,v_{r},v_{t})\) space to the full 6-D phase space by randomly sampling the orientation of the position and velocity vectors. This sets the initial conditions for the N-body integration. In addition, the Kira process maintains a radially-sorted array of \((r,v_{r},v_{t})\) for all BHs. This is done to facilitate easier communication with CMC
and to minimize the required MPI communication between CMC
and Kira every timestep. Although the CMC
processes hand over their BHs to the Kira process, the BHs are not deleted from their local arrays. The BHs are left intact yet inert, so that their positions and velocities can be updated upon completion of the N-body integration.CMC
and Kira MPI processes have been initialized, the hybrid method must allow both codes to interact while minimizing the amount of MPI communication. This is accomplished by a series of intermediate arrays, designed to store and transmit the minimum amount of information back and forth between the CMC
and Kira. Communication only occurs at two points during a RAPID
timestep. The first occurs after the relaxation and strong-encounters have been performed, in order to communicate the dynamical changes from CMC
to Kira. The second occurs after both systems have completed their respective orbit computations, to communicate the new dynamical positions and velocities from Kira back to CMC
.4.1 CMC
to Kira communication
CMC
processes have computed a new potential, performed two-body relaxations, and any strong encounters, the dynamical changes to the BHs must be communicated to the Kira process. This is done with three distinct communications: -
The MC potential, \(\varPhi ^{\mathrm{MC}}\), is sent to the Kira process as two arrays, containing the radius and cluster potential of every star (excluding the BHs) in
CMC
. The Kira process selects 30 of these stars as described in Sect. 3.5.2, and passes the information to the Kira integrator to use when computing the external force. -
The two-body relaxations are communicated as an array of objects, each containing a particle ID and a 3-dimensional Δv⃗. These weak velocity perturbations are added to the single BHs and the centers-of-mass of any BH multiple systems before the N-body system is reinitialized by Kira.
-
The results of strong encounters are communicated differently depending on the type of encounter. For binary BHs that have experienced a strong encounter with a star, only the change in semi-major axis and eccentricity are communicated back to Kira. For triples and higher-order multiples, the full position and velocity of every BH in the multiple is communicated to Kira. To reduce communication, any hierarchical information is not transmitted, and the Kira process reconstructs the hierarchy locally before the N-body system is reinitialized.
RAPID
timesteps. The one exception is strong encounters in which a single bound BH multiple is broken into components. Since strong encounters in CMC
are performed by assuming the scatterings are isolated from the cluster potential at infinity, the resultant components cannot be placed at the same infinite location in the N-body system. For such systems, the components are placed at the correct radius and random orientations, similar to the initial transfer of BHs from CMC
.CMC
may create new BHs, either through stellar evolution or through strong encounters which produce single or binary BHs. We add any such new BHs to Kira. The new BH is then flagged as a BH in the local array of the CMC
process that created it, to ensure it is not evolved by CMC
during the next timestep.4.2 Kira to CMC
communication
CMC
processes. First, the dynamical 6-D phase space information for each particle in the N-body is projected back to the reduced \((r,v_{r},v_{t})\) basis, and copied back into place in the intermediate star array on the Kira process. The intermediate BH array is then divided up and communicated back to the respective CMC
processes.CMC
processes, to be placed in the correct process once the CMC
(and intermediate BH) arrays are sorted. For single and binary BHs, this is accomplished by sending the usual \((r,v_{r},v_{t})\) for each system and the semi-major axis and eccentricity for any binaries to the CMC
processes. For higher-order multiples, the full 6D dynamical information is transmitted back using the same array that sent the strong encounters from CMC
in the first communication. Again, only the positions and velocities of the BH multiple components are communicated, so the hierarchical information is reconstructed on the local CMC
process after communication.CMC
timestep, we break apart any multiple systems whose apocenter distance is greater than 10% of the local inter-particle separation of stars at that radius. The kinetic energy of the CMC
stars is adjusted to ensure energy conservation. This criterion for breaking wide binaries is the same criterion used to break wide binaries produced by Fewbody
in CMC
.5 Analytic comparison
RAPID
can model the dynamical friction experienced by a single BH in a sea of stars. Theoretically, the time taken for a massive object to spiral in to the center of a cluster can be calculated considering the rate of change of angular momentum of the particle due to the dynamical friction experienced by said particle (Chandrasekhar 1943; Binney and Tremaine 2008). Consider a particle of mass m on a circular orbit at a radius r in a Plummer sphere of mass M and scale factor a (see e.g., Heggie and Hut 2003). Many properties of the Plummer sphere can be described analytically, such as the mass interior to r
RAPID
approach (Fig. 4). RAPID
and CMC
are designed to model two-body relaxation by averaging various quantities over several neighboring stars, special care must be taken for RAPID
to accurately model the behavior of a single particle. To that end, we set the maximum scattering angle to the typical value of \(\theta _{\mathrm{{max}}} = \pi / 2\), while we reduce the number of neighboring particles over which the quantities in Equation (5) are averaged to 2. In other words, the quantities used to compute the timestep consider only the nearest particles when computing the local two-body relaxation timescale (while the global timestep is chosen as the minimum of all nearest neighbor timescales). This ensures that the two-body relaxation timestep chosen for the RAPID
simulations can appropriately model the dynamical friction experienced by a single massive object.RAPID
. However, given the approximate nature of two-body relaxation in RAPID
, the agreement presented in Fig. 5 is encouraging, and suggests that our treatment of two-body relaxation between Monte Carlo and N-body can treat dynamical friction to within \(\sim 30\%\) (the largest deviation between theory and numerical results in the \(m_{\mathrm{{BH}}}/m_{\mathrm{{star}}} = 10\) case), with substantial improvements for more massive BHs (the \(m_{\mathrm{{BH}}}/m_{\mathrm{{star}}} = 20\) case being more representative of true BH masses in realistic clusters). RAPID
)—Similar to Fig. 4, but with the numerical results from RAPID
. Here the agreement between theory and numerical experiment is somewhat diminished, particularly for the \(m_{\mathrm{{BH}}}/m_{\mathrm{{star}}} = 10\) case, where the different in inspiral times can be as high as 30%; however, the agreement improves considerably for more massive BHsCMC
and RAPID
run, a larger averaging kernel can be used, since for realistic clusters with a continuous mass function, there will be many massive and light objects within the inner-most 40 particles (which typically sets the minimum relaxation time for the cluster). For more idealized clusters, where the mass function is discrete and there can sometimes be only one massive BH per 40-particle kernel (especially before mass segregation), the averages must be computed carefully. In this section, we have accomplished this by setting \(\theta _{\mathrm{{max}}}\) to the standard value of \(\pi / 2\) and taking the mimimum timestep computed over averages between the nearest-neighbor particles (usually the average between the BH and its two neighboring stars). More generally, this reduction in timestep can also be accomplished by reducing the maximum angle for a two-body deflection to \(\theta _{\mathrm{{max}}}=1\). We elect for the later in the next section, as it has been demonstrated to work well for the idealized two-component systems considered there (Fregeau and Rasio 2007).6 Numerical comparison
RAPID
to 10 models produced by CMC
and by a single N-body model using NBODY6
(Aarseth 1999). Each model was integrated until the majority of the BHs had been ejected from the cluster. A summary of the initial conditions and the average runtimes for each approach is listed in Table 1. NBODY6
run, and the mean and standard deviation of the 10 CMC
and RAPID
runs for each cluster. The CMC
and RAPID
models were run on 4 Intel Xeon E5-2670 Sandy Bridge processors, while the NBODY6
models were run on 8 processors and 1 Nvidia Tesla M2090 GPU
Initial Conditions
|
Runtimes (Hours)
| |||||
---|---|---|---|---|---|---|
Model Name |
\(M_{\mathrm{BH}}/M_{\mathrm{star}}\)
|
\(m_{\mathrm{BH}}/m_{\mathrm{star}}\)
|
\(T_{\mathrm{end}}\)
\((t_{dyn})\)
| CMC
| NBODY6
| RAPID
|
64k-0.01-10 | 0.01 | 10 | 14,000 | 5.0 ± 1.7 | 425 | 1.8 ± 0.2 |
64k-0.02-10 | 0.02 | 10 | 20,000 | 8.4 ± 0.9 | 304 | 2.6 ± 0.3 |
64k-0.01-20 | 0.01 | 20 | 10,000 | 2.6 ± 0.4 | 554 | 1.3 ± 0.2 |
64k-0.02-20 | 0.02 | 20 | 20,000 | 5.3 ± 0.7 | 512 | 2.7 ± 0.6 |
RAPID
are much shorter than the typical runtimes for NBODY6
, sometimes by factors of a few hundred. Slightly more surprising is that the RAPID
runtimes also tend to be shorter than the runtimes for CMC
. This largely arises from the improved treatment of the cluster center in RAPID
. As will be shown in the next section, RAPID
reproduces the less-dense core radii of the full N-body models better than CMC
, with the latter producing core radii 2–4 times smaller and more compact than NBODY6
. Because the timestep of the MC is dominated by the relaxation in the densest region of the cluster, the more compact CMC
models require many more timesteps to resolve the deep core collapses, resulting the longer runtimes.6.1 Core and half-mass radii
NBODY6
are the “true” clusters, since a direct integration technique requires the fewest simplifying assumptions. We wish to know how well the models from our new hybrid technique match the models produced by the N-body approach. To that end, we focus on two typical figures of merit in star cluster simulations: the half-mass and core radii. In both cases, the radii are defined as the distance from the center of the cluster. For NBODY6
, this is calculated as a density-weighted sum:

CMC
and RAPID
, the center is fixed at \(r=0\) by assumption. The half-mass radius is the radius from the cluster center that encloses half the cluster mass. For the core radius, all three approaches use the approximate core radius definition from Aarseth (2003), based on the unbiased estimator developed in Casertano and Hut (1985). This takes the form of a weighted sum over distances from the cluster center out to the half-mass radius:1

NBODY6
, Equations (14) and (15) are calculated using the full 3D position vectors (with the densities for each particle computed with respect to its three nearest neighbours), while for CMC
and RAPID
, Equation (15) is calculated from the 1D positions where the densities are calculated for each particle by averaging over its 40 nearest neighbors.CMC
, NBODY6
, and RAPID
. While the half-mass radii are relatively consistent across all models (with a maximum deviation of \(\sim 10\%\)), the core radii are drastically different between the three methods. CMC
consistently underestimates the core radius of each cluster immediately after core collapse, with the trend persisting until all BHs have been ejected from the cluster. This consistent underestimation of the cluster core radius has been observed in other studies using CMC
(Morscher et al. 2015) and other orbit-sampling Monte Carlo codes. However, the core radii as determined by RAPID
agree very well with the radii reported by the direct N-body. This suggests that the RAPID
approach can correctly model the dynamics of the massive BHs which dominate the long-term evolution of GC cores. NBODY6
, in black), the Monte Carlo (CMC
, in blue), and the hybrid approach (RAPID
, in red). We only show one realization from NBODY6
, while we show 10 realizations each for CMC
and RAPID
RAPID
reproduces both the core and half-mass radii at early times better that CMC
(with the exception of the 64k-0.01-10 run, though RAPID
is still much closer than CMC
). On the other hand, RAPID
reproduces the core radii of the full N-body runs far more accurately than CMC
, with the core radii from NBODY6
and CMC
disagreeing by up to a factor of 3. At late times, the core radii from RAPID
begins to diverge from NBODY6
; this occurs when the majority of the BH system has been ejected, and the CMC
-controlled two-body relaxation dominates the BH dynamics. RAPID
reverts to pure CMC
when the number of BHs drops below a certain threshold (5 BHs, indicated by the black dashed lines, (with the gray bands indicating the 1σ variation across the 10 runs)RAPID
begin to diverge from those determined by NBODY6
. This divergence is to be expected: as the BHs are ejected from the cluster, the orbits of individual BHs are determined less by their encounters with other BHs, but by two-body relaxation with stars controlled by the MC. Given the disagreement between the pure CMC
and NBODY6
, this divergence is consistent. This suggests that RAPID
will be most effective when modeling systems that retain a large number of BHs. Recent work (e.g., Mackey et al. 2007; Downing 2012; Morscher et al. 2013, 2015; Kremer et al. 2018; Askar et al. 2018) has shown that the most massive GCs can retain hundreds to thousands of BHs up to the present day. Given that, RAPID
should be able to correctly model realistic GCs throughout their entire evolution far more accurately than a traditional MC method.RAPID
model lags behind the NBODY6
model, having produced only one BH binary, while the two BH binaries in the NBODY6
cluster have started to push the stars out of the central region towards higher E and J. This is consistent with the slightly faster collapse and evolution of the core radius described in Fig. 6. After 5000 dynamical times, both models have ejected a number of BHs, creating sufficient energy to push stars out of lowest potential energy states in the central region. The final snapshot (at 20,000 dynamical times) shows the stars of the NBODY6
model in a state of deeper collapse than the RAPID
model. This is most likely due to a recent encounter between the two remaining BH binaries pushing both onto a higher orbit in the cluster with a correspondingly larger E and J. The RAPID
model retains 3 BHs at the final snapshot. As these remain in the cluster core, they manage to exclude the stars from occupying the lowest energy states in the cluster potential. This difference at late times is consistent with the stochastic nature of BH retention observed in more realistic cluster models. 6.2 Binary formation
RAPID
core radii? In Rodriguez et al. (2016a), we explored a direct comparison between CMC
and a state-of-the-art direct N-body simulation of 106 particles (the DRAGON simulation, Wang et al. 2016). There, we found good agreement between most of the structural parameters of the two cluster models (e.g., the half-mass radii, the formation and ejection rate of BHs, etc.). However, the one notable exception was the evolution of the inner parts of the cluster such as the core radii and the inner-most Lagrange radii (the radius enclosing a certain fraction of the cluster mass). This was especially true when considering the Lagrange radii of only the BHs (Rodriguez et al. 2016a, Fig. 7), where the inner-most few BHs would fall into a much deeper state of collapse (by nearly two orders of magnitude) into the cluster center than the equivalent radii from the N-body model. The cluster would remain in this deep state until the formation of a BH binary, which would reverse this deep collapse and bring the inner Lagrange radii back into agreement with the N-body results.CMC
employs to model the dynamical formation of binaries during three-body encounters of single BHs. This prescription, from Morscher et al. (2013), may underestimate the formation rate of BH binaries, especially given that the probability of binary formation scales as \(v^{-9}\) in the local velocity dispersion. Because these interactions typically involve only a handful of objects in the cluster center, where the standard MC assumptions of spherical symmetry and \(T_{\mathrm{rel}} \gg T_{\mathrm{dyn}}\) break down, it is not obvious that CMC
’s statistical approach to binary formation based on locally-averaged quantities can correctly model this process.2 This difficulty was one of the primary motivators for the development of RAPID
: by directly integrating the BH dynamics every timestep, we can explicitly model the complicated three-body encounters between single BHs on a dynamical timescale.CMC
and RAPID
. The Lagrange radii, indicating the radii enclosing 10%, 50%, and 90% of the BHs, are nearly identical between the two methods during the early stages of collapse (as would be expected, since both methods model dynamical friction through two-body MC relaxation). However, in both cases, the RAPID
models dynamically forms binaries at much earlier stages of collapse, causing the inner-most BH Lagrange radii to rebound. The CMC
models, on the other hand, reach a much deeper state of collapse before forming their first binaries. RAPID
and CMC
. On the bottom, we show the radii enclosing 10% 50% and 90% of the BHs in the cluster for the two techniques. In both cases, as the cluster collapses, RAPID
forms a binary through three-body encounters much earlier, halting the continued collapse of the cluster. CMC
continues to collapse until its first binaries are formed several hundred dynamical times later6.3 BH retention
CMC
and RAPID
models, and the number of BH binaries and BH triples present over time in the NBODY6
model and a representative RAPID
model. NBODY6
model (in black), the 10 CMC
models (in blue), and the 10 RAPID
models (in red). In each case, the RAPID
show better agreement with the NBODY6
model than the pure CMC
models. In the second and third rows, we show the total number of BH binaries and BH triples (which cannot be produced in CMC
) present in the NBODY6
model (in black) and a single RAPID
model (in red) as a function of time. Although highly stochastic, the number of bound multiple systems shows good qualitative agreement between the two methods. As in Fig. 6, we show the mean and 1σ times when RAPID
reverts to a pure MC approach with the white-dashed line and gray bands, respectively. For the middle and bottom rows, the white line indicated the reversion time for that runRAPID
models eject BHs at a much faster rate than the CMC
models, in better agreement with the NBODY6
model. Although the BH ejection rate for NBODY6
is slightly faster than the other two methods (particularly for the \(m_{\mathrm{{BH}}}/m_{\mathrm{{star}}}=10\) cases), in each case RAPID
performs far better than the pure MC approach. This is consistent with the difference in half-mass radii between NBODY6
and RAPID
noted in the previous section, where systems with less-massive BHs expand faster in NBODY6
than in RAPID
. Since the overall expansion of the cluster regulates the ejection rate of BH binaries, models that expand more rapidly will eject BHs more rapidly. For BHs in the cluster, NBODY6
and RAPID
produce a similar number of BH binaries and BH triples over time. This is a noticeable improvement over CMC
, especially when considering BH triples, which are explicitly removed from the MC integration.6.4 Ejected BH systems
NBODY6
models and the 10 RAPID
realizations of each cluster. In each case, the properties of the binaries ejected by the NBODY6
models show good agreement with those formed by the 10 RAPID
models. NBODY6
models (black diamonds) and from the 10 RAPID
realizations (red circles). We show the eccentricity and semi-major axis (in AU, assuming each cluster to have an initial virial radius of 1 parsec) for each binary. In each case, the NBODY6
results align with the larger sample size from the RAPID
models. The text in each plot indicates the total number of ejected binaries from the NBODY6
models, and the mean and standard deviation from the 10 RAPID
modelsRAPID
will be able to model the merger rate of binary BHs from dense stellar clusters with similar accuracy to a direct N-body approach.6.5 Energy conservation
RAPID
approach, we examine the energy budget and conservation of each of the runs. We quantify the various forms of energy, including the kinetic and potential energy of all particles, the binding energy of multiples, and the total energy carried out of the cluster by ejected particles. The energies are plotted in Fig. 11. In addition, we also consider the virial ratio (\(2K/W\)) and the total energy over time for each system, as a diagnostic of the effectiveness of the method. The top two plots show the energy budget and virial ratio for a single representative model, while the bottom row shows the total energy for all 10 RAPID
models. RAPID
Code—The energy budget and overall energy conservation for the four clusters modeled by RAPID
shown in Fig. 6. The top plot shows the total sum of the kinetic energy (red), potential energy (green), and multiple binding energy (purple) for all particles over time for a single representative model of each cluster. The energy carried away by the kinetic energy (blue-dotted) or binding energy (blue-dashed) of escaping particles is also shown. In the middle plot, we show the virial ratio between the kinetic and potential energies. The sum of all energies is plotted in Hénon units (black) in the top plot, while the lower plot shows the fractional change in total energy for all 10 realizations of each model. The total energy conservation error is dominated by the evolution of the N-body particles in a strong external potential (the slow upward trend) and occasional strong-encounters and tightly-bound multiple systems (discontinuous jumps)RAPID
can vary over a single run, and usually lies within 2–3% of the initial energy for the duration of the run. There are two main sources of error which contribute to this energy flux. The first is the difficulty of integrating higher-order multiples and very close encounters accurately, particularly those that occur in close triple systems. This issue is not limited to the Kira integrator, and is one of the well-known issues common to all collisional dynamics simulations (the so called “terrible triples”). Although Kira does implement Keplerian regularization for isolated two-body systems and higher-order multiples, we still find that occasionally long-lived triples can induce substantial jumps in energy conservation. Furthermore, as the CMC
potential is only applied to the center-of-mass of any multiple systems, any tidal effects upon the multiples from the background cluster potential are not incorporated correctly. These integration errors manifest as discontinuous jumps in the overall energy conservation, which can be seen in the bottom panels of Fig. 10.CMC
, the potential is computed first, before the dynamical encounters take place and the new orbit is calculated. However, the new orbit is calculated using the original potential, which does not take in to account the evolution of the cluster while the particles are dynamically interacting. While the work done by neighboring particles is correctly accounted for, the work done by the change in potential upon each particle is ignored. To compensate for this energy drift, CMC
employs a technique developed by Stodoikiewicz (1982), in which the work done by the changing potential is explicitly added to the kinetic energy of the particle at the end of each timestep. This allows energy to be conserved in the MC to 1 part in 103 over a run (Fregeau and Rasio 2007). In RAPID
, we self-consistently correct the velocities of stars controlled by the MC in a similar fashion, but do not account for this energy drift in the BHs. We will explore modifications to the external potential (such as a time-dependent background potential for the Kira integrator) in a future work.RAPID
cannot adjust to rapid dynamical changes that occur during either the MC or N-body integrations. Investigations into using an adaptive timestep between the two computational domains, similar to the effective operator splitting developed by Fujii et al. (2007) and employed in Portegies Zwart et al. (2013), are currently underway.RAPID
on clusters with a realistic initial mass function.7 Conclusion
CMC
) code with the Kira direct N-body integrator, we are able to combine the speed of the MC approach with the accuracy of a direct summation. This hybrid code, the Rapid and Precisely Integrated Dynamics (RAPID
) Code is designed to accurately model the non-equilibrium BH dynamics that powers the overall evolution of GCs and GNs. Given recent observational detection of BH candidates in GCs, and the importance of theoretical modeling of GC BHs to X-ray binary astrophysics (Pooley et al. 2003) and gravitational-wave astrophysics (Rodriguez et al. 2015; Antonini et al. 2016), understanding the dynamics of BHs in clusters is crucial to understanding BH astrophysics.RAPID
can model the highly non-spherical and rapidly changing dynamics of the few BHs in the center of the cluster. This suggests that the RAPID
approach can follow the dynamics of BH systems with comparable accuracy to a direct N-body integration, but with roughly the same integration time (with in a factor of 2) of an orbit-sampling Monte Carlo approach.RAPID
can explore regions of the GC and GN parameter space, including clusters with massive central BHs, that have previously been unexplored by direct collisional methods.NBODY
series of codes (Anders et al. 2012). Hardware acceleration was not implemented the current RAPID
version, since we have not considered systems with sufficiently large numbers of BHs for efficient GPU useage; however, the development of the Sapporo2 library (Bédorf et al. 2015) provides efficient GPU saturation for small-N systems. We will explore the advantages of a RAPID
integration with Sapporo2 in a future paper.RAPID
is designed to be a single-purpose code incorporating all the necessary physics to model dense star clusters. However, these “kitchen-sink” codes, in which many numerical codes are integrated into a single parallel infrastructure, are often difficult to extend or modify for different purposes, particularly with regard to the shared timestep. The energy drift noted in Sect. 6.5 arises from a combination of the 4th-order Hermite integrator and the particular combination of the two dynamical timesteps. While the parallel design of RAPID
makes it difficult to explore variations on this code structure, there do exist more modular approaches to computational stellar dynamics that may prove helpful. For example, the Astrophysical Multipurpose Software Environment (AMUSE, Portegies Zwart et al. 2013) can be used to easily swap different N-body integrators into a large-scale astrophysics code. Furthermore, there exist methods of combining different dynamical timesteps in a single code (e.g., the Bridge approach, Fujii et al. 2007), similar to the operator splitting approach developed by Wisdom and Holman (1991), that enable large multi-scale simulations to be performed with an adaptive, shared timestep. Because this leapfrog-esque approach is already implemented in AMUSE (as well as several different N-body integrators), we are exploring the possibility of integrating RAPID
into AMUSE, allowing for greater precision and flexibility in the N-body timestep.Acknowledgements
Availability of data and materials
RAPID
or CMC
codes publicly at this time. Any of the data presented in this paper is available upon request.