Annu. Rev. Astron. Astrophys. 1992. 30:
705-742 Copyright © 1992 by . All
rights reserved |

*ðf / ðt* + **v ·** *ðf / ð***v** -
**·**
*ðf / ð***v** = 0,

where *f = f*(**x**, **v**, *t*) is the distribution function
normalized
so that *f d***x** *d***v** is the number of stars in the
phase-space volume *d***x** *d***v** centered on the
point (**x**, **v**). The potential, , includes the self-consistent
field generated by the stars as well as the gravitational influence of
dark matter and gas. While the nature of the dark matter remains
enigmatic, observational constraints suggest that it too obeys
Equation 1.

*N-Body Methods*

*f*(**x**,**v**) is used as a
probability distribution function to pick phase-space coordinates
**x**_{i} and **v**_{i} for
particles *i* = 1, . . . , *N*; these particles
are then integrated along the characteristic curves of Equation 1:

*d***x**_{i} /
*dt* = **v**_{i} ,

*d***v**_{i} /
*dt* = -_{i} .

*N* particles can be categorized as either
``action-at-a-distance'' or ``field'' methods. The former
explicitly treat interactions between individual particles while the
latter do so only indirectly through the contributions of particles to
the global gravitational field. The simplest action-at-a-distance
technique is *direct summation*. A common expression for the
gravitational potential at the location of particle *i* is

**r**_{i})
= - *G* _{j i} (*m _{j}* /
[ |

where is the
``softening parameter.'' Direct summation is
flexible but has an asymptotic cpu cost per step scaling as ~
*O (N*^{2}), limiting its practical use to small-*N*
systems. Nevertheless, some early investigations of the dynamics of mergers
were performed using this algorithm (e.g.
White 1978,
1979,
1980;
Gerhard 1981;
Quinn 1982) and much larger
simulations with *N* >
10,000 may ultimately be feasible on special-purpose machines (e.g.
Sugimoto *et al.* 1990).

*a priori*, such as in test-particle
methods (e.g.
Schwarzschild 1979;
Quinn 1984), the
restricted three-body method (e.g.
Pfleiderer & Siedentopf 1961;
Toomre & Toomre 1972), or
semi-restricted *N*-body codes
(e.g. Lin & Tremaine 1983;
Quinn & Goodman 1986;
Hernquist & Weinberg
1989). Generally speaking, however, the dynamics of
interacting galaxies will not be represented faithfully without
including self-gravity (Barnes 1988).

*O (N* log *N*). In fact, it is possible to reduce the cost
even further to ~ *O (N)* by using tree-structured data in the
context of a field representation of the potential
(Greengard & Rokhlin 1987;
Greengard 1988). A distinct
approach, used in
``expansion codes,'' relies on the use of basis function expansions to
compute the potential from the known density field sampled by the
particles (Aarseth 1967;
Clutton-Brock 1972a,
b;
van Albada & van Gorkom 1977;
Villumsen 1982,
1983;
White 1983a;
McGlynn 1984;
Bontekoe & van Albada 1987).

*N* can be used to suppress relaxation effects to
the extent required.