1. Introduction
GCs are very old (age of the most massive can be comparable to the age of the Universe), their sizes can spread up to around 100 ly, their Galactocentric distances varies (50% GC within 5 kpc for Milky Way, the most distant 130 kpc), they have different densities and other global properties (Baumgardt & Hilker Reference Baumgardt and Hilker2018; Milone et al. Reference Milone2012). GCs have very distinct cores, which are the best places for creating many exotic objects like cataclysmic variables, X-ray binaries, black holes, intermediate-mass black holes, blue stragglers and more.
Dynamical modelling of GCs is especially important, because this it the physical process, which may contribute to understand the formation and then the evolution of exotic objects (e.g. hard binaries). Dynamical interactions between stars may lead to perturbations, disruptions, collisions and mass transfers between stars. This, in turn, may lead to decrease the semi-major axes and allow e.g. mergers which would not happen otherwise. Moreover, it may lead to formation of exotic binaries, supernova explosions (especially in the initial phase when many of massive stars are present), formation of black holes, and also ejections of a lot of binaries (e.g. potential sources of GWs in the Galactic field). All of this causes that GCs are great laboratories for studying stellar and dynamical evolution of stars and binaries. Thus, while working on numerical codes able to follow their evolution, one need to include as many physical processes as possible.
2. Method
The numerical simulations of GCs were performed with the mocca Footnote † Monte Carlo code (Giersz Reference Giersz1998; Hypki & Giersz Reference Hypki and Giersz2013). mocca is an one of the most advanced codes which is able to perform full stellar and dynamical evolution of real size star clusters up to Hubble time within a week. The stellar and binary evolution is done with synthesis population code sse/bse code Hurley et al. (Reference Hurley, Pols and Tout2000); Hurley et al. (Reference Hurley, Tout and Pols2002), and strong dynamical interactions in mocca (which follow closely nbody approach) are performed with fewbody code (Fregeau et al. Reference Fregeau, Cheung, Portegies Zwart and Rasio2004; Fregeau & Rasio Reference Fregeau and Rasio2007). mocca can provide almost as much details as nbody codes, and agrees with them very well (Wang et al. Reference Wang2016). The great advantage of mocca code is that it needs much less time for computations, and thus it is ideal to start a large number of simulations for various initial conditions. The detailed description about new features of mocca one can find in Giersz et al. (Reference Giersz, Askar, Hypki, Hong, Wiktorowicz and Hellström2025).
Recently mocca code was updated and the dynamical treatment of the multiple stellar populations were added to the code (Hypki et al. Reference Hypki, Giersz, Hong, Leveque, Askar, Belloni and Otulakowska-Hypka2022). In this work the first results are presented for a number of GCs models which include also treatment for the dynamically formed hierarchical systems (i.e. triple systems and higher hierarchies).
mocca is able now to follow full dynamical evolution of any hierarchical systems (
$\gt=$
triple) once the object is formed. Currently, the code does not generate any initial distribution of hierarchical systems. All of them have to be dynamically formed as a result of binary – single, or binary – binary interactions. The Monte Carlo method, which lies in the foundations of mocca code, needs to compute probabilities for a dynamical interaction to take place. Because the number of hierarchical systems was assumed to be low, i.e. much lower than the number of binaries, thus it was decided to use for hierarchical systems the same formulas as for binaries, with this difference that for the probability computation the outer binary semi-major axis is taken. In other words, from the point of view of the Monte Carlo algorithm, the hierarchical system is just a wide binary. Stability criterion for hierarchical systems follows Mardling & Aarseth (Reference Mardling and Aarseth2001) (default option in fewbody code). Stellar evolution procedures for hierarchical systems, e.g. mass transfers, mergers, are currently limited only to the inner binary. However, if the inner binary changes its configuration, e.g. merger takes place, then the whole hierarchical system is updated. For example for the case of a triple, when the inner binary merges, the resulting object will be a binary (the internal single star, plus the outer single star). This approach is simplified, but it is the the best possible approach with the current code.
The whole data analysis was performed using beans Footnote † software (Hypki Reference Hypki2018) – interactive, web-based, open source, distributed data analysis tool with plugins to e.g. Python, AWK, which allows for seamless access to all simulations from different sources (e.g. mocca, nbody).
3. Results
Initial conditions for mocca simulations used in this paper were chosen to test the code with the hierarchical systems, not to recreate real size GCs. Moreover, the parameters were chosen in such a way that all parameters are the same, except only two of them: initial number of particles (N), or initial binary fraction (fb). For the first set of initial conditions N values are N = 40k (for the first popualtion – FG) – 10k (for the second population – SG), 200k – 50k, 400k – 100k, 600k – 150k. All other initial conditions are the same, also fb = 0.95 (95% initial binaries). For the second set of initial conditions N = 200k – 50k, but fb varies from 0.0, 0.05, 0.2, up to 0.95. All other parameters are the same. The evolution of total mass for these models are presented in Figure 1 (left panel). Additionally, on the right panel, there is an example of the evolution of the inner semi-major axis of a randomly chosen, long-lived hierarchical system from one of the simulations. It shows that mocca can accurately follow the evolution of such systems.
Left panel: total mass for mocca simulations with hierarchical systems. Note: the green model, 400k-100k, has IMBH and thus its evolution so much different. Right panel: evolution of hierarchical system inner semi-major axis – interestingly the semi-major axis initially was increasing to decrease just prior to its dissolution into a binary.

