38
Part II N-BODY SIMULATIONS

[Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

  • Upload
    l

  • View
    218

  • Download
    4

Embed Size (px)

Citation preview

Page 1: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Part II

N - B O D Y S I M U L A T I O N S

Page 2: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations
Page 3: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations

S v e r r e J . A a r s e t h

Inst i tute of Astronomy, University of Cambridge, Madingley Road, Cambridge CB3 0HA, England

A b s t r a c t : In these lectures, we discuss a variety of methods for direct integration of the N-body problem. First we review the standard polynomial method with individual time-steps. The new Hermite integration scheme is described; it is based on explicit evaluation of the force and its first derivative. We show that this scheme is particu- larly efficient when combined with hierarchical time-steps which reduce the amount of prediction. Some examples of time smoothing lead to better behaved equations of motion for small two-body separations. We then review regularization methods which are more effective for treating close two-body and multiple encounters. Larger systems are studied more efficiently by neighbour schemes or tree code algorithms. We also describe recent developments of fast special-purpose computers. A variety of practical implementations for realistic star cluster simulations are presented. Finally, we discuss some applications to open clusters and small globular clusters in order to illustrate the general usefulness of N-body simulations.

1 I n t r o d u c t i o n

The s tudy of gravitat ional systems by N-body simulations has become an im- por tan t tool in stellar dynamics. Such problems present a formidable challenge to the numerical analyst and computer hardware because of the need to include all mutua l interactions. To this end, a wide variety of techniques have been developed, ranging f rom approximate expansion methods to the most rigorous solutions for planetary orbits. These techniques reflect the requirement of self- consistency and the extent to which the effect of close encounters are considered.

In the present lectures, we shall concentrate on the class of methods which are based on direct solutions, in the sense that the total acceleration acting on a given particle is calculated as a sum over all the mutua l interactions. Although this approach is relatively time-consuming, the increased speed of current computers permit quite realistic systems to be studied over significant times. Some problems that can be investigated by such methods are listed in Table 1, together with the characteristic membership (N) and names of relevant FORTRAN codes which are freely available f rom the author.

277

Page 4: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

2 Sverre J. Aarseth

Table 1. Typical N-body Problems

Type N Codes

Few-body scattering Groups and loose clusters Open star clusters Globular clusters Planetesimal dynamics Molecular clouds Galaxy interactions Cosmological models

3, 4 TRIPLE, CHAIN 5 - 10 2 NBODY3, NBODY4 10 2 - 10 4 NBODY5, NBODY6 10 4 - 10 ~ TREE, HARP 10 2 - 10 3 PLANET, BOX, RING 10 3 - 10 4 CLOUDS 10 2 - 10 4 NBODY1, NBODY2 10 2 - 10 4 COMOVE

In this table, the five first problems are of a collisional nature, whereas the three last are essentially collisionless in the sense that two-body relaxation effects are relatively unimportant , although physical collisions may still take place (e.g. between molecular clouds in galactic orbits). It should be emphasized that many aspects of large-N problems, i.e. galaxy interactions and cosmological models, are best studied by alternative and faster methods such as tree codes and FFT. Hence the two last entries in the table are mainly of historical interest and the emphasis of the present discussion will therefore be on methods for collisional systems. Since the theme of the School is devoted to stellar dynamics, it is not appropriate to include the subject of planetesimal N-body simulations here, although it will undoubtedly see an increased activity in the next few years.

The basic tools for direct integration may be considered under four separate headings:

1. Force polynomials 2. Individual time-steps

3. Close encounters 4. Neighbour scheme or tree force.

These topics will be discussed in some detail in the following sections. It is then desirable to combine all the different tools in order to reduce the computa- tional effort when studying time-consuming problems, such as star clusters. The t reatment of close encounters is somewhat technical and requires an extensive programming effort for efficient implementation. However, this is the price one has to pay for being able to study the highly non-linear behaviour of stellar systems.

The basic technical formulations are followed by a discussion of various im- plementations, with the emphasis on practical aspects of star cluster simulations. Finally, we conclude by illustrating some applications to open clusters and small globular clusters.

278

Page 5: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 3

2 Basic Integration Methods

In this Section, we provide all the relevant mathematical expressions and discuss the basic principles of N-body integration. We first review the traditional polyno- mial method in some detail. This treatment, which is completely self-contained, follows closely an earlier description (Aarseth 1985). We then introduce the more recent Hermite integration scheme (Makino 1991a, Makino and Aarseth 1992) which promises to become an important tool in future work, especially when combined with the so-called hierarchical time-step scheme.

2.1 D i f f e r e n c e F o r m u l a t i o n

We write the equation of motion for a particle of index i in the form

N m j (ri - r j ) ~i=-G E ( ] r i : r~f fEF-f f )3/2" (1)

j = l ; j ¢ i

Here G is the gravitational constant and the summation is over all the other par- ticles of mass m j and coordinates r j . The introduction of a softening parameter e prevents a force singularity as the mutual separation rij --* 0, thereby making the numerical solutions well behaved without employing special regularization treatments for close encounters. However, pure Newtonian interactions (e = 0) are adopted for most applications discussed in the following. For convenience, we use scaled units in which G = 1 and define the left-hand side of (1) as the force per unit mass, F, omitting the subscript. The present difference formulation is based on the notation of Ahmad and Cohen (1973, hereafter AC) and follows closely an earlier treatment (Aarseth 1985).

Given the values of F at four successive past epochs t3, t2, t l , to, with to the most recent, we write a fourth-order fitting polynomial at time t as

Ft = ( ( ( D 4 ( t - t3) + D 3) i t - t2) + D 2) ( t - t l ) + D 1 ) ( t - to) + F0. (2)

Using compact notation, the first three divided differences are defined by

Dk[t0,tk] = Dk- l [ t ° ' tk -1] -- D~- l [ t l ' tk]" (k = 1, 2, 3), (3) to -- tk

where D O -- F and square brackets refer to the appropriate time intervals (D2[tl,t3] is evaluated at tl). The term D 4 is defined similarly by D3[t, t2] and DZ[t0, t3]. Conversion of the force polynomial into a Taylor series provides simple expressions for integrating coordinates and velocities. Equating terms in the successive time derivatives of (2) with an equivalent Taylor series and setting t = to yields the force derivatives

F (D = ((D4t~ + D3)t~ + D 2) t~ + D 1

F (2) = 2! (D4(t~t~ + t~t~ + t~#3) + D3(t~ + t~) + D 2)

F (3) -- 3! (D4(t~ + t~ + t~) + D 3) (4)

F (4) = 4! D 4,

279

Page 6: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

4 Sverre J. Aarseth

where t~ = to - t k . Equation (4) is mainly used to obtain the Taylor series derivatives at t = to, when the fourth difference is not yet known. Thus the contribution from D 4 to each order is only added at the end of an integration step. This so-called 'semi-iteration' gives increased accuracy at little extra cost (on scalar machines) and no extra memory.

We now describe the initialization procedure, assuming one force polynomial. From the initial conditions mj, r j , vj , the respective Taylor series derivatives are formed by successive differentiations of (1). Introducing the relative coordinates R = ri - rj and the relative velocities V = vi - vj, all pair-wise interaction terms in F and F0) are first obtained by

Fij - - rnj R R 3

F!I.) _ m i V '~ R 3 3a Fij,

(5)

with a = R . V / R 2. The total contributions are obtained by summation over N. Next, the mutual second- and third-order terms are formed from

F!?) m i (Fi - Fi) _ 6aF~) _ 3bFij

F! 3.) = rni ( F } ' ) - F~D) - 9aF~ 2) - 9 b F ~ / ) - 3c r i j '3 R 3

(6)

b = (V) 2 + R.(FiR 2 - F j ) + a 2

3 V - ( F , - F j ) R ' ( F ~ ' ) - F ~ D) c = R2 + R2 + a (3b - 4a2).

A second double summation then gives the corresponding values of F (2) and F (3) for all particles. This pair-wise boot-strapping procedure provides a convenient starting algorithm, since the extra cost is usually small.

Appropriate initial time-steps Ati are now determined, using the general criterion discussed in the next subsection. Setting to = 0, the backward times are initialized by t~ = - k Ati (k = 1, 2, 3). Inversion of (4) to third order yields starting values for the divided differences,

D ' = (1 F(3) t ~ - 1 F ( 2 ) ) t ~ + F(1)

1 F(2) D 2 = - F (3)(t i + t ~ ) -F

D3 = 1F(3)"

(7)

280

Page 7: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 5

2.2 Individual Time-Steps

Stellar systems are characterized by a range in density which gives rise to dif- ferent time-scales for significant changes of the orbital parameters. In order to exploit this feature, and economize on the expensive force calculation, each par- ticle is assigned its own time-step which is related to the orbital time-scale. Thus the aim is to ensure the convergence of the force polynomial (2) with the minimum number of force evaluations. Since all interactions must be added con- sistently in a direct integration method, it is necessary to include a temporary coordinate prediction of the other particles. However, the additional cost of low- order predictions still leads to a significant saving since this permits arbitrarily large time-steps.

Following the polynomial initialization discussed above, the integration cycle itself begins by determining the next particle (i) to be advanced; i.e. the particle with the smallest value oft j +At j , where tj is the time of the last force evaluation. It is convenient to define the present epoch (or 'global' time) t at this end-point, rather than adding a small interval to the previous value. The complete algorithm consists of the following steps:

1. Determine the next particle: i = mini (tj + Atj) 2. Set global time: t -- ti + Ati 3. Predict all coordinates rj to order F (1) 4. Form F (2) by (4) 5. Improve ri to order F (3) 6. Obtain the new force Fi 7. Update the times tk and differences D k 8. Apply the corrector D 4 to ri and vi 9. Specify the new time-step Ati.

