Integration methods

class pNbody._integration_mixin._NbodyIntegrationMixin

Bases: object

Provide numerical integration functions for N-body simulation particles.

IntegrateUsingRK(tstart=0, dt=1, dt0=1e-05, epsx=1e-13, epsv=1e-13)

Integrate the equations of motion using a Runge-Kutta 7(8) integrator.

Perform the numerical integration of particle trajectories over a specified time interval using the adaptive RK78 algorithm from the underlying nbody library.

Parameters
  • tstart (float, optional) – Set the initial simulation time. Default is 0.

  • dt (float, optional) – Specify the total time interval for the integration. Default is 1.

  • dt0 (float, optional) – Define the initial trial time step for the adaptive integrator. Default is 1e-5.

  • epsx (float, optional) – Set the absolute precision tolerance for particle positions. Default is 1.e-13.

  • epsv (float, optional) – Set the absolute precision tolerance for particle velocities. Default is 1.e-13.

Returns

Update the instance attributes pos, vel, atime, and dt in-place. Positions and velocities are cast back to float32 after computation.

Return type

None