Figure 1 Long description
Panel A: A line graph shows the total mass in solar masses (M Sun) over time in millions of years (Myr). Multiple lines represent different models with varying initial conditions. The models are distinguished by different colors and labels indicating parameters such as the number of particles (N) and binary fraction (fb). The graph shows a general trend of decreasing total mass over time, with some models showing a more rapid decline than others. Panel B: A line graph depicts the evolution of the semi-major axis in solar radii (R Sun) over time in millions of years (Myr). The graph shows an initial increase in the semi-major axis followed by a decrease just prior to the dissolution of the hierarchical system into a binary.
Among the most important results is the relative number of hierarchical systems which seems to correlate with the initial number of binary systems. Figure 2 shows a relative number of hierarchical systems to the number of binaries (Y axis) at any given time (X axis). The data is binned over 100 Myr intervals. The mocca models in the figure are divided in such a way that in the top panel N is changing (from 40k+10k, up to 600k+150k), and in the bottom panel fb is changing (from 0, to 0.95). There is a clear correlation for the latter, i.e. the ratio between the current number of hierarchical systems to the current number of binaries is larger for the lower fb (bottom plot, Figure 2). In turn, there is no apparent correlation for the case of different initial N (top plot, Figure 2).
Top panel: number of hierarchical systems/number of binaries for N = 40k-10k, up tu 600k-200k, fb = 0.95. Bottom panel: number of hierarchical/number of binaries for N = 200k-50k simulations with different initial binary fractions.

This relation was explored further by taking the values at the time when still 80% of the initial GC mass was present in the system. This value is arbitrary, but it mimics the case in which GCs are old (i.e. vast majority of the initial mass is already lost). Next, the ratios were computed for all the models and they were combined with the initial binary fractions (fb). The resulting relation is presented in Figure 3. The Figure shows also the best fit for the data,
$-0.88 * log(x + 0.0001) - 7$
, where x is the ratio between the current number of hierarchical systems to the current number of binaries. In this relation the value 0.0001 is only artificial added because one of the models has initially fb = 0.0 and log would be undefined. The fit shows, that if only one can estimate the current number of hierarchical systems, and the current number of binaries in a GC, it seems it should be possible to narrow down also the initial binary fraction with this relation.
Relative number of hierarchical systems (num. of hierarchical systems scaled by the current num. of binaries) as a function of initial binary fractions fb. mocca models have the same initial parameters, except only fb.

4. Conclusions
mocca code was successfully updated with the procedures to deal with the formation and dynamical evolution of any hierarchical systems (i.e. triples or more complex hierarchies). The first results already show that, although the hierarchical systems are likely not able to change the global parameters of GCs, they could be a very valuable to study. Among the most important conclusions is the one which shows that the fraction of the current number of hierarchical systems to the current number of binaries depends on the initial binary fraction – this may allow to put some boundaries to the initial conditions of GCs (see Section 3). Moreover, it is found that first hierarchical systems form very quickly (see Figure 2), just in a few Myr, even for models with initial fb = 0.0 (not a large number though). Also, even based on the limited number of mocca simulations it is clear that the hierarchical systems are common in GCs and thus worth further investigations.
5. Acknowledgments
AH research was supported by “Excellence Initiative - Research University”, POB4 - competition Nr: 139 from 2024-03-28 (139/06/POB4/0030).