The individual time-step scheme (Aarseth 1963) uses two types of coordinates for each particle. We define primary and secondary coordinates, r0 and re, eval- uated at to and t, respectively, where the latter are derived from the former by the predictor. In the present treatment where high precision is not normally required, we predict coordinates to order F(1) by

r, = ( ( V 1) + + + r0, (s)

where ~(1)= ~F(1), ~ = ½F and &t~ = t - t j (with 8t~ < Atj). The coordinates and velocities of particle i are then improved to order F (3) by standard Taylor series integration [cf. (4)], whereupon the current force is calculated by direct summation. At this stage the four times tk are updated to be consistent with the definition that to denotes the time of the most recent force evaluation. New differences are now formed [cf. (3)], including D 4. Together with the new F(4), these correction terms are combined to improve the current coordinates and velocities to highest order, and finally the primary coordinates are initialized by setting r0 = re. Hence we have a fourth-order predictor-corrector scheme.

New time-steps are assigned initially for all particles and at the end of each integration cycle for particle i. We adopt the composite criterion

281

Page 8: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

6 Sverre J. Aarseth

( ,7(IFI IF(211 + IFO)I=) nt,. = \ I-F-- I + ' (91

where y is a dimensionless accuracy parameter. For this purpose, only the last two terms of the first and second force derivatives in (4) are included. This expression ensures that all the force derivatives play a role and is also well defined for special cases (i.e. starting from rest or [F[ ~_ 0). Although successive time-steps normally change smoothly, it is prudent to restrict the growth by a stability factor (presently 1.2).

In summary, the scheme requires the following 30 variables for each particle: m, r0, r~, v0, F, F(1), D 1, D 2, D 3, At, t0, tl, t2, t3. It is also useful to employ a secondary velocity, v~, for dual purposes.

2.3 H e r m i t e Scheme

Although the standard polynomial scheme has proved itself during the past 30 years, the rapid advance in computer technology calls for a critical appraisal and search for alternative formulations. The recent design of special-purpose computers, to be described in Sect. 4.4, poses a particular challenge for software developments. The essential idea here is to provide a very fast evaluation of the force and its first derivative by special hardware, and these quantities must then he utilized by the integration scheme which is implemented on some front-end machine, such as a standard workstation.

In order to increase the accuracy of integration based on the explicit values of F and FO), it is desirable to include a high-order corrector in the manner of the polynomial formulation. We write a Taylor series for the force and its first derivative to third order about the reference time t as

F = Fo + F~l)t + ~-F(021 t 2 + 1F~31 t3. (101 6

F O) = F(o 11 + F~2)t + 1F(3) t'. (111 2

Substituting F~ 21 from (111 into (101 and simplifying then yields the third deriva- tive corrector

F~ 3) : ( 2 ( F 0 - F) + (F~ 1) + FO))t) ~ . (121

Similarly, substituting (121 into (10) gives the second derivative corrector

2 r 21= ( - 3 (r0 - F) - + r ( ' ) ) t ) (131

Using F and F(1) evaluated at the beginning of a time-step, the coordinates and velocities are predicted to order F (11 for all particles. Following the evalu- ation of F and FO) by summation over all contributions in (5), the two higher derivatives are evaluated by (12) and (13). This gives rise to the third-order corrector for coordinates and velocities

282

Page 9: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 7

1 (2 1-~1 F~3)AtS, (14) Ari = F . ) A t 4 +

Avl = 1F~2)z~t3 + ~---~F~3)At 4. (15) 6

2.4 Block Time-Steps

In order to reduce the prediction overheads of the Hermite scheme, it is advanta- geous to quantize the time-steps, permitting a group of particles to be advanced at the same time. In standard units, with the crossing time Tcr ---~ 2V~, we adopt hierarchical levels defined by

1 At . = 2._1. (16)

In principle, any level n may be prescribed. However, it is rare for more than about 12 levels to be populated in a realistic simulation with N _< 1000.

At the start of a calculation, the natural time-step given by (9) is first speci- fied. The nearest truncated value is then selected according to (16). At a general time, one of the following three cases apply when comparing the previous time- step Atp with the new value (9):

1. Reduction by factor 2 if Ati < Atp 2. Increase by 2 if Ati > 2Atp and t commensurate with 2Atp 3. Unchanged if Atp < Ati < 2Atp.

Hence time-steps can be reduced after every application of the corrector, whereas increase by a factor 2 is only permitted every other time.

Extra care is necessary when initializing Hermite integration for a new centre- of-mass particle or two former regularized components. After truncation, the new time-step must now also be commensurate with the current time t. This frequently involves large reduction factors; i.e. ten or more successive reductions, but is the price one must pay for such a scheme. On the other hand, the following advantages may be emphasized:

• The Hermite scheme is self-starting • Stability is increased due to the explicit F(1) • The corrector is faster (factor of 2) • Hierarchical time-steps reduce predictions • Special-purpose computers can obtain F and FO).

So far, experience with Hermite integration scheme has been favourable. Thus even on a standard workstation, the simpler formulation compensates for the extra cost of obtaining F (1) explicitly, and the corresponding code based on the Ahmad-Cohen (1973) neighbour scheme (NBODY6) is slightly faster than the old code (NBODY5) for N _ 1000 and a similar number of steps. In fact, the Hermite scheme permits slightly longer time-steps because of the increased stability of the corrector (Makino 1991b).

283

Page 10: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

8 Sverre J. Aarseth

3 C l o s e E n c o u n t e r s

Self-gravitating systems experience frequent encounters between the bound stars which may produce significant changes in the orbital characteristics. The asymp- totic deflection of an encounter between two stars of mass ml , m2 is given by the classical expression (Chandrasekhar 1942)

D2Vo 4 cos¢ = (1 + G2(m I + m2)f )-1/2, (17)

where D is the impact parameter and V0 is the pre-encounter relative velocity. We define a close encounter by a total deflection 2¢ = 1r/2 and replace V0 by the r.m.s, velocity from the virial theorem, (GNm/2Rh) 1/2. The case of equal masses then gives Dd = 4Rh/N as the close encounter distance, where Rh is the half-mass radius (rather than the virial radius). According to theory, each star suffers one close encounter per relaxation time, and typical simulations extend over a significant number of relaxation times.

In the following sections we discuss several methods for dealing with close encounters, either as isolated systems or with external perturbations. The elegant Kustaanheimo-Stiefel (1965, hereafter KS) method of two-body regularization is a Rosetta stone for such treatments, which by now includes compact sub-systems of arbitrary membership.

3.1 T i m e S m o o t h i n g

Let us focus on two strongly interacting particles inside a cluster. Defining the relative separation R = rk - rl, the equation of motion can be written as

R . _ G M - R, ~ R + P, (18)

where P is the tidal perturbation. This equation exhibits a strong singularity as R ~ 0 which would lead to increasing errors and small time-steps if integrated by the standard methods discussed above. Before introducing the concept of regularization for the treatment of close encounters, it is instructive to consider what can be achieved by time transformations.

We introduce a fictitious time ~" by the differential relation

dt = R~dr (19)

and apply the operator d/dt = 1 /Rad/dr twice, which yields the modified equa- tion o f motion

R' RI GM R" = a -~ R3_2 a R + R 2a P. (20)

It can be seen that the case a = 1 (Sundman 1912) leads to an expression of the type R / R which is undetermined as R --+ 0. However, the so-called time smoothing of the original equation of motion (18) does represent a significant improvement for small separations.

284

Page 11: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 9

The alternative choice a = 3/2 (Szebehely and Bettis 1972) leads to an even simpler form,

R " - - 3 R ' R ' - G M R + R 3 p . (21) 2 R

Excluding very small separations, the first term on the right-hand side is now well behaved numerically. However, using/~ o¢ R -1/2 and t ' = R 3/2 o( t, it can be seen that r ~ In t for small R, compared to r c( t 1]3 with a = 1. Nevertheless, a two-body formulation based on a = 3/2 would still appear to have some merit in practical calculations. Thus we see that t ime smoothing leads to an improved treatment of close two-body encounters, although the solution may not be well behaved for very small separations.

3.2 Principles of Regularization

The basic ideas of regularization may be illustrated in one dimension by a treat- ment ascribed to Euler. From the equation of motion

M = - x - z (22)

and the t ime transformation dr = dt /x , the new equation of motion takes the form Xt2

- M . ( 2 3 ) X

Using the energy integral 1 $2 M + h (24) 2 z

together with the relation $ = x l / z then gives

x" = 2 h z + M. (25)

Although regular for z ~ 0, this displaced harmonic oscillator equation can be simplified further by the coordinate transformation

z = u ~. ( 2 6 )

Differentiating twice and substituting for x' = 2uu ~ in the energy integral (24) based on z ~ then leads to the final equation of motion

1 = h (27)

Thus the non-linear equation of motion (22) has been reduced to a harmonic oscillator which is a linear equation. It should be noted that the coordinate transformation (26) halves the frequency of (25) which is a general property of the mapping (ef. Stiefel and Scheifele 1971). Since the physical t ime is read- ily obtained from t ~ = u 2, it follows that the complete solution is regular as x ---+ 0. It should be emphasized that the above regularization is achieved by a transformation of both the t ime and the coordinate. Unfortunately, this simple formulation is not possible in two and three dimensions because of the vectorial form of (18).

285

Page 12: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

10 Sverre J. Aarseth

3.3 KS Regular iza t ion

The basic derivation of KS regularization can be found in the literature and will therefore not be repeated here since the emphasis is on practical aspects. In par- ticular the interested reader is referred to the book by Stiefel and Scheifele (1971) which contains a thorough discussion of the subject. Another useful introduction to the basic KS theory has been given by Bettis and Szebehely (1972),

The achievement of KS was to generalize the Levi-Civita regularization for planar motion to three dimensions. This formulation requires four coordinates uj which satisfy the relation

R = ~ + .~ + .~ + .~, (2s)

together with the time transformation

t ' = R. (29)

The actual coordinate transformation

R = z(u) u (30)

employs the fundamental Levi-Civita 4 x 3 matrix defined by

~(11) = ~2 ~1 - - ~ 4 - - U 3 • ( 3 1 )

?~3 ~4 ~1 U2

Likewise, the physical velocities for the relative motion are obtained from

V - 2 £(u) u' R ' (32)

whereas the inverse relation for the new regularized velocities is given by

= 1 L: 7- (u) V. (33) U t

For completeness, the explicit expressions for the relative physical coordinates R = (X, }I, Z) are given by

x = ~ - .~ - .~ + u~

Y = 2 (ulu2 - u3u4) (34)

Z = 2 (ulu3 + u2u4).

It can readily be verified that (34) satisfies the basic relation (28). Initial regularized coordinates are obtained by inverting (34). In order to be

well behaved, the corresponding transformations take alternative forms depend- ing on the sign of X. Thus for X > 0 we have

286

Page 13: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

whereas for X _< 0 we use

Direct Methods for N-Body Simulations 11

Y u2 - 2 u l (35 )

Z u3 = 2 ~/1

u 4 = O,

u , = 1/ '

Y

u2 = 2Ul (36)

u 3 = 0

Z u 4 :

2 ul

The resulting set of regularized equations of motion take the form

1 1 u " = ~ h u + 5 R / : 7 - ( u ) P

h' = 2 u ' - / :~- (u) P (37)

t I = U . U .

The initial value of the binding energy per unit mass, h, which is required to begin the integration can also be expressed in terms of the regularized velocity (33) which yields

2 u ' - u ' - (rn~ + ml) h = R ' ( 3S )

where m~ and ml are the masses of the two participating bodies. The subsequent values of h are therefore obtained by an additional equation of motion. However, the right-hand side contains the product of the transpose of the Levi-Civita matr ix and the physical perturbation which also appears in the basic equation of motion.

In order to describe the complete solution of the two-body motion, we intro- duce the centre of mass defined by

m k rk + m l rl q -- (39)

mk + m t

The corresponding equation of motion is given by

mk Pk + ml Pl = , (40)

mk + ml

where Pk and Pz denote the respecti-ve external perturbations. Using the defi- nition of I t , (39) may be inverted to yield the two physical coordinates

287

Page 14: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

12 Sverre J. Aarseth

ml R r k = q + - -

mk + ml (41) mk R

r l - - q m~ + ml "

The corresponding velocities are obtained by similar expressions, using (32) and the centre-of-mass velocity.

3.4 N - B o d y T r e a t m e n t o f KS

When studying per turbed two-body motion by the KS method, it is necessary to relate the fictitious time to the physical time in order to advance all particles in an appropriate manner. This is most conveniently done in terms of a Taylor series, where the next two explicit derivatives are given by

t u = 2 u I • u t ' " = 2 u ' . u + 2 u I . u I. (42)

For increased accuracy, we include two additional derivatives. Thus the conver- sion from regularized to physical time employs quantities such as u " and higher derivatives which are already used in the polynomial solution based on standard differences.

There is also frequent need for interpolation within a regularized time inter- vM; i.e. when the force on standard particles is evaluated. This can readily be achieved by inversion from a physical t ime interval 5t~ (< Ati),

1 ! (43) 5r = ÷o 5t~ + -~ ~-o ~t~ + 6

Using (29) and differentiating twice we obtain the coefficients

1 ~-0 = -- R

~:0- R3 (44)

2 - nt ' - - R 5

Because of the division by R, these expressions are not well behaved for R --* 0. However, for sufficiently large distance ratios the centre-of-mass assumption may be used instead of evaluating (43) and hence this problem does not arise.

Any particles involved in close encounters are readily determined by exam- ining the time-steps. We define a characteristic close encounter separation

4Rh (45) Rcl -- N C J 3 '

where Co is the central density contrast (cf. (17)). For dominant two-body motion this corresponds to a time-step of the form

2 8 8

Page 15: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 13

Atet = ~ , (46)

where t¢ is a dimensionless constant (_~ 0.04), weakly dependent on h. If a particle k satisfies the condition Atk < Atct, it is a candidate for KS

treatment and a search is made for the dominant companion (l). The pair k, l is accepted for regularization, provided that R < Rc], together with R • V < 0 if the corresponding two-body force exceeds any other contributions on I. The solution for both particles is improved to order F (3) before introducing the KS transformations.

