# DirectNBody¶

class gala.dynamics.DirectNBody(w0, particle_potentials, external_potential=None, frame=None, units=None, save_all=True)[source]

Bases: object

Perform orbit integration using direct N-body forces between particles, optionally in an external background potential.

TODO: could add another option, like in other contexts, for “extra_force” to support, e.g., dynamical friction

Parameters
w0PhaseSpacePosition

The particle initial conditions.

partcle_potentialslist

List of potential objects to add mass or mass distributions to the particles. Use None to treat particles as test particles.

external_potentialPotentialBase subclass instance (optional)

The background or external potential to integrate the particle orbits in.

frameFrameBase subclass (optional)

The reference frame to perform integratiosn in.

unitsUnitSystem (optional)

Set of non-reducable units that specify (at minimum) the length, mass, time, and angle units.

save_allbool (optional)

Save the full orbits of each particle. If False, only returns the final phase-space positions of each particle.

Attributes Summary

Methods Summary

 integrate_orbit(**time_spec) Integrate the initial conditions in the combined external potential plus N-body forces.

Attributes Documentation

w0

Methods Documentation

integrate_orbit(**time_spec)[source]

Integrate the initial conditions in the combined external potential plus N-body forces.

This integration uses the DOPRI853Integrator.

Parameters
**time_spec

Specification of how long to integrate. See documentation for parse_time_specification.

Returns
orbitOrbit

The orbits of the particles.