Termination of a KS treatment is mainly decided by the dimensionless per- turbation

IPl R 2 7 - - - (47)

mk+ mt This quantity is especially useful for treating hard binaries, hch with semi-major axis a < R¢1/2, or an equivalent definition based on the actual binding energy if there is a mass dispersion. A search is made for the dominant intruder of a hard binary if 7 > 0.5, in which case the current KS pair is terminated. Soft binaries are usually terminated at smaller perturbations; i.e. 7 < %, provided R > Rcl.

Having described the algorithms for decision-making, we now turn to the procedures for initializing a perturbed KS solution. A suitable regularized inte- gration step is most conveniently determined from the orbital period. We choose a constant value given by the binding energy, modified by an empirical expression involving the perturbation,

(' 1 ~1/2 1 (48) = k2- ] ( 1 + 1000 )1/3'

where ~/u is a dimensionless parameter controlling the number of integration steps (i.e. 2 ~r/~u) during one unperturbed period. The relation (48) is equally suitable for hyperbolic motion. However, it is prudent to impose an upper limit given by ~/u Rc,/(mk + mr) 1/2 to allow for near-parabolic orbits.

Initial polynomials for u " and h' are constructed using the principle of explicit differentiation. For example, the second derivative of the binding energy takes the form

h" = 2 u " . £T(u) P + 2 u ' . (£T(u) P ) ' , (49)

where u ' replaces u in the derivative of (31) and P ' = R t ) according to (29). Thus almost fully self-consistent polynomials can be constructed, the only excep- tion being to neglect the contribution from the second derivative of the combined perturbation term in (37) which would be rather complicated. To compensate for any errors, the initial step (48) is reduced by a factor of 2. These derivatives are then converted to divided differences in the manner of (7) and the physical time-step derived from (48) is used to schedule the KS integration. Initialization of the corresponding centre of mass defined by (39) proceeds by the standard procedure for single particles, except that the force is now obtained by the mass- weighted summation over both components given by (40).

289

Page 16: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

14 Sverre J. Aarseth

When studying perturbed relative motion, only contributions from relatively nearby particles need be considered as a tidal effect, whereas the standard treat- ment of each component would require all force terms. Active perturbers are selected from the tidal force approximation

( 2 m j ) 1 1 3 I q - r j l < (mk ~- ml)'~min R; (j • k, l), (50)

where ~min is a parameter defining small perturbations. A list of new perturbers is determined initially and at every subsequent apocentre, which is readily de- fined by using the product of the old and new radial velocity t ~. Conversely, the centre-of-mass approximation is used when calculating the force due to a distant pair if the corresponding perturbation is sufficiently small; i.e. 7j < 7rain.

The size of a hard binary is frequently so small that no perturbers are selected by (50). In this case, unperturbed motion can be assumed for the subsequent period since the actual changes in orbital parameters would be extremely small. This treatment may be extended by an integer number of Keplerian periods, provided that other particles do not approach sufficiently close in the meantime.

Regularized solutions with relatively small perturbations can also be treated more efficiently using a device based on adiabatic invariance (Mikkola 1990). The idea here is to scale the actual perturbing force by an appropriate integer which remains constant between two apocentre passages, such that the corresponding KS solution represents an equivalent number of periods. This procedure is justi- fied to the extent that the external perturbing field remains fixed and the actual perturbation P reflects the orbital phase. Again the speed-up may be consider- able since binaries with small periods also tend to spend long intervals near the unperturbed limit (which is strictly speaking no longer required).

Post-collapse evolution of star clusters often result in the formation of hier- archical systems. ~In this case a hard inner binary acquires an outer component (which can also be a binary) in bound orbit, with sufficiently large pericentre to ensure stability over long times. Provided standard stability criteria are satisfied (Harrington 1977), such configurations are reduced to a KS solution in which the inner binary is treated as a mass-point, thereby speeding up the integration. The hierarchical system is eventually restored when the outer eccentricity increases sufficiently to invalidate the two-body approximation.

The practical advantages of the KS treatment may be summarized as follows:

• The equations of motion are regular for close encounters • The time-step is independent of the eccentricity • Even circular orbits are more accurate; i.e. less steps are required • The number of force evaluations is reduced • Unperturbed motion can be used for small 7 • Hierarchical systems can be treated as two-body motion • One KS period may represent several Kepler periods.

Although the coordinate transformations (34) together with the prediction of u requires additional efforts, this is a small price to pay for the KS scheme.

290

Page 17: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 15

Actually, the frequent use of the centre-of-mass approximation compensates since this permits one force evaluation instead of two.

Several close encounters may occur simultaneously during the integration of an N-body system, as for example when studying an initial population of primor- dial binaries. The present formulation can readily be extended to an arbitrary number of KS treatments at the expense of extra programming; a detailed de- scription of the required data structure can be found elsewhere (Aarseth 1985). Decision-making in such a scheme is very simple if all arrays of each type are ordered sequentially. Thus we only need to distinguish three cases when deter- mining the next particle (i) from the smallest value of all tj $ Atj, namely i < 2Nv, 2Np < i < N, i > N, where Np is the current number of KS solu- tions. This scheme also facilitates coordinate prediction and force summations, which can be performed sequentially.

To summarize, implementation of the KS treatment requires the following additional parameters: Rch Atcl, hch ~u, ")'min, %. Here the first two parame- ters are related to the particle number, whereas the others are dimensionless constants independent of N. Relevant values of these input parameters depend somewhat on the accuracy requirements (see Aarseth 1985). Here qu is the most important since it controls the number of regularized steps; a value of 0.1 is usually satisfactory, corresponding to only 63 steps for an unperturbed period.

3.5 T h r e e - B o d y Regula r iza t ion

Although the selection of two dominant particles for KS treatment leads to considerable improvements, this procedure is sometimes inefficient as in the case of hard binaries interacting with single particles. Such configurations may require frequent switching of dominant particles, especially during so-called resonance interactions, while the third member must be advanced by standard integration. Fortunately, critical triple encounters may be studied by a special three-body regularization method (Aarseth and Zare 1974, hereafter AZ). This formulation is based on KS regularization, where two of the three interactions are now treated as simultaneous KS transformations.

We define a three-body system by the masses mi (i = 1, 2, 3) and two relative distances Rk (k = 1, 2) between rnk and m3. In analogy with (28) and (29), we introduce eight coordinates Qj satisfying two simultaneous KS transformations as well as a new time transformation by

R1 = Q~ + Q~ + Q ~ + Q42 R2 = Q~ + Q~ + Q~ + Q~, (51)

t' = R1 R2. ( 5 2 )

A formulation based on reducing the order from 18 to 12 equations using the centre-of-mass integrals gives rise to the Hamiltonian function

291

Page 18: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

16 Sverre J. Aarseth

R2P 2 R1P~ pTA1A2P2 F* - + - - +

8~13 8/223 16m3 (53) mlm2R1R2

- mlrn3R2 - m~m3R1 R I R 2 H , IR1 - R2I where Ak is identical to twice the transpose of the Levi-Civita matrix (31) and H is the total energy. The regularized momenta Pk are connected with the physical momenta of mk by

Pk = Akpk, (54)

and I-tk3 = m k m 3 / ( m k + m3) defines the respective reduced masses. The equa- tions of motion can then be obtained from

OF*

q~ = OPk or* (55) aQk"

These equations are regular for R1 -+ 0 or R2 --~ 0 since the new momenta are well behaved at small separations. The basic KS formulation (k = 1) can be recovered by setting rn2 = 0 and omitting R2 from the IIamiltonian.

The general algorithm for an isolated three-body system is very simple. Initial conditions are first expressed in the centre-of-mass frame and the reference body m3 is selected such that

I r h - R ~ l > min(R1, R2). (56)

New coordinates and momenta (Q, P) are introduced by the appropriate KS transformations of the physical relative coordinates and absolute momenta. In- tegration proceeds until (56) is violated; this necessitates transforming back to physical variables, followed by the selection of another reference body. Exam- ination of the equations of motion obtained by differentiating (53) shows that the singular terms connected with the interaction between ml and m2 are nu- merically smaller than the corresponding regular terms between mk and mz, provided (56) is satisfied. This useful property ensures that quite accurate solu- tions may be obtained even if all three distances become small simultaneously. The numerical solutions are obtained by the high-order Butirsch-Stoer (1966) integrator, which has proved very effective.

An analogous method, treating all three interactions by KS transformations is also available (IIeggie 1974). However, the increased number of equations (from 17 to 25) does not produce any significant gain in accuracy for most cases of practical interest. Note that there is no need to consider switching of reference body in this global formulation; in any case, the switching frequency in AZ is usually quite modest and the loss of accuracy is not a main concern.

Although the theory for external perturbations is already available in the AZ method, its implementation would be fairly complicated because of the need to combine Bulirsch-Stoer integration with the polynomial formulation. Instead we select the most critical configurations for unperturbed treatment. This is most

292

Page 19: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 17

conveniently done at the apocentre of a hard binary, minimizing the additional effort. A strong interaction is likely if the corresponding centre-of-mass particle has a small time-step; i.e. (46) is also used for this purpose. To be considered for selection, the external perturbation acting on the three-body system must be sufficiently small (say 74 < 10-4) • A second condition compares the impact parameter with the inner apocentre,

a2 (1 -e2 ) < a ( l + e ) , (57)

where a2 and e2 are the orbital parameters of the intruder with respect to the centre-of-mass particle.

Initialization proceeds as for isolated systems. It is usually beneficial to choose the most massive binary component as reference body. Unless escape occurs, the unperturbed triple is integrated until a specified size is exceeded,

I a l - R21 > min(r-r,2Rg), (58)

where rx corresponds to a distance of significant perturbation and Rg is the gravitational radius defined by the sum of mass products over the total energy. In the meantime, the corresponding centre-of-mass particle is advanced as a single particle, consistent with the unperturbed approximation. If the sum of all three distances exceeds 3R9, a check is made whether one of the particles is escaping from the binary (Standish 1971).

When terminated, the isolated triple system is converted back to a three- body configuration consisting of a binary and a single particle. This entails re-initializing the binary as a KS solution, whereas the most distant particle (which may not be escaping) is assigned standard force polynomials. In a careful treatment it is also necessary to include corrections due to changes in the con- figuration with respect to the external perturbers, although the corresponding change in the potential energy is relatively small, being of a tidal nature. Finally, we emphasize that only the most critical three-body interactions are studied by the unperturbed AZ method.

3.6 Cha in Regular iza t ion

The latest (and hopefully final) development of multiple regularization methods has led to the so-called chain formulation (Mikkola and Aarseth 1989, 1993). The basic idea is to select a chain of interparticle vectors such that the critical two- body interactions requiring regularization are included in the chain. Although the method is valid for an arbitrary membership, it is expected to be most useful for small particle numbers (say N = 3 - 6). Since the corresponding Hamiltonian reduces to the AZ formulation for N = 3, it is now possible to have a unified treatment for small systems. However, implementation of AZ is simpler for the three-body problem itself.

One of the main differences with AZ is that the Lagrangian function is chosen as time transformation; i.e. t' = 1/L. The main algorithm for switching to a new chain configuration can be summarized as follows:

293

Page 20: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

18 Sverre J. Aarseth

1. Transform to physical variables (at t = 0 use initial conditions) 2. Sort mutual distances Rk, (k = 1, 2 .... , N - 1) 3. Re-label particle indices to the new configuration

4. Form new chain vectors qk, Pk

5. Transform from chain coordinates and momenta to KS variables Qk, Pk

6. Scale the integration step to the new value of L (t > 0 only).

During the integration, frequent checks are made on the geometry of the configuration in case switching is desirable. Two main cases are considered: (i) the shortest side of consecutive triangles should not be of singular type, and (ii) any non-chained vector should not be shorter than the smallest chain vector opposite. Using the Bulirsch-Stoer integration scheme, each step involves a fairly large number of expensive function calls (typically 100); hence the additional effort of checking the switching condition hardly matters. It is possible to obtain quite accurate solutions for strongly interacting systems, such as binary-binary encounters with small impact parameters which can result in highly energetic escape. As in AZ, decision-making is based on the distances Rk (actually their inverse values) which are available at each step, whereas individual coordinates and velocities are only obtained under certain conditions; i.e. when the sum of the distances becomes large. Distant escapers can readily be removed from further calculation, if desired, whereupon a new chain is constructed according to the prescription above.

Chain regularization has also been implemented in all the main N-body codes during the past year. Since variable membership makes for a more flexible treatment, it seemed worthwhile to include the effect of external perturbations consistently. This calls for quite sophisticated algorithms in order to combine two different methods in an efficient manner. In view of the expensive Bulirsch-Stoer integrator, care must be exercised so that only compact subsystems are selected for the chain procedure. Thus a chain is essentially restricted to systems smaller than Rd given by (45) since this usually limits the number of perturbers to just a few. Candidates for a new chain are chosen similarly to the case of strong triple interactions. Hence the initial chain may consist of either three or four particles, depending on whether the intruder is a single particle or a hard binary.

In order to avoid advancing any chain members by the standard integration scheme and prevent corresponding force contributions, such particles are con- verted to temporary 'ghosts' with zero masses and very large time-steps. More- over, the chain members may only be stepped forward until the next perturber (or the chain centre of mass) is due to be advanced. In this respect, the block time-step scheme offers an advantage. For a consistent t reatment it is necessary to modify the force acting on nearby perturbers to include the internal structure of the chain. We write the combined differential potential energy per unit mass with respect to a perturber i as

= (50) k ~ki k rci

294

Page 21: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 19

where rci is the distance to the chain centre of mass. If the force is first added using the centre-of-mass approximation, the corresponding correction is then given by

F~ = ~ za 4~. (60) A

Likewise, the external force on the chain is obtained by a mass-weighted sum- mation over the components (cf. (40)). The total energy of the N-body system is also calculated consistently in accordance with (59).

The possibility of variable membership introduces many new considerations. For example, at some moment it becomes more efficient to treat two approach- ing KS binaries as one chain system. An existing chain of, say, three particles may also be expanded to absorb an external particle (or binary). Conversely, an escaping member must be removed at some stage, whereupon it becomes an external perturber. A chain configuration may therefore be rather long-lived compared to an unperturbed triple. Consistent termination procedures for three or four remaining members have been developed, dealing with the various situ- ations that can arise, namely two KS solutions or (more likely) one KS and one or two single particles.

The chain method has now proved itself in actual simulations. Because of the programming complexity, only one perturbed chain system can be studied at any time. However, the codes also permit one unperturbed triple as well as one unperturbed binary-binary interaction (using the chain procedures) at the same time, and this has proved sufficient in practice.

4 L a r g e - N M e t h o d s

Most star clusters are characterized my large memberships which make direct simulations very time-consuming. In order to study such systems, it is therefore necessary to design methods which speed up the calculations while retaining the collisional approach. One way to achieve this is to employ a neighbour procedure which requires fewer total force summations. The so-called AC neighbour scheme has proved very effective for a variety of collisional and collisionless problems. It is particularly suitable for combining with regularization treatments, where dominant particles as well as perturbers can be selected from neighbour lists. By now, tree codes have become an efficient tool for studying increased particle numbers. The basic idea is to partition more distant particles into clumps and obtain the corresponding force by a multipole expansion. Finally, recent advances in computer hardware also offer exciting prospects for large-N simulations. Here the speed-up is achieved by special-purpose chips for performing the direct force evaluation.

295

Page 22: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

20 Sverre J. Aarseth

4.1 N e i g h b o u r S c h e m e

The main idea of the AC scheme is to reduce the effort of ewluating the force contribution from distant particles by employing two polynomials based on sep- arate time-scales. Splitting the total force on a given particle into an irregular and a regular component,

F = Firr + Freg, (61)

we can replace the full N summation in (1) by a sum over the n nearest particles together with a prediction of the distant contribution. This procedure can lead to a significant gain in efficiency, provided the respective time-scales (Ati and A ~ ) are well separated and n < < N.

To implement the AC scheme, we form a list for each particle containing all members inside a sphere of radius R,. In addition, we include any particles within a surrounding shell of radius 21/3 R, satisfying R. V < 0.1 R2,/ATi, where AT/ denotes the regular time-step. This ensures that fast approaching particles are selected from the buffer zone.

The size of the neighbour sphere is modified at the end of each regular time- step when a total force summation is carried out. A selection criterion based on the local number density contrast has proved itself for a variety of problems, but may need modification for interacting subsystems. To sufficient approximation, the local density contrast is given by

2 c = - 7 '

where nl is the current membership and Rh is the half-mass radius. In order to limit the range, we adopt a predicted membership

np ~-~ nmax (0.04 C) li~, (63)

subject to np being within [0.2 nmax, 0.9 nm~x], with nmax denoting the maximum permitted value. The new neighbour sphere radius is then adjusted using the corresponding volume ratio, which gives

R ow = Ro,,, (64) \ n : /

An alternative and simpler strategy is to stabilize all neighbour memberships on the same constant value n p = no (AC, Makino and Hut 1988). A number of refinements are also included as follows:

* In order to avoid a resonance oscillation in R,, (np/nl) 1/6 is used in (64) if the predicted membership lies between the old and new values

* R, is modified by a radial velocity factor outside the core • The volume factor is only allowed to change by 25 %, subject to a time-step

dependent cut-off if ATi < 0.01 Tcr (Tcr is crossing time) • If nl < 3 and the neighbours are leaving the standard sphere, R, is increased

by 10 %.

296

Page 23: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 21

The gain or loss of particles is recorded when comparing the old and new neighbour list, following the re-calculation of the regular force. Regular force differences are first evaluated, assuming there has been no change of neighbours. This gives rise to the provisional new regular force difference

n e w D 1 Frneeg v - - (F old - - F i r r ) - - Fold ---- - - reg

t - T 0 (65)

where F °ld denotes the old regular force, evaluated at time To, and the net - - reg change of irregular force is contained in the middle brackets. In the subsequent discussion, regular times and time-steps are distinguished using upper case char- acters. All current force components are obtained using the predicted coordinates (which must be saved), rather than the corrected values based on the irregular D 4 term since otherwise (65) would contain a spurious force difference. The higher differences are formed in the standard way, whereupon the regular force corrector is applied (if desired).

A complication arises because any change in neighbours requires appropri- ate corrections of both force polynomials; i.e. using the principle of successive differentiation of (61). The respective Taylor series derivatives (5) and (6) are accumulated to yield the net change. Each force polynomial is modified by first adding or subtracting the correction terms to the corresponding Taylor series derivatives (4) (without the D 4 term), followed by a conversion to standard differences using (7).

Implementation of the AC scheme requires the following additional set of regular variables: Freg, D 1 , D 2, D 3, AT, To, T1, T2, T3, as well as the neighbour sphere radius Rs and neighbour list (size nmax + 1). The corresponding computer code for softened potentials (NBODY2) has been described in considerable detail elsewhere (Aarseth 1994). In the point-mass case, close encounters are treated by KS regularization, giving rise to an analogous code for the AC scheme (NBODY5, Aarseth 1985), as well as a new Hermite AC code (NBODY6).

4.2 Comoving Coord ina t e s

Cosmological N-body simulations are characterized by dominant radial motions, with subsequent growth of clusters due to density inhomogeneities which then develop peculiar velocities. Such systems may be studied more efficiently by a comoving formulation which integrates the deviations from overall expansion rather than the absolute motions. Although there are fast FFT methods and tree codes for large N, it is still of some interest to employ direct summation which can handle more modest particle numbers (say N < 104). Again the subsequent discussion is based on a previous formulation (Aarseth 1985).

In standard Newtonian cosmology, a spherical boundary of radius S contain- ing total mass M is subject to the equation of motion

~ _ GM s2 (66)

297

Page 24: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

22 Sverre J. Aarseth

Comoving coordinates for each galaxy, Pi = r J $2, are then introduced by scal- ing the physical coordinates in terms of the scale factor. We adopt a softened potential of the form m / ( r 2 + c02) 1/2, where ¢0 may be associated with the half- mass radius of a galaxy. Combining (1) and (66), the corresponding comoving equation of motion takes the form

P i - 2 S . G ( j ; ~ j # m j ( p i - p j ) ) (67) S Pi - - ~ i (IP~:-PJJ i2-+ e--~3/2 - M p i ,

where c = eo/S. Although this equation may be integrated directly (say by a low-order

scheme), the presence of S 3 in the denominator is inconvenient in the AC scheme because of the explicit derivative corrections during neighbour changes. This problem can be avoided by introducing the time-smoothing ff = S 3/2 illustrated by (21), which gives rise to the velocity relations

s' (68) vi = $3/2 + $1/------ 7.

A second differentiation yields the new equation of motion

,, S' , mj (pi - Pj) P' - 2S Pi - G E (]~ -~j~2-~_ e--~3/2 + G M Pi. (69)

j;j;~i

The corresponding equation of motion for S is readily derived by applying the rule of differentiation with respect to the fictitious time twice. Introducing scaled units with G = 1, this gives

3 S ~2 S " - 2S M S . (70)

Equation (70) may be integrated using the method of explicit derivatives. In this case it is sufficient to include two Taylor series coefficients, S (3) and S(4) if a conservative time-step is used. The latter may be based on a relative criterion involving S~/S(4).

Particles crossing the boundary may be subject to a mirror reflection in order to conserve the comoving mean density. Any such particle (i.e. pl > 1, p~ > 0) is assigned an equal negative comoving radial velocity and new polynomials are initialized to avoid discontinuity effects. A corresponding correction to the total energy can also be performed, giving

AE~ = 2m~S ' ( S ' p i + Sp~ - S') (71) $3

when converted to physical units, where p~ denotes the old radial velocity. The comoving formulation may readily be adapted to the AC scheme. Thus

the velocity-dependent term of (69) can be absorbed in the neighbour force. It

298

Page 25: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 23

can be seen that this viscous force acts as a cooling during the expansion to counteract the increase in peculiar velocities. Although the last term of (69) would combine naturally with the regular force, experience has shown that it is advantageous to retain it separately; i.e. this procedure provides increased stability. We therefore write the total force as a sum of three contributions,

1 e = Firr -4- Freg -4- M p i, (72)

where the last term is treated by explicit differentiation. Initialization of the force polynomials is similar to the standard case, except

that the softening parameter must also be differentiated; i.e. e' = - e 0 S I / S 2. In the differentiation of (72) the three required derivatives of Pl can be substituted from known quantities. The same principle applies during the integration when converting to Taylor series force derivatives for prediction purposes.

The integration itself is also quite similar to the AC scheme, except that now the boundary radius must also be advanced, instead of using time itself which is less useful here. Because of the small peculiar motions of distant particles with respect to a given particle, it is possible to omit the full coordinate pre- diction when evaluating the total force (72). Likewise, the neighbour prediction is performed to order F only. Also note that the softening length must be up- dated frequently (e = co~S); this is done after each small-step integration of the boundary radius. The actual gain in efficiency depends on the expansion rate and degree of clustering or initial peculiar velocities but may exceed a factor of 2 for a typical hyperbolic model with N = 4000 members.

4.3 Col l i s ional Tree C o d e

The time-consuming nature of direct summation methods limits this approach to N __ 104 on current workstations, depending somewhat on whether softening is included in (1). Recent tree-based algorithms reduce the cost of force evalu- ations from O (N 2) to 0 (N log g) . However, these methods employ a softened potential and are therefore not suitable for studying collisional systems. In the following we give a brief description of a new collisional tree code (McMillan and Aarseth 1993) which satisfies more stringent accuracy requirements than can be achieved by traditional formulations (tternquist 1987).

The basic idea of tree schemes is to partition the system into a set of hierar- chical cells, starting from the root which contains all the particles. This recursive procedure gives rise to a tree structure which is characterized by the number of nodes or levels. Subdivisions by factors of 2 are performed until a level is reached when only one particle occupies a cell. To evaluate the force on a given particle, each branch is considered in turn, starting with the root and descending the tree. If the angle 8 = s/r subtended by the corresponding cell of size s is smaller than a specified opening angle, a multipole expansion is carried out with respect to the cell centre of mass. This condition is usually not satisfied at first, in which case the descendants are considered until (i) a single particle is found, or (ii) the angle becomes sufficiently small. Thus the total force is a direct sum of single

299

Page 26: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

24 Sverre J. Aarseth

particle interactions and contributions from multipole expansions. It should be emphasized that the combined number of nodes (single particles and cells) in- creases as log N 0[ 3, where 0c denotes the critical angle (traditionally taken as 0.7 or even 1).

Given a test particle at r = (rl, r2, r3), we can write the multipole expansion of the potential with respect to the centre of mass of a set of particles of total mass M as (McMillan and Aarseth 1993)

M Qijrirj Sijr~ri+S123rlr2rz (_~_35 ~ ( r ) = r 2r 5 2r 7 + O (73)

Here Ax is a measure of the spatial extent of the relevant particle distribution and repeated indices i and j are summed from 1 to 3. Explicit expressions for the monopole (M), quadrupole (Q) and octupole (S) can be found in the literature. Note that the dipole term is absent from (73) because of the centre-of-mass condition; however, the centre-of-mass coordinates must still be known for each node in order to employ the shift theorem when evaluating recursive terms.

In practice, some compromise must be made between opening angle and expansion order. To increase the performance, it is desirable to employ as large an opening angle as possible while including other refinements. The collisional tree code contains the following new main features:

* Prediction of quadrupole terms during tree steps • Block time-steps for particles and cells • Standard polynomial integration • KS regularization of close two-body encounters.

The prediction of quadrupole terms permits significant deformation of cells without having to re-construct the tree. Terms to order Q(3) are evaluated by explicit differentiation for this purpose. The uniform treatment of particles and cells by a block time-step algorithm facilitates full vectorization. In principle, other types of regularization discussed in Sect. 3 can readily be included in the code. Note that only the centre of mass of such configurations appears in the tree structure itself, thereby limiting the maximum number of levels. In a sense, the standard procedure for calculating the force due to a KS pair utilizes the concept of opening angle when deciding whether the centre-of-mass approxima- tion is valid; in this case 0¢ _~ 0.01 since only the monopole is included here. Naturally the code performs all calculations in full double precision; however, the corresponding gain in accuracy only requires a modest additional CPU time.

The implementation of a high-order expansion scheme leads to a relatively large coefficient in the expression for CPU time as a function of N. Moreover, the approach to the theoretical N log N relation is very slow; even by N __ 104 the tree code has not quite reached the asymptotic regime. Comparison with the regularized AC code (NBODY5) indicates a break-even value of N _~ 104 for comparable accuracies, whereas N ~_ 4 x 103 is more representative in the case of softened potentials using NBODY2 (single precision version). Nevertheless, it is encouraging that an independent method is now available for studying collisional

300

Page 27: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 25

systems, and that initial comparisons show satisfactory agreement on quantities such as Lagrangian radii and escapers during the approach to core collapse.

4.4 Specla l -Purpose C o m p u t e r s

So far we have considered different ways of speeding up N-body calculations by introducing more efficient numerical treatments. Since any code runs faster on a more powerful computer, i t is natural to consider studying larger systems by employing supercomputers rather than workstations. However, such machines are very expensive and the available time has to be rationed. Hence, in practice, it is difficult to increase N by more than a modest factor in going from dedicated workstations to vectorized but shared supercomputers.

The recent development of special-purpose computers is based on the idea of designing very fast chips to perform the expensive force calculation (Itoh, Makino, Ebisuzaki and Sugimoto 1990). The original GRAPE (short for GRAv- ity PipE) machine returns the force on a given particle to the host computer which advances the solution. In this way, a cosmological model of N = 8 x 104 requires one week's CPU time at an equivalent speed of 240 Mflop (Fukushige, Ito, Makino, Ebisuzaki and Sugimoto 1991). Several of these machines are now in use; however, their low precision (only 12 significant bits) limits applications to collisionless systems.

Earlier this year, a high-accuracy chip called HARP (Hermite Accelerator Pipe) was produced (Makino, Kokubo and Taiji 1993). By now it has reached a maximum performance of 1 Gflop. The basic HARP chip calculates F and F(1) due to all the other particles and is therefore ideally suited to the Hermite scheme with block time-steps. The following simple algorithm gives the main steps for a standard calculation:

1. Select particle i with the smallest ti + A t i 2. If ti + At i > t v, predict all r j , v j to F(1); send r j , v j to HARP and set

t v = ti + A t i

3. Calculate Fi and F~ 1) on HARP 4. Update r i , v i using the corrector and set ti, A t i 5. Repeat the cycle at step 1.

Note that in the block scheme, step 2 is only performed for the first particle of a new level, thereby reducing the prediction overhead Considerably. Moreover, the simple form of the corrector ((14), (15)) reduces the calculation on the front- end significantly compared to the standard corrector based on (4). If necessary, the evaluation of the time-step (9) can be speeded up by employing the sum of absolute values together with a suitable correction factor, thereby eliminating two square root functions. Also note that a neighbour list is supplied.

The HARP chips can be combined to form an extremely powerful parallel machine. Each board will consist of 16 chips together with one predictor unit, thus also removing the prediction task from the front-end. Such boards may then be combined into clusters, and the final HARP-2 will consist of several clusters

301

Page 28: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

26 Sverre J. Aarseth

with the aim of reaching teraflop performance by 1995 (Makino et al. 1993). The new hierarchical time-step algorithm now takes the simple form:

1. Select all particles with the smallest tl + At i 2. Predict all r j , vj to F(1) by the HARP predictor unit

3. Calculate all - s , - i in the current block on HARP

4. Update all ri , vi, ti, At i in the block and send to HARP

5. Repeat the cycle at step 1.

Already a new N-body code based on the Itermite integration scheme with block time-steps has been developed (NBODY4) and tested successfully on the new HARP chip. The present HARP project is intended for a single-polynomial method (but the availability of a neighbour list might well be exploited for AC); hence this leads to some loss of efficiency with respect to the AC scheme (Makino and Aarseth 1992). However, the net gain in performance should outweigh the ef- ficiency loss by a large factor. Hence there is every reason to expect that this new technological development will soon offer the exciting opportunity of performing globular cluster simulations by direct N-body methods.

5 Implementations

Having discussed various numerical methods in some detail, we now turn to more practical aspects of star cluster studies. In order to perform such simulations, it is necessary to consider a variety of astrophysical effects, such as:

• External tidal field

• Interstellar clouds • Eccentric galactic orbits

• Escape of stars

• Stellar mass loss

• Tidal two-body dissipation

• Physical collisions

• Gravitational radiation • Mass transfer in close binaries.

Hence a realistic star cluster simulation requires a wide variety of processes to be taken into account. The corresponding time scales range from hours (even seconds) or days for tidal capture and collisions to ~ 10 s - 10 l° yrs for the dynamical evolution itself. In the following sections, we describe briefly some of the most important features that have already been implemented in the codes.

302

Page 29: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 27

5.1 E x t e r n a l P e r t u r b a t i o n s

In the case of open star clusters, it is usually assumed that the galactic orbits are circular with small vertical oscillations. This permits a linearized expansion of the smooth external potential which gives rise to the equations of motion

= F, + 4 A ( A - B ) z + 2 w , ( I

= Fy - 2 W z } (74) OK~

= Z .

Here the first term on the right-hand side represents the Newtonian force contri- butions (1) and A and B are Oort 's constants. We have adopted local rotating coordinates with constant angular frequency w~; the z-axis is pointing away from the galactic centre. The vertical force gradient can be replaced by a con- stant for small z. Note that the standard tidal force acts outwards along the x-axis, whereas there is also an important z-component of opposite sign, pro- viding a compression which gives rise to flattening. Polynomial initialization by explicit force derivatives can readily be applied as for isolated systems.

The equation of motion (74) allows an energy integral to be used by adding contributions from moments of inertia terms in x and z. The tidal radius is obtained by setting y = 0 on the z-axis, which yields the classical expression

= ( G N m ,~1/3 Rt \ 4A(A - B) ] (75)

Galactic constants for the solar neighbourhood give R, ~_ 10 pc for a typical cluster of total mass 500 m O.

Most globular clusters describe eccentric orbits and therefore experience a time-varying tidal field. Such simulations are most conveniently performed using a guiding centre which is integrated separately (Oh, Lin and Aarseth 1992), in which case (74) must be modified to include extra terms due to the non-circular motion.

Interstellar clouds provide additional tidal perturbations of an irregular na- ture, which may speed up the disruption of star clusters. This process can been modelled by including a small number of clouds within a spherical region sur- rounding the cluster (Terlevich 1987). Here each cloud of mass mc and coordi- nates rc contributes a perturbing force

r i - r c r i - - r d Fo = - C m o / (76)

A cloud boundary of radius Rb = 28 pc was chosen, with five clouds in the mass range 50 - 500 m o. The initial cloud velocities were sampled from a Gaussian with dispersion 6 km/sec and integrated as straight-line orbits using (74), and any cloud crossing the boundary was replaced by an incoming cloud selected from an isotropic velocity distribution and random position.

303

Page 30: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

28 Sverre J. Aarseth

Using the AC scheme, it is preferable to include the cloud force (76) as a regular component (cf. (61)) since the clouds are assumed to be quite large, rep- resented by the softening parameter Rc which is usually taken as a few pc. Note that the second term of (76) provides a smooth background force with respect to the density centre rd which must be subtracted from the direct interaction in or- der to counteract the average attraction of the clouds, otherwise particles would slow down during escape. This formulation ensures that only the fluctuating part of the cloud perturbations oulside the boundary is neglected.

The addition of external perturbations increases the escape rate with respect to isolated systems. It is natural to focus on the bound members when simulating star clusters; for example, this allows life-times to be determined and facilitates observational comparison. We employ a conservative escape criterion such that particles outside 2 Pvt are removed from the calculation. In the equivalent case of isolated systems, a nominal tidal radius of 10 Rh is adopted, together with the condition of positive energy. Appropriate corrections to the current total energy are applied in order to maintain energy conservation. As a consequence of escaper removal, the reduction of N also speeds up the calculation itself.

5.2 S t e l l a r M a s s Loss

Star cluster simulations usually employ realistic initial mass functions (IMF) derived from observations. In the simplest case, we adopt a standard power-law of the form N ( m ) ¢x m -~, where/3 = 2.3 represents the Salpeter IMF. It is also necessary to specify the maximum and minimum mass; corresponding values in the range 20 - 0.1 m® may be considered typical. Since most open clusters have ages exceeding l0 s yrs, many of these stars should undergo significant mass loss during the cluster evolution.

In order to obtain the change of mass as a function of time, we have adopted the fast fitting functions of Eggleton, Fitchett and Tout (1989) for population I stars. For convenience, mass loss is implemented at discrete intervals when the accumulated contribution reaches 1 percent. The actual mass loss is assumed to be instantaneous, with no further effect on the cluster members. Approximate energy conservation can again be achieved by performing appropriate corrections to the total potential energy, as well as relevant force terms; either neighbour interactions or the total force, depending on the magnitude of the ejected mass. The actual amount of mass loss is related to the location in the HR diagram, since both red giant winds, white dwarf formation and supernova events are included. In particular, the proportion of heavy stars in a cluster can have a decisive influence on its evolution because of the strong tendency for mass seg- regation. Thus depending on the total mass and scale factor which determine the crossing time, heavy binaries may form near the centre and expand the core before experiencing mass loss by supernova events.

Many clusters contain a significant proportion of close binaries. The orbital elements of such systems may evolve by mass transfer from one component to the other due to Roche lobe overflow. This type of mass exchange gives rise to interesting effects, and it is planned to model this process in the near future.

304

Page 31: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 29

In this way, a star cluster simulation may be used to construct a synthetic t tR diagram for all the members based on fully consistent stellar evolution.

5.3 Tidal Capture and Collisions

Stars passing within a few stellar radii of each other may experience significant transfer of orbital kinetic energy into internal oscillations. Such events may seem unlikely in most star clusters if one considers typical parameters for the core. However, several important dynamical processes act to increase the probability of extremely small impact parameters. For example, the strong interaction of two hard binaries often lead to the escape of one component, with the other in an eccentric orbit around the inner binary (Mikkola 1984). Even if such config- urations form a stable hierarchy, subsequent perturbations by other stars may increase the outer eccentricity sufficiently for a strong interaction or physical col- lision to occur at pericentre or the inner eccentricity may become large (Aarseth 1992).

The N-body implementation is based on the procedure of Press and Teukol- sky (1977)which gives the integrated energy loss for a star of mass ml due to the passage of a star of mass m2 as

\ rl z \ r p / (77) I----2,3

The summation is carried out over the quadrupole and octupole terms which provide the dominant contribution. Here rp denotes the pericentre separation and ¢ = ( m l / m b ) 1/2 ( rp /r l ) 3/2 represents the dimensionless transit time, with mb = ml -F m2. Consistent values of the physical radii r l , r2 are again obtained from the fast stellar evolution algorithm (Eggleton et al. 1989). The dimensionless quantity T(¢) which depends on the assumed stellar structure (i.e. polytropic index) is obtained by a fitting procedure (Meinen and Portegies Zwar't 1993).

Writing the angula r momentum squared per unit mass as

j2 __ mba (1 -- e 2) (78)

and assuming J = const, the new eccentricity el is related to the old eccentricity e0 and semi-major axis a0 by

e~ = e0 ~ + 2 a 0 ( 1 - e 0 ~)Ah (79) mb

In order to facilitate a two-body treatment, (79) contains the total energy loss per unit reduced mass, Ah = - ( A E 1 + A E 2 ) / p . Hence angular momentum conservation implies an increasing pericentre, a (1 - e), since Ah < 0.

The close encounters associated with tidal capture are inevitably treated by some kind of regularization/We now outline the procedure for the simplest case; i.e. when using KS. Since (77) represents the total energy loss experienced by one star, it is natural to perform the implementation at pericentre where the effect

305

Page 32: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

30 Sverre J. Aarseth

is largest. Having determined a suitably small pericentre at the first subsequent step, the regularized quantities u, u ~ at the actual pericentre are first obtained by a relation involving 1 - R/a and t"/m~/2 (Mikkola 1990). The basic KS variables are then modified according to the scaling

1111 ~ c 1 u0 - i = (80)

where (al (1 - e l ) /1 /2

Cl ---- \ a 0 ( 1 eo),, (81)

and c2 = 1/cl by angular momentum conservation. New KS polynomials are now initialized in the usual way, setting h = ho + Ah (with h0 = -mb/2ao), while still retaining the corresponding centre-of-mass quantities since the latter are conserved during the tidal interaction. Thus the present procedure avoids any numerical problems caused by near-singular variables by performing the orbit modification in KS space. A similar treatment has been included for tidal capture and physical collisions in the three-body and chain regularizations described in Sect. 3; however, the pericentre determination and correction procedures are more involved and will not be described here.

Assuming that (77) applies at subsequent pericentre passages, the eccentric- ity is gradually reduced; at the same time, the successive decrease in semi-major axis is also diminished since rp grows. Because of theoretical uncertainties in dealing with small periods, we define a minimum semi-major axis where the process is terminated by synchronous rotation. Other processes, such as mag- netic breaking, then begin to act on a longer time-scale to circularize the orbit. The case of neutron star binaries requires special consideration. Here the process of gravitational radiation may lead to coalescence, provided the period is suffi- ciently short. Such interactions have been investigated using the code NBODY5 (Lee 1993).

In view of the steep r-dependence of (77), the tidal dissipation process is only included for reasonably close passages; i.e. rp < 3 max(r1, r2). According to SPH calculations (Davies, Benz and Hills 1991), physical collisions of red giant stars take place if rp < 0.75 (rl + r2). Hence for two such stars, the expected number of collisions is equal to the number of tidal capture events because the impact parameter is proportional to distance when gravitational focusing is important. This behaviour has been noted in preliminary simulations (Aarseth 1992). In this case, two colliding stars are replaced by the combined masses at the common centre of mass, and the merged body is initialized in the usual way. Here energy conservation is maintained by adding the two-body binding energy, /~ h, as a correction.

The treatment of physical collisions poses many interesting problems since there are different channels of outcome, depending on the stellar type. Thus it is essential to include stellar evolution and mass loss consistently since otherwise the merging of stars could lead to an unrealistic runaway situation in the core.

306

Page 33: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 31

6 A p p l i c a t i o n s

These lectures have been devoted to methods for direct N-body simulations. Since self-gravitating systems pose many technical problems, it is necessary to combine a number of different tools for studying the evolution over significant times. Although the programming effort is considerable, the resulting codes are very flexible and enable a variety of aspects to be considered. In the following we discuss some applications to open clusters and small globular clusters in order to stimulate further interest in N-body simulations.

6.1 O p e n C l u s t e r s

An earlier unpublished simulation provides some interesting data on the evolu- tion of open clusters. A system of 4000 particles was distributed inside a spherical volume with an initial virial scale radius R, = 3 pc and a Salpeter-type IMF having upper and lower mass limits of 6 and 0.06 m o and mean mass 0.62 m®, respectively. External perturbations were included according to (74) with a tidal radius Rt "~ 19 pc. A simple supernova mass-loss algorithm was also employed (see Terlevich 1987).

After some 1800 hours on a relatively slow workstation, the evolution reached 1.8 × l0 s yrs. By this time 200 escaping stars (r > 2 R,) had been removed from the bound cluster, representing a mean escape rate of 1 per 106 yrs. Dividing the mass distribution into five comparable groups, we find strong evidence for mass segregation as shown in Table 2.

Table 2. Average central distance for different masses

Group R10 R40

I 0.15 0.43 II 0.28 0.85 III 0.32 0.99 IV 0.33 1.09 V 0.35 1.06

Hence the most massive group exhibits pronounced concentration to the density centre for both the inner 10 and 40 percent, whereas the other groups only show a weak differential trend. The subsequent cMculations were speeded up considerably because of core expansion due to mass loss from evolving stars, resulting in a half-life of _~ 9 × l0 s yrs for the cluster.

A representative snap-shot of the cluster at 1.8 × l0 s yrs is shown in Fig. 1, where the most massive stars are displayed as triangles. The flattening in the vertical direction is quite significant in the outer parts. Note that in scaled units, x = 6 corresponds to the current tidal radius, hence the far halo contains a number of stars not shown here.

307

Page 34: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

32 Sverre J. Aarseth

N = ,3802 TIME = 187..5

Z o F~

o f3.

N

o

c,q

I

I

• ' : . . ' . . . . . . , : , . . . . . ' . . . . : . . . . , . : . , . . . . . : " . . . :

.: ....-.:.. -~.:;-.,,::~.....!.~'-.:.. '... . , .. , . • .::.;.-...,....-.~...::~! " : ~ :.. ' : , : " . . . . . . . . . . . . . .

. . . : . . . ' . . , : : . " . . : : ?~ : , ~ . : , . _~ : , ' , . , ~ ' , . ' , . . , . . , . . • . • • .. . . . . % " : : : : , ' : ~ .~~ _ ~ . " } ~ j " . . . . ' : , " , - . . , . . . : . . : .

• . . . . . : - . . , ' , : ~ ' ~ . , , ~ ' . ' . : : ¢ . . . . . . . . . . . . . • . . . , . : . - , ~ ; . . . ~ ~ , / . : ~ . . : : , ' ' , . .

. . . . , : . . : ' . , . , . . : . . .~ i i " ~ "~L~$~ i [ ~ l ~d ' . : ; . : ~ - , , l ~ . . . ~ . - . . .

. . . . . : . . . : . , . . . .~?~::. : . . . . . . , .

• • . : .. ?,--:.~.~, "..~:-,~,.~:,-~.-:j :,.." : . . . .

• . . . . ~ . : ; , . : : ; : k ~ : : : . . . ~ : , . , ; , . . . . . . . . . , .

" ' . " ' . A : . ' : . " . ' " ' " • ' . ' .

I , I

- 4 - 2 0 4

X POSITION

Fig. 1. Simulated star cluster in the xz-plane

The increased performance of current workstations permits more extensive cMculations to be made. A recent simulation involving 3000 particles, also with mass loss and external perturbations, needed less than 300 CPU hrs to reach a half-life of 5 x l0 s yrs when using a 1 Mflop machine (which is still modest by present standards). It should be noted that the addition of tidal forces and mass loss actually speeds up such calculations since dissipative effects tend to expand the core while also reducing the life-time. Hence realistic simulations of open star clusters may now be undertaken using typical observed parameters.

6.2 G l o b u l a r C l u s t e r s

Direct N-body simulations are not yet able to deal with the actuM membership of globular clusters. However, it is still possible to investigate some relevant processes using smaller particle numbers. Recent activities have concentrated on core collapse, and in particular the effect of a population of primordial binaries (McMillan, Hut and Makino 1990, 1991, Iteggie and Aarseth 1992). The inclusion of an initial binary distribution is motivated by observations (Pryor et al. 1989, Hut et al. 1992). On theoretical grounds, such a population is expected to halt core collapse at an earlier stage than would occur in the absence of binaries.

308

Page 35: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

Direct Methods for N-Body Simulations 33

An isolated cluster with 6000 single particles and 180 hard binaries was studied recently (Aarseth and Heggie 1993). We use a Salpeter IMF with a modest mass ratio of 5:1, where the binaries are selected between the maximum and median mass with a semi-major axes distributed in the range a0 - 0.1 a0, where a0 = 9 r / 3 2 N . Here we use standard scaled units (Heggie and Mathieu 1986) such that the mean mass is 1IN and virial radius is 1; this gives a total energy E0 = - 1 / 4 and crossing time Tcr = 2 x/~.

3

.3

.1

. 0 3

.01

w

m

l l l t l l l i l t l l i l l l l l l 1 0 0 0 1 5 0 0 2 0 0 0 2 5 0 0

T i m e

m

m

m

l l l l i l t 0 500

Fig. 2. Core radius and half-mass radius as functions of time

The evolution of the core radius (lower curve) and half-mass radius is dis- played in Fig. 2 during the first ~ 1000 initial crossing times. This part of the calculation required about 3000 CPU hrs on the fast IBM RS6000 workstation (-~ 5 Mflop) and thus represents a major effort. According to the figure, core collapse terminates at t ~ 400 but there are subsequent episodes of higher cen- tral concentration. At the same time, the half-mass radius grows slowly, thereby increasing the contrast. This expansion reflects the new energy produced by the binaries which heat up significantly.

The presence of hard binaries enhances the escape of single particles with small impact parameters. On the other hand, the gradual cluster expansion eventually reduces the escape rate since we are dealing with an isolated system

309

Page 36: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

34 Sverre J. Aarseth

rather than a tidally limited one. Even so, the actual escape rate is relatively large, as shown by Fig. 3.

©

o ~q q~

q~

bq ©

_Q

W-d

o

(D

~3

E Z

6 0 0

4 0 0

2 0 0

0

B i n a r i e s ) e r s

0 5 0 0 1 0 0 0 1500 2 0 0 0 2 5 0 0 T i m e

Fig. 3. Bound binaries and escaping particles

The slow decline of bound binaries during the later stages is mainly due to the cluster expansion which results in an increased crossing time, and hence longer relaxation time. Two mechanisms tend to reduce the binary population, namely destruction by binary-binary collisions and escape mainly due to recoil. Both types of events usually involve strong interactions which are calculated here by unperturbed three-body and chain regularization.

The possible formation of new binaries is also of considerable interest. Results so far indicate that this process is very unlikely in the presence of existing hard binaries; i.e. a newly formed binary is more easily destroyed by another binary even if it has sufficient energy to survive encounters with single particles.

Although this simulation was done for an isolated cluster model, the results illustrate the complicated behaviour of stellar systems over long times. As dis- cussed above, it is now possible to model all the most important processes which occur in actual star clusters. At the same time, more powerful hardware will soon enable much bigger calculations to be undertaken. Hence it is clear that we can look forward to a period of increased activity in this fascinating subject.

310

Page 37: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

References

Direct Methods for N-Body Simulations 35

Aarseth, S.J., 1963. Mon. Not. R. astr. Soc., 126, 223. Aarseth, S.J., 1985. In Multiple Time Scales, p. 377, ed. Brackbill, J.U. and Cohen,

B.I., Academic Press, New York. Aarseth, S.J., 1992. In Binaries as Tracers of Stellar Formation, p. 6, ed. Duquennoy,

A. and Mayor, M., Cambridge University Press. Aarseth, S.J., 1994. In Computational Astrophysics: Gas Dynamics and Particle Meth-

ods, ed. W. Benz, :1. Barnes, E. Miiller and M. Norman, Springer-Verlag, New York (in press).

Aarseth, S.J. and Zare, K., 1974. Celest. Mech., 1O, 185. Aarseth, S.J. and tteggie, D.C., 1993. In The Globular-Cluster Galaxy Connection, l l t h

Santa Cruz Summer Workshop, p. 701, ed. Smith, G.H. and Brodie, 3.P., ASP Conf. Set., San Francisco.

Ahmad, A. and Cohen, L., 1973. J. Comput. Phys., 12, 389. Bettis, D.G. and Szebehely, V., 1972. In Gravitational N-Body Problem, p. 388, ed. M.

Lecar, Reidel Publ., Dordrecht. Bulirsch, R. and Stoer, J., 1966. Num. Math., 8, 1. Chandrasekhar, S., 1942. Principles of Stellar Dynamics, Dover, New York, p.242. Davies, M.B., Benz, W. and Hills, J.G., 1991. Ap. J., 381,449. Eggleton, P.P., Fitchett, M.J. and Tout, C.A., 1989. Ap. J., 347, 998. Harrington, R.S., 1977. A. J., 82, 753. Heggie, D.C., 1974. Celest. Mech., 10, 217. Heggie, D.C. and Mathieu, R.D., 1986. In The Use o] Supercomputers in Stellar Dy-

namics, p. 233, ed. Hut, P. and McMillan, S., Springer-Verlag, New York. Heggie, D.C. and Aarseth, S.J., 1992. Mon. Not. R. astr. Soc., 257, 513. Hernquist, L., 1987. Ap. J. Suppl., 64, 715. Hut, P., McMillan, S., Goodman, J., Mateo, M., Phinney, E.S., Pryor, C., Richer, H.B.,

Verbunt, F. and Weinberg, M., 1992. Publ. Astron. Soc. Paci]., 104, 981. Ito, T., Makino, :I., Ebisuzaki, T. and Sugimoto, D., 1990. Computer Physics Commu-

nications, 60, 187. Kustaanheimo, P. and Stiefel, E., 1965. J. Reine Angew. Math., 218,204. Lee, M.H., 1993. Ap. J., (submitted). Makino, J., 1991a. Ap. J., 369,200. Makino, J., 1991b. Publ. Astron. Soe. Japan, 43, 859. Makino, J. and Hut, P., 1988. Ap. J. Suppl., 68, 833. Makino, J. and Aarseth, S.J., 1992. Publ. Astron. Soc. Japan, 44, 141. Makino, J., Kokubo, E. and Taiji, M., 1993. Publ. Astron. Soc. Japan, 45, 349. McMillan, S.L.W., Hut, P. and Makino, J., 1990. 362, 522. McMillan, S.L.W., Hut, P. and Makino, J., 1991. 372, 111. McMillan, S.L.W. and Aarseth, S.J., 1993. Ap. J., 414, 200. Meinen, T. and Portegies Zwart, S., 1993. Astron. Astrophys., (submitted). Mikkola, S., 1984. Mon. Not. R. astr. Soc., 207, 115. Mikkola, S., 1990. Personal communication. Mikkola , S. and Aarseth, S.J., 1990. Celest. Mech. Dyn. Astron., 47, 375. Mikkola, S. and Aarseth, S.J., 1993. Celest. Mech. Dyn. Astron., 57, 439. Oh, K.S., Lin, D.N.C. and Aarseth, S.J., 1992. Ap. J., 386, 506. Press, W.H. and Teukolsky, S.A., 1977. Ap.J., 213, 183.

311

Page 38: [Lecture Notes in Physics] Galactic Dynamics and N-Body Simulations Volume 433 || Direct methods for N-Body simulations

36 Sverre :1. Aarseth: Direct Methods for N-Body Simulations

Pryor, C., McClure, R.D., Hesser, J.E. and Fletcher, J.M., 1989. In Dynamics of Dense Stellar Systems, p. 175, ed. Merrit, D., Cambridge University Press.

Standish, E.M., 1971. Celest. Mech., 4, 44. Stiefel, E.L. and Scheifele, G., 1971. Linear and Regular Celestial Mechanics, Springer-

Verlag, New York. Sundman, K.F., 1912. Acts Mathematics, 36, 105. Szebehely, V. and Bettis, D.G., 1972. In Gravitational N-Body Problem, p. 136, ed. M.

Lecar, Reidel Publ., Dordrecht. Terlevich, E., 1987. Mon. Not. R. astr. Soc., 224, 193.

312